Skip to main content

validate_adjacency_index

Function validate_adjacency_index 

Source
pub fn validate_adjacency_index(
    project_dir: &Path,
) -> Result<Vec<AdjacencyValidationIssue>, GfError>
Expand description

Verify a persisted adjacency index against a fresh in-memory rebuild from topology/ (ADR 0005 maintenance op): for every manifest row, the CSR file must exist, parse, and equal the expected CSR byte-for-byte (same deterministic sort the builder uses). An absent index (no manifest) is clean โ€” there is nothing to validate, not an error.

Returns the list of issues found; an empty list means the index is valid. A StaleGeneration issue is reported once and content checks still run against current topology, so a stale-but-otherwise-intact index reports exactly one issue.

ยงErrors

Returns GfError::Storage when the project itself cannot be read (the generation counter, the manifest, or a topology edge file) โ€” problems with the index are reported as issues, not errors.