Expand description
Graph construction + community detection for the validator.
Builds a Store from validated entities using the same stub +
edge rules as the runtime loader (entity::store_builder), then
runs Louvain with a fixed seed. Defence-in-depth cross-mem guard
rejects any relationship whose target lives in another mem
(structurally impossible inside a single archive because
parse_markdown tags every relationship with the archive’s single
mem, but the guard stays to catch engine refactors).
Structs§
- Dangling
Cross MemEdge - One relationship whose target lives in a different mem than the
one being validated/exported — i.e. an edge that cannot travel
inside a single-mem archive.
installrefuses on these (ARCHIVE_VALIDATION_FAILED);exportwarns on them (DANGLING_CROSS_MEM_EDGE_IN_EXPORT) so the operator sees the install-time failure before sharing — one predicate, two postures. - Graph
Check Result - Result of running graph checks — Store + communities, ready for downstream stats + canonical re-pack.
Constants§
- VALIDATOR_
LOUVAIN_ SEED - Fixed seed for Louvain — published once so both the validator and
any downstream reproducibility checker can assert on the same
value. Value
1is arbitrary but pinned. - VALIDATOR_
RESOLUTION - Default resolution parameter for Louvain at ingress. Matches the
community.resolutiondefault used by every shipped schema so validator-built stores land at the same modularity the runtime would produce for the same bytes.
Functions§
- build_
and_ check - Build a
Storefrom parse results and run community detection. Rejects any parse-result relationship whose target lives in a different mem (defense-in-depth:parse_markdownalready tags every relationship with the entity’s own mem viawiki_link_to_id, so this should never fire on a well-formed archive — but any refactor that weakens that invariant will be caught here instead of silently diverging from runtime semantics). - dangling_
cross_ mem_ edges_ in - The shared cross-mem predicate: every relationship in
parse_resultswhose target lives in a mem other thanmem_name.build_and_check(install/load) refuses on the first; the export side warns on all of them — both go through this one function so the surfaces can’t drift. - resolve_
fallback_ type - Resolve the fallback type for Store construction given a config.
Picks the first entry of
config.typesand falls back to the engine-wide fallback if unresolvable — the config checker has already confirmed every listed type resolves post-validation. - tally
- Walk the store and count entities and all out-edges. Used for
MemStatspost-validation.