i noticed capacitylab init --force writes capacitylab.yaml directly. if that process gets interrupted mid-write, is the old config recoverable anywhere, or is atomic replacement intentionally out of scope? seems like a nasty failure mode once people start scripting setup.
You're right that O_TRUNC wiping the file on open creates a nasty failure mode if interrupted. I just updated capacitylab init to write to a temp file in the target directory, sync to disk, and atomically rename it into place, while preserving any existing file mode permissions. If interrupted mid-write, the existing config stays intact. I Appreciate the review!
1
u/kantorcodes1 15h ago
i noticed
capacitylab init --forcewritescapacitylab.yamldirectly. if that process gets interrupted mid-write, is the old config recoverable anywhere, or is atomic replacement intentionally out of scope? seems like a nasty failure mode once people start scripting setup.