Repository navigation
Description
What happened
A runner Job that the kernel kills (OOM at 4 Gi), a pod that is evicted, or a Service restart ends the run. The next round records a stop, and a person or a new image digest must clear it. The Job deadline is a fixed 7200 s.
What should happen
- Checkpoints (D2) plus a run state in the job record let a new Job continue a run: the Service finds a Job that ended without a report and starts a continuation Job, bounded by a count per item.
- Heartbeats from the runner (a field of the job record, updated at each tool or model call) tell the Service that a run lives; a silent run is ended and continued.
Acceptance criteria
- A replay that kills the runner after step 2 of 4 ends with a continuation Job that runs steps 3 and 4.
- The Service distinguishes a slow run from a dead one by the heartbeat age (a setting).
- Continuations per item are bounded, and the comment says how many were used.
- The run state holds no secret.
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).
Alternatives check of 2026-11-04: covers.
Tool: temporalio/temporal (https://github.com/temporalio/temporal), MIT, last activity 2026-11-04, maintained.
Proposed design
Problem statement
A runner Job can end by OOM, eviction or a Service restart. The Service records a stop, and only a person or a new image digest clears it. This change adds a bounded continuation for a retry-class stop. The Service starts a new Job when continuations remain. It keeps the existing silent-run decision and stores only a count. The per-group checkpoint on origin is deferred to a new issue.
Acceptance criteria
Requirement: retry_stop_gets_continuation
The Service SHALL start a continuation for a retry-class implement stop when the item has continuations left.
Scenario: Retry-class stop starts a continuation
- WHEN An implement Job sets
implement.stopped=jobwith a retry-class failure, andimplement.continuationsis below the setting. - THEN The Service clears the stop with a continuation Job and increments
implement.continuationsby one.
Requirement: continuation_uses_no_digest_clear
The continuation rule SHALL run before the digest rule and SHALL NOT spend a digest clear.
Scenario: Continuation wins over digest clear
- WHEN A retry-class stop and a new image digest are both present.
- THEN The Service records a continuation and leaves the digest clear count unchanged.
Requirement: continuation_limit_keeps_blocked
The Service SHALL stop at the configured limit and leave the item Blocked.
Scenario: Third stop after two continuations
- WHEN The setting is 2, the item has used 2 continuations, and a retry-class stop occurs.
- THEN The Service leaves the item Blocked and comments
No continuation is left.
Requirement: continuation_comment_reports_count
The Service SHALL comment the continuation number and the limit when it starts a continuation.
Scenario: First continuation comment
- WHEN The Service starts continuation 1 of 2.
- THEN The comment says
continuation 1 of 2.
Requirement: continuation_record_has_no_secret
The job record SHALL hold only the continuation count and no secret.
Scenario: Record after a continuation
- WHEN The Service records a continuation.
- THEN The record key
implement.continuationsis an integer and the record holds no token or credential.
Requirement: zero_disables_continuation
A setting value of 0 SHALL disable continuation and keep the current Blocked behavior.
Scenario: Zero setting keeps Blocked
- WHEN The setting is 0 and a retry-class stop occurs.
- THEN The item stays Blocked and the Service starts no continuation Job.
Requirement: killed_run_resumes_from_origin
The Service SHALL continue a killed run from the work that is on origin through wip: commits.
Scenario: Kill after step 2 of 4
- WHEN A replay kills the runner after step 2 of 4, and steps 1 and 2 are on origin.
- THEN A continuation Job starts and runs steps 3 and 4.
Requirement: silent_run_uses_existing_setting
The Service SHALL use the existing roadmap.implement.deadline_stall_seconds decision to mark a run silent.
Scenario: Fresh log is not ended
- WHEN The Job log digest is unchanged for less than the setting.
- THEN The Service does not end the Job and starts no continuation.
Existing Tool Considered
temporalio/temporal (MIT, maintained, last activity 2026-11-04) covers durable run state, heartbeats, resume from heartbeat details and bounded retries. It lacks a Kubernetes continuation Job and a read of the hidden job record. The runner becomes a Temporal worker, and the Service must run or connect to a Temporal server. It has no built-in GitHub comment for continuations. Its event history is not secret-free by construction. It replaces the fixed 7200 s Job deadline with per-activity timeouts.
Key questions
- The alternatives check found that
https://github.com/temporalio/temporalcovers this item. Adopt the tool, or keep the item and give the reason.: Keep the item. Do not adopt Temporal. ADR 0008 rejects the new Postgres and 3 to 6 pods. The git checkpoint and the feat(roadmap): long-running tasks: progress-based deadlines instead of a fixed two hours #3063 liveness signal already exist. Temporal also lacks a Kubernetes continuation Job and a secret-free history. (best practice) [sources: CONTEXT.md]- Rejected: Adopt
temporalio/temporal. It adds a Temporal server, a new Postgres and 3 to 6 pods. ADR 0008 rejects this. It does not create the Kubernetes continuation Job. - Chosen: Keep the item and add a Service continuation rule. The Service already records the stop and reads the liveness signal. A small rule reuses them and adds no infrastructure.
- Rejected: Use Argo Workflows
retryStrategy. It re-runs a step and has no checkpoint. The runner is not on Argo yet.
- Rejected: Adopt
- What does the Service do when an implement Job stops today?:
_reportinimplement_submit.pysets Blocked andimplement.stopped=job. Only a person'simplement: retryor a new image digest clears that stop. [sources: src/devops_cli/roadmap/implement_submit.py, src/devops_cli/roadmap/stop_clear.py] - Is a heartbeat field needed to tell a slow run from a dead run?: feat(roadmap): long-running tasks: progress-based deadlines instead of a fixed two hours #3063 reads the Job log digest and ends a silent Job after
roadmap.implement.deadline_stall_seconds. A heartbeat field would cost one GitHub write per tool call, so feat(roadmap): long-running tasks: progress-based deadlines instead of a fixed two hours #3063 rejected it. [sources: src/devops_cli/roadmap/implement_deadline.py] - Where does the continuation rule run?: In
stop_clear.py, as rulecontinue, before the digest rule. It applies toimplement.stopped=jobwith a failure class whose action isretry, and it spends no digest clear. (best practice) [sources: src/devops_cli/roadmap/stop_clear.py, src/devops_cli/roadmap/implement_submit.py]- Chosen: Rule
continueinstop_clear.pybefore the digest rule. It reuses the stop record and the failure-class action. It spends no digest clear. - Rejected: A new Service path outside
stop_clear.py. It duplicates the stop-clear decision and can race the digest rule. - Rejected: A runner heartbeat field. It costs one GitHub write per tool call and feat(roadmap): long-running tasks: progress-based deadlines instead of a fixed two hours #3063 rejected it.
- Chosen: Rule
- How are continuations bounded and recorded?: Use
roadmap.implement.continuations_per_item, default 2. A value of 0 turns continuation off. The record keyimplement.continuationsholds only the count. (best practice) [sources: src/devops_cli/roadmap/store.py]- Chosen: Default 2, setting 0 disables. It bounds the loop and gives two recovery attempts. An operator can turn it off.
- Rejected: No bound. A dead Job could loop forever.
- Rejected: Default 1. One attempt does not survive a second eviction.
- Why does a one-task group lose its passed work on a kill?:
_groupsinimplement_run.pyrecords a passed group but does not push. Awip:push occurs only while tasks of a group are unticked. So a one-task group has no checkpoint on origin, and groups 1 and 2 are lost. [sources: src/devops_cli/roadmap/implement_run.py] - Do we add per-group checkpoint pushes in this issue?: No. Defer it. A push conflicts with feat(roadmap): an item has one owner, service, agent or human, and the jobs skip a claimed item #2910, feat(roadmap): the implement job runs the scoped CI before it pushes and repairs failures #3043 and the false-premise return. The owner must choose the item branch or a hidden ref. (best practice) [sources: src/devops_cli/roadmap/implement_run.py, src/devops_cli/roadmap/stop_clear.py]
- Rejected: Push each passed group to the item branch now. At least 10 tests fail on feat(roadmap): an item has one owner, service, agent or human, and the jobs skip a claimed item #2910, feat(roadmap): the implement job runs the scoped CI before it pushes and repairs failures #3043 and the false-premise return. The issue names no withdraw step.
- Chosen: Defer the per-group checkpoint to a new issue. Part A is workable now. The owner must choose the checkpoint location first.
- Rejected: Use a hidden ref now. It needs new resume and cleanup code. The issue does not name it.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
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.OOM and eviction are observed in production and each kills a full run, requiring manual clearing.Eliminates total work loss and manual intervention on every transient runner failure.Requires checkpoint state, heartbeat protocol, Service-side liveness detection, continuation Job creation, and bounded retry logic.Both items address resuming work after a stop, but #3054 preserves step-level work on a ref while this candidate adds Service-level run detection, heartbeat liveness, and continuation Job creation.devops-cli-service commentedon Nov 1, 2026
Refine cannot set this item to Ready at 2ae3772 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.
feat(roadmap): classify a failure and name its class in the stop (#3195)
devops-cli-service commentedon Nov 4, 2026
Alternatives check: covers
Tool: temporalio/temporal (https://github.com/temporalio/temporal)
Covers:
Lacks:
Searches 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 4, 2026
Refine cannot set this item to Ready at 0e3427f 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.
https://github.com/temporalio/temporalcovers this item. Adopt the tool, or keep the item and give the reason. (a person decides)dan-petty commentedon Nov 5, 2026
This item cannot be built as written. Evidence follows.
PREMISE CHECK (origin/main 66a8a63)
D2 is feat(roadmap): a stopped step keeps its work and the next attempt resumes from it #3054 (merged as PR feat(roadmap): a stopped step keeps its work and a new Job resumes #3560, archived change 2026-11-05-3054). The refine bot asked what D2 means. The tracker feat(roadmap): an enterprise-grade plan and implement pipeline (tracker) #3027 lists D2 as "checkpoints".
The heartbeat criterion is already met by feat(roadmap): long-running tasks: progress-based deadlines instead of a fixed two hours #3063. The Service reads the Job log, compares its digest, and ends a silent Job after the setting
roadmap.implement.deadline_stall_seconds(src/devops_cli/roadmap/implement_deadline.py). A heartbeat field in the job record would cost one GitHub write per tool call, so feat(roadmap): long-running tasks: progress-based deadlines instead of a fixed two hours #3063 rejected it.The continuation Job is missing.
_reportin implement_submit.py sets Blocked andimplement.stopped=job. Only a person'simplement: retryor a new image digest clears that stop (stop_clear.py, fix(roadmap): a new runner image clears only a stop that it can fix #3481).The first criterion (kill after step 2 of 4, then a continuation Job runs steps 3 and 4) FAILS on main for groups that have one task. I wrote a replay test: 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.
_groupsin implement_run.py calls_recordafter a group passes but does not push. A passed group reaches origin only at a stop, at the end, or with the nextwip:push. Thewip:push is made only while tasks of a group are unticked (feat(roadmap): a stopped step keeps its work and the next attempt resumes from it #3054). So feat(roadmap): a stopped step keeps its work and the next attempt resumes from it #3054 gives per-task checkpoints, not per-group checkpoints.Open tools:
retryStrategy: it re-runs a step. It has no checkpoint. The runner is not on Argo yet (feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535 steps 2 to 6 are not built).activeDeadlineSecondstakes precedence overbackoffLimit, and a Failed Job is never restarted. The runner template setsbackoffLimit: 0on purpose. So a continuation must be a new Job from the Service. A Service rule is justified.CONFLICT that needs an owner decision. I pushed each passed group to the item branch (about 10 lines in
_groups) and ran tests/roadmap. At least 10 tests failed. They check these requirements:issue_holder).Making the push safe needs compensating code (undo the push on a premise return) or a new hidden-ref mechanism with its own resume and cleanup. The issue names neither. I reverted the change. Saved aside: .data/agent/3062-checkpoint-push.patch and .data/agent/scratch/test_roadmap_implement_checkpoint.py (the fail-to-pass test).
RE-SCOPE PROPOSAL
continuein stop_clear.py. It applies toimplement.stopped=jobwith a failure class whose action isretry. It runs before thedigestrule and spends no digest clear.roadmap.implement.continuations_per_item(default 2, 0 turns it off) and record keyimplement.continuations.continuations_per_item=0for the 13 existing tests in test_roadmap_implement_submit.py and test_roadmap_implement_deadline.py that assume a failed Job stays Blocked. Add round tests of continuation 1, continuation 2, then Blocked.implement_job_report_stoppedin messages.py.wip:pushes (multi-task groups), not for one-task groups.wip:pushes already break "no push" for multi-task groups. I recommend this.refs/devops/wip/<issue>, with resume code in_startand cleanup on finish, premise and claim.ON DISK (not pushed, not committed)
continue), store.py, config/defaults.py, config/settings.py, lang/en/messages.py, and the test files test_roadmap_stop_clear.py, test_roadmap_digest_clears.py, test_roadmap_limit_classes.py, test_roadmap_implement_project_steps.py and tests/security/test_config_declarations.py.A local draft of Part A exists in a worktree of the agent that checked this item. It is not pushed. It is kept only until a person decides the re-scope.
devops-cli-service commentedon Nov 5, 2026
Status set to Ready at f6d57ec (see proposed design in issue body).
Moved to new items: #3677.
fix(roadmap): a rejected plan leaves its evidence on the issue (#3713)
feat(roadmap): the Service continues a Job that has no result (#3731)
dan-petty commentedon Nov 6, 2026
The continuation part of this item is delivered. PR #3731 (issue #3721) merged. The Service now clears a stop
jobwith a retry class by the rulecontinue, and starts a new Job. The limit is the settingroadmap.implement.continuations_per_item(default 2, 0 turns it off). The count is inimplement.continuations.Refine moved the checkpoint of each passed group to #3677. That part needs an owner decision, because a push of each group conflicts with the recorded requirements of #2910 (a claim ends the Job with no push), #3043 (a scoped-check stop pushes nothing) and the premise return. See the evidence comment of 2026-11-05 above.
What is left in this item: the scenario "kill after step 2 of 4 resumes at step 3" holds only for work that a
wip:push kept. A passed group of one task runs again until #3677 lands. Do not build the continuation again. If the owner agrees, close this item as completed by #3731 and #3677, or keep it as the tracker of #3677.dan-petty commentedon Nov 6, 2026
Closed as completed. The continuation Job is delivered by PR #3731 (issue #3721). The checkpoint of each passed group is tracked in #3677, which holds the evidence and two designs for the owner decision. The out-of-memory read is tracked in #3727. The details are in the comment above.