Repository navigation
fix: settle reactions and clean verdicts from one authoritative run - #54
cestercian wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
🐳 OrcaCode Review
✅ No findings — nothing to flag in this PR. Great work!
OrcaCode Review — Route Smarter. Ship Safer. Spend Less.
Engine-reported: 415 calls · 35.7M tokens · 99% cached
❤️ Share · Install OrcaCode Review
Free on GitHub — the review runs on your own OrcaRouter key. If it helped, a shout-out goes a long way.
Share: X · Reddit · LinkedIn
Follow: X · Discord · LinkedIn · OrcaRouter
|
hey, gentle ping on this one when you get a chance. happy to adjust anything, and it's still clean against main. |
|
Small bump, would appreciate a look whenever someone's free. |
Three findings, one root: every publication and every reaction was decided from one run's local view. Five review rounds added a condition per site; this is the mechanism those findings wanted. Identity: GET /user has no authenticated user for an installation token, so the fallback hard-coded github-actions[bot] and a custom App's 👀 never matched the delete filter. The 👀 POST already returns the author; that login is carried in $RUNNER_TEMP/cr-actor, and settle also asks the installation for its app slug. github-actions[bot] is last, not first. Authority: a run may publish a clean verdict or settle reactions only when it still describes the current head (unknown = no) and no newer sibling of the same workflow exists. The head comparison used to live only in the thumb step, after the clean review — including the issue-comment fallback, which has no commit association — had already been posted. Both call sites now consult scripts/authority.mjs. The 👍 is still placed and never withdrawn (Continuum-AI-Corp#40). A stale run simply does not get addThumb. Tests: 32 new, covering identity order, superseded heads, newer siblings, User-token decline, the CLI, and that action.yml no longer guesses the Actions bot.
65c4309 to
aa56f80
Compare
Reactions settlement runs scripts/authority.mjs for clearEyes/addThumb and publishClean in the post step, but the login deleted must still be the one scripts/identity.mjs recorded (cr-identity, cr-actor, resolved bot login) — not only the planner's fallback actor. Tests that execute the settle run: block inject the planner env the runner would set, and stub .head.sha so Continuum-AI-Corp#39's authority check can pass.
529c62c to
f6f8764
Compare
There was a problem hiding this comment.
⚠️ Outdated review — the PR head changed from aa56f80 to f6f8764 during the review; these findings describe a diff the PR no longer has.
These findings describeaa56f8024498. Re-run the review to check the PR as it stands now.
🐳 OrcaCode Review
✅ No findings — nothing to flag in this PR. Great work!
OrcaCode Review — Route Smarter. Ship Safer. Spend Less.
Engine-reported: 219 calls · 9.9M tokens · 94% cached
❤️ Share · Install OrcaCode Review
Free on GitHub — the review runs on your own OrcaRouter key. If it helped, a shout-out goes a long way.
Share: X · Reddit · LinkedIn
Follow: X · Discord · LinkedIn · OrcaRouter
There was a problem hiding this comment.
⚠️ Outdated review — the PR head changed from 529c62c to f6f8764 during the review; these findings describe a diff the PR no longer has.
These findings describe529c62c42ade. Re-run the review to check the PR as it stands now.
🐳 OrcaCode Review
✅ No findings — nothing to flag in this PR. Great work!
OrcaCode Review — Route Smarter. Ship Safer. Spend Less.
Engine-reported: 167 calls · 7.9M tokens · 93% cached
❤️ Share · Install OrcaCode Review
Free on GitHub — the review runs on your own OrcaRouter key. If it helped, a shout-out goes a long way.
Share: X · Reddit · LinkedIn
Follow: X · Discord · LinkedIn · OrcaRouter
There was a problem hiding this comment.
🐳 OrcaCode Review
Found 1 issue in this PR: 🟠 1 P1.
OrcaCode Review — Route Smarter. Ship Safer. Spend Less.
Engine-reported: 238 calls · 11.2M tokens · 94% cached
❤️ Share · Install OrcaCode Review
Free on GitHub — the review runs on your own OrcaRouter key. If it helped, a shout-out goes a long way.
Share: X · Reddit · LinkedIn
Follow: X · Discord · LinkedIn · OrcaRouter
| }); | ||
| if (newer) { | ||
| return `a newer run (${newer.id}) is authoritative; this run is ${live(thisRunId) || "unknown"}`; | ||
| } |
There was a problem hiding this comment.
🟠 P1 Treat a newer sibling that can never settle as permanently authoritative, silencing the surviving run
Authority is "no sibling run with id > this run's id", and both drivers (action.yml post step line ~1897 and settle step line 2496-2497) strip every run to {id, name} — status and conclusion are discarded, and GitHub's actions/runs list retains cancelled runs forever. So a run that is hard-cancelled / infra-killed before its always() settle step (the repo's own comments say a hard cancel can kill a job before its always() cleanup) is treated exactly like a live newer run. Consequence: the older surviving run — the only run that will ever settle head X — stands down permanently. Its planClean gets publishClean:false, so its "✅ No findings" for the still-current head is silently dropped (cr-clean never written, no 👍, no 👀 clear); its settle step gets clearEyes:false/addThumb:false. Nothing else runs, so the 👀 the survivor placed at its start stays on the PR forever and the review verdict for the current head is never posted — while the ungated summary still announces clean. This is new: pre-change the settle step cleared 👀 unconditionally for app tokens and the clean verdict was posted unconditionally. Fix: in relevantSiblings (or the driver's --jq), drop newer siblings whose status is cancelled (they will never settle), so a dead run cannot veto a live one.
There was a problem hiding this comment.
🐳 OrcaCode Review
Found 1 issue in this PR: 🟠 1 P1.
OrcaCode Review — Route Smarter. Ship Safer. Spend Less.
Engine-reported: 187 calls · 7.5M tokens · 93% cached
❤️ Share · Install OrcaCode Review
Free on GitHub — the review runs on your own OrcaRouter key. If it helped, a shout-out goes a long way.
Share: X · Reddit · LinkedIn
Follow: X · Discord · LinkedIn · OrcaRouter
| const status = live(r?.status).toLowerCase(); | ||
| const conclusion = live(r?.conclusion).toLowerCase(); | ||
| return status !== "cancelled" && conclusion !== "cancelled"; | ||
| } |
There was a problem hiding this comment.
🟠 P1 Exclude "skipped" sibling runs — they veto the authoritative run but never settle
siblingCanSettle() drops only cancelled siblings. The workflow ships with on: issue_comment: types: [created] (plus pull_request_target edited) and gates the real work with a job-level if: — so every ordinary PR comment, and every title/description edit, creates a NEWER workflow run on the same PR head that is skipped at the job level and never reaches the always() settle step (workflows/orca-code-review.yml line 41 documents this: "every comment starts a run in the same group, which then skips"). Those skipped runs have status "completed"/conclusion "skipped", which siblingCanSettle treats as settling-eligible. A skipped run is also typically NEWER than the review run (comments land while the review is running). Consequence in any deployment where the sibling list is visible (i.e. where actions:read is granted): the in-flight review run's publish step gets publishClean=false — the promised "✅ No findings" verdict is silently not posted (markClean never runs) — and the settle step gets clearEyes=false/addThumb=false, leaving the 👀 on the PR forever and the 👍 never placed, because the newer skipped sibling never settles either. This is exactly the class the commit fixed for cancelled runs; skipped runs (the same "never reaches settle" property, and far more common — any PR conversation) were not updated. Fix: treat conclusion/status "skipped" like "cancelled" in siblingCanSettle (a run can only veto if it will actually run its settle step).
There was a problem hiding this comment.
🐳 OrcaCode Review
✅ No findings — nothing to flag in this PR. Great work!
OrcaCode Review — Route Smarter. Ship Safer. Spend Less.
Engine-reported: 227 calls · 11.5M tokens · 94% cached
❤️ Share · Install OrcaCode Review
Free on GitHub — the review runs on your own OrcaRouter key. If it helped, a shout-out goes a long way.
Share: X · Reddit · LinkedIn
Follow: X · Discord · LinkedIn · OrcaRouter
Orca-Code-Review — push 4
✅ no blocking findings
Summary
Fixes #39.
Reaction settle and clean-verdict publishing used per-site local guesses (hard-coded
github-actions[bot], head check only on the thumb step). That let superseded runs publish “✅ No findings” and mishandle 👀 for custom App installations.This adds
scripts/authority.mjsas one planner for both call sites:/user, then{app_slug}[bot], withgithub-actions[bot]last.addThumb.Test plan
node --test scripts/*.test.mjs— 599 passed (32 new authority tests)