Repository navigation
Description
Problem Description
The row fix_plan runs only after the row stage, in one serial round of the model lane. Stage takes 36 to 75 min. So the row reaches devops-cli about once in 2 h, not each 53 min. Each release rollout (strategy Recreate) can stop the round after stage and before fix_plan. This delays every plan with plan/needs-fix.
Evidence (2026-11-13):
- The stage result line and the fix_plan line share one trace: 06:42:26Z and 06:42:27Z (stage 2161 s), 08:40:45Z and 08:40:46Z (4472 s), 10:35:03Z and 10:35:04Z (4150 s).
- At 12:22:23.818Z the Service logged: "The Service is stopping, so the round for dan-petty/devops-cli ended before it was done." Stage of fix(ci): Copilot setup hooks refuse commits on copilot/ branches #5136 had just ended (2130 s), and fix_plan did not run. Releases on this day: 05:48Z, 12:11Z and 12:23Z.
- From 22:25Z (2026-11-12) to 06:04Z the pod changed each hour, and only one devops-cli fix_plan run occurred (23:35:53Z).
- The comment at
src/devops_cli/config/defaults.py:976-979says that 53 min reaches 6 plans in 6 h. The serial round makes this false.
Cause
fix_plan is a JobRow of the model lane after stage (src/devops_cli/roadmap/run.py:943-956). A row of one round starts only after the row before it ends. The interval of the row does not apply while stage runs.
Reproduction Steps
- In Loki (namespace
devops), find the fix_plan selection lines of devops-cli in 24 h, and the stage result line with the same trace id before each one. - Compare the times with
DEFAULT_ROADMAP_FIX_PLAN_INTERVAL_MINUTES(53).
Expected vs Actual Behavior
Expected: a plan pull request that gets plan/needs-fix gets a fix-plan attempt within one poll interval of the watch row, after its 6-hour wait. A release rollout does not stop it.
Actual: the attempt waits for the next full stage round, about 2 h, and a rollout can skip it.
Environment Diagnostics
- DevOps CLI Version: 0.127.1 and 0.128.0 (origin/main 2daf63a)
- Execution Environment: roadmap Service in namespace
devops, rowfix_planin modeplan
Proposed Fix
Run fix-plan as a single-purpose step Job, as #5027 and #5028 do for fix-checks and fix-conflict:
- The watch row (feat(roadmap): one watch row for plan and delivery PRs #5024) turns the label
plan/needs-fix(event and poll) into the due markfix-plan:<pr>. It applies the selection rules of the step (wait, attempt cap, revision cap) before it makes a Job. - The launcher of feat(roadmap): the watch row starts fix-checks Jobs #5027 makes one Job
devops roadmap step fix-plan --pull N --confirm. The unit name holds the pull request and the head, so a repeat create gets 409. - Remove the row
fix_planfrom the model lane. Remove its interval setting from the live ConfigMap before the image rolls (removed-setting rule). Correct the comment atdefaults.py:976-979in the same pull request. - Mode
off,planoron, as the other step Jobs. Timeouts nest: agent run (fix(roadmap): limit each agent run of fix-plan below the budget margin #5379) < step budget < Job deadline.
Acceptance Criteria
- A test: a due mark
fix-plan:<pr>gives one Job manifest thattests/gate/k8s_checks/job_admission_policy.pyadmits, and a second create gets 409. - A test: the model lane has no row
fix_plan(tests/roadmap/test_roadmap_run_job_rows.py). - A test: mode
planmakes no Job and no GitHub write. - A test holds the order: agent run limit < step budget < Job deadline.
- Live, after the merge: a plan pull request that gets
plan/needs-fixgets a Job within one poll interval after its wait. Loki holds one result line for each Job.
Existing Tool Considered
Kubernetes Jobs made from the suspended CronJob devops-cli-runner, through the launcher of #5027. Argo Workflows replaces the launcher after #4566. Cost to build (estimate): 0.8 M tokens and 4 hours elapsed, because #5027 builds the launcher. Keep: one due mark kind and one Job template. Fix: about 0.1 M tokens for each wrong routing rule.
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
#5024 (the watch row) and #5027 (the Job launcher).
Related
#5014 (tracker of the Service step jobs), #5028, #4559 (stage in its own Job), #5211 step 11 (manual App Jobs until this ships).
Source: #4843
Owner decision 2026-11-13
The approved pipeline split (tracker #5482, Phase 3) removes the due mark fix-plan:<pr>. The fix-plan Job is due by its predicate in due_jobs: an open draft plan PR with plan/needs-fix, App-only commits, no claim and no running unit. An evicted attempt does not count, up to 3 for each head; a deadline or oom kill counts (#5493). The live criterion of this item stays.
Alternatives check of 2026-11-28: in-use.
The repository already uses this tool.
Tool: argoproj/argo-workflows (https://github.com/argoproj/argo-workflows), Apache-2.0, last activity 2026-11-28, maintained.
Reason: Searches found Argo Workflows, the engine the project already runs, which can start one workflow per due item outside the serial lane with retries and deadlines; it cannot hold the GitHub due predicate, attempt cap or mode gate, so it covers only part.
Covers:
- One workflow per due item, off the serial lane
- CronWorkflow poll and router submit as trigger
- Retry, deadline and TTL policies per step
- Label selectors and archive for the result line
Lacks:
- GitHub due predicate: plan/needs-fix, App-only commits, no claim
- Attempt count per head, evicted attempt not counted
- Mode off, plan or on gate and the step command
- Launcher move to the engine still waits for feat(k8s): let Argo Workflows run roadmap pods in devops #4566
Proposed design
Problem statement
Hold this item until #6521 closes. The row fix_plan runs only after stage in one serial round, so a plan with plan/needs-fix waits about 2 hours and a release can skip the row. The item starts the fix-plan step as its own Job from the due predicate in due_jobs.
Acceptance criteria
Requirement: The due predicate finds a fix-plan plan pull request
due_jobs SHALL return one fix-plan unit for an open draft plan pull request with plan/needs-fix, App-only commits, no claim and no running unit.
Scenario: A due draft plan pull request
- WHEN A test calls
due_jobswith a draft plan pull request that hasplan/needs-fix, App-only commits, no claim and no running unit. - THEN The call returns one fix-plan unit that names the pull request and its head SHA.
Requirement: The due predicate counts the attempts of one head
due_jobs SHALL not count an evicted attempt, SHALL count a deadline or oom kill, and SHALL allow at most 3 attempts for each head.
Scenario: The attempts of one head
- WHEN A test gives
due_jobsthree attempts for one head: one evicted, one deadline and one oom. - THEN The call reports two counted attempts and allows one more attempt for the head.
Requirement: The fix-plan Job passes the admission policy
The launcher SHALL build the fix-plan Job of a due plan pull request from CronJob devops-cli-runner, and the job admission policy MUST admit it.
Scenario: A fix-plan Job is admitted
- WHEN A test in
tests/gate/k8s_checks/job_admission_policy.pybuilds the fix-plan Job throughrunner_job. - THEN The policy reports no refusal, and the Job and its pod carry the component label
roadmap-fix-plan.
Requirement: The unit name holds the pull request and the head
The unit name of a fix-plan Job MUST hold the pull request number and the head SHA, so a second create for the same head gets 409.
Scenario: The same head gives the same name
- WHEN A test computes the fix-plan unit name twice for one pull request and head, and once for a new head.
- THEN The two names of the same head are equal, and the name of the new head differs.
Requirement: The model lane holds no fix_plan row
The model lane SHALL hold no row named fix_plan.
Scenario: The lane table of the model lane
- WHEN A test builds the lane table in
tests/roadmap/test_roadmap_run_lane_table.py. - THEN No row of the model lane has the name
fix_plan.
Requirement: Mode plan makes no Job and no GitHub write
The watch row in mode plan SHALL create no Job and SHALL send no GitHub write request.
Scenario: A due plan pull request in mode plan
- WHEN A test runs the watch row in mode
planfor a plan pull request thatdue_jobsfinds due. - THEN The launcher is not called, and the GitHub client records no write request.
Requirement: The limits of a fix-plan Job nest
The agent run limit MUST be less than the step budget, and the step budget MUST be less than the Job deadline.
Scenario: The three limits of a fix-plan unit
- WHEN A test reads the agent run limit, the step budget and the Job deadline of a fix-plan unit.
- THEN The agent run limit is less than the step budget, and the step budget is less than the Job deadline.
Requirement: The fix-plan interval setting is removed
The settings model MUST hold no fix-plan interval, and DEFAULT_ROADMAP_FIX_PLAN_INTERVAL_MINUTES SHALL be removed with the row.
Scenario: The settings after the removal
- WHEN A test imports
src/devops_cli/config/settings.pyandsrc/devops_cli/config/defaults.py. - THEN No fix-plan interval field remains, and
DEFAULT_ROADMAP_FIX_PLAN_INTERVAL_MINUTESis not defined.
Requirement: Pending a person after the merge
Before the new image rolls, a person SHALL remove roadmap.fix_plan.interval_minutes from the live ConfigMap, and the Service SHALL create one fix-plan Job for a due plan pull request within one poll interval.
Scenario: The live ConfigMap and the first fix-plan Job
- WHEN A person removes the key from the live ConfigMap, the new image rolls, and a live check runs
kubectl -n devops get configmap devops-cli-config -o jsonpath='{.data.roadmap\.fix_plan\.interval_minutes}'andkubectl -n devops get job -l app.kubernetes.io/component=roadmap-fix-planafter a plan pull request withplan/needs-fixwaits. - THEN The first command prints no value, and the second lists one Job for the pull request.
Existing Tool Considered
argoproj/argo-workflows, verdict in-use: ADR 0008 adopted it, and the repository already uses it. The alternatives check in the issue body gives what the tool covers and what it lacks. The proposal keeps the due predicate in due_jobs, the selection rules and the mode gate in the watch row, and uses the launcher of #5027 until #4566 moves the launcher to Argo Workflows.
Key questions
- Which rule makes a fix-plan Job due?: The predicate in
due_jobsmakes it due. The item uses no due markfix-plan:<pr>. The predicate reads an open draft plan pull request withplan/needs-fix, App-only commits, no claim and no running unit. (best practice) [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md, CONTEXT.md, src/devops_cli/roadmap/fix_checks_row.py]- Chosen: The predicate in
due_jobs. The owner decision of 2026-11-13 names it, and it reads the pull request state that the Job needs. - Rejected: The due mark
fix-plan:<pr>that the watch row sets. The owner decision of 2026-11-13 removes it, because the predicate already holds the state and a due mark is a second copy.
- Chosen: The predicate in
- Which launcher builds the fix-plan Job?: The launcher seam of feat(roadmap): the watch row starts fix-checks Jobs #5027,
runner_jobinsrc/devops_cli/roadmap/job_launcher.py, builds one Job from CronJobdevops-cli-runnerwithdevops roadmap step fix-plan --pull N --confirm. (best practice) [sources: src/devops_cli/roadmap/job_launcher.py, tests/gate/k8s_checks/job_admission_policy.py]- Chosen: The launcher seam of feat(roadmap): the watch row starts fix-checks Jobs #5027. It is the one place that builds a step Job, and the admission policy already admits the Jobs it builds.
- Rejected: A second Job template for fix-plan. A second template doubles the rows of the admission policy and the labels to keep.
- Which command runs one fix-plan step?:
devops roadmap step fix-plan --pull N --confirm. The command has its test attests/commands/test_roadmap_step_fix_plan.py. [sources: tests/commands/test_roadmap_step_fix_plan.py] - How do the limits of a fix-plan Job nest?: The agent run limit is less than the step budget, and the step budget is less than the Job deadline. (best practice) [sources: tests/roadmap/steps/test_roadmap_fix_plan_budget.py, tests/gate/k8s_checks/job_admission_policy.py]
- Chosen: Nest the three limits. A Job deadline under the step budget kills the step before it writes its result line, so the watch row cannot tell a deadline kill from a crash.
- Rejected: One limit for the Job and the step. The same kill then leaves no result line, and the next attempt cannot tell why the step ended.
- How does the due predicate count the attempts of one head?: An
evictedattempt does not count, up to 3 for each head. Adeadlineoroomkill counts, as the owner decision of 2026-11-13 states. (best practice) [sources: src/devops_cli/roadmap/fix_checks_row.py, tests/roadmap/test_roadmap_fix_checks_row.py]- Chosen: Count only a kill that the step caused. The owner decision of 2026-11-13 names it, and an eviction says nothing about the plan.
- Rejected: Count every attempt. A node drain evicts the pod with no fault of the plan, and three drains would retire a healthy head.
- Which live setting must the ConfigMap drop?:
roadmap.fix_plan.interval_minutes. Remove the key from the live ConfigMap before the image rolls, and remove the constant and its settings field in the same pull request. (best practice) [sources: src/devops_cli/config/defaults.py, src/devops_cli/config/settings.py]- Chosen: Remove the key from the live ConfigMap before the image rolls. The key configures a row that the change removes, so the live ConfigMap names only settings that the new image reads.
- Rejected: Keep the key in the ConfigMap. No row reads it after the removal, and a stale key hides that the row is gone.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 13, 2026
Both convert a serial model-lane row into a standalone Job via the watch row, but #5027 targets fix-checks and this candidate targets fix-plan.devops-cli-service commentedon Nov 17, 2026
Alternatives check: in-use
Reason: The searches found only general workflow/job engines (Argo Workflows, Tekton, plain Kubernetes Jobs), and of these Argo Workflows is the one the project has already adopted (ADR 0008) and the issue itself says will replace the hand-built launcher after #4566. It runs a step as its own pod with a deadline and a unique name, which covers the part that removes the serial-round coupling, but it does not turn the plan/needs-fix label into a due unit or apply the wait/attempt/revision caps, so the watch row, due predicate and launcher stay project code.
The repository already uses this tool.
Tool: argoproj/argo-workflows (https://github.com/argoproj/argo-workflows)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at 2620fae (see proposed design in issue body).
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 27, 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.
dan-petty commentedon Nov 30, 2026
Premise check after the release of the hold #6521 (2026-11-30): the stage row now only submits stage Jobs in the no-model lane (
MODEL_LANE_ROWSholdsretitle,fix_plan,refine), so stage no longer blocks fix-plan for 36 to 75 minutes. Closed as not planned (AGENTS.md rule 2); a person may reopen it, or file a new item from fresh evidence.