Skip to content

fix(roadmap): a stop in the scoped checks keeps the finished work #3645

Closed

Description

@dan-petty

Problem

A stop in the scoped checks phase discards finished work. The implement job pushes nothing in this phase, so the commits of the finished groups stay in the worktree of the Job. The job then removes that worktree.

Evidence on origin/main at cfcbd3d:

  • _scoped_checks in src/devops_cli/roadmap/implement_run.py sets stop.push = False for each stop in this phase.
  • stop calls _kept_note only when stop.push is true. The stop comment then does not say what the job kept.
  • _keep does not push the wip: commit of the last task of a group. A step that ends done folds its wip: commits into its own commit.
  • test_a_check_that_no_fix_repairs_stops_the_item_and_pushes_nothing asserts that origin holds only the plan commit after two groups passed.
  • test_a_fix_step_that_stops_in_the_scoped_checks_pushes_nothing asserts the same for a fix step that stops.
  • openspec/specs/roadmap-implement-job/spec.md and docs/ROADMAP_WORKFLOW.md state the rule: "The Job pushes only a head that passed."

This is the case of #3020 and #3078 in #3098: all groups are done and a check is red. A budget stop in a fix step of this phase also loses the work. Thus #3054 keeps the work of a stopped group, but not the work of an item whose groups all passed.

Expected

A stop in the scoped checks phase keeps the finished commits on origin, and the next Job continues from them. The stop comment says what the job kept and where. A pull request that holds this work stays a draft, because draft_readiness decides the ready mark. The plan must name the place: the item branch or a separate ref. The plan must also say how the rule "pushes only a head that passed" changes, and why.

Acceptance criteria

  • A test: two groups pass, a scoped check fails after all fix rounds, and origin holds the work of both groups.
  • A test: a fix step that reaches a budget in this phase leaves the work on origin, the item Blocked, and a comment that lists the kept work and the next action.
  • A test: the next Job takes the kept work, runs no finished group again, and runs the scoped checks.
  • A test: the draft of a stop in this phase does not get the ready mark.
  • openspec/specs/roadmap-implement-job/spec.md and docs/ROADMAP_WORKFLOW.md state the new rule.

Existing tool considered

