mdb.validate
Integrity checks.
Every check here holds in both reference samples, which is what makes them
useful: a deviation is a corruption signal, not a quirk. The most valuable
is heap tiling – in a healthy file the region in front of the TOC is 100%
covered by TOC-referenced values with no gaps and no overlaps, so a gap means
data nothing points at and an overlap means two objects claiming the same
bytes.
>>> for finding in mdb.validate(f):
... print(finding)
-
class Finding(severity, check, message, detail=None)[source]
Bases: NamedTuple
One validation result.
-
severity:
str
Alias for field number 0
-
check:
str
Alias for field number 1
-
message:
str
Alias for field number 2
-
detail:
Optional[object]
Alias for field number 3
-
property ok: bool
-
validate(f, deep=True)[source]
Run every check and return the findings, worst first.
deep=False skips the whole-file passes (heap tiling, reference
resolution) for a fast structural check on a large database.
- Return type:
List[Finding]
-
heap_coverage(container)[source]
Tile the value heap and report (regions, gaps, overlaps).
Geometry properties (the TOC object, the container itself) are excluded:
they describe file regions rather than heap allocations.
- Return type:
tuple[List[Region], List[tuple], List[tuple]]