Orchestrata Ultimate › Gates › feature-loss

Gate: feature-loss

At a glance

Purpose Refuse a requirement that silently lost its implementation, a deleted src/ file whose @traces id no current symbol declares, and a deleted spec/ADR whose id living code still cites.
Where it runs The scripts/gates.py battery (registered as feature-loss).
Trigger A battery run whose fingerprint changed, or whose last cached verdict was not ok.
Exact command python scripts/check_feature_loss.py [--repo-root PATH] [--json]
Blocks Exit 1 on an ORPHANED-REQUIREMENT, DELETED-SYMBOL or DELETED-SPEC finding; exit 2 (INVALID) when history or the corpus cannot be read; 0 clean. No waiver.
Ruling / ADR User ruling 2026-08-19 (quoted below; no RUL page names this gate). Neighbouring rulings: RUL-023, RUL-030.
Last recorded verdict ok: false in the primary checkout's .cache/gates.json (file last written 2026-09-22 10:01 local; the cause is not recorded there). wt-MAP-PRECOMMIT has no .cache/gates.json.

Diagram projects-orchestrata-ultimate-gates-feature-loss-1

What it refuses

Git-evidenced loss: a requirement whose every historical implementation has been deleted with nothing surviving to cover it; a deleted src/ file whose @traces citation no current symbol declares; a deleted spec/ADR document whose requirement id is still cited by living code or tests.

Why it exists

Module docstring, quoting the ruling verbatim:

"User ruling, 2026-08-19, verbatim: 'add checks at the gates so we never face the lost code and features again and make them non negotiable, make them all reference the specs and report loudly any deleted features and loss.'"

Two recorded losses motivate it: commit 6a186c9d (2026-07-09, the deleted testgen generator — owned by generated-artifacts; "this gate is the OTHER half: the SPEC/REQUIREMENT half"), and a dead-code triage that found "37 UNWIRED" symbols (RUL-023's territory — background for "why the project now treats 'quietly lost' as a first-class defect class").

Its distinctive capability: "walks GIT HISTORY (not just the current tree) for evidence that a requirement's implementation, or the document that defines a requirement, USED TO EXIST and is now gone. Every other traceability gate in this repo answers questions about the CURRENT tree only." The docstring demarcates it against check_requirement_corpus ("complementary, not duplicated"), check_spec_authority (fabrication in tests), trace_intel untraced-reqs (advisory, no history), history_intel ("this gate answers whether something was lost; history_intel answers what / when / how / why"), and generate_rtm_evidence (current-tree grading).

The four checks

  1. ORPHANED-REQUIREMENT — still defined in the ratified corpus, every historical implementation deleted, no survivor. Fails the gate.
  2. NEVER-IMPLEMENTED-REQUIREMENT — zero current implementation AND no git evidence it ever had one. Printed, counted, NEVER fails — a deliberate, disclosed precision decision: UNLINKED is "the honest majority" of a 5,500+-id corpus, and "failing on every requirement that was simply never built would make this gate permanently red from the day it lands … exactly the 'noisy gate gets bypassed' failure mode."
  3. DELETED-SYMBOL — a deleted src/orchestrata_ultimate/**/*.py file whose last committed content carried an @traces symbol citing an id no current symbol declares. "Reports the deleting commit sha and date — the exact information a 2026-08-19 session spent hours reconstructing by hand for a single incident." Fails the gate.
  4. DELETED-SPEC — a deleted specs/** or docs/adr/** document defining an id STILL cited by living src or tests. Fails the gate. ("If nobody currently cites the id, this is ordinary spec housekeeping, not a loss.")

Plus a fifth, SURFACE-LOSS (heuristic, info-only) — a different evidence grade for capabilities that were never traced at all (motivated by commit 2883703a…, which deleted an untraced twin).

How it runs

Typical failures and how to fix them

Wiring