Skip to main content

Module census

Module census 

Source
Expand description

The census types, the spanning-tree walker that fills them in, and the reachability views built over the result. See the module doc at crate::graph for why the census is ground truth.

Structs§

Backlink
An inbound reference to a document, as discovered by the census: which document links here (source), where in it (site), and whether the link is by stable id (survives moves) or by path (rewritten on a move). The inverse of a forward CensusEntry — the marquee payoff of the identity layer (DESIGN §6).
CensusEntry
One forward link as found in a document: where it is written and how it resolves. The unit of the census.
Walk
The result of one spanning-tree walk: the forward-link census, the structural facts observed from traversal state, and the prose body files reached through separated nodes’ content pointers (tracked for the orphan check, deliberately absent from the census).

Enums§

LinkSite
Where in a document a forward link is written — a frontmatter relation field or a body wikilink. Carried by every link-resolution finding (prov’s Finding, derived in validate — see StructuralFact) and every CensusEntry so a report can point at the exact site.
Resolution
How a forward link resolves against the workspace. Path and id forms stay distinct on purpose: the registry owns id resolution (location-independent, stable across moves), while a path is checked against the on-disk name — so a caller can tell which links a rename must rewrite (paths) from which it must leave alone (ids).
StructuralFact
A structural observation the walk makes as it traverses — not a verdict, just what it saw: a document that would not load, a self-stored id disagreeing with (or absent from) the registry, a spanning edge that revisits an already-reached node, a spanning child whose inverse field does not point back, or a content pointer that failed to resolve.

Functions§

inbound
The inbound references to one target within an already-taken census, sorted by source — invert focused on a single entry.
invert
Invert a census into a backlink map: every resolved target to the inbound references that reach it, each target’s sorted by source.
reachable_set
The set of workspace-relative paths a walk from start reaches: start itself, every path a census link resolves to (any relation, a body wikilink, or an id through the registry), and every content target.