Simplify atomic file replacement and bounded reads

This commit is contained in:
2026-09-01 17:40:08 +00:00
parent b7d989f61f
commit 0d57422b61
7 changed files with 135 additions and 63 deletions

View File

@@ -155,14 +155,11 @@ path is removable after migration and is never used to write new state.
- validates loaded documents;
- normalizes missing maps/stage records;
- writes through a sibling temporary file, syncing the completed file and
destination directory after atomic replacement;
- writes through a sibling temporary file and atomic replacement visibility;
- updates `updated_at` on save.
If the operating system or filesystem cannot sync a directory, save returns an
explicit error instead of claiming crash-durable replacement. A returned error
after the rename can therefore leave the new manifest visible but not confirmed
durable; callers must reload it before retrying.
Manifest replacement provides atomic visibility, not a crash- or power-loss
durability guarantee. Callers reload after a returned save error before retrying.
## Execution Semantics