Skip to content

#243: match the pair, and let the corpus decide when the scan is finished - #255

Merged
Polichinel merged 1 commit into
developmentfrom
fix/243-pair-matching-and-stopping-rule
Aug 12, 2026
Merged

Polichinel merged 1 commit into
developmentfrom
fix/243-pair-matching-and-stopping-rule

Conversation

@Polichinel

Copy link
Copy Markdown
Collaborator

Closes #243. Gate 2 of epic #241.

The parse is gone

The scan no longer reads a line, captures what it thinks the value is, and compares. It knows both halves before it starts — the declared names and the declared values — so it matches NAME=VALUE directly, with findall rather than one match per line.

Every blindness C-57 records came from that parse: the swallowed comment, the missing terminator, the six-character lookbehind, the second assignment on a table row. None is expressible now.

The halves need not correspond — APPWRITE_X=<value declared for APPWRITE_Y> is the ordinary copy-paste slip, and it names the coordinate that declares the value.

The stopping rule is a test, not a paragraph

It enumerates every line in this repository's own tracked markdown that assigns a declared coordinate, and fails if the matcher cannot read one. A form no document here uses is not a gap. A new form is taught in the same change as the document introducing it.

That is what stops a fifth widening, which is what this story was for.

The four mutations routed from #242 are closed

By one richer fixture rather than four tests — two copies, two sections, one short, one in markdown. Each element defeats a specific narrowing:

mutation before after
scanned_sections narrowed to target survives caught
length floor reinstated survives caught
SyntaxError swallowed survives caught
break after the first finding survives caught

Also: the secret exemption is gone — an inline name literal sitting under a comment saying the scope came from the declared partition and not from an inline list.

An exclusion list built, then deleted

The plan called for excluding values spelled like this repo's own code. Measured against what the AST branch actually sees — non-docstring string constants — the collision does not exist: the only registry values appearing that way are the two contract rows, and contract is MIRRORED, never in the scanned set.

I had built a narrowing of a security scan for a problem this branch doesn't have. Deleted. The latent version is C-97's.

The line budget, honestly

tests/*.py: 9,200 → 9,308. Still the wrong direction. Detail and what I propose in the story comment — I am not restating the criterion to make it pass.

ruff check .    # clean
pytest -q       # 415 passed, 1 skipped, 40 xfailed

🤖 Generated with Claude Code

… scan is finished

THE PARSE IS GONE. The scan no longer reads a line, captures what it thinks the value is,
and compares. It knows both halves before it starts, so it matches NAME=VALUE directly,
with findall rather than one match per line. Every blindness C-57 records came from that
parse — the swallowed comment, the missing terminator, the six-character lookbehind, the
second assignment on a table row. None is expressible now.

The two halves need not correspond: `APPWRITE_X=<value declared for APPWRITE_Y>` is the
ordinary copy-paste slip, and it names the coordinate that DECLARES the value rather than
the one the line assigns.

THE SECRET EXEMPTION IS GONE. An inline name literal, sitting under a comment saying the
scope came from the declared partition and not from an inline list. Measured, [secret]
carries no values today, so removing it changes nothing now and closes the hole the day
one gains a value.

THE STOPPING RULE IS A TEST. It enumerates every line in this repository's own tracked
markdown that assigns a declared coordinate and fails if the matcher cannot read one. So
the form list comes from the corpus: a form no document here uses is not a gap, and a new
form is taught in the same change as the document that introduces it. That is what stops
a fifth widening, which is what this story was for.

ALL FOUR SCOPE MUTATIONS ROUTED FROM #242 ARE CLOSED, by one richer fixture rather than
four tests — two copies, two sections, one short, one in markdown. Each element defeats a
specific narrowing: stopping at the first finding, reading only `target`, reinstating a
length floor, skipping the markdown branch. Measured surviving before, caught after. Plus
one small test for a package module that does not parse.

AND AN EXCLUSION LIST WAS BUILT AND THEN DELETED, which is the part worth keeping. The
plan called for excluding values spelled like this repository's own code. Measured against
what the AST branch actually sees — non-docstring string constants — THE COLLISION DOES
NOT EXIST: the only registry values appearing that way are the two contract rows, and
contract is MIRRORED rather than CONSUMED, so it is never in the scanned set. I had built
a narrowing of a security scan for a problem this branch does not have. Deleted; the
latent version is recorded in C-97.

Register: C-57 gets the mitigation, in one place, and the docstrings point at it rather
than restating it — the one-home rule, applied for the first time.

tests/*.py 9200 -> 9308. The budget is still the wrong way and I am not going to pretend
otherwise; see the story comment.

Suite 415 passed / 1 skipped / 40 xfailed, ruff clean.

Closes #243. Epic #241.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Polichinel
Polichinel merged commit 33bbc4c into development Aug 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant