Skip to content

fix: address 8 tire-kick findings (panics, output race, dead fields, doc errors, MSI inconsistency)#18

Merged
jonbaldie merged 2 commits into
masterfrom
fix/tire-kick-findings
May 26, 2026
Merged

fix: address 8 tire-kick findings (panics, output race, dead fields, doc errors, MSI inconsistency)#18
jonbaldie merged 2 commits into
masterfrom
fix/tire-kick-findings

Conversation

@jonbaldie
Copy link
Copy Markdown
Owner

Summary

A ruthless senior engineer tire-kicked the tool and found 8 confirmed real issues. This PR fixes all of them:

  • Worker goroutine panics: All panic(err) calls in runBuiltinExec and runCustomExec (and main-path setup functions) replaced with clean stderr errors + appropriate exit/return codes. A bad --exec path now prints one line to stderr instead of dumping a goroutine stack trace.
  • Output race (PrintDiff outside mutex): Diff printing moved from interpretBuiltinExitCode (outside the report mutex) into recordMutantResult (under the mutex). Diffs no longer interleave with PASS/FAIL lines from concurrent workers. interpretBuiltinExitCode became a trivial two-branch expression and was inlined.
  • --dry-run over-count undocumented: Help text and dry-run output now note the count is an upper bound — deduplication only runs during a real mutation pass.
  • README blacklist doc wrong: Instructions said "run normally and copy the hex string"; corrected to require --debug.
  • README --exec path has spurious /v2/: The example path pointed to a non-existent directory; fixed.
  • Dead struct fields: TimeOutCount, MutationCodeCoverage (never written, always 0), and Timeouted (never populated) removed from Stats/Report; README updated.
  • MSI JSON scale inconsistency: --logger-agentic-json was outputting msi as 0–100 (percentage) while --logger-summary-json used 0–1 (ratio). Agentic JSON now uses 0–1 to match.
  • Skipped mutants absent from per-mutator breakdown: report.Skipped []Mutant slice added; recordMutantResult populates it; computeMutatorStats now iterates it so the per-mutator table reflects skipped mutations consistently with the headline MSI.

Test plan

  • go test ./... passes (all packages)
  • Quality gates pass: --min-msi 75 --min-covered-msi 80 on mutator and internal packages
  • Bad --exec path produces a single clean error line, no stack trace
  • --logger-summary-json and --logger-agentic-json produce the same msi value and scale
  • go-mutesting --dry-run ./... output includes the upper-bound note

🤖 Generated with Claude Code

jonbaldie and others added 2 commits May 26, 2026 17:08
- Replace all panic(err) in worker goroutines (runBuiltinExec,
  runCustomExec) and main-path functions with clean stderr errors and
  appropriate exit/return codes; a bad --exec path now prints a single
  line to stderr rather than dumping a goroutine stack trace.

- Move all diff and status printing out of interpretBuiltinExitCode
  (called outside the report mutex) and into recordMutantResult (called
  under the mutex), eliminating the output race that caused diff lines
  to interleave with PASS/FAIL lines from other workers. As a result
  interpretBuiltinExitCode became a trivial two-branch expression and
  was inlined.

- --dry-run output and help text now note that the count is an upper
  bound; identical mutations across files are deduplicated during a real
  run, so the dry-run number is always >= the actual mutation count.

- README blacklist section: corrected "run go-mutesting normally" to
  "run with --debug"; checksums are only emitted in debug mode.

- README --exec example path: removed spurious /v2/ segment that made
  the path point to a non-existent directory, causing a panic.

- Remove dead Stats fields TimeOutCount and MutationCodeCoverage (never
  written, always 0 in JSON output) and Report.Timeouted (never
  populated); update README and tests accordingly.

- --logger-agentic-json now writes msi as a 0-1 ratio to match
  --logger-summary-json, eliminating the prior inconsistency where one
  output used percentage and the other used ratio.

- Track skipped (non-compiling) mutants in Report.Skipped slice so that
  computeMutatorStats can include them in the per-mutator breakdown,
  making the breakdown consistent with the headline MSI which already
  counts skipped mutants in the numerator.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jonbaldie jonbaldie merged commit e947416 into master May 26, 2026
@jonbaldie jonbaldie deleted the fix/tire-kick-findings branch May 26, 2026 18:37
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