Repository navigation
Description
Problem Description
The service implement job takes a staged item before a person reviews and merges the plan pull request.
Row stage opens a draft plan pull request and sets stage.pr on the item.
Row implement checks _takeable_status, which accepts status/ready.
_Judge._route reads recorded_branch, which returns stage.branch and stage.pr.
_pull_reason accepts any open draft pull request.
The service then creates a runner Job that implements the staged branch before human approval.
This run sets implement.pr to the plan pull request number.
kind_of in implement_pull.py then treats the plan pull request as an implementation pull request.
The merge readiness check then refuses the draft because tasks in tasks.md are not ticked.
Reproduction Steps
- Run row
stageon a ready roadmap item. - Confirm that row
stageopens a draft plan pull request such as PR docs(openspec): plan #3391 Refuse criteria entries not in the issue body #4069. - Run row
implementwhile the plan pull request is an unmerged draft. - Inspect the created jobs and issue record.
Expected vs Actual Behavior
Expected: Row implement takes only Planned items with changes on the default branch, or retried implementation branches.
Actual: Row implement launches a runner Job for unmerged draft plan pull requests and marks the item In Progress.
Environment Diagnostics
- DevOps CLI Version: 0.83.2
- Python Version: 3.14.10
- OS & Architecture: Linux x86_64
- Execution Environment: Roadmap Service / Kubernetes
Logs, Traces, or Terminal Output
implement.job: devops-cli-runner-20261107-201633-cba7
implement.pr: 4069
stage.pr: 4069
PR #4069 is not ready: Task group 1 has a task that is not ticked.
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.
Proposed design
Problem statement
The implement row takes a Staged item before a person merges its plan pull request. The row starts a runner Job on the staged branch. The Job writes the plan pull request number into implement.pr. The draft readiness check then reads the plan as an implementation pull request. The row must take only a Planned item, or the implementation branch of a retried Job.
Acceptance criteria
Requirement: Unmerged plan is not takeable
The implement row SHALL refuse an item whose OpenSpec change folder is not on the default branch.
Scenario: Staged item with an open plan draft
- WHEN the item has Status Ready and its record holds
stage.branchandstage.prfor an open draft plan pull request - THEN the row takes no item and reports a reason that names the plan pull request that a person has not merged
Requirement: Refused item keeps its status
The row SHALL leave the Status label and the record of an item that it refuses unchanged.
Scenario: Refused staged item
- WHEN the row refuses a Staged item with an open plan draft
- THEN the item keeps Status Ready and its record gains no
implement.job,implement.branchorimplement.pr
Requirement: Planned item is takeable
The implement row SHALL take an item with Status Planned and no branch on origin.
Scenario: Planned item with no branch
- WHEN the item has Status Planned, its change folder is on the default branch and
originholds no branch for it - THEN the row takes the item on a new branch
<type>/<issue>-<slug>at the default branch and with no recorded pull request
Requirement: Retried implementation branch is takeable
The implement row MUST continue the implementation branch of a stopped item after a person comments implement: retry.
Scenario: Retry of a stopped implement job
- WHEN the item holds
implement.branchandimplement.prand its record has noimplement.stopped - THEN the row takes the recorded implementation branch and pull request and makes no new branch
Requirement: Record reads the implementation branch only
recorded_branch SHALL read implement.branch and implement.pr only.
Scenario: Item with a staged plan and no implementation run
- WHEN the item holds
stage.branchandstage.prand noimplement.branch - THEN
recorded_branchreturnsNone
Existing Tool Considered
No check has run. No open, maintained tool or library covers this need: the change corrects the route predicate of the project itself. The written cost is about 40 changed lines in src/devops_cli/roadmap/implement/implement.py, about 15k tokens to write them, about 10k tokens to keep and fix them until the new tests pass, and about 3 hours of elapsed time.
Key questions
- Which condition must stop the implement row from taking an item whose plan is not merged?: The row takes an item only when its Status is Planned, or when its record holds
implement.branchwith no stop. The change removesstage.branchandstage.prfromrecorded_branch. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/implement/implement.py:259, src/devops_cli/roadmap/implement/implement.py:223, openspec/changes/archive/2026-10-31-2865-service-marks-stage-pr-ready/proposal.md:44]- Chosen: Require Status Planned, or a recorded implementation branch. The Status label records that a person merged the plan, and the record holds the branch of a retry.
- Rejected: Refuse only a draft plan pull request in
_pull_reason. The record still routes onstage.branch, and the stage_ready row marks the plan ready, so the refusal misses that case. - Rejected: Read the default branch for the change folder at route time. An extra GitHub read for each item costs rate limit, and the Status label already holds the answer.
- Must the implement row keep taking a Staged item whose plan draft pull request is open?: No. A Staged item waits for a person to merge the plan. The row takes it only after the merge, when its Status is Planned. (best practice) [sources: CONTEXT.md, openspec/changes/archive/2026-10-31-2865-service-marks-stage-pr-ready/proposal.md:44]
- Chosen: Take only a Planned item, or a retried implementation branch. A plan pull request that a person has not merged is no implementation work, and its branch holds the plan only.
- Rejected: Keep the Staged case of feat(roadmap): the Service marks a stage pull request ready when its checks pass #2865. That case is the defect: it starts a runner Job before a person merges the plan.
- How does the row recognize the implementation branch of a retried Job?: From the record:
implement.branchandimplement.prwith noimplement.stopped. A person'simplement: retryclears the stop, and the branch stays onorigin. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/implement/implement.py:223]- Chosen: The record holds
implement.branchand noimplement.stopped. The retry clears the stop, and the branch onoriginholds the work that the Job kept. - Rejected: The Status is In Progress. The Service sets In Progress only when it creates the Job, so a retried item is not yet In Progress.
- Rejected: The Status is Blocked. A Blocked item is not started, and the retry clears the stop before the row runs.
- Chosen: The record holds
- Must
kind_oftreat a pull request that the record holds in bothstage.prandimplement.pras a plan?: No. The gate stops the wrong record, so no new item holds the plan number inimplement.pr. A tie-break would hide the defect. (best practice) [sources: src/devops_cli/roadmap/implement/implement_pull.py, openspec/changes/archive/2026-11-03-2916-one-function-decides-when-any-draft/tasks.md]- Chosen: Add no tie-break. The gate prevents the wrong record, and a tie-break hides a defect that the row must not make.
- Rejected: Tie-break to the stage plan. It repairs one record and adds a rule that no other case needs.
- Which tests cover the implement route?:
tests/roadmap/implement/test_roadmap_implement_plan_reason.pyholds the tests of the route reason.tests/roadmap/implement/test_roadmap_implement_planned.pyandtests/roadmap/implement/test_roadmap_implement_job.pyhold the tests of the row and the Job. [sources: tests/roadmap/implement/test_roadmap_implement_plan_reason.py, tests/roadmap/implement/test_roadmap_implement_planned.py, tests/roadmap/implement/test_roadmap_implement_job.py, tests/core/test_roadmap_implement_planned_run.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-10: 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 bug launches unapproved runner Jobs and corrupts item state, but does not cause data loss or a security breach.It stops wasted compute and incorrect workflow state on unapproved items.The fix is a condition check in the implement job selection logic to exclude unmerged draft stage plan PRs.Prevent the implement job from selecting items whose stage plan pull request is still an unmerged draftas the change that both ask for.Both items ask the implement job to skip items with unmerged draft stage plan PRs, delivering the same selection filter.A person closes one of the two if that is so.devops-cli-service commentedon Nov 8, 2026
Status set to Ready at c8990be (see proposed design in issue body).
devops-cli-service commentedon Nov 10, 2026
Alternatives check: none
Reason: One search for a tool that gates work on a merged plan pull request found nothing relevant. The issue is a bug in the project's own route predicate (
recorded_branchand_takeable_statusin the implement row). It is not a need that an outside tool or library can cover.Tool: none found
Lacks:
stage.*andimplement.*record fields, or its implement row logic.Searches run:
Checked on 2026-11-10. A person decides what this means for the item. The check changes no label and closes no issue.
dan-petty commentedon Nov 11, 2026
Service data, 48 hours to 2026-11-10T23:45Z: implement took drafts with
plan/needs-fixCount: 2 runner Jobs started on a draft plan pull request that already had the label
plan/needs-fix. 8 runner Jobs ran in the window.limit_reached, 8,050,668 input tokens, work discarded, itemstatus/blockedlimit_reached, 3,630,613 + 8,103,317 input tokens; a person added a style commit and the archive commit, and the bot commits shipped in #4353First and last: 10:57:29Z and 11:47:42Z on 2026-11-10. Still occurring: no take of a labelled draft after 11:47Z. The last 6 hours of the window had 1 Job (#3429, a Planned item). No open pull request carries
plan/needs-fixnow. The cause is not fixed: no commit changesimplement.pyorimplement_pull.pyafter aec8ef5 (#4196).Cost: 42.2 Job minutes, about 19.8M input tokens, and person work on #4352 (3 plan commits). The evidence does not prove that the plan defect caused the
limit_reachedstops; the step budget unit is a separate cause (#4387).Root cause:
_Judge._pull_reason(src/devops_cli/roadmap/implement/implement.py:434) accepts every open draft (PullStatus.is_open_draft,src/devops_cli/github/client.py:108)._takeable_status(implement.py:259) accepts Ready and Planned items. The Service row uses the same judge throughplan_implement(implement_submit.py:459). Onlystage_ready.py:141readsplan/needs-fix. Nothing undersrc/devops_cli/roadmap/implement/reads the label or the review state of the plan. The label keeps a defective plan a draft, and stage_ready marks a green plan with no finding ready, after which implement refuses it as "not an open draft". So implement takes exactly the plans that the model review refused.Notes for the fix:
plan/needs-fixin_pull_reason. A person chooses between the two.Priority: P2 fits the evidence.
Queries:
dan-petty commentedon Nov 13, 2026
The owner approved the roadmap pipeline split on 2026-11-13 (tracker #5482). Decision D3 replaces the expected behavior of this item. One Staged rule applies to each item by the effort pass (
roadmap.implement.effort):#5505 builds this rule and a test that
due_jobsnever gives both paths for one head. I close this item as not planned, because #5505 replaces it. Reopen it if #5505 does not cover the case of PR #4069.