Repository navigation
Description
What happened
The step prompt says that a lost test, an exhausted refusal limit or an unfixed lint error ends the step and "all your work is lost". After a stop, the next Job starts from the last green group, and the minutes of work between are thrown away. #2175 had all five deletions done and the item still stopped.
What should happen
- The step commits work in progress to a
wip/ref or a labeled commit on the item branch after each green sub-step, and the state of the step (what is done, what failed) goes into the job record. - A new attempt or Job reads that state and continues. The final history is squashed by the existing squash-merge, so the branch keeps the WIP commits without harm.
Acceptance criteria
- A step killed after 3 of 5 edits is resumed by a second Job in a replay test, and the second Job does only the remaining edits.
- The WIP state survives a pod restart (it is on
origin, not in the pod). - The first push of a branch keeps the rule: fetch and rebase on
origin/mainbefore the push. - A stop comment says what was kept and where.
Related: tracker for this set (filed with it), #2908 (issue workflow), #2867 (draft PR evaluator), #3005 (task kind), #3010 to #3015 (plan gates), #2919 (stuck-item metrics), #2953 (Ollama parser).
Proposed design
Problem statement
The implement job discards all work done in a step when that step stops. The next Job starts from the last green group and loses the completed sub-steps. This wastes compute and delays delivery of the item.
Acceptance criteria
Requirement: WIP commit after green sub-step
The step SHALL commit work in progress to the item branch with a wip: commit-message prefix after each green sub-step.
Scenario: Step completes 3 of 5 sub-steps then stops
- WHEN A step completes three green sub-steps and then stops on the fourth
- THEN The item branch on origin holds three commits whose messages start with
wip:
Requirement: State in job record
The step SHALL write its progress state (done sub-steps, failed sub-step, last WIP commit SHA) into the job record in the issue body.
Scenario: Job record reflects in-progress step
- WHEN A step is in progress and has completed two of five sub-steps
- THEN The hidden job-record block in the issue body lists the two done sub-steps and the SHA of the last WIP commit
Requirement: Resume from WIP state
A new Job SHALL read the job record and continue from the last WIP commit, executing only the remaining sub-steps.
Scenario: Second Job resumes after stop
- WHEN A step stopped after 3 of 5 sub-steps and a second Job is triggered by
implement: retry - THEN The second Job executes only sub-steps 4 and 5 and does not re-run sub-steps 1 through 3
Requirement: WIP survives pod restart
The WIP commits SHALL be pushed to origin so that they survive a pod restart.
Scenario: Pod restart does not lose WIP
- WHEN A pod is killed after a WIP commit is made and before the step finishes
- THEN The WIP commit is present on the item branch on origin and a new pod can read it
Requirement: First push rebases on main
The first push of the item branch SHALL fetch and rebase on origin/main before the push.
Scenario: First push includes rebase
- WHEN The item branch has no prior push to origin and the step makes its first WIP commit
- THEN The push command runs
git fetch origin mainandgit rebase origin/mainbeforegit push
Requirement: Stop comment states kept work
A stop comment SHALL state what WIP work was kept and where it is stored.
Scenario: Stop comment names the WIP ref
- WHEN A step stops and the job writes its stop comment on the issue
- THEN The comment names the item branch, the count of WIP commits kept, and the SHA of the last WIP commit
Existing Tool Considered
No check has run. No open, maintained tool or library covers this need. It is project-specific behavior of the implement job step loop. The written cost is the tokens to build, keep, and fix the WIP commit logic, the job-record state block, and the resume logic in the existing job runner, plus the elapsed time to integrate them with the step loop and the squash-merge flow.
Key questions
- Where are WIP commits stored: a separate
wip/ref or labeled commits on the item branch?: Labeled commits on the item branch, with awip:prefix in the commit message. The squash-merge at delivery collapses them into one commit, so they cause no harm. A separate ref adds a ref to create, update, and delete, and the resume logic must cherry-pick or merge from it. Commits on the branch let the new Job simply continue from the branch tip. (best practice) [sources: CONTEXT.md]- Rejected: Separate
wip/ref. Adds a ref to manage. Resume must merge or cherry-pick from it. More moving parts for no benefit given squash-merge. - Chosen: Labeled commits on the item branch with
wip:prefix. Simplest. The new Job continues from the branch tip. Squash-merge collapses all commits at delivery. No extra ref to manage.
- Rejected: Separate
- What does the job record track for an in-progress step?: The task-group index, the list of done sub-steps, the failed sub-step (if any), and the SHA of the last WIP commit. This is written into the hidden job-record block in the issue body, consistent with ADR 0001 which states the issue body holds the job record. (best practice) [sources: docs/adr/0001-github-is-the-roadmap-source.md, CONTEXT.md]
- Rejected: Track only the failed sub-step. Insufficient. The resume logic needs to know which sub-steps are done to skip them.
- Chosen: Track done sub-steps, failed sub-step, and last WIP SHA. Complete. The resume logic skips done sub-steps, knows what failed, and can verify the branch tip matches the recorded SHA.
- How does a new Job resume from the WIP state?: The new Job reads the job-record block in the issue body, finds the in-progress task group and its done sub-steps, checks out the item branch (which already holds the WIP commits on origin), and executes only the remaining sub-steps. No cherry-pick or merge is needed because the WIP commits are already on the branch. (best practice) [sources: CONTEXT.md]
- Rejected: Re-run the entire task group. Wastes compute. Redoes work that is already committed and green.
- Chosen: Read job record, check out branch, run only remaining sub-steps. Minimal work. The branch already has the WIP commits. The job record says which sub-steps are done.
Open questions
- Does the first push of the item branch rebase on origin/main? (missing verified source)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-04: partly.
Tool: langchain-ai/langgraph (https://github.com/langchain-ai/langgraph), MIT, last activity 2026-11-04, maintained.
Activity
dan-petty commentedon Nov 1, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It saves hours of work per stop but the system still completes items; no blocker or security impact.Each stop currently discards all in-progress edits, so persisting them avoids repeated agent work.Requires WIP ref logic, job-record state, resumption code, and a replay test across two jobs.Both address work lost when a step stops, but #3053 retries within the step while the candidate persists state so a new job resumes it.dan-petty commentedon Nov 1, 2026
The owner asks (2026-11-01) that the job identify and handle partial implementations, to fix them or iterate on them, instead of discarding them and blocking the issue. The issue #3098 holds the design: keep the pushed work, classify the state, continue from the branch with a repair step for the class, block last. It builds on this issue (repair rounds), #3054 (keep work and resume) and #3065 (failure classes).
devops-cli-service commentedon Nov 2, 2026
Refine cannot set this item to Ready at d5dc921 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
devops-cli-service commentedon Nov 4, 2026
Alternatives check: partly
Tool: langchain-ai/langgraph (https://github.com/langchain-ai/langgraph)
Covers:
Lacks:
wip:commits, nor push them to originSearches run:
Sources:
Checked on 2026-11-04. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 5, 2026
Released in v0.58.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.58.0
devops-cli-service commentedon Nov 5, 2026
Live since 2026-11-05 01:17 UTC