Fold what the gate conversion taught into the hardening rules - #374
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
ast.dump()output for"alembic"in double quotes and reported zero, because dump writesapostrophes. The string matching had moved up a level, not gone away.
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.
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-checksnames the CIsteps 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 -ltwice on a list with no trailing newline - and neveronce 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.