Skip to content

feat(cursor-review): add defer_approval so only cursor-approve's decide approves - #352

Merged
mattmillerai merged 2 commits into
mainfrom
matt/be-19410-cursor-review-defer-approval
Oct 7, 2026
Merged

mattmillerai merged 2 commits into
mainfrom
matt/be-19410-cursor-review-defer-approval

Conversation

@mattmillerai

@mattmillerai mattmillerai commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

ELI-5

When a repo runs cursor-approve's per-axis reviewers after cursor-review, cursor-review used to approve the PR first and cursor-approve took that approval back a moment later. In that gap, or if cursor-review crashed after approving, the PR looked approved even though no axis had looked at it. The new defer_approval: true input tells cursor-review to report "this round passed" without approving, so cursor-approve's final decision is the only approval.

What changed

  • cursor-review.yml: new defer_approval boolean input, default false. It is passed to auto-approve.py decide as --defer-approval.
  • auto-approve.py decide: with --defer-approval true, an APPROVE outcome:
    • still writes approve_gate=pass, computed exactly as before (fail / untrusted / capped are unchanged too);
    • posts no review and does not auto-resolve the poster's at-or-below-threshold threads. cursor-approve's decide does that through approve_max_severity + poster_login;
    • withdraws the approver's own earlier marked approvals, the same way a no-decision round does, with a new DEFERRED_MESSAGE. Turning the input on therefore also clears approvals left from before.
    • dismisses the approver's own marked, unedited earlier REQUEST_CHANGES. Without defer, the posted APPROVE would have superseded it.
    • reads --defer-approval case- and whitespace-insensitively.
  • Docs: docs/callers/cursor-approve.md now sets defer_approval: true in the caller example and explains why in "What it does" steps 1–2 and Prerequisites. Step 2 now calls the start-phase withdraw a backstop. defer_approval is added to the input tables in docs/callers/cursor-review.md and .github/cursor-review/README.md. The approve_gate=pass descriptions now say the approval may be deferred. Comments in cursor-approve.yml and cmd_withdraw are updated to match.

Judgment calls

  • REQUEST_CHANGES is still posted with defer on. The ask is about approvals. A request-changes approves nothing, and its gate is fail, so cursor-approve never runs on that round.
  • The deferred path runs the same post-decision re-read as the posting path. A moved head or base, or an unreadable PR, makes the gate untrusted. A needs-human-review label makes it capped.
  • If the deferred withdrawal of an approval fails, the step goes red and the gate becomes untrusted, matching a failed POST, so no axis round runs over a standing severity-only approval. If dismissing a REQUEST_CHANGES fails, the step also goes red, but the gate stays pass, since a request for changes withholds nothing.
  • The deferred withdrawal is not scoped to the head. The start phase already withdraws every marked approval, and a severity-only approval posted before defer was switched on can't be told apart from cursor-approve's own.
  • poster_login is still an input, not derived. The cursor-approve guide now says it must be <app-slug>[bot] when cursor-review runs with bot_app_id.

Residual

  • Callers have not been switched over. Each existing cursor-approve caller still has to move its pin to this SHA and set defer_approval: true on its cursor-review call. That is a one-line change per caller repo and is out of scope here. Until a caller does it, that caller keeps today's two-approver ordering.
  • Not exercised end-to-end on a live PR. The acceptance criterion "never has an APPROVED review from the approver identity before cursor-approve's decide posts one" is covered by unit tests that stub gh, not by a real workflow run.

Provenance

  • Authored by: agent-work loop
  • Verified:
    • Tests: .github/cursor-review/tests (942, including 10 DeferApprovalTest cases covering failed withdrawal, REQUEST_CHANGES dismissal, the post-decision re-read and input parsing) and .github/cursor-approve/tests all pass
    • Mutation-tested (earlier round): with the defer branch disabled, the defer-on approve tests fail
    • Existing tests are unchanged and still pass (defer off or attribute absent still POSTs APPROVE and auto-resolves)
    • Lints pass: check_workflow_pins.py, .github/workflow-pins/tests, check_agents_md.py (only the 2 existing warnings), check-org-repo-literals.sh
    • actionlint on cursor-review.yml (earlier round): no new findings compared with main
  • Deviations: none. Every acceptance criterion is met, with the live-PR caveat listed under Residual.

🤖 Generated with Claude Code

…de approves

A caller that runs cursor-approve's axes after cursor-review had two
approvers in sequence: cursor-review's `decide` APPROVED on severity alone,
then cursor-approve's start phase withdrew it. In between, the approval
satisfied code-owner review (a merge-race window), and a cursor-review run
that failed or was cancelled after approving skipped the start phase,
leaving the approval standing until the next push.

`defer_approval: true` keeps `approve_gate` exactly as before but, on an
APPROVE outcome, posts no review and resolves no thread; it withdraws the
approver's own earlier marked approvals instead, as a no-decision round
does. REQUEST_CHANGES is unchanged. Default false: existing callers see no
change. The cursor-approve guide now sets it on the cursor-review call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattmillerai mattmillerai added cursor-review Multi-model cursor review agent-coded Authored by the agent-work loop labels Oct 7, 2026
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review paused — included plan limit reached

Keep your review moving with free on-demand reviews.

  • Run this review for free

On-demand reviews are free for the next 3 days.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Promotion and pricing details

On-demand reviews are free for the next 3 days. After that, they cost $0.25 per reviewed file.

Review limit details

Or wait 29 minutes for your next included review.

Check out review usage here.

Limit details: You’ve used the included review currently available. Your 127 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: 33af487a-c888-4a27-9092-9f605d66208c
📥 Commits

Reviewing files that changed from the base of the PR and between f2f37ee and c8d2440.

📒 Files selected for processing (7)
  • .github/cursor-review/README.md
  • .github/cursor-review/auto-approve.py
  • .github/cursor-review/tests/test_auto_approve.py
  • .github/workflows/cursor-approve.yml
  • .github/workflows/cursor-review.yml
  • docs/callers/cursor-approve.md
  • docs/callers/cursor-review.md
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Cursor Review — Consolidated panel

Triggered by @mattmillerai.

Found 6 finding(s).

Severity Count
🟠 High 1
🟡 Medium 1
🟢 Low 4

Panel: 5/6 reviewers contributed findings.

Reviewers that did not contribute: gpt-5.6-sol-max:edge-case (error)

Comment thread .github/cursor-review/auto-approve.py Resolved
Comment thread .github/cursor-review/auto-approve.py Resolved
Comment thread .github/cursor-review/auto-approve.py Resolved
Comment thread .github/cursor-review/auto-approve.py Resolved
Comment thread docs/callers/cursor-approve.md Resolved
Comment thread .github/cursor-review/auto-approve.py Resolved
…the posting path

Addresses the cursor-review panel on #352:
- a failed withdrawal of an earlier approval now reports approve_gate=untrusted
  instead of pass (the approval would otherwise keep satisfying protection);
- a deferred pass dismisses the identity's own marked, unedited
  REQUEST_CHANGES, which a posted APPROVE would have superseded;
- the post-decision head/base/needs-human-review re-check now also runs on
  the deferred path;
- --defer-approval is read case- and whitespace-insensitively;
- docs: poster_login must match cursor-review's poster under bot_app_id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattmillerai
mattmillerai merged commit f8a0933 into main Oct 7, 2026
8 checks passed
@mattmillerai
mattmillerai deleted the matt/be-19410-cursor-review-defer-approval branch October 7, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-coded Authored by the agent-work loop cursor-review Multi-model cursor review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants