PCs/NPCs — spine + leaf + verifier

A toy "cached squares" Compartment knows 0² through 4². The runner cycles six inputs that exercise every Outcome branch: spine hits for 0 and 1 (no leaf fires, no verifier runs), spine misses for 5 and 6 (leaf proposes, verifier accepts → LeafVerified), 7 trips the "wrong proposal" path (LeafRejected — the substrate prefers no answer to a wrong one), and 8 runs without a leaf configured (NoLeaf). Three bars show bit-ops per stage so the asymmetry is visible: the spine is cheap (~64 ops), the leaf is expensive (~800 ops, the LLM stand-in), the verifier is cheap again (~32 ops). The substrate's discipline: never commit a leaf return until the spine verifies it.

About this exhibit

The substrate's load-bearing architectural metaphor is game-AI's PCs vs NPCs split: 95% of every interaction is deterministic spine (physics, lookup, FSM, constraint check) and 5% is fuzzy leaf (text generation, novel tactic proposal). Both compose into one program. The spine ships; the leaf augments. Every leaf return passes through the spine's verifier before merging into committed state.

The four outcomes the runner can report:

  • Spine — compartment resolved on its own; leaf + verifier never ran. The common case.
  • LeafVerified — compartment unresolved, leaf proposed, verifier accepted. The augmentation pattern.
  • LeafRejected — leaf proposed, verifier rejected. Substrate drops the call rather than commit a wrong answer.
  • NoLeaf — compartment unresolved, no leaf configured (or policy refused). The pure-substrate mode.

Every public mathground crate is composable against this contract. mgai-cea's constraint search is spine-only today; a future revision could escalate to an LLM-proposed parameter jump that the existing constraint check verifies. mgai-active-inference's observe step is spine; its plan step could escalate to a learned policy that the FEP verifier accepts only if the EFE doesn't increase.

substrate piece
/lane#pair-01 · chain of thought — deterministic /exhibits/constrained-design · rule encoder over voxel kernel /exhibits/active-inference · closed-loop FEP agent
95% spine + 5% leaf, verified before merge. The substrate's canonical architecture as a typed Rust contract.