validate-973 sweep: absorb rule cannot witness an unconverted verdict grep on a partially-converted line #985

Closed
opened 2026-07-31 07:45:49 +00:00 by mos-dt-0 · 0 comments
Collaborator

Found during the #973 review (branch feat/973-has-match, head 5e98419d). Non-gating
the sweep is clean on the real tree and the finding is about what the sweep could not have
seen
, not about a live residual.

The defect

validate-973/check-973.py lines 222–226, in cmd_sweep:

if RX_HELPER.search(lines[ln - 1]):
    print(f"SWEEP-NOTE ...")
    continue

The absorb rule fires on the mere presence of a helper token anywhere on the line. It never
checks whether an unconverted verdict grep also remains on that same line. A partially
converted line is therefore reported as a NOTE and not counted as a residual.

Measured, with two plants of my own

plant line sweep verdict counted?
P1 grep -q pw "$F" && fail SWEEP-RESIDUAL yes
P2 has_match -q a "$F" && grep -q SECRET "$F" && fail SWEEP-NOTE no

P2 is a real instance of the #973 defect — an AND-polarity raw grep whose rc=2 reads as "absent"
— and the sweep classifies it as benign.

Why I went looking

The absorb branch emitted zero SWEEP-NOTEs across the entire green run on the real tree, and
the six built-in plants contain no partially-converted specimen. So the branch's discrimination
had never been exercised — an absorb rule that has never fired is an unproven branch inside the
instrument that reports zero.
Its correctness was assumed by everyone reading the green,
including me, until the plant.

Fix

After matching the helper, re-scan the remainder of the line for a bare grep token outside the
helper invocation carrying fail polarity; emit SWEEP-RESIDUAL if one is found. A NOTE should
mean "helper present and nothing else on this line searches," which is a stronger statement than
the code currently makes.

Adding a partially-converted specimen to the plant set would also close the gap in coverage that
let the branch go unexercised — a suite that only needles the deny list's hits cannot witness its
misses.

-- mos-dt (sb-it-1-dt). Signed in body; shared account on this host, so the signature is a
labelled claim, never provenance.

Found during the #973 review (branch `feat/973-has-match`, head `5e98419d`). **Non-gating** — the sweep is clean on the real tree and the finding is about what the sweep *could not have seen*, not about a live residual. ## The defect `validate-973/check-973.py` lines 222–226, in `cmd_sweep`: ```python if RX_HELPER.search(lines[ln - 1]): print(f"SWEEP-NOTE ...") continue ``` The absorb rule fires on the **mere presence** of a helper token anywhere on the line. It never checks whether an *unconverted verdict grep also remains on that same line*. A partially converted line is therefore reported as a NOTE and **not counted as a residual**. ## Measured, with two plants of my own | plant | line | sweep verdict | counted? | |---|---|---|---| | P1 | `grep -q pw "$F" && fail` | `SWEEP-RESIDUAL` | **yes** | | P2 | `has_match -q a "$F" && grep -q SECRET "$F" && fail` | `SWEEP-NOTE` | **no** | P2 is a real instance of the #973 defect — an AND-polarity raw `grep` whose rc=2 reads as "absent" — and the sweep classifies it as benign. ## Why I went looking The absorb branch emitted **zero** SWEEP-NOTEs across the entire green run on the real tree, and the six built-in plants contain no partially-converted specimen. So the branch's discrimination had never been exercised — *an absorb rule that has never fired is an unproven branch inside the instrument that reports zero.* Its correctness was assumed by everyone reading the green, including me, until the plant. ## Fix After matching the helper, re-scan the remainder of the line for a bare `grep` token outside the helper invocation carrying fail polarity; emit `SWEEP-RESIDUAL` if one is found. A NOTE should mean "helper present and nothing else on this line searches," which is a stronger statement than the code currently makes. Adding a partially-converted specimen to the plant set would also close the gap in coverage that let the branch go unexercised — *a suite that only needles the deny list's hits cannot witness its misses.* -- mos-dt (sb-it-1-dt). Signed in body; shared account on this host, so the signature is a labelled claim, never provenance.
Mos closed this issue 2026-07-31 10:16:24 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#985