The job already has _push_passed, _kept_note and kept_commits (#3054). This change reuses them and adds no tool.

Related

Moved from #3098, acceptance criteria 3 and 5. Related: #3054, #3043, #3273.

Proposed design

Problem statement

The implement job discards the commits of finished task groups when a scoped check stops the item. _scoped_checks sets stop.push to false, so stop pushes nothing, and the job removes the worktree with the commits. The next Job starts from the staged branch and runs every group again. The change keeps the finished commits on origin, names them in the stop comment, and states the new push rule in the spec and the workflow page.

Acceptance criteria

Requirement: A failed scoped check keeps the finished groups

The job SHALL push the commits of the finished task groups to origin when a scoped check fails after every fix round.

Scenario: Two groups pass and the pre-push check fails

  • WHEN Two task groups pass, repair_rounds is 3, and the pre-push scoped check exits 1 after the third fix round
  • THEN origin holds the item branch with the commits of both groups, the item is Blocked at the step scoped checks, and the stop comment names the branch and the last commit

Requirement: A fix step that spends a budget keeps the work

The job SHALL keep the commits that passed on origin when a fix step in the scoped checks stops with the class limit_reached.

Scenario: A fix step reaches the step token budget

  • WHEN The fix step of a failed scoped check stops because it spent roadmap.implement.step_token_budget
  • THEN origin holds the item branch with the work of the groups, the item is Blocked, and the comment names the kept work and the action left raise_limit

Requirement: An error in the scoped checks keeps the work

The job SHALL push the commits that passed when an error or a command that runs out of time stops the item in the scoped checks.

Scenario: Git fails in the scoped checks

  • WHEN git fails while the job reads the hook configuration in the scoped checks, after the archive
  • THEN origin holds the item branch with the commits of the groups, and the stop comment names the kept work

Requirement: The next Job resumes from the kept work

The next run SHALL take the kept branch from origin, run no step for a group whose every task is ticked, and run the scoped checks.

Scenario: A retry after a stop in the scoped checks

  • WHEN A person comments implement: retry after a stop in the scoped checks, and the next Job takes the item
  • THEN the next Job runs no step for a finished group, runs the scoped checks, and its push holds the commits of the first Job

Requirement: The job does not mark a stopped draft ready

The job SHALL stop the item before _ready and SHALL send no ready request when the scoped checks stop it.

Scenario: A stop in the scoped checks

  • WHEN The scoped checks stop the item after the job pushed the head
  • THEN the job sends no gh pr ready request, and the pull request stays a draft

Requirement: The spec and the workflow page state the new rule

openspec/specs/roadmap-implement-job/spec.md and docs/ROADMAP_WORKFLOW.md SHALL state that a stop in the scoped checks keeps the commits that passed on the item branch, and why.

Scenario: A test reads the two documents

  • WHEN A test reads the two documents
  • THEN neither states that a stop in the scoped checks pushes nothing, and each states that the job keeps the commits that passed on the item branch

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers the need: the change is a small change to the job's own push path, and git, already in use, is the tool that pushes. It reuses _push_passed, _push_with_lease, _publish and kept_commits. The cost is about 40,000 tokens to build the code, the tests and the documents, about 5,000 tokens a year to keep and fix them, and less than one day of elapsed time.

Key questions

  • Where does the job keep the commits that passed when the scoped checks stop the item?: On the item branch, /-, with the push that the job already makes for a stop. (best practice) [sources: src/devops_cli/roadmap/implement_run.py:1460, src/devops_cli/roadmap/implement_run.py:973, CONTEXT.md]
    • Chosen: the item branch. _push_passed, _push_with_lease and _publish already push it, and the next Job takes it from origin with _worktree.
    • Rejected: a separate ref, such as refs/implement/. The next Job must fetch it, merge it and delete it, and no draft pull request shows the work; that is new code for no gain.
    • Rejected: the worktree of the Job. _worktree removes the worktree when the run ends, so the commits are lost.
  • How does the rule "The Job pushes only a head that passed" change?: The job pushes only a head that passed the scoped checks, or the commits that passed at a stop in that phase. A pushed head that failed a scoped check stays a draft, and draft_readiness decides the ready mark. (best practice) [sources: openspec/specs/roadmap-implement-job/spec.md, docs/ROADMAP_WORKFLOW.md, openspec/changes/archive/2026-11-01-3043-runner-hooks-and-scoped-ci/design.md:13]
    • Chosen: push the commits that passed at a stop. The scoped checks are a pre-push filter, and the required checks of the draft pull request stay the gate. A stop loses hours of finished work otherwise.
    • Rejected: keep the rule and push nothing. That is the defect of this issue: the job removes the worktree and the next Job runs every group again.
    • Rejected: push only the wip: commits. After every group passes there are no wip: commits, so the work is still lost.
  • Which stops in the scoped checks keep the work?: Every stop: a check that fails after the last round, a fix step that stops, an error, and a command that runs out of time. (best practice) [sources: src/devops_cli/roadmap/implement_run.py:997, src/devops_cli/roadmap/implement_run.py:1379]
    • Chosen: every stop in the phase. Each of these stops ends the run with the worktree removed, so each loses the same finished work.
    • Rejected: only the exhausted check budget. A fix step that spends a budget and an error in the phase lose the same work.
  • What does the stop comment say about the work that the job kept?: It names the branch on origin and the last commit. When the branch holds wip: commits, it says how many work-in-progress commits it kept. (best practice) [sources: src/devops_cli/roadmap/implement_run.py:927, src/devops_cli/roadmap/implement_run.py:1381, openspec/specs/roadmap-implement-job/spec.md]
    • Chosen: extend _kept_note with a branch fallback. One function and one sentence cover both cases, and the stop calls it once.
    • Rejected: a second note function for this phase. Two places would write the same sentence.
    • Rejected: reuse the wip: message for the group commits. That message names work-in-progress commits, and the kept commits are group commits.
  • Does the pushed head of a stop in the scoped checks get the ready mark?: No. The job stops before _ready, and draft_readiness answers from the checks of the pushed head. (best practice) [sources: src/devops_cli/roadmap/implement_run.py, src/devops_cli/roadmap/implement_pull.py, docs/roadmap/implement.md:72]
    • Chosen: the job stops before _ready and draft_readiness decides. The pushed head failed a scoped check, so its checks refuse or wait, and a draft cannot merge.
    • Rejected: add a rule to draft_readiness for a stopped item. The issue states that the existing function decides, and the checks of a failed head already refuse.
  • Which documents state the new rule?: openspec/specs/roadmap-implement-job/spec.md and docs/ROADMAP_WORKFLOW.md. [sources: openspec/specs/roadmap-implement-job/spec.md, docs/ROADMAP_WORKFLOW.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/high
    effort/medium
    on Nov 5, 2026
  2. dan-petty commented on Nov 5, 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: P1-High. A stop in scoped checks deletes all finished group work, which costs a full re-run of expensive model calls.
    • Value: High. It prevents loss of multiple completed groups of work and the token cost of redoing them.
    • Effort: Medium. The building blocks (_push_passed, _kept_note, kept_commits) already exist from #3054; the change reuses them and updates tests, specs, and docs.
    • Related: feat(roadmap): the implement job keeps, classifies and continues a partial implementation #3098, which asks for a different change. Both are about the implement job keeping partial work on stop; #3098 is the umbrella covering all stop phases, while this candidate covers only the scoped-checks phase.
  3. added
    priority/p1-high
    on Nov 5, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 5, 2026
  5. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

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

  6. added
    status/in-progress
    and removed
    status/ready
    on Nov 6, 2026
  7. added
    status/in-review
    and removed
    status/in-progress
    on Nov 6, 2026
  8. removed
    status/in-review
    on Nov 6, 2026
  9. 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/mediumpriority/p1-highscope/roadmapsource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions