Repository navigation
fix(rules,web): break same-block ref cycles upstream-first; refuse browser merge of retargeted PRs (D-600, D-501) - #73
Merged
Conversation
…other cycle The fallback took the smallest-id update on any cycle, so a cycle downstream of another cycle could be broken first, placing an update before its own predecessor (five same-block updates resolved to Diverged [e, c] instead of [e, a]). cycle_to_break / cycleToBreak now take the smallest-id update all of whose unplaced predecessors build back on it (Tarjan SCCs, iterative). Vector resolve_ref__ref_same_createdat_cycle_waits_on_upstream_cycle and an exhaustive property test over one-block histories (fails on the previous rule). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The fold checks a merge against the base the PR was opened with, so merging a retargeted PR moved the new base and recorded a merge that never counts. mergeBaseTip returns no tip for it, and mergeRefProblem (panel and runner) gives dg's guidance: merge by hand, then dg pr merge --event-only --merge-oid. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… rule in TS Review follow-up: the retargeted-PR advice (merge by hand, then dg pr merge --event-only) could not work: dg refuses a retargeted PR before --event-only, and a merge into the new base never counts against the base the PR was opened with. Both dg and the web now say to open a new PR against the new base. The runner's openedBaseRefName is required, so no caller can skip the check. A TS port of the exhaustive causal-order property test. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
openedBaseRefName is now required on the merge runner's pull; #67's test built one without it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Warning Review limit reachedNext included review available in 26 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (12)
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. Comment |
PastaPastaPasta
added a commit
that referenced
this pull request
Sep 27, 2026
…al private edits Private-repo edits of issues and comments now re-seal through #67's sealEdit and replace only enc/epoch (no plaintext ever leaves); without a seal context a private edit is still refused. The issue page and list use #68's privateComposeBlock / composeCost / SealedLimit. dg issue list reads private issues through readable_all (decrypted for members); the CLI edit still refuses private repos (no sealed CLI edit yet). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
PastaPastaPasta
added a commit
that referenced
this pull request
Sep 27, 2026
…chedDocument, open_for_write) Rebased onto master after #67, #68, #72, #73 and #74: the settings sections use the AA text shades the contrast test requires; the test fixture fills FetchedDocument.updated_at_block_height; the archive check opens through Session::open_for_write so dg pr create stays within the line limit. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes two bugs that a follow-up review found in #65's commits that nobody had reviewed. Both relate to D-600 and D-501.
1. A same-block chain cycle could place an update before its own predecessor (D-600 rule)
Within one block,
resolve_reforders updates by theprevOidchain: an update that recorded another's tip comes after it. When every remaining update waits on a cycle, one has to be placed anyway. #65 picked the smallest-$idupdate that lies on any cycle. If that cycle itself waited on another cycle, this could place an update before one it builds on.Five updates in one block show it:
These resolved to
Diverged [e(D), c(A)]instead ofDiverged [e(D), a(C)].Fix. The change is in both ports:
forge-core::rules::cycle_to_breakand forge-webcycleToBreak.builds_onamong the updates not yet placed, with an iterative Tarjan.$idupdate all of whose unplaced predecessors build back on it, so it waits on nothing outside its own cycle.docs/contracts/forge-v2.md§6 and both doc comments describe the rule.Tests.
resolve_ref__ref_same_createdat_cycle_waits_on_upstream_cycle. It fails on master in both ports.Reading histories already on chain. This changes how a ref is resolved when one block holds two chained push cycles, one waiting on the other. That needs several same-block pushes going back and forth, so real data is very unlikely to have it. It is listed in the release notes (BACKLOG).
2. The browser merge could move a retargeted PR's new base, for a merge that never counts (D-501 follow-up)
The fold checks a merge against the base the PR was opened with. For a retargeted PR,
mergeBaseTipreturned the new base's tip, so the browser merge moved that branch and posted a merge event the fold ignores.Fix.
mergeBaseTipreturns''for a retargeted PR.mergeRefProblem(both the panel and the runner) refuses it.openedBaseRefNameis now required in the runner, so no caller can skip the check.dg's refusal gave the same unworkable advice ("merge by hand, thendg pr merge --event-only"). That could not work:dgrefuses a retargeted PR before--event-only, and the merge would not count anyway. Bothdgand the web now say to open a new PR against the new base.Verification
clippy -D warnings, all web vitest tests,tscandlint.openedBaseRefName. It also suggested the TS property test, which is added.read_private_merge_baseis left as it is. feat(private): seal issues, pull requests, comments and reviews in the CLI #68 uses it and moves it to the D-501 rule on the private path.🤖 Generated with Claude Code