From c246593645266548c1ddb0de08e3ccf665973d1c Mon Sep 17 00:00:00 2001 From: Conduction Release Bot Date: Wed, 9 Sep 2026 16:16:08 +0200 Subject: [PATCH] feat(gate-46): resolve @e2e anchors too, report-only Gate 46 resolved `@spec` targets and nothing else. `@e2e openspec/...` is written with the identical target grammar and carries the identical meaning in the opposite direction, and no gate read one: 1,964 across the 21 fleet apps, 194 dangling, against 55,720 `@spec` anchors with a single unresolved. The gate was never wrong. It read four fifths of the corpus. The cost is measured. dossiq#2057 renumbered two scenarios and two `@e2e` anchors kept citing the old ids; every check passed and the tests went on reporting green while naming scenarios that no longer existed. Two sessions later found six such anchors by hand, hours apart, in the same repo on the same day, because CI does not look. openregister carries the other flavour: a literal placeholder from a template, never filled in. The pattern captures the tag name, the resolver is untouched, and findings are labelled by the tag they came from so the runner can split the counts. An unresolved `@spec` still FAILS exactly as it has since #246. `@e2e` findings WARN, with HYDRA_GATE_SPEC_ANCHOR_E2E_BLOCKING=1 to flip one repo at a time. Warning-first because of where the debt sits: 154 of the 194 are in four repos, dossiq 46, zaakafhandelapp 43, pipelinq 36, decidesk 29, and those are the four with the most end-to-end coverage. Blocking on day one would redden them on debt no PR introduced and would punish the coverage. Gate 46 is therefore named in _ADVISORY_ALLOWED_GATES with its issue, so the demotion is stated rather than silent, and the suite still refuses a second one. Four new arms in test_gate_46_tests_scope.sh and seven in the unit suite, each mutation checked: reverting the pattern, blocking on @e2e, letting the advisory half mask the blocking half, and collapsing the finding label each redden the arm that names them. Closes #726 --- hydra-gates/scripts/lib/check_spec_anchors.py | 36 +++++- .../scripts/lib/test_check_spec_anchors.py | 72 ++++++++++++ .../scripts/lib/test_gate_46_tests_scope.sh | 103 +++++++++++++++++- ..._gate_discarded_counts_and_empty_deltas.sh | 16 ++- hydra-gates/scripts/run-hydra-gates.sh | 86 ++++++++++++--- 5 files changed, 284 insertions(+), 29 deletions(-) diff --git a/hydra-gates/scripts/lib/check_spec_anchors.py b/hydra-gates/scripts/lib/check_spec_anchors.py index e04ae0a43..0dda2af26 100644 --- a/hydra-gates/scripts/lib/check_spec_anchors.py +++ b/hydra-gates/scripts/lib/check_spec_anchors.py @@ -1,6 +1,10 @@ #!/usr/bin/env python3 # SPDX-License-Identifier: EUPL-1.2 -"""Gate-46 spec-anchor-existence — does the `@spec` tag point at something real? +"""Gate-46 spec-anchor-existence — does the tag point at something real? + +Reads `@spec` and `@e2e`, which are written with the same target grammar and +mean the same thing in opposite directions: this code implements that +requirement, this test proves it. Gate-16 checks that a `@spec` tag is PRESENT. This gate checks that its target RESOLVES: the file exists, and — when the tag carries a `#fragment` @@ -96,10 +100,31 @@ # the shape below is 0.0000s. Same family as the `py/redos` CodeQL raised on # gate-28's tail rule in this change; found by sweeping the other regexes it # adds rather than by waiting for the alert. +# +# BOTH TRACEABILITY TAGS, NOT ONLY `@spec` (.github#726). +# +# `@e2e openspec/...` is written with the identical target grammar and means +# the identical thing — this test proves that requirement — and until this +# change no gate resolved one. Measured across the 21 fleet apps: 1,964 `@e2e` +# anchors, 194 of them dangling, against 55,720 `@spec` anchors with ONE +# unresolved. The gate was never wrong; it read four fifths of the corpus. +# +# The measurement is reproducible and was NOT a reimplementation: every `@e2e` +# target was rewritten to `@spec` in a probe file outside the repo and run +# through THIS helper with cwd set to the app, so the numbers are this +# resolver's own semantics. That probe also established the two facts this +# widening depends on — every `@e2e` line carrying an `openspec/` path already +# matches the shape below, and no such tag lives outside `tests/`, which is +# already enumerated. +# +# The tag NAME is captured so the finding can say which one it came from, and +# so the runner can block on `@spec` while reporting `@e2e`. That split is the +# whole reason the group exists; do not collapse it back to a non-capturing +# group without moving the label somewhere else. TAG = re.compile( r'^[^\S\n]*(?:(?:\*+/?|//+|\#(?!\[)|/\*+|