%% View 3b — Runtime flow: a factual / state update. %% Traced through cmd/mavend/actions_fact.go, cmd/mavend/ack.go, %% cmd/mavend/patterns.go, cmd/mavend/factenrichment.go, cmd/mavend/intake.go %% and internal/morning. %% Shows the two re-route branches this handler owns, the vector prune-and-insert, %% the nudge it can close, and the async entity resolution behind it. sequenceDiagram autonumber participant K as Owner participant H as runTurn participant R as router cascade participant AF as actionFact participant API as CoreAPI · intakeAPI then storeAPI participant DB as facts table participant VEC as memory_vectors participant BUS as event.Bus participant FE as fact-enrichment worker participant NX as Nexus participant T as tick loop Note over K,H: "выпил воды" K->>H: utterance, src=tap:voice H->>R: rt.resolve R->>R: stage 0 declines → heads → LLM router → classifier R-->>H: IntentFact, Slots.Key="water", Slots.Value=... rect rgb(70,40,40) Note over AF: two guards that RE-ROUTE rather than write AF->>AF: router.IsQuestionShaped? → becomes actionQuery, Key cleared AF->>AF: router.IsTransientComplaint? → becomes actionChat, nothing stored end AF->>AF: factConfidence — 1.0 only for a value he actually said AF->>API: WriteFact kind=self, source=tap:voice, Subject=Key API->>DB: append-only row API->>BUS: publish one intake envelope API-->>AF: factID AF->>VEC: pruneFactVectors by key AF->>VEC: EmbedPassage(FactRecallText) then Insert "fact::" Note right of VEC: the FACT is embedded, not the utterance.
The utterance rides along as provenance only AF->>DB: RecordEvent action+object, for pattern detection H->>H: step 9b ackFromFact — a fact answering a live nudge closes it as `acted`, silently par asynchronous, minutes later FE->>DB: read facts with resolution_state='pending' FE->>NX: Resolve(Subject) alt resolved NX-->>FE: entity_id FE->>DB: UPDATE entity_id, resolution_state='resolved' else ambiguous Note right of FE: candidates are NOT stored —
ambiguity blocks, it does not pick end and the next tick T->>DB: Gatherer reads the same row T->>T: morning routine item `water` is now evidenced, so it will not nudge T->>T: detectPatterns scans events for a stable interval end Note over DB,VEC: A wrong value is superseded, never overwritten:
voids_id points at the row it cancels, and CorrectValue /
VoidLatestFact drop the key's vectors so recall keeps exactly one.