Skip to content

feat(roadmap): checkpoint each passed group on origin #3677

Closed

Description

@devops-cli-service

Split from #3062. Decided on 2026-11-06 with best practice (see the comment of that date). Code and documents read at origin/main 29309f0.

Problem or Motivation

_groups in src/devops_cli/roadmap/implement_run.py records a passed group with _record, but _record does not push. A wip: push (#3054) happens only while tasks of a group are unticked. So a group of one task has no copy on origin until the final push.

Reading the code at 29309f0 gives this case. An item has 4 groups of one task each. The runner is killed in group 3. Origin holds only the staged plan, or nothing for a Planned item. Groups 1 and 2 are lost. The continuation Job (#3721, merged) runs them again.

I did not run this case at 29309f0. A test for it is the first test of this item (see the criteria).

Proposed Solution & Architectural Design

Push each passed group to the item branch. Withdraw the pushes when a premise returns the item. The item branch is the place that #3054 uses and that #3645 chose.

  1. Checkpoint. Add _checkpoint() to _ItemRun. It calls _push_passed(). A failed push goes to the log and the run goes on, as _keep does. After one failed push, the run makes no more checkpoint pushes. The final push still runs.
  2. Place. In _groups, call _require_unclaimed first, then _check_premise, then _checkpoint(). Do this before each group. The claim check comes first, so a claim that the check sees pushes nothing. The premise check comes second, so a false premise wastes no push.
  3. End boundary. Leave the end boundary as it is. It calls only _require_unclaimed. _push follows and runs the scoped checks before it pushes. So the last group reaches origin after the scoped checks, as it does now.
  4. Base. In _start, write implement.base in the existing marks write when the record has none. For a Staged item, the value is the sha of origin/<branch>. For a Planned item, the value is new. This adds no request. _ready clears implement.base with its other marks. The return of an item clears it too.
  5. Withdraw. Add _withdraw() and call it in _return_to_new, before apply_return. Both returns then use it: the premise request (_return_premise) and the behavior-group check (_check_premise).
    • implement.base is a sha and origin/<branch> differs: git push --force-with-lease=<branch>:<tracking tip> origin <base>:refs/heads/<branch>. The lease value is the local ref origin/<branch>. It holds the head that the job last pushed. A push of a person after that makes the lease fail.
    • implement.base is new: read the remote with git ls-remote --heads origin <branch>. If the branch is there, run git push origin --delete <branch>, then close_pull(repo, pull) when a pull request is recorded. If the branch is not there, do nothing. A refused draft has already removed it.
    • A git or GitHub error, or a failed lease: raise _StopError with push=False. The item is Blocked and is not returned to New. The reason is a new string in src/devops_cli/lang/en/messages.py.
    • The return then clears implement.base with the other keys.
  6. No other code change. _push_passed, _push_with_lease, _publish, recorded_branch and the resume path stay as they are. The next Job already takes the branch and runs the groups that are not ticked.

Rejected: a hidden ref such as refs/devops/wip/<issue>. It needs fetch, ancestry and reset code in _start. It needs cleanup on finish, claim and premise, and a sweep for refs of dead Jobs. It makes a second place for progress next to the wip: commits. I could not test a push of a custom ref to a real GitHub remote.

Known limit: a kill in the docs step, the archive step or the scoped checks loses the last group. It is pushed only after the scoped checks. This keeps the rule that a pushed head passed them, apart from the checkpoints.

Order of work: #3645 first (see Dependencies).

Acceptance criteria

Each line is a test.

  • A replay has 4 groups of one task and a runner killed in group 3. Then groups 1 and 2 are on the item branch of origin. Test test_a_runner_killed_after_two_of_four_groups_leaves_both_groups_on_origin.
  • A second Job after that kill runs groups 3 and 4 only. The item reaches ready. Test test_a_second_job_runs_only_the_groups_that_are_left.
  • The same two tests pass for a Planned item (planned_world). One draft pull request opens at the first checkpoint. The second Job is routed as a Staged item.
  • A claim that the check sees at a boundary pushes nothing at that boundary. It opens no pull request.
  • A claim comes during group 2, after the checkpoint of group 1. The Job ends with group 1 on the branch. It makes no further push and no Status change. A Planned item keeps its draft.
  • A false premise in group 2 of a Staged item restores the tip that implement.base holds. Test test_false_premise_on_staged_item_after_group_1_leaves_old_tip_and_clears_group passes unchanged.
  • A false premise in group 2 of a Planned item deletes the branch and closes the draft pull request. implement.base is cleared.
  • The _check_premise path does the same for a Staged item and for a Planned item. A behavior group 2 adds a guard that the branch defines, after the checkpoint of group 1. The item returns to New, and the branch is restored or deleted.
  • A person pushes to the branch between the checkpoint and the withdraw. The lease fails. The item is Blocked, is not returned, and the push of the person stays.
  • A withdraw that fails for any other reason stops the item as Blocked and does not return it to New.
  • A push that fails at a boundary does not stop the run. The run makes no further checkpoint push.
  • GitHub refuses the draft at the first checkpoint of a Planned item. The run asks for the draft once, then makes no more checkpoint pushes. The final push stops the item as it does now.
  • A Planned withdraw finds no branch on origin after a refused draft. It does nothing and does not fail.
  • The end boundary pushes nothing. Only _push pushes after the docs and the archive, and only after the scoped checks.
  • implement.base is written once, is cleared at ready and at a return, and holds no secret.
  • The spec and the documents below state the checkpoint and the withdraw.

Target Subsystem

  • src/devops_cli/roadmap/implement_run.py
  • src/devops_cli/roadmap/store.py: ImplementRecordKey.BASE and the docstring of the class, which lists the keys.
  • src/devops_cli/lang/en/messages.py: the reason of a failed withdraw.
  • The specs roadmap-implement-job and roadmap-item-claim.
  • docs/ROADMAP_WORKFLOW.md: the claim sentence, the "Before the push" bullet and the list of return actions. Also the table of record keys: add a row for implement.base.
  • docs/roadmap/implement.md: the paragraphs "The premise of a behavior group", "A plan request" and "Claims".

Requirements to amend

Spec Requirement Change
roadmap-item-claim A claim of a person or an agent ends the Job at the next group boundary "it SHALL push nothing, open no pull request" becomes "it SHALL push nothing more and open no pull request". Add: a checkpoint that an earlier boundary pushed stays, and the job does not remove it.
roadmap-item-claim scenario "A person claims while group 1 runs" The job pushes nothing at that boundary. The same words stay true. Check the text against the new sentence.
roadmap-item-claim scenario "A claim after the last group" The job does not push the last group and does not mark a pull request ready. Groups that passed before stay on the branch.
roadmap-item-claim scenario "A claim while a group runs and fails" The job pushes nothing at the stop. Earlier checkpoints stay.
roadmap-item-claim new scenario "A claim after a checkpoint" A person claims during group 2, after group 1 was pushed. Group 1 stays on the branch. A Planned item keeps its draft. The job sets no Status.
roadmap-implement-job A false premise returns the item to New "It SHALL push nothing" becomes "It SHALL withdraw the checkpoints". Staged: restore the tip in implement.base. Planned: delete the branch and close the draft pull request. The clear list gets implement.base. New scenarios: Planned after a checkpoint, a failed withdraw, and a person who pushed after the checkpoint.
roadmap-implement-job The job checks the premise of a behavior group at the branch tip New scenario: the guard premise fails in group 2 after a checkpoint. The job withdraws the checkpoints and returns the item.
roadmap-implement-job The job record Add implement.base.
roadmap-implement-job The job runs the scoped checks before it pushes The last sentence gets one exception: a checkpoint of a group that passed its step. #3645 edits the same sentence. Build on its text.
roadmap-implement-job The job pushes the work in progress of a step The commit that ticks the last task waits for the next checkpoint, the push of the stop or the push of the end.
roadmap-implement-job New: The job checkpoints each passed group on the item branch The criteria above, as WHEN/THEN scenarios.

Documents: state the checkpoint and the withdraw in the places named under Target Subsystem.

Not amended here: the four scoped-stop scenarios ("pushes nothing"). #3645 rewrites them.

Tests to change

On 69aa24d, a scratch version of the change made 11 tests in tests/roadmap fail. That version put a push at the end boundary too. The final design does not, and the code moved to 29309f0. I did not re-run the count. Count again when you build. These tests are the likely set:

  • Claim, in tests/roadmap/test_roadmap_implement_job.py: test_a_claim_made_while_the_last_group_runs_ends_the_job_before_the_push, test_a_claim_made_while_the_docs_are_generated_ends_the_job_before_the_push, and test_a_claim_made_while_a_group_runs_beats_the_stop_of_that_group, for job_world and planned_world. Some of them may pass without a change, because the end boundary pushes nothing.
  • Push count and order: test_the_push_runs_in_the_worktree_with_a_lease_and_leaves_no_worktree_behind (in test_roadmap_implement_job.py). Its single push may become one push for each checkpoint.
  • Push order, in tests/roadmap/test_roadmap_implement_job_scoped.py: test_the_scoped_checks_run_in_the_worktree_after_the_last_commit_and_before_the_push and test_an_ast_grep_violation_is_repaired_before_the_first_push.
  • Scoped stops, in the same file: test_a_hook_stage_that_runs_out_of_time_in_a_fix_step_pushes_nothing, test_an_error_in_the_scoped_checks_pushes_nothing, test_a_fix_step_that_stops_in_the_scoped_checks_pushes_nothing and test_a_check_that_no_fix_repairs_stops_the_item_and_pushes_nothing. fix(roadmap): a stop in the scoped checks keeps the finished work #3645 rewrites these four. Do not change them in this item.
  • Premise, in tests/roadmap/test_roadmap_implement_amend_job.py: test_false_premise_on_staged_item_after_group_1_leaves_old_tip_and_clears_group must pass unchanged.

New tests: the fail-to-pass pair (in tests/roadmap/test_roadmap_implement_checkpoint.py) and its Planned variant. Also tests for these cases: the Staged and Planned withdraw for both returns, the failed withdraw, and the push of a person before the withdraw. The last two are the refused draft and the claim after a checkpoint.

Cost and failure modes

  • GitHub requests, Staged: no more. Planned: the draft opens at the first checkpoint, not at the end. A refused draft costs one create_draft_pull request and one branch delete. The run then makes no more checkpoint pushes. A Planned withdraw costs one ls-remote and one close_pull.
  • CI: each push starts CI on the draft. .github/workflows/ci.yml sets cancel-in-progress: true, so one run is active at most. I read this in the file. I did not measure it.
  • A person who pushes to the branch makes the lease of a checkpoint fail. The run logs it and goes on. The same push makes the lease of the withdraw fail, and the item is Blocked. The push of the person stays.
  • A head that failed no scoped check yet is on origin as a draft. draft_readiness still decides the ready mark.
  • A kill between the first push of a Planned item and the write of implement.pr leaves a branch with no record. _publish has this window now. I read it in the code and did not test it. This item does not widen it.
  • Not tested: a real GitHub remote. I ran the lease restore on a local bare origin. It restored the tip when the job was the last to push. It was refused when a person had pushed after the job.

Existing Tool Considered

Plain git: git push with a lease, which the job already uses. No open tool covers a checkpoint of one run in git. Temporal is rejected by ADR 0008. langgraph was rejected in #3054 for its own store. A hidden ref is plain git too, and was rejected above for its extra code.

Cost to build: about 40,000 tokens. That covers about 50 lines of code, 11 spec edits, a few test edits and about 10 new tests. The time is under one day, with two CI runs. Cost to keep: about 3,000 tokens each quarter. Cost to fix one miss: about 10,000 tokens.

Dependencies

Blocked by #3645. It rewrites the scoped-stop scenarios and the sentence "pushes only a head that passed". If #3645 is rejected, drop the block. Then amend those four tests and that sentence here.

Fits in one pull request.

Proposed design

Problem statement

The implement job records a passed group but does not push it. A group of one task can be lost when the runner dies before the final push. The change checkpoints each passed group on the item branch and withdraws the checkpoints when a premise returns the item.

Acceptance criteria

Requirement: Checkpoint each passed group

The implement job SHALL push each passed task group to the item branch before it starts the next group.

Scenario: A runner is killed after two of four one-task groups

  • WHEN An item has four groups of one task each, and the runner is killed in group 3.
  • THEN The item branch on origin holds the commits of groups 1 and 2.

Requirement: Resume from the last checkpoint

A second implement job SHALL run only the groups that are not ticked on the item branch.

Scenario: A second job after a kill

  • WHEN A first job is killed after group 2 of four groups, and a second job takes the item.
  • THEN The second job runs groups 3 and 4 only, and the item reaches ready.

Requirement: Checkpoint a Planned item

The implement job MUST publish a Planned item at its first checkpoint and route a second job as a Staged item.

Scenario: A Planned item with a killed runner

  • WHEN A Planned item has four groups of one task, and its runner is killed in group 3.
  • THEN One draft pull request opens at the first checkpoint, and a second job takes the branch as a Staged item.

Requirement: Claim before checkpoint

A claim that the job sees at a group boundary SHALL stop the job before any checkpoint push at that boundary.

Scenario: A person claims at a boundary

  • WHEN A person claims the item before a group boundary, and the job checks the claim.
  • THEN The job pushes nothing at that boundary and opens no pull request.

Requirement: Claim after a checkpoint

A claim that the job sees after an earlier checkpoint SHALL keep the earlier checkpoint on the item branch.

Scenario: A person claims during group 2

  • WHEN A person claims during group 2, after the checkpoint of group 1.
  • THEN Group 1 stays on the item branch, the job makes no further push and sets no Status, and a Planned item keeps its draft.

Requirement: Withdraw a Staged checkpoint

A false premise in a Staged item SHALL restore the tip that implement.base holds and clear the group record.

Scenario: False premise in group 2 of a Staged item

  • WHEN Group 1 passes and a later group finds a false premise.
  • THEN The item branch returns to the tip in implement.base, and implement.group is cleared.

Requirement: Withdraw a Planned checkpoint

A false premise in a Planned item SHALL delete the item branch and close the recorded draft pull request.

Scenario: False premise in group 2 of a Planned item

  • WHEN Group 1 passes, the first checkpoint opens a draft, and a later group finds a false premise.
  • THEN The job deletes the item branch, closes the draft pull request, and clears implement.base.

Requirement: Withdraw from the premise check

The _check_premise path SHALL use the same withdraw as the premise request.

Scenario: A behavior group adds a defined guard after a checkpoint

  • WHEN Group 1 passes, and group 2 adds a guard that the branch already defines.
  • THEN The job returns the item to New and restores or deletes the branch as the item type requires.

Requirement: Lease refusal on withdraw

A withdraw MUST fail when a person pushed to the item branch after the checkpoint.

Scenario: A person pushes before the withdraw

  • WHEN A person pushes to the item branch after a checkpoint, and the job then withdraws.
  • THEN The lease fails, the item is Blocked, the job does not return the item, and the push of the person stays.

Requirement: Failed withdraw

A withdraw that fails for any other reason SHALL stop the item as Blocked and SHALL NOT return it to New.

Scenario: A withdraw command fails

  • WHEN The withdraw command fails with an error that is not a failed lease.
  • THEN The item is Blocked and is not returned to New.

Requirement: Checkpoint push failure

A failed checkpoint push SHALL NOT stop the run, and the run SHALL make no more checkpoint pushes.

Scenario: A checkpoint push fails

  • WHEN A checkpoint push fails at a group boundary.
  • THEN The run logs the failure, goes on, and makes no further checkpoint push.

Requirement: Refused draft at first checkpoint

The job SHALL ask for a Planned item's draft once, and SHALL make no more checkpoint pushes after GitHub refuses it.

Scenario: GitHub refuses the draft

  • WHEN GitHub refuses the draft at the first checkpoint of a Planned item.
  • THEN The run asks once, makes no more checkpoint pushes, and the final push stops the item as it does now.

Requirement: Planned withdraw with no branch

A Planned withdraw SHALL do nothing when origin has no item branch.

Scenario: A refused draft leaves no branch

  • WHEN A Planned withdraw finds no item branch on origin after a refused draft.
  • THEN The withdraw does nothing and does not fail.

Requirement: End boundary

The end boundary SHALL push nothing, and only the final push SHALL push after the docs, the archive and the scoped checks.

Scenario: The last group passes

  • WHEN The last group passes and the job reaches the end boundary.
  • THEN The end boundary pushes nothing, and only _push pushes after the scoped checks.

Requirement: Record base

The job SHALL write implement.base once in _start and SHALL clear it at ready and at a return.

Scenario: The job writes and clears the base

  • WHEN The job starts an item and later reaches ready or returns it to New.
  • THEN implement.base holds the start tip or new during the run, and it is cleared at ready and at the return.

Requirement: Documentation and specs

The specs and the named documents SHALL state the checkpoint and the withdraw.

Scenario: The change is built

  • WHEN A reader opens roadmap-implement-job, roadmap-item-claim, docs/ROADMAP_WORKFLOW.md and docs/roadmap/implement.md.
  • THEN Each states the checkpoint and the withdraw in the places named in the issue.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers a checkpoint of one implement run in git. Plain git with git push and a lease covers it, and the job already uses it. It lacks an automatic checkpoint of each passed group, so the job adds about 50 lines and tests. Cost to build: about 40,000 tokens and under one day. Cost to keep: about 3,000 tokens each quarter. Cost to fix one miss: about 10,000 tokens.

Key questions

  • Where should the job keep the progress of each passed group?: On the item branch. The job pushes each passed group to the item branch and withdraws the checkpoints on a premise return. A hidden ref adds fetch, ancestry, reset and cleanup code. (best practice) [sources: src/devops_cli/roadmap/implement_run.py, docs/ROADMAP_WORKFLOW.md, CONTEXT.md]
  • How should the job record the tip that a Staged withdraw restores?: Write implement.base in _start in the existing marks write. For a Staged item, the value is the sha of origin/<branch>. For a Planned item, the value is new. A Staged withdraw pushes that sha with a lease on the local origin/<branch> tip. (best practice) [sources: src/devops_cli/roadmap/implement_run.py, src/devops_cli/roadmap/store.py]
    • Chosen: Record the base sha. It needs no extra request and gives the withdraw the exact tip to restore.
    • Rejected: Read the remote at withdraw. The remote tip is the checkpoint, not the base tip.
    • Rejected: Use the reflog. The reflog is local and does not survive a new Job.
  • How should a Planned withdraw remove the checkpoint?: When implement.base is new, read the remote with git ls-remote --heads origin <branch>. If the branch exists, delete it and close the recorded draft pull request. If it does not exist, do nothing. (best practice) [sources: src/devops_cli/roadmap/implement_run.py, src/devops_cli/roadmap/store.py, docs/ROADMAP_WORKFLOW.md]
    • Chosen: Delete the branch and close the draft. A Planned item had no branch before the run, so the withdraw restores that state.
    • Rejected: Leave the branch. The item would keep a branch and a draft that its return to New did not create.
    • Rejected: Reset the branch to the default branch. The branch must not exist for a Planned item.
  • What should happen when a checkpoint push fails?: The job logs the failure and the run goes on. After one failed checkpoint push, the run makes no more checkpoint pushes. The final push still runs. (best practice) [sources: src/devops_cli/roadmap/implement_run.py, docs/ROADMAP_WORKFLOW.md]
    • Chosen: Log and continue, then suppress further checkpoints. A checkpoint is best effort. A failed push must not discard a group that can still run.
    • Rejected: Stop the item. A checkpoint failure is not a reason to discard the remaining groups.
    • Rejected: Retry at every boundary. A repeated failure wastes requests and can hide the first cause.
  • What should happen when a withdraw cannot complete?: Raise _StopError with push=False. The item is Blocked and is not returned to New. A failed lease keeps the push of the person. (best practice) [sources: src/devops_cli/roadmap/implement_run.py, docs/ROADMAP_WORKFLOW.md]
    • Chosen: Stop as Blocked and keep the person's push. The job cannot name a safe tip to restore after a person pushed.
    • Rejected: Force the restore. It would overwrite the push of a person.
    • Rejected: Return to New anyway. The item would lose the evidence of the failed withdraw.
  • Does the end boundary need a checkpoint push?: No. The end boundary calls only _require_unclaimed. _push follows and runs the scoped checks before it pushes. So the last group reaches origin after the scoped checks. (best practice) [sources: src/devops_cli/roadmap/implement_run.py, docs/ROADMAP_WORKFLOW.md]
    • Chosen: Leave the end boundary as it is. _push already pushes after the scoped checks, and a second push at the boundary would break the rule that a pushed head passed the checks.
    • Rejected: Push at the end boundary. It would put a head on origin before the scoped checks.
  • What does a claim after a checkpoint do?: The claim check runs before the checkpoint at each boundary. A claim that the check sees stops the job with no push at that boundary. Groups pushed before it stay on the branch. A Planned item keeps its draft. The job sets no Status. (best practice) [sources: src/devops_cli/roadmap/implement_run.py, docs/ROADMAP_WORKFLOW.md, docs/roadmap/implement.md]
    • Chosen: Keep earlier checkpoints. The new owner starts from the branch on origin and does not lose passed groups.
    • Rejected: Remove earlier checkpoints. The job no longer owns the item and cannot name a safe restore.
    • Rejected: Push the current group. The claim ends the job at that boundary.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#3645

Alternatives check of 2026-11-08: none.
Tool: none found.

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 5, 2026
  2. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    ContributorAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. A killed runner loses passed groups, but the failure needs a kill event and the fix is deferred behind other items.
    • Value: Medium. It prevents loss of completed groups on a killed runner, but only in that edge case.
    • Effort: Medium. It changes push timing, adds a cleanup path, must keep at least 10 existing tests green, and needs a branch-strategy decision.
    • Related: fix(roadmap): a stop in the scoped checks keeps the finished work #3645, which asks for a different change. Both address work loss in implement_run.py, but #3645 keeps work on a scoped-checks stop while the candidate adds a proactive checkpoint after each passed group.
  3. dan-petty commented on Nov 6, 2026

    @dan-petty
    Owner

    Material from the premise check of #3062, for the owner decision on this item.

    Replay test (found on origin/main 66a8a63): 4 groups with one task each, and a runner killed by a BaseException in group 3. On main, origin holds 1 commit (the plan), not 3. Groups 1 and 2 are lost. Cause: _groups in implement_run.py calls _record after a group passes but does not push. A passed group reaches origin only at a stop, at the end, or with the next wip: push, which is made only while tasks of a group are unticked (#3054).

    A draft push of each passed group (about 10 lines in _groups) made at least 10 tests of tests/roadmap fail. They check these recorded requirements:

    Two designs:

    1. Push to the item branch, as feat(roadmap): a stopped step keeps its work and the next attempt resumes from it #3054 does. Amend the three requirements, and add a withdraw step on a premise return (Staged: reset to the old tip; Planned: delete the branch and close the draft). This agrees with feat(roadmap): a stopped step keeps its work and the next attempt resumes from it #3054, whose wip: pushes already break "no push" for multi-task groups.
    2. A hidden ref such as refs/devops/wip/<issue>, with resume code in _start and cleanup on finish, premise and claim.

    The continuation Job (#3721) is merged, so a killed run now restarts. Without this item a passed group of one task restarts from the plan.

  4. dan-petty commented on Nov 6, 2026

    @dan-petty
    Owner

    Decision on the checkpoint place: use the item branch (design 1). Do not use a hidden ref. The owner delegated this choice, so I decided it with the project rules. I read the code and the documents at origin/main 29309f0. I ran the resume test on a scratch worktree at 69aa24d (now removed). I did not run it again at 29309f0.

    Reason

    1. Resume code exists. A Planned run that pushed a branch and a draft is routed as a Staged item by recorded_branch. A retry then takes the branch from origin. At 69aa24d, I killed a Planned item after group 1. A second Job ran group 2 only and reached ready. A hidden ref needs new fetch, ancestry and reset code in _start.
    2. One place for all progress. feat(roadmap): a stopped step keeps its work and the next attempt resumes from it #3054 already pushes wip: commits to the item branch. fix(roadmap): a stop in the scoped checks keeps the finished work #3645 (Ready) chose the item branch for a scoped-check stop. It rejected a separate ref. A hidden ref would make two places.
    3. No leak. A hidden ref outlives a Job that dies after its last push. It needs cleanup on finish, claim and premise. It needs a sweep for the leaks. The branch needs none of this.
    4. Plain git covers it. The change uses _push_passed, _push_with_lease and _publish. No open tool covers a git checkpoint of one run.

    The hidden ref keeps the recorded requirements true with less text. That is its one real gain. It does not outweigh points 1 to 3.

    Facts

    Read in the code at 29309f0:

    • _record writes marks and does not push. _keep skips the push for the commit that ticks the last task. So a group of one task has no copy on origin before the final push.
    • _return_to_new has two callers: _return_premise and _check_premise. The second runs in _groups right after _require_unclaimed. The withdraw goes in _return_to_new so that both returns use it. PR feat(roadmap): the implement job re-checks a plan premise against the base #3657 added the second caller after my first draft.
    • The end boundary in execute is followed at once by _push, which runs the scoped checks. So the end boundary needs no push.
    • _push_with_lease reads the local ref origin/<branch>. It is the head that the job last pushed or fetched. So it is a real lease.
    • _publish deletes the branch when GitHub refuses the draft. _push_passed then logs the failure and the run goes on.

    Tested on a local bare origin (git, not the Job code):

    • git push --force-with-lease=<branch>:<tracking tip> origin <base>:refs/heads/<branch> restores the base tip when the job pushed last.
    • The same push is refused with "stale info" when a person pushed after the job.

    Measured earlier, not reproduced at 29309f0:

    • At 69aa24d, a scratch version of the change made 11 tests fail. It also put a push at the end boundary. The final design does not. The count can change.
    • At 69aa24d, the draft test (4 groups, kill in group 3) failed before the change and passed with it. A Planned variant passed too.

    Not tested here: a real GitHub remote and the CI cost per push, which I read from ci.yml. Also not tested: the window between the first push and the write of implement.pr.

    Failure modes

    Case Result
    A person claims while a group runs The claim check runs before the push at each boundary. A claim that the check sees pushes nothing. Groups pushed before it stay. A Planned item keeps its draft. The race between check and push is a few seconds.
    False premise (premise request or behavior-group check) The job withdraws the checkpoints, then returns the item to New. Staged: restore the tip in implement.base. Planned: delete the branch and close the draft.
    Withdraw fails The item stops as Blocked with the reason. It is not returned. The job removes nothing it cannot name.
    A person pushes to the branch The lease of a checkpoint fails. The line goes to the log and the run goes on. The lease of the withdraw fails too. The item is Blocked and the push of the person stays.
    A draft that GitHub refuses at the first checkpoint The run asks once, then makes no more checkpoint pushes. The final push stops the item as it does now.
    A kill in the docs, the archive or the scoped checks The last group is lost, because it is pushed after the scoped checks. Earlier groups stay.
    GitHub requests Staged: none extra. Planned: the draft opens at the first checkpoint, not at the end. A premise withdraw of a Planned item: one ls-remote and one close_pull.
    CI minutes Each push starts CI on the draft. ci.yml cancels the run in progress, so at most one runs. #3054 pushes already do this.

    Requirement changes

    Amended (the exact text is in the body):

    1. roadmap-item-claim, "A claim of a person or an agent ends the Job at the next group boundary": the words "push nothing" change. Two scenarios change and one is new.
    2. roadmap-implement-job, "A false premise returns the item to New": "push nothing" becomes "withdraw the checkpoints". Three scenarios are new.
    3. roadmap-implement-job, "The job checks the premise of a behavior group at the branch tip": one new scenario.
    4. roadmap-implement-job, "The job record": add implement.base.
    5. roadmap-implement-job, "The job runs the scoped checks before it pushes": the last sentence gets one exception for a checkpoint. fix(roadmap): a stop in the scoped checks keeps the finished work #3645 edits the same sentence.
    6. roadmap-implement-job, "The job pushes the work in progress of a step": the last tick waits for the next checkpoint too.
    7. New requirement "The job checkpoints each passed group on the item branch".

    Not amended by this item: the scoped-stop scenarios ("pushes nothing", 4 tests). #3645 rewrites them. So #3677 is blocked by #3645.

    The new body of #3677 holds the design, the criteria and the list of tests to change. I changed no tracked file.

  5. added
    status/ready
    and removed
    status/new
    on Nov 7, 2026
  6. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    ContributorAuthor

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

  7. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    ContributorAuthor

    Alternatives check: none

    Reason: Searches for a per-step checkpoint of a run found only generic durable-execution frameworks (Temporal, DBOS Transact), which persist workflow state in their own service or database rather than pushing each passed group's commits to the item's git branch, and Temporal is rejected by ADR 0008 (a new Postgres and 3-6 pods). The issue needs commits of passed groups on origin so a second Job resumes from the branch and a draft pull request exists, which plain git push with a lease already gives the job; no external tool covers the checkpoint plus withdraw.

    Tool: none found

    Lacks:

    • No tool pushes each passed task group's commits to the item branch on origin, so a second Job can resume from the branch.
    • No tool restores the base tip (or deletes the branch and closes the draft) when a premise returns the item.
    • Durable-execution frameworks keep run state in their own store, not in git, and Temporal was rejected by ADR 0008.

    Tools considered:

    Searches run:

    • durable execution framework python checkpoint resume after crash, results: 5
    • library checkpoint each completed step to git branch resume after crash agent workflow, results: 5
    • open source tool automatic git commit checkpoint working tree periodically gitwatch, results: 5
    • temporal durable execution stores workflow state in its own database not git, results: 5
    • langgraph checkpoint persistence library github, results: 5
    • DBOS Transact durable workflow checkpoint resume github, results: 5
    • git push --force-with-lease documentation, results: 5
    • Temporal durable execution, results: 5

    Sources:

    Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.

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

    @devops-cli-service
    ContributorAuthor
  12. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    ContributorAuthor

    Live since 2026-11-08 23:37 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/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions