Ruleset engine — build inventory
One row per unit of functionality, one line each. BUILT = exists in the repo and was verified (round-16 reviewer checks + this session's gate runs). TO BE BUILT = specified by the design (v17,
plans/ruleset-runtime-design.md) but not implemented — per Mohamed's ruling (ADR-0052 condition, 2026-08-29) every one of these is planned → designed → adversarially reviewed → built under gates, never wired as a config flip. Implementation of the engine is NOT authorized until Mohamed ratifies.
BUILT — exists today, verified
| # | Functionality | What it is / what it does |
|---|---|---|
| B1 | Review battery (scripts/gates.py) |
The RUL-008 entrypoint: runs the 24 registered gates in parallel with fingerprint dedup and self-heal; any FAIL blocks the change. |
| B2 | Prolog gate layer (scripts/gate.py) |
Proves Key-Rule violations over the AST fact snapshot (PASS/FAIL/INVALID with proof trees and why-not). |
| B3 | AST toolkit (scripts/serialize_codebase_ast.py) |
Serves all code structure and content (symbols, refs, exact source, renames) plus the trace subcommands — the mandated alternative to hand-reading source. |
| B4 | check-traces ratchet (pre-commit) |
Fails a commit if the repo-wide untraced-symbol count exceeds 2219 — a NET-COUNT ratchet, not a per-symbol block (its known gap is why ADR-0052 exists). |
| B5 | trace-lint (pre-commit) |
Fails a commit containing malformed @traces annotations. |
| B6 | REQ-id format gate (check_req_format.py, pre-commit --max 0) |
Fails a commit that introduces a requirement id violating the one canonical grammar. |
| B7 | Feature-loss gate (check_feature_loss.py, pre-commit + battery) |
Fails when a requirement's implementation disappears from the tree silently. |
| B8 | Requirement-corpus gate (battery) | Fails production code that cites a requirement id no spec can grade. |
| B9 | trace_intel.py queries |
Deterministic Prolog queries for trace orphans, untraced requirements and use-case narratives — a query tool, currently bound to no failure point. |
| B10 | check_spec_authority.py |
Verifies every test-cited REQ id exists in a spec registry — script built, currently bound to no failure point (ADR-0052). |
| B11 | Factory conformance B2/B3 (factory_conformance, factory_trace_check) |
Mechanically checks built code against designed contracts and validates structural traces — CLIs built, currently bound to no failure point (ADR-0052). |
| B12 | RTM generator (generate_rtm_evidence.py) |
Produces the evidence-graded requirement traceability matrix consumed by the requirement-corpus gate. |
| B13 | Suite runner (scripts/run_tests.py) |
Kernel-REQUIRED infra preflight + safety gates + batched execution of ~29K tests; no xdist, no mocks, no skips. |
| B14 | ADR drift gate (check_adr_graph_sync.py) |
Refuses any ADR not identical across its three homes (docs / wiki / graph) in both string-significant registers — currently OK across 77 ids. |
| B15 | ADR sync + register migration (sync_architecture_to_graph.py) |
Ingests both ADR registers and the wiki decisions page into ArchitectureDecision graph nodes; ran the one-time two-register migration (ADR-0047). |
| B16 | Decision skill + word trigger | Any prompt mentioning decision/ADR/ratify/ruling injects the full ADR procedure (three homes, gate to green, same-turn recording) — deployed and plugin-shipped. |
| B17 | session pipeline approve/reject |
Resumes or re-enters a pipeline escalation thread — built and tested, but it is NOT ratification; it is only the UX pattern F13(D)'s target interface will follow (the R16-4 finding). |
| B18 | Adversarial-loop evidence chain | Briefs committed before dispatch, review evidence committed on landing, mechanical fold-verifier, per-round status doc — exercised across 17 design rounds. |
| B19 | Wiki + canvas | Wiki.js serving the full knowledge-wiki repo (incl. 24 per-gate pages) with credential-free LAN editing, plus the arch-canvas drawing server. |
TO BE BUILT — specified in the design, not implemented
| # | Functionality | What it is / what it does |
|---|---|---|
| T1 | RulesetVersion + Composition store | Content-addressed, per-surface immutable rule trees and named Compositions pinning surface→version — the artifact model everything else reads. |
| T2 | Name register | The chained, append-only register of name births, surface births and retirements, with genesis anchors and the duplicate-refusal walk. |
| T3 | Surface-lease chain | Grant/renewal/retire records with compare-and-append, chain-derived epochs, and enforced terminality (no append past a retire). |
| T4 | The projector | The admission-gate daemon: admits pointers/rejections/births/leases, writes gate-signed AdmissionRecords, record-then-XADD, reconciliation + lease-publish drains. |
| T5 | The queue | Mohamed's-context service: proof re-derivation, review adjudications, the review and mint n-allocators, lineage minting with bearer tokens, presentation assembly with full verdict histories. |
| T6 | Silence gate | Computes every overlapping-surface lineage's blocking-verdict history at presentation AND re-checks it at the act via the new overlap_gate admission check. |
| T7 | A1 admission pipeline | The fan-out validators (load-check, meta-lint, rule tests, consistency, shadow) producing proofs stamped with lease_chain_ref under a fenced lease. |
| T8 | A2 act verification | Verifies all THIRTEEN act+target conjuncts at ratification before a pointer lands. |
| T9 | Four-key trust system | The ratify/adjudicate/prove/admit namespaces, the key registry with validity windows/revocations, and per-gate rotation. |
| T10 | Dispute subsystem | Mohamed-signed dispute ranges with per-class coordinates (pointer-seq, lease-chain, review-n, mint-n, proof-seq) and per-gate re-admission executors. |
| T11 | Ratification interface (F13-D target) | The one-word approve/reject/rollback verbs with override carriers + the harness SSH signer over the full C-6 pointer payload — held on ADR-0050. |
| T12 | Serving runtime (OWNER/workers/janitor/reaper) | RoutingSnapshot, generation leases, deny_all modes, and the revoked-law intersection that serve ratified law to callers. |
| T13 | CTRL + health monitor | Revoked-set materialization from the registry chain, freeze/gap declarations, health cadence and republish. |
| T14 | SUP | Supervision: keyless lease-grant decisions and bounded projector restarts. |
| T15 | Streams layer | The control/heartbeat/activations Redis streams with per-consumer cursors and the stated trim rules. |
| T16 | C-11 decision-input recording | Durable per-decision input records (the replay substrate), with node_seq reserve-ahead and gap declarations. |
| T17 | SurfaceShadow replay | Replay-shadow over closed watermark ranges; NOT-EXERCISED on a changed rule blocks Proven. |
| T18 | Rollback + grandfather machinery | Window rollbacks that skip re-validation via grandfather records — the deny-episode recovery path. |
| T19 | Engine runtime | Spawn-selftest-flip lifecycle, chain checkpoints (incl. the RETIRED terminal marker), INV-10 apply, decision evaluators + the bounded IPC cache. |
| T20 | Gate wirings (ADR-0052, conditioned) | Battery entries for the three trace gates, spec-authority + factory B2/B3 bindings, and a SPEC-115-scoped check-traces --max 0 lane — each one planned, designed, reviewed and built per Mohamed's condition. |
| T21 | SPEC-115 spec-sync | Converting the ratified design into SPEC-115 with the total REQ-115 decomposition map (the §0/§1/§10 buckets held on ADR-0051) and mandatory @traces. |
| T22 | F6 numbers | The measured budgets/deadlines/capacities the design names (lease durations, drain cadences, assembly budget, signer alarm…) — sized by benchmark, not guessed. |
Substrate note: the codebase already has reusable primitives (Redis factories, graph repositories, the Prolog adapter, DI container, kernel/gateway) — but none of the ruleset mechanisms above exist on that substrate today; T1–T22 are all subject to the full build discipline.