Fully test the isolated mutation run state - #1954
Conversation
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
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 36 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
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.tsnow 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.envand the local database. Not one entry was checked, so any of them could have been deleted without a test noticing. Quietly copyingnode_modulesinto every snapshot would roughly double how long each mutation run takes; quietly copying.envwould put secrets in a temporary folder. Every entry is now checked one by one.The rest covers rules nothing had pinned down:
.dbitself.distfolder further down is theirs to keep.--kill mutation-abccannot refuse to act becausemutation-abc-2also exists.Four things that were doing nothing
docs-outputlisted as a folder name, when the rule below it already skips anything starting with that.tickets.dblisted as a file name, when the database-file rule already covers it.withFileLockfromscripts/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.tsis still at 100% after that lock change.Next
The remaining
scripts/files with gaps arestripe-mock.ts,stripe-mock/install.ts,specs/run.ts, andmutation.ts.Generated by Claude Code