100%

Section 02: plan.json binding_constraints[] registry + 3-source populator

Goal

Stand up the plan-owned binding-constraints registry that makes prior knowledge (sibling dossiers, closed bugs, Locked Designs) enforceable downstream. The registry is the SSOT the detector and route pass read.

Implementation Sketch

plan.json binding_constraints[] (plan-owned per state-discipline §1; written via scripts.plan_corpus.write). Populator pulls 3 sources at section-close time. New dossier_constraint.schema.json for the entry shape.

Spec References

scripts/plan_corpus/write.py; scripts/plan_corpus/schemas/v7/plan-routing.schema.json; scripts/intel_package_runtime/ (§01 extractor); .claude/rules/state-discipline.md §1; .claude/rules/script-first.md §11.

Work Items

  • TDD-first: pin the binding_constraints[] schema entry shape {source_section_id, constraint_kind, constrained_symbols[], rationale, source} + the populator over the 3 sources, as failing tests in scripts/plan_corpus/tests/.
  • Add binding_constraints[] as plan-owned state in the v7 plan.json schema (state-discipline §1 SSOT, NOT an _inflight sidecar); write it ONLY via scripts.plan_corpus.write (never raw plan.json).
  • Author the populator: source-(a) prior/sibling section dossier constrained_symbols (via §01 extractor), source-(b) closed-bug hardened surfaces, source-(c) CLAUDE.md ## Locked Designs + decisions/*.md; idempotent, keyed by (source_section_id, constraint_kind, symbol).

Fresh intel (regenerated)

{ “schema_version”: 1, “target”: { “kind”: “plan-section”, “ref”: “plan-forward-coherence/s-817e616e” }, “generated_at”: “2026-06-26T00:12:48.602640+00:00”, “graph_state”: { “head_sha”: “8f006d26”, “last_code_import_at”: “2026-06-26T00:12:30.809Z”, “embedding_stale”: false, “insights_stale”: false, “cpg_stale”: false }, “surfaces”: {}, “summary”: “intel-package[plan-section:plan-forward-coherence/s-817e616e] agent-authored dossier”, “degraded”: false, “dossier”: { “objective_symbols”: [], “tiers”: {}, “agent_authored”: true, “constrained_symbols”: [ “resolve_scheme_var”, “dossier_constraint_violation_or_none” ], “difficulty”: { “class”: “routine”, “research_online”: false, “research_mode”: “auto”, “signals”: [], “plan_dir”: “/home/eric/projects/ori_lang/plans/plan-forward-coherence” } } }

(full dossier: binding-constraints-registry—s-817e616e.intel.json)