Skip to content

feat(roadmap): run each stage item in its own Job #4559

Closed
2 of 2 issues completed
Closed

Description

@dan-petty

Problem or Motivation

Stage runs 1,244 s at p50 and 6,547 s at p99 on this repository, in the roadmap Service pod. About 19 releases and ConfigMap edits a day restart that pod. Since 2026-11-07, 53 of 71 restarts killed a running stage round, and a killed round runs again from its start (src/devops_cli/roadmap/run.py:1488). At this rate a stage round of p90 length finishes with about a 44 % chance (estimate). Stage opens about 11 draft pull requests a week.

Implement left the Service pod in #2667 with no shared store but GitHub and the Kubernetes API. Stage can do the same. It is the row that restarts kill most, so it moves first, before any Valkey work.

Proposed Solution & Architectural Design

  • Template: a suspended CronJob roadmap-stage in k8s/devops/, in the form of cronjob-runner.yaml, on the Service image (stage needs openspec and its read tools). Labels and names from the naming ADR: app.kubernetes.io/name: devops-cli-job, app.kubernetes.io/component: roadmap-stage, roadmap.devops-cli/owner, roadmap.devops-cli/repo, roadmap.devops-cli/item; OTEL_SERVICE_NAME=roadmap-stage. ServiceAccount devops-cli, automountServiceAccountToken: false. secretKeyRef for only the keys that stage needs (App key, gateway key, MCP token), not envFrom. emptyDir home with git clone --filter=blob:none. Requests 250m and 1Gi, limits 1 CPU and 2Gi. activeDeadlineSeconds: 10800. podFailurePolicy (Ignore on DisruptionTarget; FailJob on exit codes other than 75), backoffLimit: 2.
  • Generalise the Job build of src/devops_cli/k8s/cluster_job.py from one template name to roadmap-* templates. Extend k8s/devops/roadmap-service/admissionpolicy.yaml (feat(k8s): an admission policy pins the Jobs the roadmap Service may create #2696) to this template and image. The Role of roadmap-service gets get on the new CronJob and delete on its Jobs. The runner Job uses the same blobless clone.
  • Entry point: a new option that runs the normal stage selection narrowed to one item and keeps every rule, including the rejected-plan rule and the failure wait (src/devops_cli/roadmap/stage/stage.py:497-510,1990). --item stays for a person. The entry point calls network.set_model_call_limit(1) (src/devops_cli/ai/client/network.py:500-530).
  • The stage row in the Service becomes a submit. It runs the orphan rule of stage_pending.py:52-62 first, lists the Ready items that the selection would take, lists the stage Jobs by label, and creates one Job for each item that has none, up to roadmap.stage.jobs Jobs at once (new setting; the owner sets the value, proposed 1). It deletes a Failed Job of an item when the failure ledger allows a retry. It writes the last success at the submit. It reports an ended Job into the failure ledger, keyed by item, as implement reports its Jobs.
  • Name: the unit name of the naming ADR, devops-cli-stage-<slug>-<n>-<10 hex of sha256(key, n, input key)>, at most 63 characters, so a repeated create gets 409.
  • Until "feat(roadmap): keep plan records and record locks in Valkey", the plan record of a Job lives in its emptyDir, so a rerun after a failed push plans again (tokens). Until "feat(service): share the GitHub budget and holds in Valkey", the Job paces by GitHub's headers and its own ledger, as the runner Job does, and the Service counts each stage Job's measured requests as a reserve in its own window.
  • The planner run tool of feat(k8s): manifest and admission policy for planner sandboxed run job #4003 and feat(roadmap): wire sandboxed run tool into stage toolbox and prompt #4098 creates a sandboxed Job from the stage process. A stage pod with no API token cannot do that. State in the design how the run tool works from a stage Job (for example, a narrow Role that creates only the run Job template), or keep the run tool off in a stage Job until a later item.
  • The engine item later moves this template to WorkflowTemplate roadmap-stage.

Removes: the in-pod body of _run_stage_adapter (run.py:604-636), the use of model-clone by stage, stage from MODEL_LANE_ROWS. The pull request states the lines it removes and adds.

Target Subsystem

SDLC, Git & PR Governance (roadmap stage: src/devops_cli/roadmap/, src/devops_cli/k8s/cluster_job.py, k8s/devops/).

Existing Tool Considered

The implement Job path of #2667 (implement_submit.py:19-26: the Job list is the lock) and Kubernetes podFailurePolicy. Cost: about 200,000 tokens and 9 hours to build, about 15,000 tokens a month to keep, about 30,000 tokens to fix.

Acceptance Criteria

  • Live: a stage Job runs to the end while the Service rolls out, and the draft pull request appears.
  • A second submit of the same item makes no second Job, whatever the plan key.
  • At most roadmap.stage.jobs stage Jobs run at once.
  • A Job deleted by a node drain is retried; a Job that exits 1 is not.
  • A kill test: the Job is killed after each GitHub write, then runs again, and the item ends with one pull request and all marks.
  • The stage counters and histogram reach Prometheus by OTLP with the row in their labels; the dashboards that read the Service series change in the same pull request.
  • Before it ships: the GitHub requests of one stage Job with a cold cache are measured and stated, against the 3,357 requests a day of the stage row.
  • Measure after 7 days: stage rounds killed by a Service shutdown, 0; draft pull requests from stage a week, more than 11; stage pod deaths not caused by a deletion, counted.

Dependencies

Source: #4517

Alternatives check of 2026-11-12: partly.
Tool: argoproj/argo-workflows (https://github.com/argoproj/argo-workflows), Apache-2.0, last activity 2026-11-12, maintained.

Owner decision 2026-11-13

The approved pipeline split (tracker #5482, Phase 1, D1) changes this scope. This body holds too many requirements for one PR, so it is divided:

  1. feat(roadmap): add the stage Job template and one-item entry point #5483 (part 1): the stage Job template, the Role, the admission policy, the one-item entry point, the 3 stage keys and the stage request budget.
  2. This item (part 2): a status-lane row submits one stage Job for each Ready item, and the in-pod stage path goes.

Changes to the design above:

Owner decision 2026-11-13: check-out

The owner decision of 2026-11-13 makes each job check its item out and in (#5524). #5483 adds the stage marks stage.job, stage.job_at, stage.job_deadline and stage.job_result, and the check-in of the Job.

  • The submit of this item writes the check-out (stage.job with the Job name, stage.job_at and stage.job_deadline) in the same pass that creates the Job.

  • The poll of feat(roadmap): the poll frees the check-out of a gone job #5524 frees the check-out of a missing, failed or late stage Job and records the class.

  • A test: the submit writes the check-out with the Job name and the deadline when it creates the Job, and creates no Job for an item whose check-out names a live Job.

Proposed design

Problem statement

A stage run takes 1,244 s at p50 and 6,547 s at p99 in the Service pod. About 19 releases and ConfigMap edits a day restart that pod, and 53 of 71 restarts since 2026-11-07 killed a running stage round. A killed round starts again from its start. This item makes the Service submit each stage item as its own Job, writes the check-out at the submit, reports the ended Job into the failure ledger, and removes the in-pod stage path.

Acceptance criteria

Requirement: Stage submit row

The Service SHALL run a status-lane row that creates one stage Job for each Ready item that has no stage Job, up to roadmap.stage.jobs Jobs at once.

Scenario: Two Ready items and a limit of one

  • WHEN A test runs the row with two Ready items, a limit of one and no stage Job.
  • THEN The row creates one stage Job and creates no second Job in that round.

Requirement: Check-out at the submit

The submit SHALL write stage.job with the Job name, stage.job_at and stage.job_deadline in the same pass that creates the Job.

Scenario: Marks of a new Job

  • WHEN A test runs the submit for one Ready item that has no check-out.
  • THEN The record of the item holds the name, the time and the deadline of the new Job.

Requirement: Live check-out holds the item

The submit SHALL create no stage Job for an item whose check-out names a live Job.

Scenario: Item with a running Job

  • WHEN A test runs the submit for a Ready item whose stage.job names a Job that is running.
  • THEN The row creates no Job and leaves the check-out as it is.

Requirement: Idempotent stage Job name

The stage Job name SHALL derive from the item and the plan key and SHALL be at most 63 characters.

Scenario: Repeated create of one item

  • WHEN A test builds the name of one item and plan key twice and creates the Job twice.
  • THEN The two names are equal and at most 63 characters long, and the second create gets 409.

Requirement: Stage failure ledger

The submit SHALL report each ended stage Job into the failure ledger, keyed by item, and SHALL delete a Failed Job only when the ledger allows a retry.

Scenario: Ended Job with a failure

  • WHEN A test ends a stage Job with a failure and runs the row.
  • THEN The ledger holds one entry for the item, and the row deletes the Job only when that entry allows a retry.

Requirement: Orphan mark before a create

The submit SHALL judge the orphan mark of stage_pending.py before it creates a stage Job.

Scenario: Old orphan mark

  • WHEN A test runs the row with an item whose stage.pending mark is older than the age limit and whose branch is on origin.
  • THEN The row removes the orphan branch before it creates any Job.

Requirement: In-pod stage path removed

The change SHALL remove the in-pod body of _run_stage_adapter, the use of model-clone by stage and the stage row of MODEL_LANE_ROWS, with no shim.

Scenario: Row and adapter inspection

  • WHEN A test reads src/devops_cli/roadmap/run.py.
  • THEN MODEL_LANE_ROWS holds no stage row and the file holds no in-pod stage adapter body.

Requirement: Branch is the checkpoint

The stage Job SHALL keep no plan record on a volume, and a rerun SHALL resume from the branch of the item.

Scenario: Rerun after a kill

  • WHEN A test kills the Job after its branch push and runs the entry point again with a fake client.
  • THEN The second run makes no planner call and the item ends with one branch and one draft pull request.

Requirement: Stage result line

A stage attempt SHALL write a result line with attempt, tokens, cost_usd_micros and extensions, and its intended result SHALL stay staged.

Scenario: Result line of a staged attempt

  • WHEN A test runs the entry point for one item to a draft pull request.
  • THEN The result line holds the four fields and the result staged.

Requirement: Stage Job request reserve

The Service SHALL subtract the request budget of each running stage Job from its self-cap.

Scenario: Two running stage Jobs

  • WHEN A test reads the self-cap with two running stage Jobs of known budgets.
  • THEN The self-cap is its own value minus the sum of the two budgets.

Requirement: Stage series in the dashboards

The dashboards that read the stage series SHALL select the stage Job series in the same pull request.

Scenario: Dashboard query of a stage panel

  • WHEN A test reads the dashboard JSON of the stage panels.
  • THEN Each stage query selects the series that the stage Job sends, and the step histogram keeps the row stage.

Existing Tool Considered

Argo Workflows (https://github.com/argoproj/argo-workflows, Apache-2.0, last activity 2026-11-12, maintained) covers the execution, retry and isolation half. It runs each unit in a pod of its own, with a queue, retry expressions, template checks and a deadline, and ADR 0008 (kept by ADR 0021) chose it as the engine for this work. No ADR rejects it. It lacks the roadmap stage selection narrowed to one item with the rejected-plan rule and the failure wait, the failure ledger keyed by item and its retry gate, the deterministic hashed Job name, the plan record and the GitHub budget pacing of a stage Job, and the submit row, the admission policy and the Role rows. The owner decision of 2026-11-13 keeps plain Kubernetes Jobs first and leaves the WorkflowTemplate to the engine item. This item builds the submit row itself. Cost: about 200,000 tokens and 9 hours to build, about 15,000 tokens a month to keep, about 30,000 tokens to fix.

Key questions

  • Which part of the split does this item deliver?: Part 2: the status-lane row that submits one stage Job for each Ready item, the check-out at the submit, the failure ledger report, the self-cap reserve, the result-line fields and the removal of the in-pod stage path. Part 1 (feat(roadmap): add the stage Job template and one-item entry point #5483) holds the CronJob template, the Role, the admission policy, the one-item entry point, the 3 stage keys and the stage request budget with its cold-cache measurement. (best practice) [sources: src/devops_cli/roadmap/run.py:1041, src/devops_cli/roadmap/stage/stage.py]
    • Chosen: Part 2 as the owner decision divides it. The owner decision of 2026-11-13 divides the body because it holds too many requirements for one pull request.
    • Rejected: The whole design in one pull request. The owner decision divides it, and part 1 is its own item.
    • Rejected: Keep the in-pod stage path as a shim. The owner decision removes it with no shim.
  • Does a stage Job keep a plan record on a volume?: No. The branch is the checkpoint (feat(roadmap): scaffold makes, resumes or adopts the item branch #5499, fix(roadmap): the final push of the implement Job can miss the latest main #4957), so the change deletes the kept plan file and the stage entry point writes no plan record. A rerun after a killed attempt resumes from its branch with no planner call. (best practice) [sources: src/devops_cli/roadmap/stage/stage_plan_record.py, src/devops_cli/roadmap/stage/stage.py]
    • Chosen: The branch is the checkpoint. The owner decision of 2026-11-13 makes the branch the checkpoint and deletes the kept plan file.
    • Rejected: A plan record in the emptyDir of the Job. A rerun after a failed push plans again and spends tokens, and the owner decision removes it.
  • How does the Service find the Ready items that need a stage Job?: From the labels and the record. The row lists the Ready items that the normal selection would take and the stage Jobs by label, and it creates one Job for each item that has none. No due mark is set or read. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/stage/stage.py]
    • Chosen: The labels and the record. The owner decision of 2026-11-13 states that the Ready set comes from the labels and the record.
    • Rejected: A due mark in Valkey. The due mark needs the shared store that a later item adds.
  • What limits the number of running stage Jobs?: The setting roadmap.stage.jobs of feat(roadmap): make the attempt limits of the failing jobs settings #5440, with a proposed value of 1. This item reads no roadmap-limits ConfigMap, which does not exist before feat(k8s): let Argo Workflows run roadmap pods in devops #4566, and feat(roadmap): the decision model judges stage gate extensions #5386 judges an extension. (best practice) [sources: src/devops_cli/roadmap/run.py, src/devops_cli/ai/client/network.py:500-530]
  • Which lane runs the stage submit row?: The status lane. The row calls no model: it lists the items and the Jobs and creates Jobs, and the Job makes the model calls. Stage leaves MODEL_LANE_ROWS. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/run.py:1041]
    • Chosen: The status lane. A row that calls no model runs on the status lane.
    • Rejected: The model lane. It would hold the model lane slot for a row that makes no model call.
  • How does a repeated submit avoid a second stage Job?: The Job name is devops-cli-stage-<slug>-<n>-<10 hex of sha256(key, n, input key)>, at most 63 characters. The same item and plan key give the same name, so a repeated create gets 409. The check-out stage.job also names the live Job, so the row creates none for that item. (best practice) [sources: src/devops_cli/k8s/cluster_job.py, src/devops_cli/roadmap/stage/stage.py]
    • Chosen: A hash of the plan key. The same item and plan key give the same name, so a repeated create is refused.
    • Rejected: A timestamp and a random suffix. A second submit would create a second Job.
  • How does the submit handle an ended stage Job?: It reports the ended Job into the failure ledger, keyed by item, as the implement submit row does. It deletes a Failed Job of an item only when the ledger allows a retry. The poll of feat(roadmap): the poll frees the check-out of a gone job #5524 frees the check-out of a missing, failed or late Job and records the class. (best practice) [sources: src/devops_cli/roadmap/implement/implement_submit.py, src/devops_cli/roadmap/failure.py]
    • Chosen: One ledger keyed by item, as implement. One ledger shape serves both Jobs, and the failure wait of the item reads the same record.
    • Rejected: A second ledger for stage Jobs. It duplicates the failure wait and the retry rule of the existing ledger.
  • What does the submit write for the check-out?: stage.job with the Job name, stage.job_at and stage.job_deadline, in the same pass that creates the Job. The row creates no Job for an item whose check-out names a live Job. feat(roadmap): add the stage Job template and one-item entry point #5483 adds the marks and the check-in of the Job. (best practice) [sources: src/devops_cli/roadmap/implement/implement_submit.py, src/devops_cli/roadmap/stage/stage_pending.py:52-62]
    • Chosen: Write the check-out in the create pass. The owner decision of 2026-11-13 writes the check-out in the same pass that creates the Job.
    • Rejected: Write the check-out after the create. A round that dies between the two leaves a Job that no item names.
  • Which result line does a stage attempt write?: The shared result line with attempt, tokens, cost_usd_micros and extensions (feat(roadmap): result lines state first-pass, model calls and cost #5168, feat(roadmap): result lines state attempt, class, pipeline and unit #5500). A trial arm uses the trial field of feat(roadmap): trial a model tier on a share of a job's attempts #5177. The intended result stays staged. (best practice) [sources: src/devops_cli/roadmap/job_result.py, src/devops_cli/roadmap/stage/stage.py]
    • Chosen: The shared result line. The owner decision of 2026-11-13 states these fields, and the base of 5 of 15 stays comparable.
    • Rejected: A stage-only result line. The job grade and the eval read one line shape.
  • Does the planner run tool of feat(k8s): manifest and admission policy for planner sandboxed run job #4003 and feat(roadmap): wire sandboxed run tool into stage toolbox and prompt #4098 work from a stage Job?: No. The run tool stays off in a stage Job until a later item. The pod sets automountServiceAccountToken: false and the admission policy refuses any other value, so a stage Job cannot create a run Job. (best practice) [sources: k8s/devops/roadmap-service/admissionpolicy.yaml, CONTEXT.md]
    • Chosen: Keep the run tool off. The stage Job has no API token, so it cannot create a run Job.
    • Rejected: A narrow Role that creates only the run Job template. It adds a second Job template and a privileged path before the stage Job works.
  • How do the Service and the stage Jobs share the GitHub request budget until Valkey holds it?: The Service subtracts the request budget of each running stage Job from its self-cap (feat(service): give each roadmap pod an hourly request budget #5497). Each Job paces by GitHub's headers and its own ledger, as the runner Job does. (best practice) [sources: src/devops_cli/roadmap/implement/implement_submit.py]
    • Chosen: Reserve the request budget of each running Job. The owner decision of 2026-11-13 subtracts the budget of each running stage Job from the self-cap.
    • Rejected: Wait for the shared budget in Valkey. It holds this item behind a later item.
  • Which container layout does the stage unit use?: The one-container stage template that feat(roadmap): add the stage Job template and one-item entry point #5483 adds. After feat(roadmap): the model container of a unit holds no credential #5506 merges, the stage unit uses the two-container template. (best practice) [sources: k8s/devops/roadmap-service/admissionpolicy.yaml, src/devops_cli/k8s/cluster_job.py]
  • Who confirms the live proof, and what does the comment state?: The owner confirms it after the merge and the release, on 7 days of stage Jobs. The comment states the result lines, 0 stage attempts stopped by a Service restart, one killed attempt that resumed from its branch with no new planner call, and the hop from Ready to the Job of one status-lane interval or less. (a person decides)

Open questions

  • Who confirms the live proof, and what does the comment state? (a person decides)

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#4485, #4467, #4527, #4545, #4555, #4558, #4957, #5168, #5440, #5483, #5497, #5499, #5500, #5524

Sub-issues

Sub-issues

2 of 2 Issues completed
Loading 2 sub-issues

Activity

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

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P1-High. A 44 percent chance of a stage round failing makes this a high-impact reliability fix.
    • Value: High. It removes the main cause of lost stage work and restores predictable stage throughput.
    • Effort: High. It needs a new CronJob template, a new entry point, Service submit logic, and removal of in-pod stage code.
    • Related: feat(k8s): the implement job runs as a cluster Job on a runner image with uv, the dev dependencies and the pinned tools, submitted by the Service #2667, which asks for a different change. Both move a roadmap lane row from the Service pod to cluster Jobs submitted by the Service; #2667 does this for implement, the candidate does it for stage.
  4. added
    priority/p1-high
    on Nov 11, 2026
  5. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    The proposal at 5f75d25 needs splitting into 4 items. A person splits the item into the items below, or replies in a comment or edits the body to keep one item, and the next refine round looks at the item again.

    1. feat(k8s): add the roadmap-stage CronJob template and the stage admission policy
    2. feat(roadmap): add a single-item stage Job entry point with the normal selection rules
    3. feat(roadmap): submit stage items as Jobs from the Service with an idempotent name and a failure ledger
    4. chore(monitoring): move the stage series and dashboards to the stage Job row
  6. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Related to #4796 (filed 2026-11-11). #4796 makes the model lane run stage before refine, so the first round of a new Service pod gives stage its turn. It is a small fix until this item moves stage off the model lane. It does not stop a restart from cutting a stage round in flight; this item still owns that.

  7. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    The proposal at d83c7d9 needs splitting into 4 items. A person splits the item into the items below, or replies in a comment or edits the body to keep one item, and the next refine round looks at the item again.

    1. feat(k8s): add the roadmap-stage CronJob template and the stage admission policy
    2. feat(roadmap): add a single-item stage Job entry point with the normal selection rules
    3. feat(roadmap): submit stage items as Jobs from the Service with an idempotent name and a failure ledger
    4. chore(monitoring): move the stage series and the dashboards to the stage Job row
  8. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    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 stage-job item 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 each stage item in its own Job

    Problem (plan evidence)

    Stage runs in the Service pod with no wall limit. 53 of 71 Service restarts since 2026-11-07 stopped a stage round (stage-drought C09: about 4 % of the lost plan PRs). Stage also waits behind refine on the model lane (C04: about 13 % of the lost plan PRs, and the current block). #4559 is status/new, because refine asks to split it into 4 items.

    Added scope

    Keep the #4559 design (template roadmap-stage, Service image, its own stage admission policy and Role change, the kill test). Add: the stage Job calls the push, open, comment and Status steps, and cleanup already runs in the status lane. Correct the evidence as stated above. An agent applies the 4-part refine split under the owner rule of 2026-11-05 (bot-filed work goes ahead with an agentic judge); the step scope goes to parts 2 and 3. Cost: as #4559 states.

    Added acceptance

    Merge first

    Coordination

    #4517 stays the parent. The 4-part refine split of this item comes first; the step scope goes to parts 2 and 3.

  9. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

    The proposal at 87ae9ee needs splitting into 4 items. A person splits the item into the items below, or replies in a comment or edits the body to keep one item, and the next refine round looks at the item again.

    1. feat(k8s): add the roadmap-stage CronJob template and the stage admission policy
    2. feat(roadmap): add a single-item stage Job entry point with the normal selection rules and the shared push, open and comment steps
    3. feat(roadmap): submit stage items as Jobs from the Service with an idempotent name and a failure ledger
    4. chore(monitoring): move the stage series and the dashboards to the stage Job row
  10. 5 remaining items

  11. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 6eae498 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.

    • Who confirms the live proof, and what does the comment state? (a person decides)
  12. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    Part 2 is ready on branch feat/4559-run-each-stage-item-in-its-own-job (head 40684f12b, on main 0ae1ce51f). It waits for one measure: the cold-cache GitHub requests of one stage Job ("Before it ships"). Then open the PR.

    Part 1 (#5545) is merged and in v0.132.0. The live policy admits a stage Job of the Service and refuses other args and an extra plain variable (server dry-run as roadmap-service, see #5548). The agent could not start the live stage Job: the permission system refused it. So a person runs steps 1 to 5.

    Review fixes in part 2: the row acts on a Job only when its item label names the item (a record block that an author edits cannot delete another Job); it frees only what check_in wrote; an item that holds its draft checks in as succeeded; a DeadlineExceeded pod with no log is ci_infra; only timeout and plan_defect count toward the split; an orphan removal keeps the failure ledger; roadmap.stage.jobs counts the stage Jobs of every repository; RoadmapServiceGitHubRequestsHigh reads the Service alone and the new RoadmapStageGitHubRequestsHigh reads the stage budget.

    Deviation from the owner decision: the kept plan file stays until #5499, which makes the branch the checkpoint. In a stage Job the file is in the emptyDir of the pod, so a new pod plans again. The live-proof item "one killed attempt that resumed from its branch with no new planner call" waits for #5499.

    Filed #5551 (the implement row trusts implement.job of the record). Commented on #3685 (the stage pod holds the master key of the gateway).

    Measure, before part 2 (the in-pod stage row still runs):

    1. Use a Ready item low in the queue, so the in-pod row (limit 1, top item) does not take it, for example test(roadmap): check golden base commits in a devops ci row #4449 (P3).
    2. uv run devops k8s run-job --template stage --repo dan-petty/devops-cli --item 4449 -- roadmap stage --repo dan-petty/devops-cli --job-item 4449 --confirm
    3. While the pod runs: kubectl -n devops rollout restart deploy/roadmap-service. The stage pod stays Running.
    4. The Job exits 0, the draft plan PR of test(roadmap): check golden base commits in a devops ci row #4449 opens, and the command prints the GitHub requests of the pod.
    5. State sum(increase(devops_cli_github_requests_total{job="roadmap-stage"}[3h])) here, against the 3,357 requests a day of the stage row. Change the default of roadmap.stage.github_requests_per_hour (1000) in part 2 when the measure needs it.
    6. Open part 2: uv run devops pr create -t "feat(roadmap): run each stage item in its own Job" -b "<body>" from the branch.

    Live proof after the release of part 2:

    1. A Ready item gets a stage Job: kubectl -n devops get jobs -l app.kubernetes.io/component=roadmap-stage shows one Job, and the item record holds stage.job. Run kubectl -n devops rollout restart deploy/roadmap-service while it runs. The Job runs to its end, the draft plan PR appears, and the record holds stage.job_result with staged and no stage.job.
    2. A second stage round while the Job runs makes no second Job: the Job list still holds one Job for the item, the Service log has reason=stage_job for the item, and devops_cli_service_stage_jobs_total{result="created"} grows by 1 only.
    3. Delete the running stage Job of another Ready item: kubectl -n devops delete job <name>. The next stage round writes stage.job_result with evicted, stage.evictions with count 1 and no failure mark, and creates the Job again; devops_cli_service_stage_jobs_total{result="evicted",class="none"} grows by 1.
  13. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    Live proof of the stage Job (part 1, release 0.132.0), 2026-11-13

    The owner approved the run. Command: devops k8s run-job --template stage --repo dan-petty/devops-cli --item 4449 -- roadmap stage --repo dan-petty/devops-cli --job-item 4449 --confirm.

    Check Result
    Job devops-cli-stage-devops-cli-4449-c68895. It started at 21:05:48Z and completed at 21:48:57Z (43 min). The pod ended Completed with exit code 0 and 0 restarts.
    Service rollout during the Job At 21:16:05Z, kubectl -n devops rollout restart deploy/roadmap-service ran. The old Service pod ended, and the new pod was ready at 21:26:36Z. The stage pod kept running and finished the item.
    Result Staged: branch test/4449-check-golden-base-commits-in-a, 2 task groups (the largest is 42,117 tokens). The draft plan PR is #5558.
    GitHub requests, cold cache The pod reports 107 GitHub requests for the item, against its budget of 1,000 an hour (roadmap.stage.github_requests_per_hour). For comparison, the in-pod stage row spent about 3,357 requests a day. So one cold-cache stage Job is far below the default, and the default stays at 1,000.

    The ship-gate measure for part 2 is done, so the part 2 PR opens now.

    One known cost: the restart stopped an in-pod devops-cli stage round that had run since 20:55. Part 2 removes this cost.

  14. added a commit that references this issue on Nov 13, 2026
    e916f06
  15. added
    status/in-review
    and removed
    status/new
    on Nov 13, 2026
  16. removed
    status/in-review
    owner/agent
    on Nov 13, 2026
  17. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-13 22:33 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/p1-highscope/roadmapsource/agenttype/featurevalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions