pub fn carve_with_fragments(db: &Database) -> CarveTiersExpand description
Two-tier deleted-record recovery: Tier-1 full rows plus Tier-2 partial fragments, in one pass.
CarveTiers::full is byte-identical to carve_all_deleted_records (the
high-precision, structurally-0-false-positive output). CarveTiers::fragments
is the opt-in lead surface: at every freeblock/gap anchor where full
reconstruction failed but ≥ 1 distinctive cell (TEXT ≥ 4 bytes of valid UTF-8,
or REAL) survived, the maximal decodable column prefix is salvaged as a
CarvedFragment. Three suppression layers keep the fragment bucket honest:
- By construction — a fragment is emitted only where full reconstruction failed, so an anchor yields a full cell or a fragment, never both.
- Full-row value suppression — a fragment whose every surviving
(column, value)matches the corresponding column of a Tier-1 record infullis dropped (the row was already recovered another way). - Live-row suppression — a fragment whose every surviving
(column, value)matches the corresponding columns of a currently-live row is dropped (never re-surface a live row, the fragment analog of the rebalance-copy drop).
Read-only and panic-free, identically to carve_all_deleted_records.