Skip to content

feat(roadmap): the watch row starts fix-checks Jobs #5027

Description

@dan-petty

Problem or Motivation

After fix-checks, a finished bot pull request that fails a check later still waits for a person: only the runner Job calls the step, and the Job ends at the ready mark. The REPAIR action has no taker after the Job (failure.py:120-122).

Proposed Solution & Architectural Design

  1. Launcher seam: generalize implement_submit._create (:416) into a JobLauncher. It makes a Job from the suspended CronJob devops-cli-runner with arguments only. The admission policy admits this today: it pins the runner image and the 2 sizes, not the arguments (k8s/devops/roadmap-service/admissionpolicy.yaml:16, :48-53, :140-149). A WorkflowLauncher replaces it after feat(k8s): let Argo Workflows run roadmap pods in devops #4566.
  2. The watch row turns the due mark fix-checks: into one Job devops roadmap step fix-checks --pull N, with the size of the plan (1 CPU/2Gi or 4 CPU/6Gi). The unit name is RepoRef.unit_name(FIX_CHECKS, ::), so a repeat gets 409. The Job has its own component and item labels (feat(roadmap): label Service Jobs by repository and item #4558), so the implement lock (implement_submit.py:487) does not count it.
  3. Fix Jobs of finished pull requests go before new implement and stage units under the shared limit of 2 model Jobs.
  4. The Job activeDeadlineSeconds is the step chain plus at least 300 s, because the pod start takes up to 108 s. A structural test fails when request < command < step < unit < 14400 s breaks.
  5. Exit 75: the Service creates the next attempt from the failure ledger, with a capped backoff. _report_ended (implement_submit.py:394) reports an ended fix Job, and an attempt with no result line counts as outcome none and fires an alert.
  6. Mode off, plan or on: 1 week in plan mode (the plan goes to Loki, nothing to GitHub), and only pull requests with no live unit.

Spend: at most 4M tokens for each Job, under owner decision O5. Cost: about 1.2M tokens and 1 agent-day.

Target Subsystem

Roadmap Service Job launcher (implement_submit.py), the runner CronJob template and the admission policy tests.

Existing Tool Considered

Kubernetes Jobs made from the suspended CronJob devops-cli-runner, which the admission policy admits today. Argo Workflows replaces the launcher after #4566.

Acceptance Criteria

  • Tests: a due mark gives one Job manifest that the gate check tests/gate/k8s_checks/job_admission_policy.py admits; a second create gets 409; a fix Job goes before a new implement Job; plan mode sends 0 GitHub writes; the timeout-chain test passes.
  • Live, after 1 week in plan mode: kubectl get jobs -n devops with the component label value roadmap-fix-checks (ADR 0022) lists the Jobs, and Loki shows each would-be fix.

Dependencies

Source: #5014

Owner decision 2026-11-13

No due mark: the fix-checks Job is due by its predicate in due_jobs (#5504). The unit name comes from <pr>:<head>:<check>. A fix Job goes before a new stage or implement unit. Source: tracker #5482, Phase 3.

  • Live proof: after the merge and the release, a bot PR with a failed required check gets one fix-checks Job as the App. A comment gives the result line.

Alternatives check of 2026-11-15: 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-14, maintained.

Proposed design

Problem statement

After fix-checks, a finished bot pull request that fails a check later still waits for a person: only the runner Job calls the step, and the Job ends at the ready mark, so the REPAIR action of a failed test, lint, types or conflict class has no taker. This item makes the watch row start one fix-checks Job for that pull request, before new implement and stage work, under the shared limit of 2 model pods. The step's repair command with its fixers (#5976, v0.165.0) and its guards (#5986, v0.165.2, closes #5983) have landed, so the block of the last plan is gone. After the merge and the release, the owner asks for a live proof: a bot pull request with a failed required check gets one fix-checks Job as the App, and a comment gives the result line.

Acceptance criteria

Requirement: One launcher seam

The Service SHALL build each fix-checks Job from the suspended CronJob devops-cli-runner through one launcher seam that takes the arguments, the size and the row labels only.

Scenario: The launcher builds a fix Job

  • WHEN the launcher builds a fix-checks Job for pull request 7 of owner/name with head <head>, the check Static Analysis, the large size and the row fix-checks
  • THEN the manifest names the runner image, the args roadmap step fix-checks --repo owner/name --pull 7 --head <head> --confirm, 4 CPU with 6Gi and no command, and the gate check tests/gate/k8s_checks/job_admission_policy.py admits it

Requirement: The watch row starts the fix Job

The watch row SHALL create exactly one fix-checks Job when its due predicate holds for a finished bot pull request with a failed required check.

Scenario: A failed required check

  • WHEN the watch row runs for a bot pull request with a failed required check, no live unit and no fix Job for that head and check
  • THEN the Service creates one Job with the component label roadmap-fix-checks and the args of the fix-checks step

Requirement: A repeat create is refused

The Service MUST name the fix unit RepoRef.unit_name(ServiceRow.FIX_CHECKS, "<pr>:<head>:<check>", item), so that a second create for the same head and check is refused.

Scenario: A second create for the same unit

  • WHEN the watch row asks for a fix Job for a <pr>:<head>:<check> that already has a Job
  • THEN the create returns 409 and the cluster holds one Job for that unit

Requirement: The fix Job takes no implement lock

The fix Job MUST carry the component label roadmap-fix-checks and the owner, repository and item labels of ADR 0022, and MUST NOT carry the implement-repo label.

Scenario: A live fix Job and a due implement unit

  • WHEN a fix-checks Job is live for a repository and a new implement unit is due
  • THEN implement_submit._runs reports no live implement Job for that repository, and the Service creates the implement Job

Requirement: A fix Job goes first under the shared limit

The Service SHALL start a due fix Job of a finished pull request before a new implement or stage unit, and MUST hold all model Jobs to a shared limit of 2.

Scenario: A fix Job and a new unit wait

  • WHEN one fix Job is due, a new implement unit is due and no other model Job runs
  • THEN the Service creates the fix Job first and creates no third model Job

Requirement: Plan mode writes nothing

In plan mode the Service MUST run the step without --confirm, so the step writes nothing to GitHub, to the store or to the branch, and MUST send the planned action to Loki.

Scenario: Plan mode runs a fix Job

  • WHEN the mode setting is plan and a fix Job is due
  • THEN the Job runs devops roadmap step fix-checks --repo owner/name --pull N --head <head> with no --confirm, the result line is planned with the action, and no GitHub write happens

Requirement: The deadline nesting holds

The fix Job MUST set activeDeadlineSeconds at least 300 s above the step chain and at most 14400 s, and a structural test MUST fail when the order request < command < step < unit < 14400 s breaks.

Scenario: A deadline that breaks the order

  • WHEN a fix Job manifest sets activeDeadlineSeconds to 14401, or to less than the step chain plus 300 s
  • THEN the structural test fails and the admission policy refuses the manifest

Requirement: An evicted pod gets the next attempt

The Service SHALL report an ended fix Job and MUST create the next attempt as a new Job under the capped continuation rule when its pod exits 75 or leaves no result line, and MUST record a Job with no result line as the stop job.

Scenario: A pod exits 75

  • WHEN a fix Job pod exits 75 with no result line
  • THEN the Service reports the ended Job, records the stop job, and creates the next attempt under roadmap.implement.continuations_per_item

Requirement: The token budget is a setting

The model fix of one fix-checks Job MUST stop at roadmap.fix_checks.token_budget, whose default is 16,000,000 new tokens (uncached input plus output).

Scenario: The default budget

  • WHEN no value sets roadmap.fix_checks.token_budget
  • THEN the setting reads 16000000 and the step stops the model fix at that count

Requirement: The shipped mode

The mode setting roadmap.fix_checks.mode MUST take off, plan or on, and k8s/devops/configmap.example.yaml MUST set on.

Scenario: The rendered ConfigMap

  • WHEN the template k8s/devops/configmap.example.yaml is rendered
  • THEN the mode value is on, and the setting accepts off, plan and on only

Requirement: The fix-checks task entry

The ConfigMap MUST set ai.tasks.fix_checks to the DeepSeek model with a context window of 256000 after the release image that declares the key runs.

Scenario: The rendered ConfigMap

  • WHEN the template k8s/devops/configmap.example.yaml is rendered on the release image that declares ai.tasks.fix_checks
  • THEN the task fix_checks names openrouter/deepseek/deepseek-v4.1-flash with context_window: 256000, and an image that does not declare the key refuses the entry

Existing Tool Considered

Argo Workflows (https://github.com/argoproj/argo-workflows, Apache-2.0, maintained, last activity 2026-11-14) is in use: the repository already uses it, and a WorkflowLauncher replaces the Job launcher after #4566. It lacks the roadmap glue that this item needs: the due predicate, the unit name and its 409, the failure ledger and the exit-75 next attempt, the plan-mode routing to Loki, and the rule that puts fix Jobs before new implement and stage units. It also lacks the component and item labels of #4558, it does not admit the runner image and the two sizes through the admission policy, and it needs the engine and its controller in the cluster (#4566). Until then the launcher makes Kubernetes Jobs from the suspended CronJob devops-cli-runner, as ADR 0021 section 8 gives the fix unit. The launcher seam and its glue cost about 1.2M tokens and 1 agent-day.

Key questions

  • Which launcher does the Service use for a fix-checks Job?: A Kubernetes Job made from the suspended CronJob devops-cli-runner through one launcher seam that takes the args, the size and the row labels only; the seam passes --repo <owner/name>, as the implement Job does. A WorkflowLauncher replaces the seam after feat(k8s): let Argo Workflows run roadmap pods in devops #4566. (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:195, k8s/devops/roadmap-service/admissionpolicy.yaml, src/devops_cli/k8s/cluster_job.py:59, src/devops_cli/roadmap/implement/implement_submit.py:498]
    • Chosen: A Job from the suspended CronJob behind one launcher seam. ADR 0021 section 8 gives the fix unit as a Job from devops-cli-runner with arguments only before the engine step, and the admission policy admits that template today.
    • Rejected: Argo Workflows now. It needs the engine and its controller in the cluster (feat(k8s): let Argo Workflows run roadmap pods in devops #4566), and ADR 0021 gives it the Workflow after the engine step.
    • Rejected: One CronJob for each fix-checks run. A CronJob runs on a schedule and the Service cannot set the arguments of one pull request.
  • How does the Service find a fix-checks Job due, and which name does its unit take?: No due mark: the owner decision of 2026-11-13 makes the fix-checks Job due by its predicate, and the watch row's pure router due_steps holds that predicate until the due_jobs row of feat(roadmap): one due_jobs function names the due jobs of an item #5504 lands (the code holds no due_jobs today). The unit name is RepoRef.unit_name(ServiceRow.FIX_CHECKS, "<pr>:<head>:<check>", item): ADR 0022 makes the item the <n> of the unit and the pull request, head and check its input key, so the same inputs give the same name and a second create gets 409. A fix Job goes before a new stage or implement unit. (best practice) [sources: src/devops_cli/roadmap/steps/watch.py:52, src/devops_cli/roadmap/steps/watch.py:240, src/devops_cli/github/repo_ref.py:178, docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md:62, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:174]
  • Which labels does the fix Job carry, and does it hold the implement lock?: The component roadmap-fix-checks, the part-of, managed-by, owner, repository and item labels of ADR 0022, and no implement-repo label. build_job adds implement-repo to every Job of the runner template when it gets repo, so the seam must suppress that label for the fix-checks row. The implement lock implement_submit._runs lists Jobs by implement-repo and then does not count the fix Job. (best practice) [sources: docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md:74, docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md:80, src/devops_cli/k8s/cluster_job.py:255, src/devops_cli/roadmap/implement/implement_submit.py:571]
    • Chosen: Its own component and no implement-repo label. ADR 0022 puts implement-repo on implement Jobs only, and the implement lock lists by that label.
    • Rejected: Accept that a fix Job holds the implement lock. A fix Job would block the implement work that the owner wants to go first.
  • What limits how many model Jobs the Service runs, and where does a fix Job sit in it?: A shared limit of 2 model pods, from the semaphore agent of ADR 0021 section 5. The code holds no shared count today: roadmap.stage.jobs is 1 for every repository, and the implement lock allows 1 runner Job for each repository, so this item adds the shared count. A due fix Job goes before a new stage or implement 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:97, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:196, docs/CLUSTER.md:46, src/devops_cli/roadmap/implement/implement_submit.py:571]
    • Chosen: Add a shared limit of 2 model Jobs, with fix Jobs first. ADR 0021 section 5 admits 2 model pods through the semaphore agent, and section 8 puts the fix unit before a new implement or stage unit.
    • Rejected: Keep the row limits only. The row limits let more than 2 model Jobs run at once, so the fix Jobs would not go first.
  • What caps the model fix of one fix-checks Job?: The setting roadmap.fix_checks.token_budget, default 16,000,000 new tokens (uncached input plus output). The code already implements it, and the Status History of ADR 0021 records it; it replaces the 4,000,000 of the body and of section 8. [sources: src/devops_cli/config/settings.py:1911, src/devops_cli/config/defaults.py:1154, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:330]
  • Which mode does the Service ship, and what does plan mode write?: The mode lives in roadmap.fix_checks.mode with the values off, plan and on, as ADR 0021 section 8 gives every row; the field defaults to plan, and k8s/devops/configmap.example.yaml sets on. In plan mode the Job runs the step without --confirm, which returns planned with the action and writes nothing to GitHub, to the store or to the branch. (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:128, k8s/devops/configmap.example.yaml:210, src/devops_cli/roadmap/steps/fix_checks.py:20, openspec/specs/roadmap-fix-checks/spec.md:98]
    • Chosen: Ship on through the ConfigMap template. The owner direction of 2026-11-16 sets on in k8s/devops/configmap.example.yaml and removes the week in plan.
    • Rejected: One week in plan. The owner direction of 2026-11-16 removes the week in plan.
    • Rejected: Ship off. The item would deliver no fix Job.
  • Which image accepts the ConfigMap entry ai.tasks.fix_checks?: The code at this commit already declares the task (AIFixChecksTaskOverride, a default window of 128,000 tokens), and it shipped with the fix-checks command wiring (fix(roadmap): Give the fix-checks command a checkout and its fixers #5976, v0.165.0), so the release image of this change accepts the entry. The ai sections refuse an unknown key, so the entry ships after that image runs; the roadmap section ignores an unknown key, so the roadmap.fix_checks.mode entry is safe earlier. [sources: src/devops_cli/config/settings.py:737, docs/ENV_VARS.md:55, openspec/changes/archive/2026-11-16-5971-fix-checks-command-wiring/proposal.md:21, CHANGELOG.md:33]
  • What deadline does a fix Job set?: The step chain plus at least 300 s, because the start of a pod takes up to 108 s, and at most the 14400 s cap that the admission policy holds. A structural test holds the order request < command < step < unit < 14400 s. (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:198, docs/CLUSTER.md:67, tests/gate/k8s_checks/job_admission_policy.py]
    • Chosen: The step chain plus 300 s, inside the 14400 s cap. ADR 0021 section 8 gives the unit deadline as the sum of the step limits plus at least 300 s, and the policy refuses a deadline above 14400 s.
    • Rejected: The 14400 s cap for each fix Job. A stuck fix Job would hold a model slot for the full cap.
  • How does the Service continue a fix Job that exits 75 or ends with no result line?: Exit 75 is EX_TEMPFAIL for a pod that an eviction, a drain or a stop of the Service ended. The Service reports the ended Job and creates the next attempt as a new Job under the capped continuation rule (roadmap.implement.continuations_per_item, default 2), and a Job that leaves no result line is the stop job. The failure ledger counts failed rounds of a row, so it does not hold a pod eviction. (best practice) [sources: src/devops_cli/roadmap/attempt_kill.py:25, docs/CLUSTER.md:47, src/devops_cli/roadmap/implement/implement_submit.py:410, CONTEXT.md:52]
    • Chosen: A new Job under the capped continuation rule. The implement row already continues a Job that ended with no result within a limit, and exit 75 is the evicted case that the attempt kill writes for exactly that retry.
    • Rejected: The failure ledger with a capped backoff. The ledger counts failed rounds of a row and suspends the row; a pod eviction is a Job that ended, not a failed round.
    • Rejected: One attempt only. An eviction would lose the fix and leave the pull request to a person.
  • Which work must land before the launcher starts a fix-checks Job?: None. The guards of fix(roadmap): Guard fix-checks against a live Job and a repeated failure #5983 landed in v0.165.2 through fix(roadmap): Guard fix-checks against a live Job and repeats #5986 (the step skips an item with a live implement Job, skips a head and check whose round ended, and reaches the ready path after three repairs), and the repair command with its fixers landed in v0.165.0 through fix(roadmap): Give the fix-checks command a checkout and its fixers #5976. The reply that blocked the item on fix(roadmap): Guard fix-checks against a live Job and a repeated failure #5983 is out of date. [sources: CHANGELOG.md:11, src/devops_cli/roadmap/steps/fix_checks.py:5, src/devops_cli/commands/roadmap_step_fix_checks.py:60, CHANGELOG.md:33]
  • Which failed checks stay out of this item?: A failed Semantic PR title check. The fix step is file-scoped: tier 2 runs only when the log names a path of the plan scope, and a title is not a file; the retitle row owns titles. The fix Job therefore never takes a title failure, and a title repair stays out of this item. (best practice) [sources: .github/workflows/pr-title.yml:31, openspec/specs/roadmap-fix-checks/spec.md:51, docs/CLUSTER.md:46]
    • Chosen: Leave a failed Semantic PR title check out of this item. The step's tier 2 is confined to the plan scope and stops when the log names no path, and the retitle row already owns titles.
    • Rejected: Repair a title failure in the fix Job. A title is no file, so the step has no fixer for it; that work belongs to the retitle row.
  • Which repair does ADR 0021 give a plan draft, and what does the step do today?: ADR 0021 section 8 says a plan draft gets the stage plan repair in its change folder, but the step today runs the generic model fix in the plan scope (Plan: repair check ... with tier 1, then the model in the plan scope). The difference is taken out of this item as a new issue, because the launcher can ship without it. [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md:205, src/devops_cli/roadmap/steps/fix_checks.py:552]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    on Nov 12, 2026
  2. added
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/high
    on Nov 12, 2026
  3. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 12, 2026
  5. 10 remaining items

  6. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

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

    Moved to new items: #5997.

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

    @devops-cli-service
    Contributor

    Live since 2026-11-16 20:17 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/highpriority/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