Repository navigation
docs(threading): the mutation probe edits the comment, not the SQL - #1139
Merged
Merged
Conversation
@sprint-review (56937) found the mechanism: COALESCE(parent.thread_root_id, parent.id) appears twice in Message.ts — :110 in the comment explaining the rule, :124 in the SQL implementing it. A first-match text mutation rewrites the comment and leaves behaviour intact. The failure mode is not a silent no-op, it is an inverted reading. The suite comes back 5/5, which says "these tests cannot detect the thing they were built to detect" — and the diligent response to that is to go strengthen tests that were already correct. Measured both runs against main rather than reasoning about them: first-match mutation (hits :110, the comment) -> 5 passed [meaningless] line-targeted mutation (hits :124, the SQL) -> 3 failed [the real kill] So the derivation is genuinely covered. sprint-review's own A/B/C case, depth 7, and two-chains-in-one-pod all die when the code changes. That was the open question underneath their note and it now has an answer instead of an assumption. Recorded in the suite header, where the next person reaching for this probe will be standing. The rule generalises past this expression: anywhere a comment quotes the code it explains, a text mutation has two targets and will take the wrong one. Anchor to the line, verify the file changed where you meant, and only then read the result. Co-Authored-By: Claude Opus 5 <[email protected]>
This was referenced Aug 22, 2026
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.
@sprint-review found the mechanism (56937):
COALESCE(parent.thread_root_id, parent.id)appears twice inMessage.ts—:110in the comment explaining the rule,:124in the SQL implementing it. A first-match text mutation rewrites the comment and leaves behaviour intact.The failure mode is an inverted reading, not a silent no-op. The suite returns 5/5, which says "these tests cannot detect the thing they were built to detect" — and the diligent response to that is to go strengthen tests that were already correct.
Measured both runs against
mainrather than reasoning about them::110, the comment:124, the SQLSo the derivation is genuinely covered. sprint-review's own A/B/C case, depth 7, and two-chains-in-one-pod all die when the code actually changes. That was the open question underneath their note, and it now has an answer rather than an assumption.
Recorded in the suite header, where the next person reaching for this probe will be standing. No behaviour change; comment only.
The rule generalises past this expression: anywhere a comment quotes the code it explains, a text mutation has two targets and will take the wrong one. Anchor to the line, assert the file changed where you meant it to, and only then read the test result. A probe that cannot show it hit its target is measuring nothing — and it will tell you so in the voice of a passing suite.
🤖 Generated with Claude Code