@@ -8,6 +8,38 @@ under a category (`Added` / `Changed` / `Fixed` / `Removed` / `Security`).
88
99## [ Unreleased]
1010
11+ ### Phase 4 — Transactions, MVCC & durability
12+
13+ #### Added
14+ - ` txn ` : the embedded database handle — ` Db ` (create/open/clone), atomic
15+ multi-op ` write ` (plus ` put ` /` delete ` helpers), and pinned, consistent read
16+ ` Snapshot ` s (` get ` /` range ` /` scan ` ).
17+ - A single writer thread owning the pager: drains the write queue, coalesces
18+ waiting transactions into one ** group commit** (one fsync pair for the whole
19+ batch), and publishes the new version on success.
20+ - ** Validate-then-apply** atomicity: every op is checked before any mutation,
21+ so a transaction is applied whole or rejected whole; post-validation I/O
22+ errors are fatal — the writer fans out ` WriterStopped ` and stops, leaving the
23+ database readable but unwritable (` DECISIONS.md ` D8).
24+ - ` Registry ` : reference-counted snapshot versions and the ** reclamation
25+ watermark** — a page superseded by commit ` T ` is returned to the allocator
26+ only once no live snapshot older than ` T ` remains.
27+ - A ` loom ` model check of the registry handoff proving a pinned reader can
28+ never observe its pages reclaimed, over every interleaving; gated behind
29+ ` --cfg loom ` so it never enters normal builds (` DECISIONS.md ` D9).
30+ - Exit-criteria tests: crash-at-every-fsync-boundary durability (acknowledged
31+ commits always recover; interrupted ones land whole or not at all), a
32+ long-pinned reader keeping its exact view across heavy churn while
33+ reclamation defers then catches up, and a seeded deterministic simulation of
34+ interleaved writes and snapshot open/close matched against a model.
35+
36+ #### Changed
37+ - ` pager ` : ` commit() ` no longer holds the state lock across fsyncs — readers
38+ proceed during the data/meta syncs; safe under the single-writer regime
39+ (` DECISIONS.md ` D10).
40+ - ` btree ` : entry-size validation extracted as ` check_entry ` so the ` txn ` layer
41+ can pre-validate transactions before mutating.
42+
1143### Phase 3 — Copy-on-write B+tree
1244
1345#### Added
0 commit comments