Skip to content

Gate 46: a capability whose canonical spec exists never has its open change's delta read #730

Open

Description

@rubenvdlinde

hydra-gates/scripts/lib/check_spec_anchors.py

resolve() consults the capability index "LAST RESORT ONLY": a tag whose literal path exists is judged against that file and nothing else. That is right when a spec has MOVED. It is wrong when the capability's canonical spec exists but the requirement the tag names is still in an open change's delta.

Measured on dossiq (development, 2026-09-09). Ten @e2e anchors in tests/e2e/case-documents.spec.ts name REQ-ZAK-011, REQ-ZAK-012, REQ-ZAK-013, template-library REQ-005 and beschikking-generatie REQ-BES-012. All five requirements exist, in openspec/changes/documents-on-the-case/specs/. The anchors are correct and will keep being correct after that change archives. The gate reports all ten as "anchor not found", because openspec/specs/document-zaakdossier/spec.md exists, so the delta is never opened.

The failure mode is the expensive one: it is a false positive that looks exactly like real debt, and the only way to tell them apart is to open the change by hand. Ten of dossiq's 26 findings were this.

Suggested fix: when the literal path resolves but the fragment is not found in it, fall through to the capability index rather than reporting. A fragment found in the open change's delta for the same capability is resolved, not dangling. Resolution stays by capability across the three homes a spec has in its life:

  1. in flight, openspec/changes/<change>/specs/<capability>/spec.md
  2. archived, openspec/changes/archive/<date>-<change>/specs/<capability>/spec.md
  3. canonical, openspec/specs/<capability>/spec.md

A fragment nobody wrote in ANY of the three still fails, so this does not widen what counts as resolved.

Related: #726 (gate 46 reads only @spec, never @e2e), #727 (gate 46 enumerates lib src tests, missing appinfo/ and scripts/). All three were found by the same dossiq sweep.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions