pub fn memory_identity() -> SchemaExpand description
The identity preset: SAME_AS rules over the aliases list, and over the
declared alias_keys list.
Opt-in, never part of memory_defaults: a store gains rules only when
someone asks (SKILL.md: never create a rule silently), so this is applied
by mushroomdb schema apply <db> --memory-identity and nothing else.
Sixteen rules, all global (namespace: None):
- one same-label rule per entity label and for the provisional label —
Person→Person, …,Entity→Entity—OverlaponaliasesatSAME_AS_FLOOR. A same-label rule derives both directions, whichcrate::memory::identity::same_as_pairsreads as one claim; - one directed rule from the provisional label to each entity label —
Entity→Person, … — the sameOverlap. A stubremembermade from anaboutkey is anEntityfor life, and aPerson→Personrule never sees it, so without these the case identity exists for — a subject named before it was described — could never link; - one directed rule from each entity label to the provisional label —
Person→Entity, … —KeyMatchonalias_keys: an entity that declares an alias equal to a stub’s key links that stub, at 1.0.Overlapcannot: a stub keyedmattholds one alias, and a declared alias is not among the entity’s own — those are its key, its name and the name’s words. It readsalias_keys, notaliases, becausealiasesholds derived name words, and an entity merely named “Alex” must not claim a stub keyedalex. The rules key on labels, and a nodeaboutcreated keepsEntityfor life: a stub that was later described can still be claimed, and cannot itself claim.
The KeyMatch rules stand alone rather than under an Any beside the
Overlap: Any is never KeyMatch-rooted, so it would lose the engine’s
foreign-key fast path (core_rules::is_keymatch_rooted). A pair both kinds
link carries one edge per direction, each owned by its own rule, and is
still one claim, at the higher score.
weight_prop and max_edges are set explicitly: apply_schema takes a
RuleDef as given, without the defaults MCP create_rule fills in.