Repository navigation
Description
Problem Description
The implement job selects Staged items whose plan pull requests have failing checks. In the roadmap workflow, row stage opens a draft plan pull request. If the plan pull request fails CI checks (such as Plan Check), the pull request stays unready. However, devops roadmap implement checks only local plan parsing and does not verify remote CI check status on stage.pr. As a result, the service launches an expensive runner Job on an item whose plan is broken or rejected.
Reproduction Steps
- Open a draft plan pull request that fails
Plan Checkin CI. - Run
devops roadmap implementwhile the item has statusreadyorplanned. - Observe that the implement job creates a runner Job for the item despite the failing plan check in CI.
Expected vs Actual Behavior
Expected: The implement selection filter verifies that stage.pr has passed CI quality gate checks before creating a runner Job.
Actual: The implement job launches a runner Job on an item with a failing plan pull request, wasting compute and model tokens.
Environment Diagnostics
devops-cli 0.79.0, Linux x86_64, 2026-11-07.
Proposed Solution & Architectural Design
- In
src/devops_cli/roadmap/implement/implement_pull.pyorimplement.py, inspect the check run status ofstage.pr. - Reject Staged items whose plan pull request has failing check runs.
- Record the failing check in
_plan_reasonor_pull_reason. - Add unit test coverage in
tests/roadmap/implement/test_roadmap_implement_job.py.
Existing Tool Considered
GitHub Check Runs API and existing check readers in devops_cli.github.check_verdict.
Proposed design
Problem statement
The implement selection takes a Staged item without reading the check status of its plan pull request. A plan pull request that fails Plan Check stays unready, and the Service still creates a runner Job for the item. The Job then spends compute and model tokens on a broken or rejected plan. The change makes the selection read the check runs of stage.pr and leave the item out with the reason.
Acceptance criteria
Requirement: Failed plan check refuses the item
The implement selection SHALL leave a Staged item out when a check of its plan pull request failed.
Scenario: A plan check fails
- WHEN The plan pull request of a Staged item has a check with the
failbucket. - THEN
plan_implementselects no target for the item, and the reason of itsleft_outentry names the failed check.
Requirement: Cancelled plan check refuses the item
The implement selection SHALL leave a Staged item out when a check of its plan pull request was cancelled.
Scenario: A plan check is cancelled
- WHEN The plan pull request of a Staged item has a check with the
cancelbucket. - THEN
plan_implementselects no target for the item, and the reason of itsleft_outentry names the cancelled check.
Requirement: Unsettled plan check refuses the item
The implement selection SHALL leave a Staged item out while a check of its plan pull request has not settled.
Scenario: A plan check still runs
- WHEN The plan pull request of a Staged item has a check with the
pendingbucket. - THEN
plan_implementselects no target for the item, and the reason of itsleft_outentry says that a check runs.
Requirement: Unread plan check refuses the item
The implement selection SHALL leave a Staged item out when it cannot read the checks of its plan pull request.
Scenario: The check read gives no verdict
- WHEN The read of the check runs of the plan pull request returns an unread verdict.
- THEN
plan_implementselects no target for the item, and the reason of itsleft_outentry holds the unread reason.
Requirement: Passing plan check selects the item
The implement selection MUST select a Staged item when every check of its plan pull request passed.
Scenario: Every plan check passes
- WHEN The plan pull request of a Staged item has no failed, cancelled, pending or unread check.
- THEN
plan_implementselects the item with its branch and its pull request number.
Requirement: The selection reads the checks of the plan head
The implement selection SHALL read the check runs of the head commit of stage.pr.
Scenario: The selection judges one Staged item
- WHEN The selection judges a Staged item whose record holds
stage.pr. - THEN The run reads the check runs of the head SHA of that pull request once.
Requirement: A refused item starts no step
The implement run MUST make no model call for an item that the selection left out.
Scenario: Every candidate fails its plan check
- WHEN A run holds only Staged items whose plan pull request has a failed check.
- THEN The run makes no model call and opens no pull request.
Existing Tool Considered
No alternatives check has run. GitHub's Check Runs REST API covers the need, and the repository already reads it with read_check_runs in src/devops_cli/github/check_verdict.py. That reader returns one verdict with a bucket for each check. It lacks a call from the implement selection and the head SHA of stage.pr; this change adds both. No new library or reader is built, so the build cost is zero.
Key questions
- Where does the selection judge the plan pull request of a Staged item?:
_Judge._pull_reasoninsrc/devops_cli/roadmap/implement/implement.py:434judges the plan pull request. Line 317 calls it for the route of each candidate. [sources: src/devops_cli/roadmap/implement/implement.py:317, src/devops_cli/roadmap/implement/implement.py:434] - Which existing reader gives the verdict of the checks of a commit?:
read_check_runsinsrc/devops_cli/github/check_verdict.pyreturns aCheckVerdictSummary, with an exit code, a bucket for each check and an unread reason.implement_pull.pyandimplement_run.pyalready use it. [sources: src/devops_cli/github/check_verdict.py, src/devops_cli/roadmap/implement/implement_pull.py, tests/roadmap/implement/test_roadmap_implement_job.py] - Where does the change add the plan check gate?: Add the gate to
_pull_reasonof the selection insrc/devops_cli/roadmap/implement/implement.py. (best practice) [sources: src/devops_cli/roadmap/implement/implement.py:317, src/devops_cli/roadmap/implement/implement.py:434, src/devops_cli/roadmap/implement/implement_pull.py, CONTEXT.md]- Chosen:
_pull_reasonof the selection. It runs before the Service creates a runner Job, and it is the gate of the plan pull request. - Rejected:
_plan_reasonof the selection. That method holds the checks of the tasks text, not of the pull request. - Rejected:
draft_readinessinimplement_pull.py. It runs inside the runner Job, after the expensive work starts.
- Chosen:
- Which check verdicts leave the Staged item out of the selection?: A failed, cancelled, pending or unread check leaves the item out. Only a settled verdict with no failed check selects the item. (best practice) [sources: src/devops_cli/roadmap/implement/implement_pull.py, src/devops_cli/github/check_verdict.py, docs/adr/0004-ci-is-the-authoritative-gate.md]
- Chosen: Fail, cancel, pending and unread leave the item out. An unsettled or unreadable plan is no proof of a good plan, and a wrong selection costs a runner Job.
- Rejected: Only a failed check leaves the item out. A pending check can settle as failed after the Job starts, and the Job then wastes its tokens.
- Rejected: An unread check selects the item. An unread check hides a broken plan, so the selection fails closed.
- How does the selection get the head commit of the plan pull request?: Read
PullStatus.head_shaofstage.prand give it toread_check_runs. (best practice) [sources: src/devops_cli/roadmap/implement/implement.py:434, src/devops_cli/roadmap/implement/implement_pull.py, src/devops_cli/github/client.py]- Chosen: Read
PullStatus.head_sha.PullStatusalready carries the head SHA, andimplement_pull.pyreads a file at it. - Rejected: Read the checks of the default branch. The plan checks run on the head of
stage.pr, not on the default branch. - Rejected: Use the branch name as the ref. The branch can move after the read, so its name is no stable key.
- Chosen: Read
- Which text does the selection use for the reason of a failed plan check?: Reuse
MESSAGES.roadmap.implement_stop_check_failed, which the job already uses to name a failed check. (best practice) [sources: src/devops_cli/roadmap/implement/implement_pull.py, src/devops_cli/roadmap/implement/implement.py]- Chosen: Reuse
implement_stop_check_failed. The selection and the job then name the same failed check with the same words. - Rejected: Add a new message. It gives a second wording for one fact.
- Chosen: Reuse
- Where do the tests of the selection go?:
tests/roadmap/implement/test_roadmap_implement_job.pyholds the selection tests of the plan check, andtests/roadmap/implement/test_roadmap_implement_selection.pyholds the selection tests. [sources: tests/roadmap/implement/test_roadmap_implement_job.py, tests/roadmap/implement/test_roadmap_implement_selection.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-09: none.
Tool: none found.
Activity
dan-petty commentedon Nov 7, 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.(roadmap)scope of the title gives the scope.The defect wastes compute and model tokens but does not break a user-facing workflow or block delivery.It prevents launching expensive runner jobs on plans that CI has already rejected, saving tokens and compute.The change adds one CI-status check using existing readers in devops_cli.github.check_verdict and one unit test.Both make the implement job refuse a bad plan, but 3393 validates local tasks.md content while the candidate verifies remote CI check-run status on the plan PR.devops-cli-service commentedon Nov 8, 2026
Status set to Ready at 1f03ee3 (see proposed design in issue body).
devops-cli-service commentedon Nov 9, 2026
Alternatives check: none
Reason: Two searches returned nothing relevant (only MDN pages). The need is a small gate inside this project's own implement selection. The repository already has
read_check_runsindevops_cli.github.check_verdict, which reads GitHub's Check Runs API. No outside tool or library would add anything, because the missing part is the call from_pull_reasonwith the head SHA ofstage.pr.Tool: none found
Covers:
Lacks:
Searches run:
Checked on 2026-11-09. A person decides what this means for the item. The check changes no label and closes no issue.
docs(openspec): plan #3976 read the plan checks
fix(roadmap): leave out an item whose plan checks did not pass (#3976)
docs(openspec): archive #3976 read the plan checks
docs(openspec): plan #3976 read the plan checks
fix(roadmap): leave out an item whose plan checks did not pass (#3976)
docs(openspec): archive #3976 read the plan checks
chore(main): release 0.138.0 (#5690)
devops-cli-service commentedon Nov 14, 2026
Released in v0.138.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.138.0
devops-cli-service commentedon Nov 14, 2026
Live since 2026-11-14 15:02 UTC