Skip to content

docs(threading): the mutation probe edits the comment, not the SQL - #1139

Merged
lilyshen0722 merged 1 commit into
mainfrom
docs/mutation-probe-hits-the-comment
Aug 22, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
docs/mutation-probe-hits-the-comment

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

@sprint-review found the mechanism (56937): 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 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 main rather than reasoning about them:

Mutation Hits Result
First-match text :110, the comment 5 passed — meaningless
Line-targeted :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 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

@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]>
@lilyshen0722
lilyshen0722 merged commit ef99fb3 into main Aug 22, 2026
11 checks passed
@lilyshen0722
lilyshen0722 deleted the docs/mutation-probe-hits-the-comment branch August 22, 2026 20:23
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