Skip to content

Fully test the isolated mutation run state - #1954

Merged
stefan-burke merged 1 commit into
mainfrom
claude/mutation-check-isolation-state
Jul 27, 2026
Merged

Fully test the isolated mutation run state#1954
stefan-burke merged 1 commit into
mainfrom
claude/mutation-check-isolation-state

Conversation

@stefan-burke

Copy link
Copy Markdown
Member

The next chunk after #1951, continuing the work from #1944: taking one scripts/ file at a time up to a full mutation score, so its tests really would catch a change to it.

scripts/mutation/isolation-state.ts now scores 100% — 224 of 224, with nothing suppressed. It was at 78.3%.

What was untested

Most of the gap was the two lists naming what a mutation snapshot must not copy — folders like node_modules, .git, and the coverage output, plus files like .env and the local database. Not one entry was checked, so any of them could have been deleted without a test noticing. Quietly copying node_modules into every snapshot would roughly double how long each mutation run takes; quietly copying .env would put secrets in a temporary folder. Every entry is now checked one by one.

The rest covers rules nothing had pinned down:

  • Which files count as a database, so the write-ahead and shared-memory files go too, not just the .db itself.
  • Which built browser assets are left behind, and that an ordinary file sitting in the same folder still comes along.
  • That a folder name is only skipped when it is the top folder — someone's own dist folder further down is theirs to keep.
  • That a run id ends in eight letters, so two runs starting in the same second cannot land in one folder.
  • That the record written to disk stays readable, indented, one field per line, for anyone who opens it.
  • That a whole run id wins outright over one that merely starts the same way, so --kill mutation-abc cannot refuse to act because mutation-abc-2 also exists.
  • That the lock genuinely keeps a second run out, that it hands the lock back when the work inside fails, and that a run nobody is holding is reported as free.

Four things that were doing nothing

  • Two folder-making calls that repeated the line directly above them.
  • docs-output listed as a folder name, when the rule below it already skips anything starting with that.
  • tickets.db listed as a file name, when the database-file rule already covers it.
  • The run lock was its own copy of withFileLock from scripts/lock-file.ts — opening, holding, releasing and closing in the same order. It now calls that helper and only adds the part that is genuinely its own: making the run's folder first, so there is something there to lock.

scripts/mutation/isolation.ts is still at 100% after that lock change.

Next

The remaining scripts/ files with gaps are stripe-mock.ts, stripe-mock/install.ts, specs/run.ts, and mutation.ts.


Generated by Claude Code

Takes scripts/mutation/isolation-state.ts from 78.3% to 100% on the mutation
gate, with nothing suppressed.

Most of the gap was the two lists naming what a snapshot must not copy. Every
entry is now checked, so dropping one fails a test rather than quietly doubling
how long each run takes by carrying node_modules or a coverage folder along.
The rest covers rules nothing had pinned down: which files count as a database,
which built assets are left behind, that a run id ends in eight letters so two
runs starting in the same second cannot collide, that the record on disk stays
readable, and that a whole run id beats one that merely starts the same way.

Four things turned out to be doing nothing and are gone:

- Two folder-making calls that repeated the line above them.
- "docs-output" listed as a folder name when the rule below already skips
  anything starting with it.
- "tickets.db" listed as a file name when the database rule already covers it.

The run lock was also its own copy of withFileLock, down to holding, releasing
and closing in the same order. It now calls that helper and only adds the part
that is its own — making the run's folder first, so there is something to lock.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EJqdnQoBuuQkQCFVcQHcVn
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 36 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: dbd26af8-8269-47c3-8546-26398468e618

📥 Commits

Reviewing files that changed from the base of the PR and between e383011 and b587df7.

📒 Files selected for processing (7)
  • scripts/mutation/isolation-state.ts
  • test/scripts/mutation/isolation-state/commands.test.ts
  • test/scripts/mutation/isolation-state/env.test.ts
  • test/scripts/mutation/isolation-state/lock.test.ts
  • test/scripts/mutation/isolation-state/paths.test.ts
  • test/scripts/mutation/isolation-state/records.test.ts
  • test/scripts/mutation/isolation-state/skips.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/mutation-check-isolation-state
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/mutation-check-isolation-state

Comment @coderabbitai help to get the list of available commands.

@stefan-burke
stefan-burke added this pull request to the merge queue Jul 27, 2026
Merged via the queue into main with commit 93b6a94 Jul 27, 2026
3 checks passed
@stefan-burke
stefan-burke deleted the claude/mutation-check-isolation-state branch July 27, 2026 11:29
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.

2 participants