Skip to content

Fold what the gate conversion taught into the hardening rules - #374

Merged
haksungjang merged 3 commits into
mainfrom
er66-guide-lessons
Sep 4, 2026
Merged

Fold what the gate conversion taught into the hardening rules#374
haksungjang merged 3 commits into
mainfrom
er66-guide-lessons

Conversation

@haksungjang

Copy link
Copy Markdown
Contributor

Eight things the ER66 gate conversion turned up, folded into rules 7 and 8. No
new rules, and nothing that could not be attached to something already there.

Rule 7, in the "a tool found nothing" bullet, which already says a pattern
finds the notation you imagined while a parse finds what is there:

  • Reaching for a parse is half of it. The census searched ast.dump() output for
    "alembic" in double quotes and reported zero, because dump writes
    apostrophes. The string matching had moved up a level, not gone away.
  • What a comparison normalises away is its definition of "the same", and that
    decision produces the answer, not the comparison after it. Erasing string
    literals merged eight unrelated fixtures, because for a fixture the strings are
    the payload; erasing decorators would have merged fixtures with different
    lifetimes into one recommendation.
  • Widening what a census counts invalidates the sample taken before it. Widened
    to a second way of reaching the database, it swept in 83 modules that skip over
    a missing binary and never open a connection. It was wrong six times in all,
    five of them immediately after the definition grew.

Also a new bullet for a way an assertion can hold nothing: a rule induced from a
single example keeps that example's accidents. An exemption list with one entry
asserted that exempt modules have no gate, which was true of that one by
coincidence; the next three keep their gates on purpose and the assertion failed
for all three.

And the counterpart to "a specific wrong answer is more dangerous than an empty
one": make a tool say what it does not do. tools/static-checks names the CI
steps it deliberately omits and why, and its contract test is what noticed a
later change adding a CI step without registering it - not review.

Rule 8, which already says to check a surviving mutation actually landed:
the same question applies before a bulk change. Declare how many files an edit
must touch and stop with nothing written on a mismatch, since a pattern matching
nothing reports "nothing to do" and that reads as "not applicable". Over 193
modules it stopped three runs, all three the operator's arithmetic rather than
the tool - including wc -l twice on a list with no trailing newline - and never
once the transformation. Worth saying which input was weaker.

A declared number can also disagree with you: a prediction that a batch would
shrink by one came back unchanged, and without it the correct result would have
confirmed a wrong model. Keep the count independent of the tool, or the two
always agree and nothing is checked. Hold the same bar whatever the size - one
file edited by hand is not safer than a hundred edited by a transformation
already run against the whole tree. And two identical failures mean the thing
being changed is not the variable: three attempts to repair a docstring each
moved the insertion point and each failed the same way, because the fragment
being inserted carried a stray terminator.

EN and KO move together.

No new rules. Eight lessons from the ER66 series go where they belong:
switching to a parse does not help if its output is read as text again; what
a comparison normalises away is its definition of sameness; widening what a
census counts invalidates the sample taken before; a rule induced from one
example carries that example's accidents.

And in rule 8, that 'did it land' applies before a bulk change too: declare
the count, keep it independent of the tool, hold the same bar whatever the
size, and treat two identical failures as evidence that the thing being
changed is not the variable.
Same eight lessons, about a third fewer words: the concrete cases stay, the
sentences around them go.
The additions landed almost entirely in one bullet that was already the
longest, so somebody arriving with a specific problem has to read the whole
block to find their case. Same rule number, same single item, but each
mechanism now leads with what it is: the pattern finds only the notation you
imagined, a parse can be read as text again, what you erase in order to
compare is what counts as the same, and a wider definition needs a fresh
sample.
@haksungjang
haksungjang merged commit 8ad4841 into main Sep 4, 2026
30 checks passed
@haksungjang
haksungjang deleted the er66-guide-lessons branch September 4, 2026 22:29
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