Build Log
Canonical Gate Identity
July 18, 2026
A second review found the unaccounted-gates hard-fail shipped the prior session compared gate names as exact strings — fixed with a canonical gate_id registry, removed the trapdoor escape hatch, and versioned enforcement so 150 real historical sessions don't retroactively fail
Timeline
What shipped
forgekit-os/scripts/gate-registry.mjs — canonical gate_id registry, 21 gates, aliases sourced from a verified grep of real historical session JSONs (not invented)
forgekit-os/scripts/gate-accounting.mjs — session_audit validation extracted from build-session.mjs, gate_accounting_policy-versioned (legacy sessions warn, 'canonical-v1' sessions hard-fail)
REMOVED: audit.unaccounted_gates_accepted — the escape hatch that let a session accept the ABSENCE of gate accounting. gates_missed + a reason remains the correct, unchanged path for a consciously-skipped gate.
forgekit-os/scripts/tests/gate-registry.test.mjs — 15 tests including a real-data verification that every registered alias actually appears in a real historical session (no invented aliases)
forgekit-os/scripts/tests/gate-accounting.test.mjs — 13 tests including a real historical audit reclassifying the prior session's 19 flagged sessions: 13 genuine gaps, 6 naming-drift false positives
Rewrote build-session-gate-audit.test.mjs's gate-accounting-related tests to match the new architecture — CLI-wiring tests instead of duplicated policy-invariant tests (those now live in gate-accounting.test.mjs), and a mutation test fixed to target the actual new location of the logic
Documentation: triggers.md's Session Contract template + a new Trigger Map row for gate-registry maintenance, ignition.md's session_contract template, _SCHEMA.md's Session Audit section — all updated to describe gate_accounting_policy and the new reconciliation design
“lets wrap the current session and then start the new session in the same conversation”