fix(774): the loose extractor shared its subject's blind spot; stop claiming the limit list is exhaustive
Round four, one Medium, and it lands on the defence rather than the code: the change argued that its residue was acceptable BECAUSE it was accurately disclosed, and the disclosure was wrong within one round. `SHIP-IT) state=success ;;` is valid shell selecting `success`. Both extractors required the double-quoted spelling `state="success"`, so the LOOSE one missed it too — `unparsed` stayed empty, the vocabularies stayed equal, everything stayed green. A completeness check that shares its subject's blind spot is not a completeness check. The bug was structural, not about quoting. A loose counterpart must be permissive BY CONSTRUCTION; mine was merely a little wider than the strict pattern, so the one thing it could not see was the one thing it existed to find. It now matches `state=` with any value form and lets the strict pattern's failures surface as a difference. Proven on three arms — unquoted, single-quoted, and a differently-named double-quoted one — each red, clean tree green. The disclosure is corrected too, and this is the part worth keeping. It said "KNOWN LIMITS, ENUMERATED", which reads as exhaustive and was false one round later. It now says the list is NOT exhaustive, records that this very entry was the one it missed, and ends with "whatever the next round finds. Assume this list is one short." Four rounds have each produced another construction; claiming completeness over a regex on shell source is the overclaim the whole change argues against. Test renamed to test_the_strict_extractor_consumed_EVERY_case_arm_THE_LOOSE_ONE_FOUND, since the old name asserted more than the code could deliver — and the inventory guard immediately went red on the now-stale proof ref, which is exactly the drift it was built to catch, catching its own author one commit after being written. ruff clean, pyright clean, decisions-validate OK, 580 script-tests pass. Refs #774 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -22,16 +22,19 @@ it prevents. So this takes detector A instead: leave both lists where they are a
|
||||
equality between them, EXTRACTED from each file rather than restated here. A test that spelled the
|
||||
words out would be a third copy of the thing whose duplication is the defect.
|
||||
|
||||
KNOWN LIMITS, ENUMERATED — this is a regex over shell source and CANNOT be made complete, so the
|
||||
limits are listed rather than left for the next reader to discover. Three review rounds each found
|
||||
another construction that escapes; a fourth would find a fifth. Currently invisible to the
|
||||
extractors:
|
||||
KNOWN LIMITS — NOT AN EXHAUSTIVE LIST, and the wording matters. This is a regex over shell source
|
||||
and cannot be made complete; four review rounds have each found another escaping construction, so
|
||||
the honest claim is "these are the ones we know of", never "these are the ones there are". An
|
||||
earlier draft said ENUMERATED, which reads as exhaustive and was itself wrong within one round —
|
||||
`SHIP-IT) state=success ;;` (unquoted value) escaped both extractors and was not on the list. Known
|
||||
to be invisible:
|
||||
|
||||
* a case arm whose first command is not the `state=` assignment — `SHIP*) # note` then
|
||||
`state="success"` on the next line;
|
||||
* an INDENTED later re-assignment of `POS_RE`/`NEG_RE` (inside an `if`), which the runtime uses
|
||||
and `test_each_verdict_pattern_is_assigned_exactly_once` does not see;
|
||||
* an added alternative outside the first captured group of the read-side regex.
|
||||
* an added alternative outside the first captured group of the read-side regex;
|
||||
* whatever the next round finds. Assume this list is one short.
|
||||
|
||||
What IS caught is the realistic edit: someone adding a word in the surrounding style, on either
|
||||
side, to one file and not the other. That is the drift this exists for, and the guard is strictly
|
||||
@@ -65,7 +68,14 @@ _CASE_ARM = re.compile(r'^\s*([A-Z|-]+)\)\s*state="(success|failure)"', re.M)
|
||||
# An emptiness check cannot see that, because the degradation is PARTIAL rather than total. So the
|
||||
# strict pattern is held to consuming EVERY arm the loose one finds — the same completeness idea as
|
||||
# the rest of this change, applied to the extractor rather than to the guard.
|
||||
_ANY_CASE_ARM = re.compile(r'^\s*(\S+)\)\s*state="(?:success|failure)"', re.M)
|
||||
#
|
||||
# It matches `state=` with ANY value form — `"success"`, `'success'`, bare `success`. The first
|
||||
# version required the double-quoted spelling in BOTH patterns, so `SHIP-IT) state=success ;;` was
|
||||
# invisible to the loose one too and `unparsed` stayed empty: a completeness check that shared its
|
||||
# subject's blind spot, which is no completeness check at all. The lesson is structural rather than
|
||||
# about quoting — a loose counterpart must be permissive BY CONSTRUCTION, not merely a little wider
|
||||
# than the strict one. Anything the strict pattern then fails to read shows up as a difference.
|
||||
_ANY_CASE_ARM = re.compile(r"^\s*(\S+)\)\s*state=", re.M)
|
||||
|
||||
# `POS_RE='^review-verdict:[[:space:]]*(mergeable|approved|lgtm)([[:space:]@]|$)'`
|
||||
_VERDICT_RE = re.compile(r"^(POS_RE|NEG_RE)='[^']*?\(([a-z|-]+)\)", re.M)
|
||||
@@ -99,7 +109,7 @@ def read_side_vocabulary() -> dict[str, set[str]]:
|
||||
# ------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
def test_the_strict_extractor_consumed_EVERY_case_arm():
|
||||
def test_the_strict_extractor_consumed_EVERY_case_arm_THE_LOOSE_ONE_FOUND():
|
||||
"""PARTIAL extraction, which emptiness cannot catch. Cold review demonstrated this rather than
|
||||
hypothesising it: adding `SHIP*) state="success" ;;` beside the existing arm leaves
|
||||
`write_side_vocabulary()` returning the unchanged baseline set — non-empty, and equal to the
|
||||
|
||||
Reference in New Issue
Block a user