Skip to content

fix: V8 coverage innermost-wins across FunctionCoverage entries#116

Merged
SutuSebastian merged 1 commit into
mainfrom
fix/v8-coverage-innermost-wins
May 20, 2026
Merged

fix: V8 coverage innermost-wins across FunctionCoverage entries#116
SutuSebastian merged 1 commit into
mainfrom
fix/v8-coverage-innermost-wins

Conversation

@SutuSebastian
Copy link
Copy Markdown
Contributor

Summary

V8 can emit nested functions as separate FunctionCoverage entries. Innermost-wins was applied per entry, so an outer whole-file range listed after an inner range could mark nested lines as covered incorrectly.

Fix: flatten all ranges for a script, sort globally by descending byte span, then write line hits (smallest range wins).

Test plan

  • New test: inner count: 0 entry before outer whole-file count: 2inner stays uncovered
  • Existing single-entry nesting test unchanged
  • bun test src/application/coverage-engine.test.ts
  • bun run typecheck
  • CI green

Flatten and sort all ranges per script before writing line hits so outer entries cannot overwrite narrower inner ranges when V8 lists the outer function last.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Warning

Rate limit exceeded

@SutuSebastian has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 54 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cf6b75fc-0476-47e8-99cb-7ac384196a8f

📥 Commits

Reviewing files that changed from the base of the PR and between eb18750 and 999d86c.

📒 Files selected for processing (3)
  • .changeset/fix-v8-coverage-innermost-wins.md
  • src/application/coverage-engine.test.ts
  • src/application/coverage-engine.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/v8-coverage-innermost-wins

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

🦋 Changeset detected

Latest commit: 999d86c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stainless-code/codemap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@SutuSebastian SutuSebastian merged commit a444c40 into main May 20, 2026
12 checks passed
@SutuSebastian SutuSebastian deleted the fix/v8-coverage-innermost-wins branch May 20, 2026 14:35
@github-actions github-actions Bot mentioned this pull request May 20, 2026
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