Expand description
Shared helper for turning ParseResults into a populated Store.
The runtime engine calls this during Engine::init + reload and
attach_read_mem. The strict validator calls it during V1 graph
construction. Having one implementation guarantees both paths use
identical stub + edge semantics.
Structs§
- Load
Collector - Context passed to
push_entities_into_storefor load-time drift detection. Load-path call sites passSome(LoadCollector { .. })so authored nested-prefix wiki-links (the classic mem-rename drift footprint) emit aSuspiciousNestedPrefixwarning — mutation-path call sites passNoneto stay silent (an author editing an entity that still has a drifted link should not see the warning refire on every save; load already caught it).
Functions§
- last_
segment_ suffix - Extract the last
--separated segment of a mem name (e.g.test-mem-plugin→plugin). Used to derive the known-mem-suffix set from the roster. - make_
stub - Minimal placeholder entity for a wiki-link target that has no
markdown file. Tagged
StubKind::LoadTime— this constructor fires from parser-driven paths (boot, reload, attach) where the stub is auto-emitted from a wiki-link to a not-yet-present target. Mutation paths that needForwardReference/Residualuse the engine-internalmake_stubinengine/mutation/mod.rswhich takes an explicit kind. - push_
entities_ into_ store - Upsert parse results into the store, adding explicit relationship
edges and auto-stubbing any unknown targets. Body wiki-links are
not edge sources — under the alias model every edge originates
from the auto-managed
## Relationshipssection. - reconstruct_
incoming_ cross_ mem_ edges - Re-add edges that point INTO
reloaded_memfrom entities living in other mems, after a per-mem reload ofreloaded_mem. - remap_
alias_ target_ edge_ sources - Remap edge sources to reflect each source mem’s
alias_target_rel_typeschema pointer: edges whoserel_typeequals the pointer are flipped fromExplicittoBodyLink. Idempotent — running it repeatedly produces the same result. - validate_
loaded_ relations - Validate every loaded entity’s
## Relationshipsentries against the source mem’s schema and the wiki-link grammar. Invalid relations are dropped from both the store’s edge index and the entity’s in-memoryrelationshipslist; each drop emits aPARSED_RELATION_INVALIDwarning naming the offending entity, rel-type, target, and reason.