Repository navigation
Description
Problem Description
When an implement step stops after committing earlier task groups, _push_passed calls _publish.
The function _publish creates a draft pull request with the body Work on #{number}. The job closes the issue in the body when it finishes.
Because the step stopped, _finish_change and _pull_request never run.
The draft pull request remains on GitHub without a Closes #{number} trailer.
The active change folder in openspec/changes/ remains unarchived.
As a result, devops pr check-readiness reports the pull request as ungrounded.
When the item stop is cleared, the implement job does not reconcile the draft pull request body.
This left pull request #3172 in an ungrounded draft state.
Reproduction Steps
- Run an item with two or more task groups where group 1 succeeds and group 2 stops.
- Inspect the created pull request on GitHub.
- Observe the pull request body contains
Work on #{number}instead ofCloses #{number}. - Run
devops pr check-readiness <pr_number>. - Observe grounding failure:
PR is not grounded: it closes no issue.
Expected vs Actual Behavior
Expected the draft pull request to remain valid under grounding checks or be reconciled upon item resumption.
Actual behavior leaves an ungrounded draft pull request that blocks merge evaluation.
Target Subsystem
src/devops_cli/roadmap/implement_run.py, src/devops_cli/github/merge_readiness.py
Existing Tool Considered
None. This is internal implement job and draft pull request choreography.
The cost to fix is adjusting the draft pull request creation body or updating the body during stop handling.
Proposed design
Problem statement
A stopped implement run can leave the draft pull request of a Planned item without a closing keyword. devops pr check-readiness then reports the pull request as ungrounded, and the item cannot reach review. The fix makes _publish send a body that holds the closing keyword, whatever the message text holds.
Acceptance criteria
Requirement: Draft body holds the closing keyword
The implement job SHALL send a draft pull request body that holds the closing keyword for the item number.
Scenario: Message without a keyword
- WHEN the draft body message holds no closing keyword and
_publishopens the draft of a Planned item - THEN the body sent to
create_draft_pullends with aCloses #trailer for that item.
Requirement: One closing keyword only
The implement job MUST NOT add a second closing keyword to a draft body that already holds one.
Scenario: Message with a keyword
- WHEN the draft body message already holds
Closes #and_publishopens the draft - THEN the body sent to
create_draft_pullholds exactly one closing keyword.
Requirement: Stop keeps the draft grounded
A stop after the first push SHALL leave the body of the draft pull request with the closing keyword.
Scenario: Stop after publish
- WHEN a step stops after
_publishcreated the draft pull request - THEN the last body written to that pull request holds
Closes #.
Requirement: Final body replaces the draft body
The implement job MUST replace the draft body with the final body that holds the closing keyword and the archived change folder name.
Scenario: Finished run
- WHEN the run archives the change and calls
_pull_request - THEN the body sent to
update_pullholdsCloses #and the archived change folder name.
Requirement: Readiness rejects an ungrounded pull request
The readiness check MUST report a pull request that closes no issue as ungrounded.
Scenario: Body without a closing keyword
- WHEN
assess_merge_readinessreads a pull request whose body closes no issue - THEN the verdict holds a
GROUNDINGblocker that says the pull request closes no issue.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers the choreography of the implement job and its draft pull request. The change edits _publish and adds tests, and it builds no component. Cost: about 3,000 tokens to write, about 1,000 tokens a year to keep, and less than one day of elapsed time.
Key questions
- Why did the stage job find that the premise of the issue does not hold at the staging commit?: The return names no commit, file or body text, so the cause stays open. The change no longer depends on the message text:
_publishtests the formatted body withclosing_keyword_inand adds the trailer when the body holds none. The next investigation readsimplement_pull_body_draftand the log of_publishat the staging commit. [sources: src/devops_cli/roadmap/implement_run.py] - Which function creates the draft pull request of a Planned item?:
_publishcreates it._push_passedcalls_publishwhen a Planned item has a commit and no recorded pull request, and_pushcalls it at the first push. The body comes fromMESSAGES.roadmap.implement_pull_body_draft. [sources: src/devops_cli/roadmap/implement_run.py] - How does the job give the draft body a closing keyword when the message text may hold none?: Test the formatted body with
closing_keyword_in, and add aCloses #trailer when it holds no closing keyword. (best practice) [sources: src/devops_cli/roadmap/implement_run.py, src/devops_cli/roadmap/stage_change.py]- Chosen: Test the formatted body with
closing_keyword_inand add a trailer when it holds none. The body is grounded from the first push, whatever the message text holds, and the call stays one write. - Rejected: Add the keyword to
implement_pull_body_draftalone. The stage job found the premise unproven, so the message text may already hold the keyword, and a second keyword would result. - Rejected: Update the body during stop handling. The body stays ungrounded between the first push and the stop, and the job needs a read of the pull request.
- Rejected: Excuse a draft pull request in the grounding check. It weakens the gate for every draft pull request and hides the missing keyword.
- Chosen: Test the formatted body with
- Does
merge_readiness.pyneed a change?: No._judge_groundingalready blocks a pull request that closes no issue withBlockerKind.GROUNDING. The grounded draft body passes that check. [sources: src/devops_cli/github/merge_readiness.py] - Does the final body still replace the draft body?: Yes.
_pull_requestwrites the title and the body after the archive. That body holds the closing keyword and the archived change folder name. [sources: src/devops_cli/roadmap/implement_run.py] - Does the fix change the draft pull request of the stage job?: No. The stage job opens its own draft with the title
docs(openspec), and_judge_groundingjudges a plan withplan_blockers, which reads no closing issue._publishruns only in the implement job. [sources: src/devops_cli/github/merge_readiness.py, src/devops_cli/roadmap/implement_run.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-06: none.
Tool: none found.
Activity
dan-petty commentedon Nov 2, 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 stopped step leaves a draft PR that blocks merge evaluation, but only in the stop scenario and a manual edit is a workaround.It breaks grounding checks and blocks merge evaluation for affected pull requests, but only when a step stops mid-run.The fix is adjusting the PR creation body string or updating the body during stop handling in one or two files.Both deal with what happens when an implement step stops, but #3098 asks to keep, classify, and continue partial work while the candidate asks to fix the draft PR body so it passes grounding checks.devops-cli-service commentedon Nov 3, 2026
Status set to Ready at 1b3184b (see proposed design in issue body).
devops-cli-service commentedon Nov 3, 2026
The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.
Evidence:
PROBE
4 remaining items
test(roadmap): the first draft body of a planned item closes its issue (
docs(openspec): plan the grounded draft of a stopped step (#3273)
fix(roadmap): the draft of a stopped step closes its issue (#3273)
docs(openspec): archive the change (#3273)
fix(roadmap): wrap the _publish docstring (#3273)
test(roadmap): the first draft body of a planned item closes its issue (
devops-cli-service commentedon Nov 6, 2026
Released in v0.72.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.72.0
devops-cli-service commentedon Nov 6, 2026
Live since 2026-11-06 19:47 UTC