pub fn audit_journal(db: &Database, journal: &[u8]) -> Vec<Anomaly>Expand description
Audit a rollback -journal (raw bytes) bound to db for the design-§6
observations, additive to audit (which covers main-db anomalies only).
The journal is parsed with the database’s authoritative page size and graded into observations, each derivable from the parser API and each “consistent with …” (the examiner draws the conclusion):
- a hot journal (valid header magic) — an interrupted/in-progress write;
- a recoverable PERSIST journal (zeroed header, page images intact);
- checksum mismatch(es) (Tier A) — corruption / torn page / modification;
- a schema-cookie advance (journal page-1 image vs live db, offset 40) — a DDL change, prior schema recoverable;
- a duplicate page record — corruption / savepoint / tampering;
- a db-size delta (Tier A
mxPagevs current) — growth or shrink.
Read-only and panic-free: an unparsable/garbage journal simply yields no observations rather than an error or panic.