Skip to content

fix(roadmap): implement refuses items with failing plan checks #3976

Description

@dan-petty

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

  1. Open a draft plan pull request that fails Plan Check in CI.
  2. Run devops roadmap implement while the item has status ready or planned.
  3. 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

  1. In src/devops_cli/roadmap/implement/implement_pull.py or implement.py, inspect the check run status of stage.pr.
  2. Reject Staged items whose plan pull request has failing check runs.
  3. Record the failing check in _plan_reason or _pull_reason.
  4. 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 fail bucket.
  • THEN plan_implement selects no target for the item, and the reason of its left_out entry 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 cancel bucket.
  • THEN plan_implement selects no target for the item, and the reason of its left_out entry 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 pending bucket.
  • THEN plan_implement selects no target for the item, and the reason of its left_out entry 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_implement selects no target for the item, and the reason of its left_out entry 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_implement selects 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_reason in src/devops_cli/roadmap/implement/implement.py:434 judges 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_runs in src/devops_cli/github/check_verdict.py returns a CheckVerdictSummary, with an exit code, a bucket for each check and an unread reason. implement_pull.py and implement_run.py already 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_reason of the selection in src/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_reason of the selection. It runs before the Service creates a runner Job, and it is the gate of the plan pull request.
    • Rejected: _plan_reason of the selection. That method holds the checks of the tasks text, not of the pull request.
    • Rejected: draft_readiness in implement_pull.py. It runs inside the runner Job, after the expensive work starts.
  • 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_sha of stage.pr and give it to read_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. PullStatus already carries the head SHA, and implement_pull.py reads 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.
  • 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.
  • Where do the tests of the selection go?: tests/roadmap/implement/test_roadmap_implement_job.py holds the selection tests of the plan check, and tests/roadmap/implement/test_roadmap_implement_selection.py holds 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

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 7, 2026
  2. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. The defect wastes compute and model tokens but does not break a user-facing workflow or block delivery.
    • Value: Medium. It prevents launching expensive runner jobs on plans that CI has already rejected, saving tokens and compute.
    • Effort: Low. The change adds one CI-status check using existing readers in devops_cli.github.check_verdict and one unit test.
    • Related: fix(roadmap): the implement job refuses a plan that fails the plan check #3393, which asks for a different change. 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.
  3. added
    priority/p2-medium
    on Nov 7, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 8, 2026
  5. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 1f03ee3 (see proposed design in issue body).

  6. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    Contributor

    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_runs in devops_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_reason with the head SHA of stage.pr.

    Tool: none found

    Covers:

    • The repository's own reader, read_check_runs, already returns per-check buckets for a commit

    Lacks:

    • A call to the check reader from the implement selection (_pull_reason)
    • The head SHA of stage.pr passed to that reader

    Searches run:

    • gate workflow on pull request check runs status passing before launching job GitHub API, results: 5
    • GitHub REST API list check runs for a git reference, results: 5

    Checked on 2026-11-09. A person decides what this means for the item. The check changes no label and closes no issue.

  7. added
    status/in-review
    and removed
    status/ready
    on Nov 14, 2026
  8. removed
    status/in-review
    on Nov 14, 2026
  9. added a commit that references this issue on Nov 14, 2026
  10. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-14 15:02 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions