Repository navigation
Description
Problem or Motivation
ADR 0009 dropped issue_comment from CONST_ROADMAP_WEBHOOK_EVENTS before consumer refusals and scoped updates existed, because every bot comment triggered a full round across all rows. Today, the Service has both WebhookConsumer.refusal (src/devops_cli/server/routes/webhooks.py:141-154) and SCOPED_UPDATES (src/devops_cli/roadmap/run.py:881-883), yet issue_comment remains unsubscribed.
This gap slows down three human-in-the-loop workflows and wastes GitHub API quota:
clear_stops(src/devops_cli/roadmap/stop_clear.py:49-50, 345) polls comments on every Service-stopped Blocked item every 7 minutes forimplement: retry. That poll spends one GitHub request per Blocked item per round even when nobody commented.- When a collaborator answers open questions on an item waiting on
person(src/devops_cli/roadmap/refine/refine.py:43-55),refinewaits up to 31 minutes (DEFAULT_ROADMAP_REFINE_INTERVAL_MINUTES) to read the reply. - When a collaborator comments to wake a suspended row (feat(roadmap): a comment by a person on an item starts a suspended row again #2754),
_person_comment_stamps(src/devops_cli/roadmap/run.py:1297-1346) waits for the next poll tick.
Proposed Solution & Architectural Design
- Extend
GitHubWebhookPayload(src/devops_cli/models/webhooks.py) with an optionalcommentmodel and anissue.pull_requestmarker. - Add
"issue_comment"toCONST_ROADMAP_WEBHOOK_EVENTS(src/devops_cli/config/constants.py). - Enforce zero-trust payload refusal in
roadmap_consumer(SECURITY.mduntrusted-input rule):- Refuse
issue_commentpayloads whenaction != "created". - Refuse payloads where
sender.loginmatchesservice_manager.bot_login(own_write) or ends with[bot]. - Refuse payloads where
comment.author_associationis outsideCONST_ROADMAP_TRUSTED_AUTHORS, counting them asignoredwith zero GitHub requests.
- Refuse
- Route accepted trusted comments on issues (where
issue.pull_requestis absent):- For
implement: retry, enqueue astatuslane update to clear the stop onissue.numberand callrun_implement_round. - Otherwise, enqueue a scoped
refineupdate forissue.numberonmodeland pass the comment timestamp toFailureLedger.
- For
Target Subsystem
SDLC, Git & PR Governance
Existing Tool Considered
gidgethub parses GitHub issue_comment payloads, and Probot or peter-evans/slash-command-dispatch dispatch comment commands in GitHub Actions. Neither tool integrates with RoadmapStore, FailureLedger, stop_clear.py, or the in-cluster RepoWorker lanes, and ADR 0009 routes GitHub deliveries through webhooks.py. Adding issue_comment parsing, trust refusal, and scoped handlers costs about 115,000 tokens to build, maintain, and fix, and 2.5 hours of elapsed time.
Acceptance Criteria
-
CONST_ROADMAP_WEBHOOK_EVENTSincludes"issue_comment", andk8s/README.mdstep 8 matches. -
roadmap_consumerrefusesissue_commentdeliveries from bots,editedordeletedactions, and authors outsideCONST_ROADMAP_TRUSTED_AUTHORSbefore making any GitHub API request. - A trusted
implement: retrycomment on a Service-stopped Blocked issue clears the stop onstatusand submits an eligible runner Job. - Another trusted human comment on an open issue enqueues a scoped
refineupdate on themodellane for that issue number. - Offline unit tests cover bot refusal, untrusted-author refusal,
implement: retry, and trustedrefinereply routing.
Standards Compliance
- I confirm this proposal aligns with AGENTS.md engineering principles (cyclomatic complexity <= 10, nesting <= 5, zero bare exceptions, tests that cover the changed lines).
- I am willing to submit a pull request implementing this feature with accompanying tests.
Alternatives check of 2026-11-22: in-use.
The repository already uses this tool.
Tool: gidgethub/gidgethub (https://github.com/gidgethub/gidgethub), Apache-2.0, last activity 2026-11-20, maintained.
Reason: The searches and repository facts show gidgethub, an open maintained Python GitHub App library, parses issue_comment payloads and dispatches events to handlers, but it brings no trust refusal, roadmap state or scoped sweep, so it covers only the payload and routing part.
Covers:
- Parses GitHub issue_comment webhook payloads
- Dispatches webhook events to per-event handlers
- GitHub App authentication and API calls
Lacks:
- Trust refusal on comment author_association
- Scoped sweep of the commented issue
- Stop clear, FailureLedger and lane integration
Owner decision 2026-11-13
D8 (approved, tracker #5482, Phase 3) adds issue_comment to the App events (owner step). A trusted reply makes the router run a scoped sweep for that item. Refine or resolve then becomes due by its predicate. No due mark.
- Live proof: after the merge, the release and the owner step, a trusted reply on a live item makes the due job run as the App. A comment gives the result line.
Proposed design
Problem statement
The roadmap consumer does not subscribe to issue_comment. A person's retry or reply waits for the next poll, and clear_stops spends one GitHub request on each Blocked item each round. The change adds trusted issue_comment handling with zero-trust refusal and a scoped sweep for the item.
Acceptance criteria
Requirement: Roadmap webhook event subscription
The roadmap webhook event set SHALL include issue_comment, and the intake batch keys SHALL not include it.
Scenario: Event set and intake keys
- WHEN The roadmap webhook tests read
CONST_ROADMAP_WEBHOOK_EVENTSandCONST_ROADMAP_INTAKE_BATCH_KEYS. - THEN
CONST_ROADMAP_WEBHOOK_EVENTScontainsissue_commentandCONST_ROADMAP_INTAKE_BATCH_KEYSdoes not.
Requirement: Onboarding step names issue_comment
Step 8 of k8s/README.md SHALL name both issues and issue_comment.
Scenario: Onboarding documentation
- WHEN
uv run devops ci --check --only docsruns after the change. - THEN The docs check passes and step 8 names both
issuesandissue_comment.
Requirement: Issue comment payload model
GitHubWebhookPayload MUST parse an optional comment with body, author_association and created_at, and an optional issue.pull_request marker.
Scenario: Issue comment payload
- WHEN A test validates an
issue_commentpayload that holds a comment and a pull request marker. - THEN The payload exposes the comment fields and the pull request marker.
Requirement: Refuse non-created and bot comments
The roadmap consumer SHALL refuse an issue_comment payload before any GitHub API request when its action is not created or its sender login is the Service bot or ends with [bot].
Scenario: Non-created or bot comment
- WHEN A test sends an
issue_commentpayload with a non-created action or a bot sender. - THEN The consumer refuses the payload and records zero GitHub requests.
Requirement: Refuse pull request comments
The roadmap consumer SHALL refuse an issue_comment payload before any GitHub API request when issue.pull_request is present.
Scenario: Pull request comment
- WHEN A test sends an
issue_commentpayload with anissue.pull_requestmarker. - THEN The consumer refuses the payload and records zero GitHub requests.
Requirement: Refuse untrusted authors
The roadmap consumer SHALL refuse an issue_comment payload before any GitHub API request when comment.author_association is outside CONST_ROADMAP_TRUSTED_AUTHORS, and it SHALL count the payload as ignored.
Scenario: Untrusted author comment
- WHEN A test sends an
issue_commentpayload with an author association outside the trusted set. - THEN The consumer refuses the payload, counts it as ignored, and records zero GitHub requests.
Requirement: Retry comment runs a scoped sweep
A trusted implement: retry comment on a Service-stopped Blocked issue SHALL make the router run a scoped sweep for that issue, and the implement row SHALL clear the stop and submit one eligible runner Job.
Scenario: Retry on a blocked issue
- WHEN A test sends a trusted
implement: retrycomment for a Blocked issue with a Service stop. - THEN The router runs a scoped sweep for the issue, the stop clears, and the implement round submits one eligible runner Job.
Requirement: Trusted reply runs a scoped sweep
A trusted human comment on an open issue that is not implement: retry SHALL make the router run a scoped sweep for that issue, and refine or resolve SHALL become due by its predicate without a due mark.
Scenario: Trusted refine or resolve reply
- WHEN A test sends a trusted human comment on an open issue that is not
implement: retry. - THEN The router runs one scoped sweep for the issue, the refine or resolve row becomes due by its predicate, and no due mark is written.
Requirement: Offline webhook tests
Offline unit tests MUST cover non-created refusal, bot refusal, untrusted-author refusal, pull request refusal, implement: retry routing, and trusted refine or resolve routing.
Scenario: Webhook unit tests
- WHEN A test run executes the roadmap webhook tests.
- THEN Each of the six cases passes and makes no network request.
Existing Tool Considered
The alternatives check in the issue body records partly for gidgethub/gidgethub (Apache-2.0, last activity 2026-09-25, maintained). See that check for what the tool covers and lacks. The proposal adds the refusal, the scoped sweep route, the targeted retry stop clear, the event subscription and the README step at about 115,000 tokens and 2.5 hours.
Key questions
- How does the event set add
issue_commentwithout making intake treat comments as intake batches?: KeepCONST_ROADMAP_INTAKE_BATCH_KEYSunchanged. Addissue_commentonly toCONST_ROADMAP_WEBHOOK_EVENTS. (best practice) [sources: src/devops_cli/config/constants.py:3913, src/devops_cli/config/constants.py:3935, src/devops_cli/roadmap/run.py]- Chosen: Add
issue_commentonly to the webhook event set. It keeps the intake batch keys separate and adds the event to the webhook set. - Rejected: Add
issue_commenttoCONST_ROADMAP_INTAKE_BATCH_KEYS. Intake would read comment events as intake batches. - Rejected: Replace the set with an explicit event list. It would drift when an intake webhook event changes.
- Chosen: Add
- Which payload fields does the consumer need to decide trust and route?: Add
comment.body,comment.author_association,comment.created_atandissue.pull_requesttoGitHubWebhookPayload. Ignore the other fields. (best practice) [sources: src/devops_cli/models/webhooks.py, SECURITY.md]- Chosen: Add the comment fields and the pull request marker. The refusal and routing need all four fields.
- Rejected: Add only
comment.body. The trust check needsauthor_associationand the routing needs the timestamp. - Rejected: Parse the raw payload in the route. It bypasses the typed model and the existing refusal signature.
- How does the consumer tell an issue comment from a pull request comment?: Refuse an
issue_commentpayload when theissue.pull_requestmarker is present. (best practice) [sources: src/devops_cli/models/webhooks.py, src/devops_cli/server/routes/webhooks.py]- Chosen: Use the
issue.pull_requestmarker. GitHub sends the marker only for a pull request, and the refusal needs no request. - Rejected: Look up the issue number. It needs a GitHub request, which the refusal must avoid.
- Rejected: Read the comment URL. It is less direct and still needs the marker.
- Chosen: Use the
- Which comments are trusted?: Trust only an
author_associationinCONST_ROADMAP_TRUSTED_AUTHORS. Refuse the Service bot, a[bot]sender and every other association. (best practice) [sources: SECURITY.md, src/devops_cli/config/constants.py:4213, src/devops_cli/roadmap/trust.py]- Chosen: Use the trusted author set and refuse bots. It matches the existing item-author rule and the own-write guard.
- Rejected: Trust every comment. SECURITY.md trusts only write access and two bots.
- Rejected: Trust the sender login only. A contributor login has no write access.
- What does owner decision D8 of 2026-11-13 require?: D8 approves
issue_commentin the App events. A trusted reply makes the router run a scoped sweep for the item. Refine or resolve becomes due by its predicate, and the handler writes no due mark. (best practice) [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md, src/devops_cli/roadmap/run.py:881-883]- Chosen: Run a scoped sweep for the item. D8 makes the scoped sweep the route, and the row predicate decides the work.
- Rejected: Set a refine or stage due mark. D8 says no due mark.
- Rejected: Enqueue a scoped refine update on the model lane. D8 replaces the lane enqueue with a scoped sweep.
- Rejected: Run a full round across all rows. ADR 0009 rejected a full round for every comment.
- How does a trusted
implement: retrycomment clear the stop?: The scoped sweep runs the implement row for the issue.retry_asked_onsees the trusted comment, and theretryrule clears the stop without a fullclear_stopspass. (best practice) [sources: src/devops_cli/roadmap/stop_clear.py:49-50, src/devops_cli/roadmap/stop_clear.py:345, src/devops_cli/roadmap/run.py, src/devops_cli/roadmap/implement/implement.py]- Chosen: Run a scoped sweep and let the implement row clear the stop. The row already has the retry rule and the stop-clear path.
- Rejected: Run
clear_stopsfor every Blocked item. It lists comments for every Blocked item and keeps the quota cost. - Rejected: Clear the stop in the webhook route. It would write GitHub state from the route and bypass the row.
- Does ADR 0009 still block
issue_comment?: No. Owner decision D8 approves the event, and the scoped sweep meets the router rule. The refusal and scoped update controls exist. (best practice) [sources: docs/adr/0009-one-webhook-router-delivers-each-event-to-the-consumers-subscribed-to-it.md, docs/adr/0017-each-subscribed-webhook-event-runs-the-update-scoped-to-it.md, src/devops_cli/server/routes/webhooks.py:141-154, src/devops_cli/roadmap/run.py:881-883]- Chosen: Add
issue_commentwith refusal and a scoped sweep. D8 approves it, and the controls meet the router rule. - Rejected: Keep the event unsubscribed. The poll cost and latency remain.
- Rejected: Add
issue_commentwith a full round. ADR 0009 rejected full rounds for every comment.
- Chosen: Add
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 10, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It removes 7 to 31 minute polling delays for three human workflows but the system still functions without it.It cuts wait time for retry, refine-reply, and row-wake actions and saves GitHub API quota on idle polls.It needs a new payload model, constant update, refusal logic, and two routing branches plus offline tests.Both route GitHub webhooks through roadmap_consumer in webhooks.py, but #4412 fixes issues-event routing gaps while the candidate adds issue_comment subscription and comment-specific routing.devops-cli-service commentedon Nov 10, 2026
Refine cannot set this item to Ready at 1ca0133 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
devops-cli-service commentedon Nov 11, 2026
Alternatives check: partly
Reason: The web searches were mostly noise, but the tool facts confirm gidgethub is a maintained Python GitHub library, and the issue itself states it parses
issue_commentpayloads — the parsing half of this need. It does not provide the zero-trust refusal, the scoped routing intoRoadmapStore/FailureLedger/RepoWorkerlanes, or the targetedimplement: retrystop clear, so it covers only a part.Tool: gidgethub/gidgethub (https://github.com/gidgethub/gidgethub)
Covers:
issue_commentpayloads, into event dataLacks:
edited/deletedactions, bot and own-write senders, andauthor_associationoutside the trusted setissue.pull_requestmarkerRoadmapStore,FailureLedgerand the in-clusterRepoWorkerlanesimplement: retrycomment without a fullclear_stopspassrefineupdate on themodellane and passing the comment timestamp to the ledgerCONST_ROADMAP_WEBHOOK_EVENTSand the matchingk8s/README.mdhook instructionsTools considered:
Searches run:
Sources:
Checked on 2026-11-11. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 14, 2026
Refine cannot set this item to Ready at 79eb893 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
devops-cli-service commentedon Nov 20, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
20 remaining items
docs(openspec): plan #4415 Handle trusted issue_comment replies
docs(openspec): plan #4415 Handle trusted issue_comment replies (#6927)
devops-cli-service commentedon Nov 24, 2026
The draft pull request #6942 holds the final title and body. In mode
onofroadmap.fix_checks.mode, the watch row marks it ready when its checks pass, and a fix-checks Job repairs a failed check whose name gives the class test, lint or types. In each other case the watch row stops the item: another failed check, a cancelled check, a conflict, a fix-checks Job that ended with no repair, or another mode.Spend: 325 model requests, 32464473 input tokens, 142416 output tokens.
devops-cli-service commentedon Nov 24, 2026
Released in v0.205.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.205.0