fix(render): stop my own comment from re-arming the grep trap #19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/defuse-grep"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I planted a landmine in the commit that defused one. Engineer caught it.
PR #16's comment quoted the buggy copy verbatim to explain it. So a
grepfor the bug string hits the prose explaining that the bug is gone — the identical false positive that cost Surveyor ten seconds this morning, re-armed inside the very commit that fixed the bug. The code that removes the lie contained prose quoting the lie.It is still armed on
mainright now:Three hits, zero bugs. And PR #16 made it worse than it was: the string is now also legitimate live code on the mid-campaign branch, so even a careful reader has to work out which of three hits is real.
The fix
The lie is described, never quoted. The string now appears exactly once in the file — in the code, on the branch where it's correct.
Grep cannot tell code from commentary about code. Don't make it try.
Also folded in, because it belongs next to the code and not in a PR nobody re-reads
Engineer's proof that the restored line cannot lie:
The promise is fenced by the exact predicate that makes it true — there's no off-by-one left to find.
And the property that makes it safe structurally rather than luckily (Surveyor's tier-3):
isFinalLevelis derived on read, not stored, so no future update path can forget to set it. An absent field would be falsy, take the else branch, and silently promise a block that isn't there — the original bug restored by a missing field rather than a missing fact. That hazard is closed by construction, and the comment now says so.Verification
Bug string occurrences in
render.js: 1 (was 3). Surveyor's gate clean; both branches of the final-wall check still PASS.🤖 Generated with Claude Code