Skip to content

feat(cognition): causal memory graph slice A — acts join the engram edge substrate (#447) - #2321

Merged
joelteply merged 2 commits into
canaryfrom
feat/causal-memory-graph-slice-a
Aug 15, 2026
Merged

joelteply merged 2 commits into
canaryfrom
feat/causal-memory-graph-slice-a

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The overhaul (Joel, 2026-08-15: act memory is 'completely broken… fundamental to every activity and room')

A citizen with 1,808 lifetime acts sees 1–2 of them, concludes she has nothing to contribute, and withdraws — measured live in round v4's first captures. The diagnosis is a design gap, not a budget bug: the receipt's because clause is a causal edge serialized as prose, starving the char-budgeted archive. And EngramGraph — the substrate built for exactly this — had zero production callers.

What this slice does (general cognition, zero benchmark rigging)

  • EdgeKind::{CausedBy, Produced} — the causal/motor level of the ONE engram graph, joining BJG's epistemic kinds. No parallel store.
  • AdmissionState owns the graph: link_engrams() / engram_neighbors(), written at the site that KNOWS the relation, never inferred.
  • ActChain: the settle driver owns the turn's causal thread; apply_act links each admitted act CausedBy its predecessor. The chain dies with the turn — edges cannot cross turns or rooms by construction.
  • probe! engram.edge.caused_by at the link site.
  • Design doc: docs/cognition/CAUSAL-MEMORY-GRAPH.md — the two-pointer convergence (trace/span, correlation/causation, PROV, git parents), views-as-queries (slices B–D: compact scope-first ledger, thread retrieval affordance, confab + L1 consumers), and the freedom doctrine inherited from BJG §5: edges are facts, the graph never decides.

Tests

a_settle_chain_links_each_act_caused_by_its_predecessor (two acts, one chain → CausedBy edge; fresh chain starts empty) + serde round-trip rows for the new kinds. Suites: act_observe 38/38, engram_graph 16/16, admission_state 41/41.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…dge substrate (#447)

Joel's overhaul ruling (2026-08-15): act memory is fundamental to every
activity and room, and it was structurally broken — a citizen with 1,808
lifetime acts sees 1-2 of them, concludes she has nothing to contribute,
and withdraws (the deprivation mechanism, measured live in the v4 round).

The diagnosis is a design gap, not a budget bug: the receipt's 'because'
clause is a causal edge serialized as prose, starving the char-budgeted
archive. Every mature system converges on two pointers per node (trace/
span, correlation/causation, PROV, git parents); we had the thread pointer
(Engram.context_id) and were missing the cause pointer — and EngramGraph,
the substrate built for exactly this, had ZERO production callers.

This slice gives it its first:

- EdgeKind::{CausedBy, Produced} — the causal spine, joining BJG's
  epistemic kinds on the ONE graph (no parallel store).
- AdmissionState owns the graph: link_engrams()/engram_neighbors(),
  wired at the site that KNOWS the relation, never inferred.
- ActChain: the settle driver owns the turn's causal thread; apply_act
  links each admitted act CausedBy its predecessor. Chain dies with the
  turn — edges cannot cross turns or rooms by construction.
- probe! engram.edge.caused_by at the link site (glass box).
- Design doc: docs/cognition/CAUSAL-MEMORY-GRAPH.md (slices B-D: compact
  scope-first ledger, thread retrieval affordance, confab/L1 consumers).

Freedom doctrine inherited from BJG §5: edges are facts about what
happened; the graph never decides; retrieval is an affordance she invokes.

Tests: a_settle_chain_links_each_act_caused_by_its_predecessor (+ serde
round-trip rows for the new kinds); act_observe 37/37, engram_graph 16/16,
admission_state 41/41 green.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ce E (GraphViewState)

The ts-rs drift gate caught the missing regenerated binding for the new
EdgeKind variants. Also records slice E in the design doc per Joel:
the positron GraphViewState — event-driven engram-graph rendering, one
truth in Rust keyed (room_id, kind) per #408, her slice-C introspection
walk IS the human's clicked view (one graph, one query, two observers).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit 2bcefcd into canary Aug 15, 2026
5 checks passed
@joelteply
joelteply deleted the feat/causal-memory-graph-slice-a branch August 15, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant