feat(certification): mutation survivors carry the edit that produced them - #326
Merged
Conversation
…them A surviving mutant was reported by id alone - 'mutate-int-literal-41' - which names an operator and a line and nothing else. That is enough to locate a survivor and not enough to judge it. The two causes of escape_rate > 0 need opposite responses: a weak witness wants more cases; an EQUIVALENT MUTANT (a rewrite that cannot change behaviour on any input) wants none, because no case can kill it and the candidate may be perfectly correct. Ledger S5 hit the second twice on semver-parse across two campaigns, and telling the cases apart meant decoding the recorded candidate by hand both times. Every AstMutation now carries a MutationSite: line, column, the original text, the mutated text, and the trimmed source line. BrickMutationEngine threads the sites of the survivors onto MutationTestResult.Survivors, and CertificationGate spells them out in the rejection reason: ... survivors=[mutate-int-literal-41]; mutate-int-literal-41 (line 41, col 13): 0 -> 2 in: if (version.Length > 0) The verdict is deliberately unchanged. Equivalence is undecidable, so the gate still rejects on EscapeRate > 0 and a human adjudicates; this makes that adjudication a glance instead of an investigation. Mutant ids keep their exact format, so nothing that keys on them moves. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Follows #325. The gate reported a surviving mutant by id alone —
mutate-int-literal-41— which names an operator and a line and nothing else. That locates a survivor; it does not let you judge one.The two causes of
escape_rate > 0need opposite responses. A weak witness wants more cases. An equivalent mutant — a rewrite that cannot change behaviour on any input — wants none, because no case can kill it and the candidate may be perfectly correct. Ledger S5 hit the second twice onsemver-parseacross two campaigns, and telling the cases apart meant decoding the recorded candidate by hand both times.Change
Every
AstMutationnow carries aMutationSite(line, column, original text, mutated text, trimmed source line).BrickMutationEnginethreads the survivors' sites ontoMutationTestResult.Survivors, andCertificationGatespells them out in the rejection reason:That line is all the adjudication needed for both S5 cases.
What does not change
EscapeRate > 0still rejects and a human adjudicates. This is deliberately a reporting change only — a threshold that admits an equivalent mutant admits a real escape of the same rate.{kind}-{line}format, so anything keying on them is untouched.RepairFeedbackstill renders survivors as locations only, gated byIncludeMutantLocations. Whether the proposer should see the mutant diff is a separate policy question (it is data about the candidate's own text, never the witness — but that decision is worth its own PR and measurement).Tests
AstMutationEngineTests.CollectMutations_CarriesTheEditThatProducedEachMutant— the S5 shape: asserts the int-literal mutant reports0 -> 2onif (version.Length > 0)and that the id still encodes the site's line.AstMutationEngineTests.MutationSurvivor_Describe_NamesLocationAndEdit.Nexo.Kernel.slnbuilds clean.