Skip to content

fix(roadmap): stopped step creates ungrounded draft PR #3273

Closed

Description

@dan-petty

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

  1. Run an item with two or more task groups where group 1 succeeds and group 2 stops.
  2. Inspect the created pull request on GitHub.
  3. Observe the pull request body contains Work on #{number} instead of Closes #{number}.
  4. Run devops pr check-readiness <pr_number>.
  5. 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 _publish opens the draft of a Planned item
  • THEN the body sent to create_draft_pull ends with a Closes # 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 _publish opens the draft
  • THEN the body sent to create_draft_pull holds 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 _publish created 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_pull holds Closes # 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_readiness reads a pull request whose body closes no issue
  • THEN the verdict holds a GROUNDING blocker 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: _publish tests the formatted body with closing_keyword_in and adds the trailer when the body holds none. The next investigation reads implement_pull_body_draft and the log of _publish at the staging commit. [sources: src/devops_cli/roadmap/implement_run.py]
  • Which function creates the draft pull request of a Planned item?: _publish creates it. _push_passed calls _publish when a Planned item has a commit and no recorded pull request, and _push calls it at the first push. The body comes from MESSAGES.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 a Closes # 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_in and 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_draft alone. 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.
  • Does merge_readiness.py need a change?: No. _judge_grounding already blocks a pull request that closes no issue with BlockerKind.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_request writes 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_grounding judges a plan with plan_blockers, which reads no closing issue. _publish runs 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

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 2, 2026
  2. dan-petty commented on Nov 2, 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. A stopped step leaves a draft PR that blocks merge evaluation, but only in the stop scenario and a manual edit is a workaround.
    • Value: Medium. It breaks grounding checks and blocks merge evaluation for affected pull requests, but only when a step stops mid-run.
    • Effort: Low. The fix is adjusting the PR creation body string or updating the body during stop handling in one or two files.
    • Related: feat(roadmap): the implement job keeps, classifies and continues a partial implementation #3098, which asks for a different change. 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.
  3. added
    priority/p2-medium
    on Nov 2, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 3, 2026
  5. devops-cli-service commented on Nov 3, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    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

  7. added
    status/new
    and removed
    status/ready
    status/new
    on Nov 3, 2026
  8. 4 remaining items

  9. added
    status/in-progress
    and removed
    status/ready
    on Nov 6, 2026
  10. added
    status/in-review
    and removed
    status/in-progress
    on Nov 6, 2026
  11. removed
    status/in-review
    owner/agent
    on Nov 6, 2026
  12. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor
  13. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-06 19:47 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