Repository navigation
Description
Problem Description
The implement job takes an item when recorded_branch(item) returns a branch on origin and the pull request is an open draft. In src/devops_cli/roadmap/implement/implement.py, recorded_branch() reads StageRecordKey.BRANCH and StageRecordKey.PR when implement.* keys are absent. Because a plan staged by the stage job is pushed to origin with an open draft pull request, the implement job immediately takes the item before Gate G1 review and before stage_ready marks the plan pull request ready.
When the runner Job starts, it records implement.pr with the stage plan pull request number. If the runner Job stops or fails, the item remains blocked with implement.pr equal to stage.pr. Then devops pr check-readiness classifies the plan pull request as an implementation pull request and refuses it because task groups are not ticked and the change is not archived. Additionally, stage_ready ignores the pull request because implement.job is set.
Reproduction Steps
- A roadmap item reaches
status/ready. - The
stagejob stages the item and opens a draft plan pull request (for example PR docs(openspec): plan #3247 Require a security section for sensitive plans #4022 for item feat(roadmap): Require a security section for sensitive plans #3247). - The
implementjob runs while the plan pull request is still open. - Inspect the item: the
implementjob takes the item, setsimplement.prto the plan pull request number, and starts an implementation Job. - If the Job stops, inspect
devops pr check-readiness <pr>: it fails with unticked task group errors.
Expected vs Actual Behavior
Expected: The implement job leaves out an item whose stage plan pull request has not been reviewed and merged into the default branch (Gate G1).
Actual: The implement job takes the stage plan pull request immediately, overwrites implement.pr, and locks the plan pull request in an unready state.
Environment Diagnostics
- DevOps CLI Version: 0.83.2
- Python Version: 3.14.10
- OS & Architecture: Linux x86_64
- Execution Environment: Kubernetes runner / DevContainer
Logs, Traces, or Terminal Output
PR #4022 is not ready: Task group 1, Refuse a security trigger without a security section, has a task that is not ticked.
Task group 2, Render the security section in the design file, has a task that is not ticked.
Task group 3, State the security rule in the stage prompt, has a task that is not ticked.
Task group 4, Measure the stage job with the new rule, 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 job takes an item as soon as the stage job pushes its draft plan pull request. It then writes the plan pull request number as implement.pr and starts an implementation Job before Gate G1. A Job that stops leaves the item blocked, and devops pr check-readiness then refuses the plan pull request. The change makes the job take an item only after a person merges the plan into the default branch.
Acceptance criteria
Requirement: Recorded branch is the implement pair
recorded_branch SHALL return the branch and pull request that the implement job wrote, and SHALL return None when the record holds only the stage pair.
Scenario: Stage record only
- WHEN An item's job record holds
stage.branchandstage.pr, and noimplement.branchorimplement.pr. - THEN
recorded_branch(item)returns None.
Requirement: Staged item is left out
The implement job SHALL leave out an item whose change folder is not active on the default branch.
Scenario: Open plan pull request
- WHEN An item holds
status/ready, astage.branchonoriginand an open draftstage.pr, and the default branch holds no change folder for it. - THEN
plan_implementselects no item and reports the item left out with the unmerged-plan reason.
Requirement: Unmerged-plan reason names the plan pull request
The left-out reason of an item whose plan pull request is not merged SHALL name the stage pull request number.
Scenario: Report line
- WHEN
render_implement_planrenders a plan that holds the left-out item. - THEN The line of the item holds its number, its title and the stage pull request number.
Requirement: Stale implement pair is left out
The job SHALL leave out an item whose implement.* pair names the stage plan pull request and whose change folder is not on the default branch.
Scenario: Runner stopped before its own draft
- WHEN The record holds
implement.branchequal tostage.branchandimplement.prequal tostage.pr, and the default branch holds no change folder for the item. - THEN
plan_implementselects no item and reports the item left out with the unmerged-plan reason.
Requirement: Planned item is taken
The job SHALL take an item whose change folder is active on the default branch, also when its record still holds the stage pair.
Scenario: Merged plan with the stage branch on origin
- WHEN The record holds a
stage.*pair whose branch is onorigin, and the change folder is active on the default branch. - THEN
plan_implementselects the item as a Planned target withpullNone and the branch<type>/<issue>-<slug>.
Requirement: Retry keeps the implementation draft
The job SHALL take an item whose implement.* branch is on origin, whose implement.* pull request is an open draft, and whose change folder is active on the default branch.
Scenario: Retry after a stop
- WHEN The record holds an
implement.*pair and a stop, a trusted person commentedimplement: retryafter the last job comment, and the plan on the branch passes the stage gates. - THEN
plan_implementselects the item with that branch and pull request, and the target hasretrytrue.
Requirement: Stale implement pair is cleared
The Service SHALL clear every implement.* key of an item when its recorded implement pull request is the stage plan pull request and the default branch holds no change folder for it.
Scenario: Repair of a stopped item
- WHEN A status round reads an item whose record holds
implement.prequal tostage.prand animplement.job, and the default branch holds no change folder for it. - THEN The record holds no
implement.*key, andstage_readymarks the plan pull request ready when its checks pass.
Existing Tool Considered
No check has run. No open, maintained tool or library covers this need, because the rule reads this project's own job record and its own plan layout. The project builds it: about 15,000 tokens to write the selection change, the message and the tests, and about 30 minutes of one implement run. The rule adds no dependency, so the keep and fix cost is the cost of the existing implement tests.
Key questions
- Which condition makes an item takeable by the implement job?: The change folder must be active on the default branch. The job reads
tasks.mdfrom that branch, so an item without the folder cannot run. A recorded branch alone never makes an item takeable. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/implement/implement.py]- Chosen: Require the active change folder on the default branch. The job reads
tasks.mdand the base specs from that branch. CONTEXT.md makes a person's merge of the plan the step that makes an item Planned. - Rejected: Compare
implement.prwithstage.pr. This catches the stale record only. A fresh Staged item holds the stage pair alone. - Rejected: Keep the stage pair as a takeable record. This is the defect. It starts an implementation Job before Gate G1.
- Chosen: Require the active change folder on the default branch. The job reads
- Which record pair does
recorded_branchread?: Onlyimplement.branchandimplement.pr. A second helper reads thestage.*pair to give the left-out reason. (best practice) [sources: src/devops_cli/roadmap/implement/implement.py]- Chosen: Implement pair only, with a stage helper for the reason. The stage pair is the plan record. It must not select the item.
- Rejected: Both pairs, in order. The fallback to the stage pair is the defect.
- How does the project clear an implement pair that names the stage plan pull request?: The Service clears every
implement.*key when the pair names the stage plan pull request and the default branch holds no change folder. The record then reads as Staged, andstage_readymarks the plan pull request ready. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/implement/implement.py]- Chosen: Clear the record in the Service. The Service writes the job record and already clears a stop. One repair restores every reader.
- Rejected: Make
stage_readyignoreimplement.job. This hides a bad record from one reader.devops pr check-readinessstays wrong. - Rejected: Leave the repair to a person. The item stays blocked, and no command clears the pair.
- Which message does the job give for an item whose plan pull request is not merged?: A new key
implement_left_plan_unmergedinsrc/devops_cli/lang/en/messages.py. It names the item and the stage pull request number. (best practice) [sources: src/devops_cli/lang/en/messages.py, src/devops_cli/roadmap/implement/implement.py]- Chosen: New key
implement_left_plan_unmerged. Every left-out reason is a key ofMESSAGES.roadmap, and the existingimplement_left_pullsays the pull request is not an open draft. - Rejected: Reuse
implement_left_pull. The plan pull request is an open draft, so the text is wrong. - Rejected: Reuse
implement_left_not_staged. The item is staged, so the text is wrong.
- Chosen: New key
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 locks items in a broken state and blocks the pipeline, but it is a specific edge case, not a data-loss or security defect.It prevents the implement job from corrupting item state and blocking plan PRs, keeping the roadmap pipeline usable.The change is local to the selection logic in implement.py but needs a merge-state check and tests.Both change the implement job selection rule for items with a plan PR, but #3976 checks for failing CI checks while the candidate checks for the PR being unmerged.devops-cli-service commentedon Nov 8, 2026
Status set to Ready at 447f024 (see proposed design in issue body).
devops-cli-service commentedon Nov 10, 2026
Alternatives check: none
Reason: The search found no open, maintained tool that covers this need. The fix changes how this project's
implementjob picks items. It reads the project's own job record (stage.*andimplement.*keys) and its OpenSpec change-folder layout on the default branch. The only results were unrelated GitHub Actions and container images. The issue's design already says no tool covers it.Tool: none found
Lacks:
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 18, 2026
Close this issue as not planned per AGENTS.md Rule 2.
Evidence
Newer changes on
mainreplaced this issue and resolved the related concerns:Plan merge wait handled in selection:
PR fix(roadmap): name the plan merge wait in explain #5632 (commit
cdef5c22, closing fix(roadmap): clarify review wait message for ready plan PRs in explain #3971) updated_pull_reasoninsrc/devops_cli/roadmap/implement/implement.pyto identify when a plan pull request is ready for review and awaiting merge:Its plan pull request #{pull} is ready for review and awaiting merge.CI gate checks for plan pull requests:
PR fix(roadmap): leave out an item whose plan checks did not pass #5650 (commit
c8b98323, closing fix(roadmap): implement refuses items with failing plan checks #3976) updated_pull_reasonto evaluate the CI checks of the plan pull request (Plan Check), leaving out items whose plan checks have not completed or passed.Staged branch rebase before implementation:
PR feat(roadmap): rebase staged branch onto main before implement #5921 (commit
42fbc79e, closing feat(roadmap): rebase staged branch onto main before implement #4076) added--rebaseto rebase the staged branch ontomainbeforeimplement.The premise of requiring the change folder on the default branch contradicts the existing roadmap architecture, which explicitly supports taking Staged items to ready pull requests (
CONTEXT.md). Over 1,100 existing tests rely on the Staged implementation workflow.