Repository navigation
Description
Problem Description
The Service subscribes to GitHub issues webhooks, but three routing gaps drop events after scoped intake. These gaps leave refine, retitle, stage, and implement waiting for their polling timers.
First, roadmap_consumer (src/devops_cli/server/routes/webhooks.py:284-304) sends ("issues", "edited") to _SCOPED_INTAKE on the triage lane and returns early. When a person edits an existing Item that already holds a priority/* label, _intake_one (src/devops_cli/roadmap/run.py:519-555) skips non-candidates and writes nothing. The model lane never wakes up, so refine, retitle, and stage miss the edit until the next poll.
Second, when _intake_one places a P0 item or a critical fix, _apply_round (src/devops_cli/roadmap/run.py:462-465) stamps refine_due in schedule.json. However, roadmap_consumer only enqueues work on the triage lane and never wakes the model lane worker. refine waits up to 151 seconds today, or up to 600 seconds once idle backoff (#3672) lands.
Third, un-scoped issues actions such as labeled, unlabeled, and closed call enqueue_trigger (src/devops_cli/server/routes/webhooks.py:306). That call wakes all three lanes, and triage spends one GitHub request on store.changes_since. Yet no row in STATUS_LANE_ROWS or MODEL_LANE_ROWS (src/devops_cli/roadmap/run.py:770-861) sets batch_keys or due_rule. _Poll.is_due (src/devops_cli/roadmap/run.py:1026-1040) returns False for every row whose interval has not expired, so zero jobs run.
Reproduction Steps
- Deliver a signed
issueswebhook withaction="edited"for an open Item that holds apriority/*label. - Observe that
enqueue_scopedruns_intake_oneontriageand never wakes themodellane. - Deliver a signed
issueswebhook withaction="labeled"oraction="closed"before row timers expire. - Observe that
enqueue_triggerwakesstatusandmodel, and_Poll.is_dueskipsimplement,refine, andstage.
Expected vs Actual Behavior
Expected behavior:
- Editing an open Item runs or wakes
refineandretitleon themodellane. - Placing a P0 item or critical fix in
_intake_oneimmediately wakesrefineon themodellane. issueslabeled,unlabeled, andclosedwebhook triggers markrefine,stage, andimplementdue viabatch_keys.
Actual behavior:
- Editing an open Item stops after
_intake_onedoes nothing ontriage. - Placing a P0 item in
_intake_onestampsrefine_dueon disk without waking themodelworker. issueslabeled,unlabeled, andclosedtriggers wake all three workers, spend atriageread, and run zero rows onstatusandmodel.
Proposed Solution & Architectural Design
- Update
roadmap_consumer(src/devops_cli/server/routes/webhooks.py) andrun_scoped_update(src/devops_cli/roadmap/run.py) to inspect theJobOutcomeof_intake_one. - Wake the
modellane whenoutcome.placed_critical_or_p0isTrue. - Route
("issues", "edited")for an open Item to themodellane instead of dropping it. - Declare
batch_keysinsrc/devops_cli/config/constants.pyandsrc/devops_cli/roadmap/run.pyforrefine,stage, andimplement. - Update
openspec/specs/roadmap-scoped-updates/spec.mdandk8s/README.mdso the documents match the code.
Target Subsystem
SDLC, Git & PR Governance
Existing Tool Considered
gidgethub (https://github.com/gidgethub/gidgethub, ADR 0006) parses GitHub webhooks, while ADR 0008 and ADR 0009 rejected Argo Events for roadmap-service. Neither tool schedules the in-process lane workers or tracks per-row schedules in schedule.json. Updating webhooks.py and run.py costs about 90,000 tokens to build, maintain, and fix, and 2 hours of elapsed time.
Acceptance Criteria
- An
issuesediteddelivery for an existing open Item wakes or runsrefineandretitleon themodellane. - When
_intake_onesetsplaced_critical_or_p0=True, themodellane worker wakes immediately and runsrefinefromrefine_due. -
issueslabeled,unlabeled, andclosedwebhook deliveries match explicitbatch_keyson the affectedmodelandstatusrows instead of waking workers that run zero rows. - Unit tests in
tests/server/andtests/roadmap/verify each path offline without network calls.
Pre-Submission Checklist
- I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
- I have checked existing issues and pull requests to ensure this is not a duplicate.
- I confirm this proposal aligns with AGENTS.md engineering principles (cyclomatic complexity <= 10, nesting <= 5, zero bare exceptions, tests that cover the changed lines).
Proposed design
Problem statement
The Service drops three issues webhook paths after scoped intake. An edit of an existing Item wakes no model-lane round, so refine, retitle and stage wait for the poll. A P0 item or a critical fix stamps refine_due on disk, and no model-lane worker wakes. An issues labeled, unlabeled or closed trigger wakes three lanes, and no row declares the webhook key that makes it due, so zero rows run.
Acceptance criteria
Requirement: An edit of an Item wakes the model lane
The Service SHALL enqueue a trigger with the delivery key when a scoped intake decides nothing for an open Item.
Scenario: An edit of an issue that holds a priority label
- WHEN a signed
issuesediteddelivery names an open issue with the labelpriority/p2-medium, and the scoped intake writes nothing for it - THEN the Service enqueues a trigger with the key
("webhook", "issues", "edited"), and therefineandretitlerows run in the model-lane round
Requirement: A critical placement wakes the model lane
The Service SHALL wake the model lane when the scoped intake places a critical fix or a P0 item.
Scenario: An opened issue that intake places as a critical fix
- WHEN a signed
issuesopeneddelivery names an issue with the labelstype/bugandpriority/p0-critical, and the scoped intake places it - THEN
schedule.jsonholds arefine_duestamp, and the model-lane round runsrefine
Requirement: A webhook key makes only the rows that declare it due
Each roadmap row SHALL declare in batch_keys the webhook keys that make it due.
Scenario: A labeled delivery
- WHEN a signed
issueslabeleddelivery arrives, and therefine,stageandimplementrows declare its key while theintakeandalternativesrows do not - THEN
refineandstageare due on the model lane,implementis due on the status lane, andintakeandalternativesare not due by that delivery
Requirement: The Service answers no delivery of its own write
The roadmap consumer SHALL drop a delivery that the App's own bot sent before it enqueues a trigger or a scoped update.
Scenario: The delivery of the Service's own status label
- WHEN the
issueslabeleddelivery of the Service's ownstatus/plannedwrite arrives - THEN the consumer counts the outcome
self, and no lane wakes
Requirement: The spec and the runbook state the lane and the wake
The change SHALL state the triage lane and the model-lane wake in the scoped-update spec and in the roadmap service runbook.
Scenario: A reader of the two documents
- WHEN a test reads
openspec/specs/roadmap-scoped-updates/spec.mdand steps 8 and 17 ofk8s/README.md - THEN both documents name the triage lane for the scoped update and the model-lane wake after it
Requirement: Offline tests prove each path
The change SHALL prove each routing path with a unit test that makes no network call.
Scenario: The tests of the webhook route and the roadmap rows
- WHEN
tests/server/andtests/roadmap/run with no network - THEN the tests assert the Item edit wake, the critical placement wake, and the row set that each webhook key makes due
Existing Tool Considered
No alternatives check has run on this item. gidgethub (ADR 0006) parses the GitHub webhook payloads, and the Service already uses it. It does not schedule the in-process lane workers or track the per-row schedules in schedule.json. ADR 0008 and ADR 0009 rejected Argo Events for the roadmap-service. No open, maintained tool covers the routing need. The change therefore builds on the existing code, at the written cost of about 90,000 tokens to build, keep and fix, and 2 hours of elapsed time.
Key questions
- Which lane runs intake, and which lane runs refine, retitle and stage?: The triage lane runs intake. The model lane runs refine, retitle, stage and the alternatives check. The status lane runs the rows that call no model. [sources: CONTEXT.md, src/devops_cli/config/constants.py, openspec/specs/roadmap-scoped-updates/spec.md]
- What form does a batch key take?: A batch key is a tuple
(source, event, action).CONST_ROADMAP_INTAKE_BATCH_KEYSholds("webhook", "issues", "opened")and("webhook", "issues", "reopened"). [sources: src/devops_cli/config/constants.py] - Which lane runs the scoped update of an
issuesdelivery?: The triage lane runs it. Intake is the triage lane's row, and the scoped update runs intake's own decision code. (best practice) [sources: CONTEXT.md, openspec/specs/roadmap-scoped-updates/spec.md]- Chosen: Triage lane. CONTEXT.md gives intake to the triage lane, and the scoped update runs
_intake_one. - Rejected: Model lane. The model lane holds no intake row, and two lanes would write the intake record.
- Rejected: A new lane. The Service has three lanes, and a fourth lane doubles the workers for one event.
- Chosen: Triage lane. CONTEXT.md gives intake to the triage lane, and the scoped update runs
- How does the scoped update of an edited Item make refine and retitle run?:
run_scoped_updatereports whether intake decided the delivered issue, and whether it placed a critical fix or P0 item. The scoped callable then enqueues a trigger with the delivery key("webhook", "issues", "edited"). Therefineandretitlerows declare that key, so both run in the model-lane round. (best practice) [sources: src/devops_cli/roadmap/run.py, src/devops_cli/config/constants.py]- Chosen: Read the intake outcome. The outcome states what intake did, and the call needs no second read of the issue.
- Rejected: Route
editedto the model lane. The model lane holds no intake row, so the issue would never be placed. - Rejected: Write a second due stamp.
refine_duealready holds the due time, and a second stamp adds a writer ofschedule.json.
- What does
_intake_onereport for an issue that is no candidate?:plan_intakeholds no decision for that issue, and_apply_roundwrites nothing for it. The scoped update therefore reports that it decided nothing for the delivered number. [sources: src/devops_cli/roadmap/run.py] - Which webhook keys does each row declare?:
refinedeclaresedited,labeledandunlabeled.retitledeclaresedited.stageandimplementdeclarelabeled,unlabeledandclosed. Each key is("webhook", "issues", <action>). (best practice) [sources: src/devops_cli/config/constants.py, src/devops_cli/roadmap/run.py]- Chosen: The keys above. An edit changes the text that refine and retitle read. A label change changes the set that refine, stage and implement act on. A close frees a
planned_limitslot. - Rejected: Every key on every row. The intake row would run for a label change that it does not decide.
- Rejected:
labeledalone on every row. An edit and a close then wait for the interval, which is the gap that this item closes.
- Chosen: The keys above. An edit changes the text that refine and retitle read. A label change changes the set that refine, stage and implement act on. A close frees a
- How does a trigger carry the batch key to a lane?:
enqueue_triggertakes the(source, event, action)key and hands it to the lane poll as its batch.roadmap_consumerpasses the key of the delivery, and the scoped callable passes the key that it handled. (best practice) [sources: src/devops_cli/server/routes/webhooks.py:306, src/devops_cli/roadmap/run.py]- Chosen: Pass the key to
enqueue_trigger. The consumer knows the delivery, and_Poll.is_duealready reads a batch key. - Rejected: Build the key in the manager. The manager receives no delivery and no event.
- Rejected: Keep the key in the lane state. Two deliveries at once would overwrite one key, and the round would read the wrong one.
- Chosen: Pass the key to
- Does a delivery of the Service's own label write wake a lane?: No. The roadmap consumer refuses a delivery that the App's own bot sent, and counts it as the outcome
self. The newlabeledkeys therefore make no loop. [sources: src/devops_cli/config/constants.py, k8s/README.md] - Which documents state the lane and the wake?: The spec
openspec/specs/roadmap-scoped-updates/spec.mdand steps 8 and 17 ofk8s/README.md. The spec scenario that names the model lane for a scoped update is wrong, and the change corrects it. [sources: openspec/specs/roadmap-scoped-updates/spec.md, k8s/README.md]
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.
fixprefix of the title gives the type.(service)scope of the title gives the scope.Three routing gaps drop webhook events and delay jobs by up to 600 seconds.Fixes dropped events for refine, retitle, stage, and implement in the core workflow.Requires changes to webhooks.py, run.py, constants.py, and two spec documents.Both work on scoped intake webhook routing, but #2009 built the mechanism while this candidate fixes three routing gaps in it.devops-cli-service commentedon Nov 10, 2026
Status set to Ready at 9bb67a0 (see proposed design in issue body).
devops-cli-service commentedon Nov 11, 2026
Released in v0.112.2: https://github.com/dan-petty/devops-cli/releases/tag/v0.112.2
devops-cli-service commentedon Nov 11, 2026
Live since 2026-11-11 17:36 UTC