pub fn attribute_record(
rec: &CarvedRecord,
tables: &[LiveTable],
page_table_map: &BTreeMap<u32, String>,
) -> AttributionExpand description
Attribute one carved record to a tier given the live tables and the page→table map. Pure (no DB access) so it is directly unit-testable.
- Tier 1 (CERTAIN):
sourceis an in-page class (RecoverySource::InPageFreeBlockorRecoverySource::FreeblockReconstructed) AND the record’s page is inpage_table_map→Attribution::Known. - Tier 2 (INFERRED):
sourceisRecoverySource::FreelistPage→ match the record’s shape againsttables; exactly one match → a guess, more than one → ambiguous, none →Attribution::Unattributed. - Tier 3 (UNATTRIBUTED):
RecoverySource::DroppedTable, any other source, or a shape matching no surviving table.