Skip to content

feat: cognition decision trace schema (substrates-structures-circuits 13.2) - #82

Merged
mdheller merged 1 commit into
mainfrom
feat/cognition-decision-trace-schema
Aug 3, 2026
Merged

feat: cognition decision trace schema (substrates-structures-circuits 13.2)#82
mdheller merged 1 commit into
mainfrom
feat/cognition-decision-trace-schema

Conversation

@mdheller

@mdheller mdheller commented Aug 3, 2026

Copy link
Copy Markdown
Member

What

Integrates section 13.2 of the Substrates, Structures, and Circuits framework (spec-intake 2026-08-03) into the schema lane as spec-as-code with teeth.

Adds schemas/lawful-learning/cognition-decision-trace.v1.json — the per-inference decision trace emitted one record per *.decision event. It carries the declared trunk substrate and structure, the retrieval regime + weights + energy, the per-slot mixture state (mode / weights / dominant option), the head observation, the two-layer approval gate with its named triggers, and a SHA-256 replay seal.

Why this and not the existing decision-emission schema

decision-emission.v1.json records a lawful-learning governance decision (claim promotion, circuit admission). It does not carry the runtime cognition-loop trace fields (substrate / structure / slots / retrieval / substrate diagnostics / approval triggers). This schema fills that gap — the runtime decision itself, section 13.2 of the framework.

Much of the framework is already integrated in this repo (framework doc, circuit-registry / forbidden-circuits / alignment-check schemas, hopfield + neural-fabric). This PR adds the one concrete missing contract.

Teeth

Wired into make lawful-learning-schema-ci:

  • replay_seal must be a SHA-256 digest (^sha256:[a-f0-9]{64}$) — FIPS-authoritative;
  • two-layer approval gate: a non-single trunk retrieval regime forces approval.required = true with the trunk_regime_non_single trigger declared.

Ships a valid fixture plus negatives for the approval-gate bypass and a weak replay seal. Verified locally: make lawful-learning-schema-ci and make lawful-learning-checker-fixtures both exit 0 (valid accepted, both negatives rejected). Framework doc updated with a schema-lane pointer, respecting the M/T/S/E/G claim-tag discipline.

Follow-ups (filed as issues)

  • Procrustes feature-alignment / drift checker (check-alignment.py, framework 11 / 13.3).
  • Offline circuit-discovery pipeline (SAE + integrated-gradients + causal ablation, framework 9).

🤖 Generated with Claude Code

… 13.2)

Adds schemas/lawful-learning/cognition-decision-trace.v1.json: the per-
inference decision trace from the Substrates, Structures, and Circuits
framework (section 13.2), emitted one record per *.decision event. Carries
the trunk substrate/structure, retrieval regime + energy, per-slot mixture
state, head observation, approval gate, and a SHA-256 replay seal.

Distinct from decision-emission.v1 (a lawful-learning governance decision);
this records the runtime cognition-loop decision itself.

Teeth (wired into make lawful-learning-schema-ci):
- replay_seal must be a SHA-256 digest (^sha256:[a-f0-9]{64}$);
- two-layer approval gate: a non-single retrieval regime forces
  approval.required=true with the trunk_regime_non_single trigger.

Ships a valid fixture plus negatives for the approval-gate bypass and a
weak replay seal. Framework doc updated with a schema-lane pointer.
@mdheller
mdheller merged commit ece87b7 into main Aug 3, 2026
10 checks passed
@mdheller
mdheller deleted the feat/cognition-decision-trace-schema branch August 3, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant