Skip to content

fix(repo-audit): a rebase-merged branch is not unmerged work (0.1.0-alpha.16) - #46

Merged
jaruesink merged 2 commits into
mainfrom
fix/rebase-merged-branches
Aug 9, 2026
Merged

fix(repo-audit): a rebase-merged branch is not unmerged work (0.1.0-alpha.16)#46
jaruesink merged 2 commits into
mainfrom
fix/rebase-merged-branches

Conversation

@jaruesink

Copy link
Copy Markdown
Contributor

Nothing in your last brief is wrong — the one thing you asked me to confirm is answered below, and the rest of the round went to work I found by dogfooding.

Confirming §3: the all-exempt case was covered, the other half wasn't

You were right that all-exempt is covered directly. But the emptiness split I added in alpha.15 has two branches, and no-governance-files-at-all was covered only indirectly, by a golden fixture. That's the branch that would silently launder a missing rule surface into a date-hygiene pass. Now has its own unit test.

alpha.16: my own check was producing 7 false positives on Anvil

anvil repo audit on Anvil reported 11 findings — 8 GIT_BRANCH_NOT_ON_DEFAULT, of which 7 branches were fully merged. Rebase and squash merges rewrite SHAs, so ancestry calls landed work unmerged forever. My own standing notes describe this failure mode; my own check reproduced it.

Measured on all 8 branches before writing anything:

ahead cherry-unapplied
7 merged branches >0 0 noise
fix/publish-root-cause-comment 1 1 genuine

git cherry compares patch ids rather than SHAs and separates them cleanly. n=8, not n=1.

The finding now gates on unapplied commits and reports "N commit(s) with no equivalent on main". Anvil's own audit: 11 findings → 5, with the genuinely unmerged branch still reported.

Known limit, stated rather than papered over: git cherry matches patch ids one-for-one, so N commits squashed into a single patch still read as unapplied. It fails toward reporting, which is the safe direction. Rebase merges and 1:1 squashes — this repo's entire history — are covered.

cherry is added to the read-only allowlist; it only reads.

Fixture note

The first version of the rebase test cherry-picked onto an unmoved main and produced the identical SHA — same tree, parent, author, timestamp — so nothing diverged and the test asserted nothing. It now moves main first. Same family as the earlier silent-tool-failure catches.

Verify

lint · format:check · release:pin --check · typecheck · 520 pass / 0 fail · verify:self-audit-proof.

🤖 Generated with Claude Code

jaruesink and others added 2 commits August 9, 2026 14:59
Found by dogfooding `anvil repo audit` on Anvil itself: eleven findings, eight of
them GIT_BRANCH_NOT_ON_DEFAULT, and seven of those eight branches were fully
merged. Rebase and squash merges both rewrite SHAs, so ancestry calls landed work
unmerged forever — the failure mode my own standing notes describe and my own
check reproduced.

`git cherry` compares patch ids instead of SHAs. Measured on all eight branches
before writing anything:

  7 merged branches   ahead>0, cherry-unapplied=0   noise
  1 real branch       ahead=1, cherry-unapplied=1   genuine

The finding now gates on unapplied commits rather than ahead-count, and reports
"N commit(s) with no equivalent on main". Anvil's own audit goes 11 findings -> 5,
with the one genuinely unmerged branch still reported.

Known limit, stated rather than papered over: `git cherry` matches patch ids
one-for-one, so a branch of N commits squashed into a single patch still reads as
unapplied. It fails toward reporting, which is the safe direction. Rebase merges
and 1:1 squashes — this repo's whole history — are covered.

`cherry` is added to the read-only allowlist; it only reads.

Also adds the none-exist unit test for the emptiness split introduced in
alpha.15. All-exempt was covered directly; no-governance-files-at-all was covered
only indirectly by a golden fixture, and it is the branch that would silently
launder a missing rule surface into a date-hygiene pass.

One fixture note worth keeping: the first version of the rebase test cherry-picked
straight onto an unmoved main and produced the IDENTICAL sha — same tree, parent,
author and timestamp — so nothing diverged and the test asserted nothing. It now
moves main first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

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: 12 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4e82a605-fdfa-499a-8a0e-4a47a35176fb

📥 Commits

Reviewing files that changed from the base of the PR and between d537a1a and 51a46c6.

📒 Files selected for processing (13)
  • README.md
  • docs-site/public/llms-full.txt
  • docs-site/src/content/docs/reference/cli.md
  • docs/byok-trust-model.md
  • docs/first-user-proof-packet.md
  • docs/first-user-proof.md
  • docs/getting-started.md
  • docs/proofs/current-outside-tester-send-packet.md
  • package.json
  • scripts/governance-metadata-scoping.test.ts
  • scripts/lib/git-state.ts
  • scripts/lib/repo-audit.ts
  • scripts/repo-audit.test.ts

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

@jaruesink
jaruesink merged commit c44c5af into main Aug 9, 2026
3 checks passed
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