Repository navigation
feat(cli): dg review parity (review-parity PR 7) - #76
Merged
Merged
Conversation
|
Warning Review limit reachedNext included review available in 56 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 (28)
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 |
…edit WriteEngine::replace_document signs one DocumentReplace over the stored document with the changes merged and the revision bumped, skips an edit that already holds (nothing signed), refuses a non-owner before signing, and confirms a spent nonce or a revision refusal by re-reading. Collab::update_target / update_comment are the author edits (title/body, comment body); private repos are refused (plaintext would sit next to enc). dg issue edit --title/--body/--body-file uses it. Verified live on moutai: an edit landed (13.5M credits), a re-run wrote nothing, a non-author was refused with E601 before signing. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…, head sync, suggestions) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…tch; add scenario 20 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… cross-check wording Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A submit that fails before the review is signed no longer saves the draft, so re-running it cannot add its comments twice (test). prs_following reads only the signer's PRs, skips unreadable ones and is capped. suggestion apply --all takes members' and the author's suggestions only, skips resolved threads by root, prints each replacement before confirming and reads regular files only. update-branch needs an open PR. Reviewer rows put counted verdicts before dismissals. pr view falls back to an anonymous reader; its --json lists explicit fields and side is 0/1 everywhere. --body-file must precede --file. Push errors name their action. Drafts are created 0600. The auto-sync honours dash.confirm refuse/always and skips private PR repos. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
PastaPastaPasta
force-pushed
the
feat/dg-review-parity
branch
from
September 27, 2026 16:39
09ac16c to
3cdbdf4
Compare
Takes master's WriteEngine::replace_document (update_target/update_comment call it). dg pr merge uses #66's require_merge_rights and policy_refusal; a squash is checked as method bit 4 (METHOD_SQUASH), up front and after planning; --override-policy is on PrMergeArgs. Every PR 7 write opens through Session::open_for_write (E606 on an archived repo unless --allow-archived), and pushes to a PR branch pass -o allow-archived under --allow-archived; checks and commits read without it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… scenario 21 Master took scenario number 20 (config-storage-ux), so the review round trip is renumbered 21 (E2E_S21_* and the web spec's E2E_S21_STATE follow). helper.rs keeps both new helpers. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
PastaPastaPasta
added a commit
that referenced
this pull request
Sep 27, 2026
Keeps F-1's private-repo refusal in update_target/update_comment (collab_contract no longer refuses private repos, so without it a CLI edit would publish plaintext beside enc). The #n/@name autolinks ride #82's markdown render context. The CLI issue-parity scenario is renumbered 22. 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.
Review parity for the CLI: PR 7 of
docs/design/review-parity-spec.md(§2.5 C1–C13, §7 PR 7). It is built on master's forge-coreCollabAPI (#48/#56):post_target_event,patches_from_branch,PatchView.head, andreview/commentwith anchors andreviewId. It is stacked on F-1's document replace (Collab::update_target), which this PR carries as its first commit, and wired into #68'sseal_if_private.Commands
dg pr review … --file P --line N [--start-line M] [--side old|new] --body …(repeatable),--suggest TEXT, summary--body/--body-filedg pr review … --pendingkeeps the comments in a local draft (nothing is written); a later--approve/--request-changes/--commentsubmits 1 review + N comments;--resume;--discarddg pr comment(general, inline,--reply-to)dg pr view --comments: threads grouped underpath:line/path:3-5 (old), outdated / resolved markers, suggestions, a Reviewers list (approved / changes requested / commented / awaiting / stale / dismissed / doesn't count, re-requested), the "new commits since your review" marker, the policy statusdg pr edit --title/--body/--body-file(a replace; a re-run writes nothing)dg pr sync [--head];git pushof your PR's branch moves its head (dash.prAutoSync, default on)dg pr create --draft,dg pr ready,dg pr draftdg pr resolve/unresolve(any comment of a thread)dg pr request-review/unrequest-review(id or@name; re-request after a review)dg pr dismiss-review --reasondg pr checks(newestcheckRunper name on the head; trusted = current member)dg pr commitsdg pr merge --squash [--message](Co-authored-byper other author),--delete-branchdg pr update-branch(merge the base into the PR branch, then a head update)dg pr suggestion apply <ids>… | --all(one commit on the PR branch withForge-Suggestion:trailers, then a head update)Every command has
--jsonwith a stable shape (documented in the scenario's assertions), and all have E-codes. New in this PR: E107 "suggestion not applicable", for overlapping suggestions, an older head, the old side, or lines that no longer exist. "Not a writer of the source repo" reuses E601 and names the source repo.Built on #66 (repo settings):
dg pr mergegoes through feat(core,cli,web): repo settings: default branch, protected branches, policy, archive (D-503) #66'srequire_merge_rights/policy_refusal, with E804 and--override-policy. A squash is checked as merge-method bit 4 (METHOD_SQUASH), both before any git work and again after planning.Session::open_for_write, so an archived repo is refused with E606 unless--allow-archivedis given. Pushes to a PR branch pass-o allow-archivedwhen the flag is set.checksandcommitsonly read, so they are not blocked.dg repo policy show|setis feat(core,cli,web): repo settings: default branch, protected branches, policy, archive (D-503) #66's;dg pr viewreads the policy throughCollab::policy.WriteEngine::replace_document, which feat(core,cli,web): repo settings: default branch, protected branches, policy, archive (D-503) #66 brought in.forge-core
comment_props/review_props: pure builders.Collab::commentandCollab::reviewwrap them and callseal_if_private(feat(private): seal issues, pull requests, comments and reviews in the CLI #68).Collab::create_once(repo, ContentKind, props, saved, persist): a single create that is resumable across runs. The signed transition is persisted before its first broadcast and replayed byte for byte. Sealing happens only when a fresh transition is signed. The review submit is built on it: the review first (withcommentCount), then each comment (withreviewId). The draft file records each intent and landed id, so an interrupted submit finishes on re-run without writing anything twice.Collab::check_runs/newest_check_runs/CheckRun: the firstcheckRunreader. I-1 extends its trust rule oncerunnermemberships exist. The e2e seeds a run through a test-only example (examples/seed_check_run.rs), so no public writer is added.Collab::prs_following: the open PRs of a pushed branch, found through thesourceRefindex.Patch.repo_id.git-remote-dash
pr_sync.rs: after a push, each moved branch's open PRs whose author is the signer get aheadUpdate, logged asPR #7 in o/r follows this branch: updating its head (≈ 0.00072 DASH). For other people's PRs, or withdash.prAutoSync=false, the helper prints thedg pr syncline instead. A failure here never fails the push. The commands that push to a PR branch on the user's behalf (suggestion apply,update-branch) turn auto-sync off and post the head update themselves.Hardening
dash://fetch, the PR's base ref must be a plain branch and its head a hex oid (require_git_safeinfetch_base_and_head). This also coversupdate-branchandsuggestion apply, which previously put an unchecked base into a refspec.require_branch_refbefore it becomes a push destination.Fuzz (asked alongside)
parseSuggestions(web) was quadratic. Its fence trim/^[ \t\r]+|[ \t\r]+$/gtook 180 ms at 20 KB of spaces and hung the 1 MiB batch past its 60 s deadline. It is now a linear scan.applySuggestionalso no longer spreads a large replacement intosplice(...), which would overflow the stack at 1 MiB.lib/rules/suggestion.ts(no imports), so the fuzz worker can load it.render-fuzz.test.tsgains adversarial, 1 MiB and random batches forparseSuggestionsandapplySuggestion, with the same budgets as the other renderers (≤250 ms per input at 20 KB, ≤3 s at 1 MiB). They fail on the old regex (a 1 MiB hang) and pass now.parse_suggestions/apply_suggestionwere already linear. They get bounded-time tests with the same budgets (rules::review::bounded_time).Tests
e2e/cli/scenarios/21-review-round-trip.shpassed 40/40 (log in QA evidence). It follows the task's round trip:ready.suggestion apply --all(trailer present, head follows), thengit pushes one more commit and the helper moves the head (prSync).dg pr checksreads a seeded run,dg pr commitslists 3, andeditis idempotent.merge --squash: the base tip is one commit on the old base, with the head's tree andCo-authored-by.dg pr viewmeasured 23 DAPI requests, counted from the SDK'sdapi_client::dispatchtrace (7 aregetDataContract). The scenario asserts ≤ 30, with a TODO for P-5 to tighten it once the contract memo lands.forge-web/e2e/review-round-trip.spec.tsran with Playwright against the master web build, served locally (moutai). It reads the folddg pr view --jsonproduced and checks the page shows the same thing: title, merged, folded head, 2 head updates, both reviews with their commits and verdicts, the 3 threads as "4 comments on an older version" with the same anchors (includinglines 3–5 (old)), 3 "resolved a conversation" entries, and the approval fold. It passed.cargo clippy --all-targets -D warningsandcargo testpass for forge-core, dg and git-remote-dash. Web typecheck, lint and vitest (rules + fuzz) pass.QA evidence:
dash-forge-qa/evidence/impl/feat-dg-review-parity/. It holds the scenario log,dg pr view --commentsoutput, the fold JSON, and web screenshots of the outdated threads and the timeline.🤖 Generated with Claude Code