Trigger objectives from GitHub issues via mention or assignment#13
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an issue-trigger monitor: orcha can now pick up work directly from GitHub issues. On each registered project it polls for:
@<bot> work on this), andand 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:
Anyone can open an issue, so only a mention from — or an assignment by — an allowlisted login summons work.
Dedup & re-fire
issue_taskstable, unique on(repo, number, external_id)— mirrors thepr_feedbackdedup index, so a re-poll or a restart never double-spawns. The claim is recorded before objective creation and rolled back on failure.Wiring
Runs on the host monitor loop alongside the PR monitor. New flags:
ghon 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-racesuite +go vetclean.