Skip to content

fix: settle reactions and clean verdicts from one authoritative run - #54

Open
cestercian wants to merge 1 commit into
Continuum-AI-Corp:mainfrom
cestercian:fix/39-authoritative-reaction-run
Open

cestercian wants to merge 1 commit into
Continuum-AI-Corp:mainfrom
cestercian:fix/39-authoritative-reaction-run

Conversation

@cestercian

@cestercian cestercian commented Sep 17, 2026 •

Copy link
Copy Markdown

Orca-Code-Review — push 1

Severity Count
P0 0
P1 0
P2 0
P3 0

✅ 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.mjs as one planner for both call sites:

  • Identity: prefer the 👀 create response login, then /user, then {app_slug}[bot], with github-actions[bot] last.
  • Authority: publish/settle only when the run still describes the current head and no newer sibling workflow run exists (best-effort if listing is forbidden).
  • 👍: still placed and never withdrawn (The thumb is placed and never withdrawn #40); stale runs simply do not get addThumb.

Test plan

  • node --test scripts/*.test.mjs — 599 passed (32 new authority tests)

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.

@orcacode-review orcacode-review 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.

🐳 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reactions need one authoritative run, not a guard per call site

1 participant