@@ -30,6 +30,17 @@ before account allocation, checks the SHA-256 domain-separated digest, requires
3030strict account ordering, validates caller-trusted immutable parameters, and
3131restores through the kernel's state-invariant and root checks.
3232
33+ The public engine-independent archive codec implements ADR 0007's exact
34+ ` PSAR ` version-one bytes. The encoder accepts canonical genesis, contiguous
35+ canonical block outputs and admitted transaction records, plus a head
36+ snapshot. It independently loads genesis, replays every admitted block through
37+ the kernel, exact-compares transaction IDs, receipts, headers and block IDs,
38+ and requires the decoded snapshot to equal the replayed head before emitting
39+ bytes. The decoder bounds all attacker-controlled lengths and counts before
40+ allocation or advancement, never reserves from the declared block count,
41+ rejects non-exact framing, verifies the archive digest, and performs the same
42+ complete semantic replay.
43+
3344` SQLiteLedger::create_snapshot ` serializes with reads and block application,
3445verifies that the durable metadata head equals the owned ledger, independently
3546decodes the candidate bytes, and atomically replaces the one retained snapshot.
@@ -42,6 +53,14 @@ block ID, and requires the recovered state and root to equal authoritative full
4253replay. A snapshot at the current head exercises the same path with an empty
4354suffix.
4455
56+ ` SQLiteLedger::export_archive ` holds the adapter guard and one SQLite read
57+ transaction while it fully validates the durable ledger against
58+ caller-trusted genesis and the owned head. It creates a fresh snapshot of that
59+ verified head, then reads every block and admitted transaction in explicit
60+ height and ordinal order with exact width, count, and contiguity checks. The
61+ public codec replays that independently projected archive before export
62+ returns. Export does not change the retained database snapshot.
63+
4564The public header exposes no SQLite handle or SQL type. ` SQLiteLedger ` is
4665move-constructible but not copyable or assignable. It owns the live
4766` protocol::v1::Ledger ` , serialized connection, normalized path, exact canonical
@@ -132,10 +151,9 @@ before the completed adapter is returned.
132151
133152## Remaining issue 11 work
134153
135- The ordinary durable commit, full-genesis-replay path, canonical snapshot
136- codec, atomic latest-snapshot persistence, and independent snapshot validation
137- at its recorded replay height are implemented. Independent snapshot-plus-suffix
138- recovery reaches the identical authoritative head. Portable export/import,
139- automatic reopen after an ambiguous commit result, fault injection around
140- every commit phase, long seeded restart sequences, and final issue closure
141- remain.
154+ The ordinary durable commit, full-genesis-replay path, canonical snapshot and
155+ archive codecs, atomic latest-snapshot persistence, independent
156+ snapshot-plus-suffix recovery, and portable export are implemented. Portable
157+ import into a new database, automatic reopen after an ambiguous commit result,
158+ fault injection around every commit phase, long seeded restart sequences, and
159+ final issue closure remain.
0 commit comments