Skip to content

Trigger objectives from GitHub issues via mention or assignment#13

Merged
nathanwhit merged 1 commit into
mainfrom
issue-triggers
Jun 13, 2026
Merged

Trigger objectives from GitHub issues via mention or assignment#13
nathanwhit merged 1 commit into
mainfrom
issue-triggers

Conversation

@nathanwhit

Copy link
Copy Markdown
Owner

What

Adds an issue-trigger monitor: orcha can now pick up work directly from GitHub issues. On each registered project it polls for:

  • @-mentions of the bot in issue comments (@<bot> work on this), and
  • issues assigned to the bot,

and turns an authorized one into an objective — manager spawned, PR opened the usual way.

No blind crawling: a repo is only scanned once it's a registered project, and the feature is fail-closed (does nothing unless a bot login and a non-empty allowlist are set, with a real forge).

Authorization

A GitHub-login allowlist gates every trigger:

  • a mention is attributed to the comment author;
  • an assignment is attributed to whoever performed it (resolved via the issue events API).

Anyone can open an issue, so only a mention from — or an assignment by — an allowlisted login summons work.

Dedup & re-fire

  • New issue_tasks table, unique on (repo, number, external_id) — mirrors the pr_feedback dedup index, so a re-poll or a restart never double-spawns. The claim is recorded before objective creation and rolled back on failure.
  • Orcha acks the issue with a marked comment; the marker also stops the mention scan from re-firing on its own comment.
  • Mentions re-fire per new comment. Assignments dedup on the assignment event id, so re-assigning the bot (a new event) re-fires, while a steady-state re-poll does not.

Wiring

Runs on the host monitor loop alongside the PR monitor. New flags:

orcha -real-forge -issue-bot-login orcha-bot -issue-allow alice,bob

gh on the orchestrator host must be authenticated as the bot account (it reads issues and posts the ack). Authorization is the allowlist, not gh auth.

Tests

9 cases: allowed/disallowed mention, no-mention, PR-comment-skip, allowed/disallowed assignment, reassignment re-fires, fail-closed-without-allowlist, plus the mention-matcher table (rejects bob@orcha-bot.com, @orcha-botanist). Full -race suite + go vet clean.

Add an issue-trigger monitor: on each registered project, poll for issue
comments that @-mention the bot and issues assigned to the bot, and turn an
authorized one into an objective. Fail-closed — disabled unless a bot login
and a non-empty GitHub-login allowlist are configured (and a real forge is
installed). A mention is attributed to the comment author; an assignment to
the actor who performed it (resolved via the issue events API). Both are
gated by the allowlist.

Dedup via a new issue_tasks table (unique repo+number+external_id), mirroring
the pr_feedback dedup index, so a re-poll or restart never double-spawns. The
claim is recorded before objective creation and rolled back on failure. Orcha
acks the issue with a marked comment, which also keeps the mention scan from
re-firing on its own comment.

Mentions re-fire per new comment; assignments dedup on the assignment event id,
so re-assigning the bot (a new event) re-fires while a steady-state re-poll does
not. Watched repos are the existing project registry, so there is no blind
crawl: a repo is only scanned once registered as a project. Runs on the host
monitor loop alongside the PR monitor; new -issue-bot-login / -issue-allow
flags.
@nathanwhit nathanwhit merged commit 65265c7 into main Jun 13, 2026
1 check passed
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.

1 participant