Repository navigation
Description
Problem or Motivation
The implement Job runs all task groups of an item in one Kubernetes Job. A failure in group 3 can discard the finished groups 1 and 2, or block the item (see the issue on partial implementations). The Job has no step-level retry, no resubmit from a failed step and no artifact store for the worktree.
Proposed Solution & Architectural Design
Run one implement item as an Argo Workflow with one step per task group. A failed step retries with its logs and gate output as input. A person or the Service can resubmit from the failed step alone. The worktree passes between steps as an artifact or a volume.
ADR 0008 holds the go verdict: the owner recorded it on #1535 on 2026-11-11 (warm p95 of 11 s). The cluster already runs WorkflowTemplates, for example k8s/devops/workflowtemplate-devops-cli-noop.yaml (#4566). The implement step runs on the harness Coder (src/devops_cli/roadmap/implement/implement_step.py); one Workflow step runs one task group of that step.
Target Subsystem
k8s/devops/cronjob-runner.yaml, src/devops_cli/roadmap/implement/implement_run.py, docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md.
Existing Tool Considered
Argo Workflows. The controller already runs in the namespace argo-workflows. Cost to build: about 80k tokens and 6 hours. Cost to keep: one WorkflowTemplate.
Alternatives check of 2026-12-01: in-use.
The repository already uses this tool.
Tool: Argo Workflows (https://github.com/argoproj/argo-workflows), Apache-2.0, last activity 2026-12-01, maintained.
Reason: Searches confirm Argo Workflows, the tool the issue already names. Its step pods, retry strategy and failed-node resubmit cover the engine need; the issue supplies only the roadmap wiring.
Covers:
- One pod for each ordered step
- retryStrategy expression and backoff for a failed step
- Resubmit re-runs failed nodes and keeps passed nodes
Lacks:
- WorkflowTemplate roadmap-implement with 20 group slots
- WorkflowLauncher that replaces the runner Job
- implement: retry comment handling and stall termination
- Secret split between the prepare and agent containers
Owner decision 2026-11-13
The approved pipeline split (tracker #5482): the implement Workflow ends at its checked branch and calls the open module (#5029). In Phase 7, the tests unit (#5520) takes the n.1 half of each group through this seam.
- After feat(roadmap): the model container of a unit holds no credential #5506 merges, the unit uses the two-container template.
- Live proof: after the merge, the next implement item runs as the App in a Workflow with one resubmit for each group. A comment gives the result lines.
Proposed design
Problem statement
The implement job runs all task groups of an item in one Kubernetes Job. A failure in one group can discard the finished groups or block the item, and the Job has no step retry or resubmit. This change runs implement as an Argo Workflow with one pod for each unticked task group and a retry of the failed nodes.
Acceptance criteria
Requirement: WorkflowTemplate roadmap-implement
The devops chart SHALL provide WorkflowTemplate roadmap-implement with 20 ordered group slots, group1 through group20.
Scenario: The chart check validates the template
- WHEN
uv run devops ci --check --only k8sruns on the chart. - THEN The check exits 0 and reports no error for WorkflowTemplate roadmap-implement.
Requirement: Group parameter limit
The Service MUST stop an item with more than 20 unticked task groups and leave it Blocked with a message.
Scenario: A change has 21 unticked groups
- WHEN A test gives an item whose change holds 21 task groups with an unticked task.
- THEN The Service writes no Workflow and sets the item Blocked with a message that names the 20-group limit.
Requirement: Unticked group parameters
The Service SHALL pass the item number and the unticked groups in file order as Workflow parameters item and group1 through group20.
Scenario: A change with two unticked groups
- WHEN A test submits an item whose change holds three task groups, and the second and the third group hold an unticked task.
- THEN The submitted Workflow holds item set to the item number, group1 naming the second group, group2 naming the third group, and every later group parameter empty.
Requirement: Retry only exit 75
The group template SHALL set retryStrategy.expression to asInt(lastRetry.exitCode) == 75 and retryStrategy.backoff.maxDuration to 10m.
Scenario: The template lint validates the retry strategy
- WHEN
argo lintruns on the rendered WorkflowTemplate roadmap-implement. - THEN argo lint exits 0 and reports no error for retryStrategy.
Requirement: Retry failed nodes on implement retry
The Service SHALL retry the failed nodes of the existing implement Workflow when a person comments implement: retry.
Scenario: A person retries a stopped item
- WHEN An item is Blocked after a failed group, the implement Workflow still exists, and a person comments
implement: retry. - THEN The API receives one retry request for the Workflow and no Workflow create request.
Requirement: One worktree claim for each run
The implement Workflow SHALL declare one PersistentVolumeClaim, each group pod MUST mount it at /run/roadmap, and the Workflow MUST delete it when it ends.
Scenario: The chart check validates the claim
- WHEN
uv run devops ci --check --only k8sruns on the chart. - THEN The check exits 0 and reports no error for volumeClaimTemplates and volumeClaimGC.
Requirement: Group pod secret split
Each group pod MUST run the two-container template; the prepare container MUST reference only the App key, and the agent container MUST reference only the gateway key.
Scenario: The chart check validates the group pod secrets
- WHEN
uv run devops ci --check --only k8sruns on the chart. - THEN The check exits 0 and reports no error for the prepare and agent secretKeyRef values.
Requirement: Push and open steps get only the App key
Each push and open step MUST reference only the GitHub App private key by secretKeyRef and MUST NOT mount the gateway key.
Scenario: The chart check validates the push and open step secrets
- WHEN
uv run devops ci --check --only k8sruns on the chart. - THEN The check exits 0 and reports no error for the push and open step secretKeyRef.
Requirement: Group pod identity
Each group pod MUST use ServiceAccount devops-cli, mount ConfigMap devops-cli-config at /config, set automountServiceAccountToken to false, and the Workflow MUST set executor.serviceAccountName to argo-executor.
Scenario: The chart check validates the group pod identity
- WHEN
uv run devops ci --check --only k8sruns on the chart. - THEN The check exits 0 and reports no error for serviceAccountName, automountServiceAccountToken, and executor.serviceAccountName.
Requirement: Name, labels and repository mutex
The Service MUST name each implement Workflow devops-cli-implement-<slug>-<n>-<10 hex>, set the labels roadmap.devops-cli/owner, roadmap.devops-cli/repo, roadmap.devops-cli/item and app.kubernetes.io/component: roadmap-implement, set OTEL_SERVICE_NAME to roadmap-implement, and hold the mutex implement-<owner>.<name>.
Scenario: Two items of one repository submit
- WHEN The Service submits a second implement Workflow for a repository whose first Workflow still runs.
- THEN Both Workflow specs set synchronization.mutex.name to implement-<owner>.<name>, and each name and label set matches the rule, with app.kubernetes.io/component: roadmap-implement and OTEL_SERVICE_NAME=roadmap-implement.
Requirement: Group pod deadline
Each group template MUST set activeDeadlineSeconds: 7200.
Scenario: The chart check validates the group deadline
- WHEN
uv run devops ci --check --only k8sruns on the chart. - THEN The check exits 0 and reports no error for the group template activeDeadlineSeconds.
Requirement: Stalled Workflow termination
The Service SHALL terminate the implement Workflow when the log of its running step pod does not change for the configured stall deadline.
Scenario: A group pod writes no line
- WHEN A test gives a running implement Workflow whose step pod log does not change for the stall deadline.
- THEN The Service sets the annotation roadmap.devops-cli/stalled on the Workflow and patches spec.shutdown to Terminate.
Requirement: WorkflowLauncher replaces JobLauncher
The Service SHALL submit the implement unit through a WorkflowLauncher and MUST NOT create a runner Job for the same item.
Scenario: An implement item is due
- WHEN A test gives a Planned item and a fake Kubernetes API, and the Service runs the implement row.
- THEN The API receives one Workflow create request, the request names WorkflowTemplate roadmap-implement, and the API receives no Job create request for the item.
Requirement: Implement Workflow runs push then open
The implement Workflow SHALL run the push step before the open step after the group slots, and each step SHALL run its template roadmap-step-push and roadmap-step-open.
Scenario: The template lint validates the push and open steps
- WHEN
argo lintruns on the rendered WorkflowTemplate roadmap-implement. - THEN argo lint exits 0 and reports no error for the push and open steps.
Requirement: Templates pass argo lint
Each WorkflowTemplate and the Workflow spec SHALL pass argo lint.
Scenario: The templates lint
- WHEN
argo lintruns on each rendered template. - THEN argo lint exits 0 for roadmap-implement, roadmap-step-push and roadmap-step-open.
Requirement: Pending a person after the merge
After the merge, a person MUST run the next implement item as the App and MUST record one resubmit for each group in a comment.
Scenario: The live proof after the merge
- WHEN The next implement item runs as the App in a Workflow after the merge.
- THEN A comment gives the result lines, including one resubmit for each group.
Existing Tool Considered
Argo Workflows (argoproj/argo-workflows), Apache-2.0, maintained. The alternatives check in the issue body gives verdict in-use: the repository already uses this tool, and the block lists what it covers and lacks. This proposal supplies the roadmap wiring in the Lacks list: WorkflowTemplate roadmap-implement, WorkflowLauncher, implement: retry, executor service account, secret split, and stall termination. It builds no workflow engine.
Key questions
- Which existing tool covers the need, and what is the verdict?: Argo Workflows. The alternatives check in the issue body gives in-use: the repository already uses this tool. The block lists what the tool covers and lacks. The proposal adopts the tool and supplies the roadmap wiring in the Lacks list. It builds no workflow engine. (best practice) [sources: docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md, k8s/devops/workflowtemplate-devops-cli-noop.yaml]
- Chosen: Adopt Argo Workflows. The alternatives check gives in-use, ADR 0008 records the engine, and the cluster runs WorkflowTemplates.
- Rejected: Keep the Kubernetes Job. The Job has no step retry and no resubmit from a failed step.
- Rejected: Build a custom step runner. It repeats Argo Workflows and costs about 80k tokens and 6 hours.
- What scope does Owner decision 2026-11-13 set?: The implement Workflow ends at its checked branch and calls the open module refactor(roadmap): the implement Job ends at its draft #5029. After feat(roadmap): the model container of a unit holds no credential #5506 merges, the unit uses the two-container template. A live proof after the merge records one resubmit for each group. (best practice) [sources: docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md, CONTEXT.md]
- Chosen: Owner decision 2026-11-13. It records the approved pipeline split and the live proof.
- Rejected: Keep the runner Job. ADR 0008 records the go for Argo Workflows.
- Which items must merge before this one?: chore(roadmap): hold incremental stage and implement work #6521 first, then refactor(roadmap): the implement Job ends at its draft #5029 and feat(roadmap): the model container of a unit holds no credential #5506. refactor(roadmap): the implement Job ends at its draft #5029 supplies the open module. feat(roadmap): the model container of a unit holds no credential #5506 changes the pod to the two-container template. [sources: CONTEXT.md]
- Which namespace runs the implement Workflow?: Namespace devops. The Workflow references WorkflowTemplate roadmap-implement in the same namespace. (best practice) [sources: k8s/devops/workflowtemplate-devops-cli-noop.yaml, docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md]
- Chosen: Namespace devops. The noop WorkflowTemplate and the runner ConfigMap are in devops.
- Rejected: Namespace argo-workflows with a copy of the Secret. It makes a second copy of the GitHub App key.
- Rejected: Namespace argo-workflows with no Secret. The group pod gets no GitHub App key.
- How does one Workflow hold one pod for each task group?: The Service submits one Workflow that references WorkflowTemplate roadmap-implement. The template holds 20 ordered slots, group1 through group20. A slot runs only when its groupN parameter is not empty. The Service stops an item with more than 20 unticked groups and leaves it Blocked. (best practice) [sources: k8s/devops/workflowtemplate-devops-cli-noop.yaml, src/devops_cli/roadmap/implement/implement_step.py, docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md]
- Chosen: 20 fixed group slots. It keeps one Workflow, runs groups in order, and gives a finite template with a clear guard.
- Rejected: One Workflow for each group, chained by the Service. The Service then tracks the chain and its state.
- Rejected: An inline steps template in the Workflow. The Workflow references a WorkflowTemplate.
- How does the worktree pass between the group pods?: As one PersistentVolumeClaim for each run, from volumeClaimTemplates, mounted at /run/roadmap by every group pod and deleted when the Workflow ends. The claim holds the clone, worktree and venv. Each group pod uses an emptyDir at /home/devops for its uv cache. (best practice) [sources: k8s/devops/cronjob-runner.yaml, k8s/README.md, docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md]
- Chosen: One PersistentVolumeClaim at /run/roadmap. Each group pod mounts the same claim, so a passed group's commit is there for the next group.
- Rejected: An artifact repository. The chart sets no artifact repository, and the cluster runs none.
- Rejected: An emptyDir volume. An emptyDir belongs to one pod and goes when the pod ends.
- Rejected: A fresh clone in each group pod. It repeats the clone and loses the uncommitted work of the group.
- Which retry policy do the group pods use?: retryStrategy with expression asInt(lastRetry.exitCode) == 75 and backoff.maxDuration 10m. A group retries only when it exits 75 (try again later). A typed stop waits for a person. (best practice) [sources: CONTEXT.md, docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md]
- Chosen: Retry only exit 75, with a backoff cap. A retry of a typed stop repeats a model call that no retry fixes, and exit 75 asks for a new try.
- Rejected: retryPolicy: OnFailure with a limit. It repeats a model call and its token cost for a stop that a retry does not fix.
- How does a resubmit from a failed group work?: The Service calls the Argo retry for the existing Workflow. Argo re-runs only the failed nodes, and the passed nodes keep their results. The PVC and the worktree stay for the retry. (best practice) [sources: docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md, CONTEXT.md]
- Chosen: Argo retry on the same Workflow. It re-runs only the failed nodes and keeps the passed nodes and the PVC.
- Rejected: A new Workflow from the first unticked group. It loses the PVC and repeats passed groups or needs a new clone.
- Which ServiceAccount and RBAC do the group pods use?: The pod uses ServiceAccount devops-cli with automountServiceAccountToken: false. The Workflow sets executor.serviceAccountName to argo-executor. The environment repository makes argo-executor with a Role for workflowtaskresults. The prepare container reads only the App key. The agent container reads only the gateway key. The push and open steps read only the App key. (best practice) [sources: k8s/devops/workflowtemplate-devops-cli-noop.yaml, k8s/devops/cronjob-runner.yaml]
- Chosen: Follow the noop template. The pod mounts no token, and the executor uses the existing argo-executor Role.
- Rejected: Run the group pods as argo-executor. That account is for the executor's task results, not the app pod.
- Rejected: Reuse devops-cli with automountServiceAccountToken: true. The pod then mounts a token that it does not need.
- How does the Service name and label the Workflow?: The name is devops-cli-implement-<slug>-<n>-<10 hex>. The labels are roadmap.devops-cli/owner, roadmap.devops-cli/repo, roadmap.devops-cli/item and app.kubernetes.io/component: roadmap-implement. OTEL_SERVICE_NAME is roadmap-implement. The Workflow holds the mutex implement-<owner>.<name>. (best practice) [sources: k8s/devops/workflowtemplate-devops-cli-noop.yaml, CONTEXT.md]
- Chosen: The naming rule of the RepoRef item. One rule names every resource of a repository, and the labels select the pods and telemetry of one item.
- Rejected: The names of the runner Job. A Job name is no valid Workflow name, and the labels then select the wrong pods.
- How does the first retry pod get the failed group's log and gate output?: The Service writes the failed group's log and conflict files to the item record. The retried group reads them through the existing EarlierStop section in build_step_inputs. This item passes the item number and the group as arguments and copies none of that code. (best practice) [sources: src/devops_cli/roadmap/implement/implement_step.py, CONTEXT.md]
- Chosen: Use the existing EarlierStop section. The implement step already reads check_log and conflict_files from the item record.
- Rejected: Copy the writer into this item. The writer belongs to the stop record code, and a copy would duplicate it.
- How does the Service stop a stalled group pod?: Each group template sets activeDeadlineSeconds: 7200. The Service sets the annotation roadmap.devops-cli/stalled on the Workflow and patches spec.shutdown to Terminate when the log of its running step pod does not change for the configured stall deadline. (best practice) [sources: k8s/devops/cronjob-runner.yaml, CONTEXT.md, docs/guidelines/kubernetes.md]
- Chosen: Bound each group pod and terminate a stalled Workflow. The deadline stops a group that hangs, and the stall check stops a Workflow whose log stops moving.
- Rejected: Rely on the Workflow deadline alone. A pod that runs but writes no line can hold the Workflow until the deadline.
Fit
Fits in one pull request.
Suspected block
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.The item is blocked on the #1535 go/no-go verdict, so it cannot start until that resolves.It prevents loss of finished task-group work on a partial-implementation failure, a repeated pain point.The candidate estimates about 80k tokens and 6 hours to build one WorkflowTemplate and wire the CLI.Both target Argo Workflows for the roadmap jobs, but #1535 measures the controller and decides go/no-go, while the candidate implements the per-step workflow after that verdict.devops-cli-service commentedon Nov 2, 2026
Refine cannot set this item to Ready at ac16675 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.
docs(openspec): plan #3032 keep and show a trace of each run (#3194)
feat(roadmap): keep and show a trace of each run (#3355)
devops-cli-service commentedon Nov 5, 2026
Alternatives check: covers
Tool: argoproj/argo-workflows (https://github.com/argoproj/argo-workflows)
Covers:
argo retryre-runs only the failed or errored nodes of the same Workflow while the passed steps keep their results.Lacks:
implement: retrycomment handler.Searches run:
Sources:
Checked on 2026-11-05. 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
Refine cannot set this item to Ready at d254410 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/argoproj/argo-workflowscovers this item. Adopt the tool, or keep the item and give the reason. (a person decides)[-]feat(roadmap): the implement item runs as an Argo Workflow with one step per task group that resubmits alone[/-][+]feat(roadmap): Run implement as Argo Workflow with per-group resubmit[/+]3 remaining items
dan-petty commentedon Nov 11, 2026
New scope from the plan to move the roadmap Service work to Workflows and Valkey (tracker: "feat(roadmap): move Service work to Workflows and Valkey").
devopsthrough a managed namespace, templates usetemplateReferencing: Strict, and the admission policy admits onlyroadmap-*template references fromroadmap-service.devops-cli-implement-<slug>-<n>-<10 hex>, labelsroadmap.devops-cli/owner,/repo,/item,app.kubernetes.io/component: roadmap-implement,OTEL_SERVICE_NAME=roadmap-implement, and a muteximplement-<owner>.<name>in place of the Job list as the lock. When no code lists by the labelimplement-repoany more, this item removes it.Build cost stays as stated in this issue (about 80,000 tokens and 6 hours), plus about 20,000 tokens for the names, labels and mutex.
devops-cli-service commentedon Nov 11, 2026
Refine cannot set this item to Ready at 5f75d25 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
dan-petty commentedon Nov 12, 2026
Scope update from the Service step jobs plan (#5014).
The owner asked on 2026-11-12 for a separate job for each step that the Service jobs run the same way every time. This issue is the
implement-workflowitem of that plan. The plan is extract-first: each repeated step becomes one module and one command (devops roadmap step <name>) that every caller uses, and then the steps that cost most move to their own Jobs.Proposed title:
feat(roadmap): run implement and fix units as WorkflowsProblem (plan evidence)
#3105 plans implement as one Argo Workflow with group steps. After implement-ends-at-draft, implement, fix-checks and fix-conflict are plain Jobs. push and open run in the pod that holds the model key, and the
devops-cliSecret gives every pod both the gateway key and the App key (envFrom, k8s/devops/cronjob-runner.yaml).Added scope
Change the scope of #3105: implement, fix-checks and fix-conflict become WorkflowTemplates. push and open become the step templates roadmap-step-push and roadmap-step-open on a Workflow volume (volumeClaimTemplates with volumeClaimGC). The model steps get the gateway key only, and the steps that write GitHub get the App key only (Secret split, owner decision O4). Retry only on exit 75 (a retryStrategy expression with a backoff cap). An exit hook writes the report and the Status of a failed unit. The timeout-chain test also reads the templates. A WorkflowLauncher replaces the JobLauncher. One template at a time, with Strict template references (ADR 0021:80).
Cost: about 2M tokens on top of #3105.
Added acceptance
argo lintpasses for each template.Merge first
devops-cli-service commentedon Nov 12, 2026
Refine cannot set this item to Ready at 2c0fe36 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
k8s/argo-workflows/values.yaml.devops-cli-service commentedon Nov 14, 2026
Refine cannot set this item to Ready at ffce5d9 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
k8s/argo-workflows/values.yaml,k8s/devops/cronjob-runner.yaml.devops-cli-service commentedon Nov 14, 2026
Refine cannot set this item to Ready at 0955f8e while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 18, 2026
The result in the alternatives block of the issue body changed. Before this check:
covers, tool https://github.com/argoproj/argo-workflows. A person decides what the new result means for the item.Searches (10)
Tools considered:
Searches run:
Sources:
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
devops-cli-service commentedon Nov 20, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Dec 1, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.