Repository navigation
feat(cursor-review): link every auto-approve review to the cursor-approve card (BE-20246) - #412
Conversation
…rove card (BE-20246) Every review the approver posts (decide's APPROVE, REQUEST_CHANGES and standing block, and approve-external's standing block) now carries a link to the status card. approve-external's approval already linked it. The link has to be in the review when it is posted. Editing a review afterwards would break it: an edited approval reads as stale, and the bot never withdraws an edited request for changes. So on a PR's first round, before any card exists, decide creates a pending card (no_decision/none) just before the review. The round's card replaces it in the same step, by comment id rather than a re-list, so a lagging listing cannot produce a second card. Rounds that post no review create no pending card, and neither does a PR the approver authored. A card that cannot be found or created only costs the review its link.
|
Warning Review limit reached
This review includes 6 billable files and costs up to $1.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 44 minutes for your next included review. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No merge-blocking issue is established. The first-round card-link flow can proceed through normal checks. Pre-merge checks |
|
…e pair (BE-20246) The pending card a first round creates before its review carried no_decision/none. Agent lane readers escalate that pair to a human: one applies needs-human-review, which withdraws the bot's approvals. A card read in the few seconds before the round's own card replaced it could therefore hand a PR that was being approved to a human. pass/none is the pair render_start already writes while the axes are pending, a round in progress with nothing to do, and every current consumer reads it that way. The text stays "Deciding this round". A test pins the pending card's markers to render_start's non-capped pair.
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @mattmillerai.
Found 5 finding(s).
| Severity | Count |
|---|---|
| 🟡 Medium | 1 |
| 🟢 Low | 4 |
Panel: 6/6 reviewers contributed findings.
…es (BE-20246) Review round on #412: - decide renders the review body before it looks up or creates the card, so a body that fails to render creates no pending card. - A review GitHub refuses as the approver's own PR deletes the pending card it created. An empty or stale --pr-author gets past the up-front check. - A review that could not be withdrawn after the head/base moved, or after a hand-off, now writes a no_decision/human card. The pending card would otherwise keep pointing readers at that review as the decision. - card.ensure looks again after a create that failed ambiguously, so the caller edits a card that did land instead of posting a second one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ELI-5
Each round, the bot posts a review that approves a PR or blocks it. It also keeps one status card comment on the PR, updated every round, showing what it decided and why. Until now those reviews didn't link to the card, so people had to scroll the PR to find it. Every one of those reviews now links straight to the card.
What changed
Live status: the [cursor-approve card](…), updated in place every round.It sits below the decision and above the scope and threshold notes. The markers at the top of each review are unchanged, so staleness, the recorded base and the auto-retry budget all parse the same way. The URL check (https only, nothing that can close the link) is now one helper,safe_card_url, andrender_external_bodyuses it too.card.ensurejust before posting its first review of the round.ensurereturns the existing card, or creates a pending one (render_pending: "Deciding this round…" withpass/none, the pair the start phase already writes for a round in progress, so agents read it as nothing to do) when there is none. The round's card replaces the pending one in the same step, after the review, as before. This is the same pattern cursor-approve.yml'sFind the cardstep already uses for its approval link.upsert(..., card=)skips the second comment listing. A listing taken seconds after the card was created could miss it and post a second card.capped);--pr-authorlets the round through to the refused POST, decide deletes the pending card it created.--card true.no_decision/humancard.card.ensurealso lists the comments again after a create that failed ambiguously, so the caller edits a card that did land rather than posting a second one.docs/callers/cursor-review.md, the status-card contract indocs/callers/cursor-approve.md(the pending card and whatnonemeans there), both module docstrings and the cursor-review README row.Why not edit the review afterwards
The ticket's first plan was to post the review, write the card, then edit the review to add the link. That would break the dismissal model.
_review_nodetreats any review withlastEditedAtas edited, and:So the link has to be in the review when it is posted, and on the first round that means the card must exist first. A test pins that no review is ever edited.
Why
On a recent four-round PR in a private caller repo, the bot posted four auto-approve reviews and none of them linked the card. One standing block said "Address the axis verdicts above, push, then start a new round". The verdicts it meant are on the card, which nothing in the review linked to.
Testing
python3 -m unittest discover -s .github/cursor-review/tests -p 'test_*.py': 1543 tests, OK.python3 -m unittest discover -s .github/cursor-approve/tests -p 'test_*.py': 246 tests, OK. The 1 skip ("needs /proc") is a pre-existing macOS-only skip.check_workflow_pins.pyOK.check-org-repo-literals.sh(and its shellcheck) OK.check_agents_md.pypassed with 2 warnings that were already there.no_decision/humancard;card.ensurereturns a card that landed after an ambiguous create, and raises when none did;card.ensurefound and created paths, theensurephase'scard_urloutput and its never-fatal failure, andupsert(card=).Notes for callers
Only assets loaded at run time change (
auto-approve.py,card.py). There are no new inputs, secrets or permissions, because decide already writes the card. A caller gets this whenuses:andworkflows_ref:are bumped together.Provenance
Authored by: agent-work loop
Verified:
check_workflow_pins.py,check-org-repo-literals.shandcheck_agents_md.pyall pass (2 warnings that were already there).Deviations:
upserthas always listed and then POSTed.🤖 Generated with Claude Code