Repository navigation
Description
Problem Description
In src/devops_cli/roadmap/implement/implement_pull.py, kind_of(item, pull) determines whether a pull request is evaluated as DraftKind.PERSON, DraftKind.AGENT, DraftKind.IMPLEMENT, or DraftKind.STAGE_PLAN:
pull_str = str(pull) if pull is not None else None
if pull_str and item.job_record.get(ImplementRecordKey.PR) == pull_str:
return DraftKind.IMPLEMENT
if pull_str and item.job_record.get(StageRecordKey.PR) == pull_str:
return DraftKind.STAGE_PLANWhen a runner Job records implement.pr equal to stage.pr (e.g. from an erroneous or failed implementation attempt on a staged branch), kind_of() returns DraftKind.IMPLEMENT.
Consequently:
_judge_completeness()treats the pull request as an implementation draft and refuses readiness if any task group is unticked or if the change is not archived.devops pr check-readinessfails with errors for all unticked task groups.stage_readyanddevops pr readycannot mark the stage plan pull request ready.
kind_of() should verify whether the pull request is actually a stage plan pull request (e.g., matching the title prefix docs(openspec): plan or checking that the pull request diff only contains unarchived files under openspec/changes/<change>/), so a collision does not permanently block the stage plan pull request.
Reproduction Steps
- An item has
stage.prset to a plan pull request. - A runner job sets
implement.prto the same number and stops. - Run
devops pr check-readiness <pr>. - Observe that
kind_of()classifies the plan pull request asimplement, causing readiness checks to fail on unticked task groups.
Expected vs Actual Behavior
Expected: A pull request that plans an item (docs(openspec): plan #...) is classified as DraftKind.STAGE_PLAN and evaluated without requiring implementation tasks to be ticked.
Actual: The pull request is classified as DraftKind.IMPLEMENT and permanently fails readiness.
Environment Diagnostics
- DevOps CLI Version: 0.83.2
- Python Version: 3.14.10
- OS & Architecture: Linux x86_64
- Execution Environment: CLI / CI
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
A runner Job can record the stage plan pull request number as implement.pr. Then kind_of returns DraftKind.IMPLEMENT. Readiness checks then demand ticked tasks and the stage plan pull request cannot become ready. The fix uses the pull request title to break the tie.
Acceptance criteria
Requirement: Stage plan title wins a collision
When implement.pr and stage.pr hold the same pull request number, kind_of SHALL return DraftKind.STAGE_PLAN if the pull request title starts with docs(openspec): plan.
Scenario: Colliding plan title
- WHEN
kind_ofreceives an item whoseimplement.prandstage.prequal the pull request and a title that starts withdocs(openspec): plan - THEN it returns
DraftKind.STAGE_PLAN.
Requirement: Implement title keeps a collision as implement
When implement.pr and stage.pr hold the same pull request number, kind_of SHALL return DraftKind.IMPLEMENT if the title does not start with docs(openspec): plan.
Scenario: Colliding implement title
- WHEN
kind_ofreceives an item whoseimplement.prandstage.prequal the pull request and a title that starts withfix(roadmap): - THEN it returns
DraftKind.IMPLEMENT.
Requirement: Read draft passes the pull request title
read_draft SHALL pass the pull request title to kind_of for classification.
Scenario: Read a colliding plan pull request
- WHEN
read_draftreads a pull request whose title starts withdocs(openspec): planand whose number both records hold - THEN the returned
Draft.kindisDraftKind.STAGE_PLAN.
Requirement: Stage plan readiness ignores unticked tasks
draft_readiness SHALL NOT refuse a DraftKind.STAGE_PLAN draft because a task group is unticked.
Scenario: Stage plan with unticked tasks
- WHEN
draft_readinessreceives a stage plan draft with unticked task groups and passing checks - THEN it returns
Readiness(Answer.READY).
Requirement: Implement readiness keeps task checks
draft_readiness SHALL refuse an implement draft when a task group is unticked.
Scenario: Implement draft with unticked tasks
- WHEN
draft_readinessreceives an implement draft with an unticked task group - THEN it returns
Readiness(Answer.REFUSE)with the unticked group in the reason.
Requirement: Check readiness accepts a colliding stage plan
devops pr check-readiness SHALL classify a colliding stage plan pull request as a stage plan and SHALL NOT report unticked task groups.
Scenario: Check readiness on a colliding plan
- WHEN the command runs on a pull request whose title starts with
docs(openspec): planand whose number both records hold - THEN the output contains no unticked task group error.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers this need. GitHub CLI supplies pull request data, but it does not classify draft readiness. The change corrects existing code. The estimated cost is about 1,500 output tokens and 20 minutes of elapsed work.
Key questions
- How does
kind_ofresolve a pull request number that bothimplement.prandstage.prhold?: Use the pull request title. ReturnDraftKind.STAGE_PLANwhen the title starts withdocs(openspec): plan. Otherwise returnDraftKind.IMPLEMENT. (best practice) [sources: src/devops_cli/roadmap/implement/implement_pull.py, CONTEXT.md, docs/ROADMAP_WORKFLOW.md]- Chosen: Check the stage plan title prefix. The title type is the recorded marker of a plan pull request, and the check needs no diff fetch.
- Rejected: Prefer
stage.prwhen both fields match. This can misclassify a real implement pull request whenstage.pris stale. - Rejected: Inspect changed files for only unarchived
openspec/changesfiles. An early implement pull request can also change only the change folder, and the check needs an extra API call.
- Where does the fix apply?: Fix
kind_ofand give it the title fromread_draft. Keep_judge_completenessunchanged. (best practice) [sources: src/devops_cli/roadmap/implement/implement_pull.py]- Chosen: Fix
kind_ofand pass the title fromread_draft. One classification point servespr check-readiness,stage_readyanddevops pr ready. - Rejected: Add a second check in
_judge_completeness. It hides the wrong kind and leaves other callers with the wrong result.
- Chosen: Fix
- What marks a stage plan pull request?: The stage plan pull request has the type
docs(openspec)and its summary starts withplan. [sources: CONTEXT.md, docs/ROADMAP_WORKFLOW.md] - Does the fix need a new external library?: No. The fix uses the GitHub client data in
read_draft. It adds no dependency. [sources: src/devops_cli/roadmap/implement/implement_pull.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.A stage plan PR is permanently blocked from readiness, but only in a specific PR-number collision scenario.Unblocks a workflow that is otherwise stuck with no recovery path for the affected item.Requires adding a verification check (title prefix or diff inspection) to one function in one file.Both address the implement.pr equals stage.pr collision; 4041 prevents the implement job from taking the item, while the candidate fixes kind_of() to classify the PR correctly.devops-cli-service commentedon Nov 8, 2026
Status set to Ready at 3181b22 (see proposed design in issue body).
devops-cli-service commentedon Nov 10, 2026
Alternatives check: none
Reason: One search found no tool for this need. The issue is a bug in project-specific logic:
kind_of()must tell a roadmap stage plan PR from an implement PR whenimplement.prandstage.prhold the same number. The planned fix is a title-prefix check on the project's own code, so no external library applies.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.
devops-cli-service commentedon Nov 18, 2026
Released in v0.176.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.176.0
devops-cli-service commentedon Nov 18, 2026
Live since 2026-11-18 13:25 UTC