Repository navigation
Description
Problem or Motivation
The implement Job runs only the scoped checks before its push, so GitHub finds the rest. The census week (2026-11-04 to 2026-11-11) had 6 repair heads.
Proposed Solution & Architectural Design
- Run the full
devops ci --check --no-cachein the Job pod with 8 workers. - Raise the CPU limit in
k8s/devops/cronjob-runner.yamlfrom 2 to 8. - Write the gate record with the lane
in-pod. - Repair rounds use the result, and they gate in the pod before a push.
The gate ends inside the 1,800 s command limit of the Job. Each inner timeout stays shorter than the one around it: test < row < gate < command.
Target Subsystem
SDLC, Git & PR Governance (src/devops_cli/roadmap/implement/, k8s/devops/cronjob-runner.yaml).
Existing Tool Considered
devops ci --check runs the same rows as GitHub and the cluster gate. Kubernetes resource limits cover the CPU. Cost (estimate): about 150,000 tokens and 3 hours to build, about 5,000 tokens a month to keep, about 20,000 tokens to fix.
Acceptance Criteria
- The gate ends inside the 1,800 s command limit on 5 live items.
- Repair heads are at most 2 a week.
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)
Source: #4667
Alternatives check of 2026-11-26: in-use.
The repository already uses this tool.
Tool: dan-petty/devops-cli (https://github.com/dan-petty/devops-cli), MIT, last activity 2026-11-26, maintained.
Reason: Searches found no external tool that gates a pod before push; the project's own devops ci already runs the same rows as GitHub and the cluster gate, so the item only adds in-pod wiring around it.
Covers:
- Runs the full check rows that GitHub and the cluster gate run
- One command with --check --no-cache in the Job pod
- Command timeout and per-row timeouts already bound each check
Lacks:
- No in-pod gate lane record with duration
- No gate and row timeout settings above the test bound
- No runner size CPU rows or admission policy pairs
Proposed design
Problem statement
The implement Job runs only scoped checks before its push. GitHub finds the remaining failures and repair rounds follow: the census week 2026-11-04 to 2026-11-11 had 6 repair heads. The runner pods also throttle at 1 CPU. The item adds a full in-pod devops ci --check --no-cache gate, an in-pod lane record, nested timeouts, and CPU rows for the runner size table and admission policy. The item waits on #6521; stage and implement leave it while #6521 is open.
Acceptance criteria
Requirement: In-pod full gate before push
The implement Job SHALL run the full devops ci --check --no-cache gate in its pod before it pushes.
Scenario: Gate runs before the push
- WHEN An implement step reaches its push with the in-pod gate enabled
- THEN The recorded command order holds the gate before the push command, and the gate sets PYTEST_XDIST_AUTO_NUM_WORKERS to the Job CPU limit.
Requirement: A failing gate stops the push
The implement Job MUST make no push when the in-pod gate fails.
Scenario: A failing gate blocks the push
- WHEN The in-pod gate exits non-zero
- THEN The step records the gate result with its failing row and runs no push command.
Requirement: Repair rounds gate in the pod
A repair round MUST run the in-pod gate before its push and use its result.
Scenario: A repair push waits for the gate
- WHEN A repair round changes the branch
- THEN The round runs the gate before the push and stops on the failing row without a push.
Requirement: The gate record names the lane in-pod
The gate record SHALL name the lane in-pod.
Scenario: The gate record names its lane
- WHEN The in-pod gate ends
- THEN The record holds lane: in-pod, the result and the duration of the gate.
Requirement: Nested timeouts
Each inner timeout MUST be shorter than the timeout around it: test < row < gate < command.
Scenario: The timeouts keep their order
- WHEN The implement settings load
- THEN A test asserts 600 s < gate_row_timeout_seconds (1200 s) < gate_timeout_seconds (1500 s) < command_timeout_seconds (1800 s).
Requirement: Runner size rows carry the new CPU
The runner size rows SHALL give the small row 2 CPU and the large row 6 CPU, with the CPU request equal to the CPU limit.
Scenario: The rows set the workers
- WHEN The implement Job selects a runner size
- THEN The Job container gets 2 CPU on the small row or 6 CPU on the large row, and PYTEST_XDIST_AUTO_NUM_WORKERS equals the CPU limit.
Requirement: The admission policy admits the new rows
The roadmap-service-jobs policy MUST admit the CPU and memory pair of each runner size row and refuse a pair above 6 CPU.
Scenario: The policy admits each row
- WHEN uv run devops ci --check --only k8s runs the roadmap-service-jobs policy check against a Job of each runner size row
- THEN Each row passes the policy, and a Job with 8 CPU and an 8Gi memory request is refused.
Requirement: The memory limit admits each row
The setting roadmap.implement.max_memory_limit MUST admit the memory request of each runner size row.
Scenario: The memory setting admits the rows
- WHEN A config test validates roadmap.implement.max_memory_limit with 6Gi, 8Gi, 16Gi and 5Gi
- THEN The 6Gi, 8Gi and 16Gi values pass, and the 5Gi value is refused.
Existing Tool Considered
The alternatives check in the issue body records verdict in-use for dan-petty/devops-cli (https://github.com/dan-petty/devops-cli), MIT, last activity 2026-11-20, maintained. See that block for what the tool covers and lacks. The proposal adds only the wiring that the block's Lacks list names; it does not replace the tool. ADR 0014 rejected the full devops ci in the pre-push hook, not in the runner Job pod. The wiring costs about 150,000 tokens and 3 hours to build, about 5,000 tokens a month to keep, and about 20,000 tokens to fix.
Key questions
- Where does the CPU of a Service implement Job come from?: The Service creates the Job from the runner template and replaces its resource values. implement_submit.py passes size.resources(settings.max_memory_limit) to build_job, and _with_resources replaces the request and limit values. The size is a row of RUNNER_SIZES. The roadmap-service-jobs policy pins the CPU and memory pair in its CEL rows. The template's own 2 CPU, 4Gi request and 8Gi limit are the default of a manual devops k8s run-job, which the policy never evaluates. The Service Job CPU comes from the size table and the policy, not from the template. [sources: src/devops_cli/roadmap/implement/implement_submit.py, src/devops_cli/k8s/cluster_job.py, src/devops_cli/roadmap/implement/implement_size.py:63, k8s/devops/roadmap-service/admissionpolicy.yaml, docs/CLUSTER.md]
- Does k8s/devops/cronjob-runner.yaml change?: No. The Service replaces the CPU and memory values of the template for every Job it creates, so raising the template would change only a person's devops k8s run-job and would not give the gate more workers. The template keeps 2 CPU with PYTEST_XDIST_AUTO_NUM_WORKERS value 2, its CPU limit, which is the new small row. The proposal uses 2 or 6 workers, not 8, because the large row is 6 CPU. (best practice) [sources: k8s/devops/cronjob-runner.yaml, docs/CLUSTER.md, src/devops_cli/roadmap/implement/implement_submit.py]
- Rejected: Raise the template to 8 CPU. The Service overrides the template resources. This changes only a manual devops k8s run-job, and the large row is 6 CPU.
- Rejected: Raise the template to 6 CPU. A manual Job is not the throttled Service Job, and the template's 4Gi request pairs with no row of the size table.
- Chosen: Keep the template at 2 CPU. The template is the small size of a manual run. The Service Job takes its pair from RUNNER_SIZES and the policy.
- Which CPU values do the runner size rows take?: The small row goes from 1 to 2 CPU and the large row from 4 to 6 CPU. The memory request stays 2Gi on the small row and 6Gi on the large row. The CPU request equals the CPU limit, and PYTEST_XDIST_AUTO_NUM_WORKERS equals the limit, so the gate runs 2 or 6 workers. A large row at 8 CPU waits: it needs 8 CPU of free request, and the 8Gi limit has no measurement at 8 workers. (best practice) [sources: src/devops_cli/roadmap/implement/implement_size.py:63, docs/CLUSTER.md]
- Rejected: Keep the small row at 1 CPU. The 17 pods with a 1-CPU limit were throttled in 46 % of CFS periods, and pytest runs one xdist worker on that row.
- Chosen: Small row 2 CPU, large row 6 CPU. The small row gets two workers. The large row stays inside the workers' 9 CPU of free request and the existing 8Gi limit.
- Rejected: Raise the large row to 8 CPU now. 8 CPU needs 8 CPU of free request, and the memory limit needs a measurement at that worker count.
- Does the roadmap-service-jobs policy need new CEL rows?: Yes. The policy admits only 1 CPU with 2Gi and 4 CPU with 6Gi today, so the change adds a 2 CPU pair and a 6 CPU pair. The gate check tests/gate/k8s_checks/job_admission_policy.py already builds a Job from each RUNNER_SIZES row and runs the policy expressions against it. It holds a grid of pairs around the rows that must be refused. The grid must drop 2 CPU from the refused pairs and keep 8 CPU refused. (best practice) [sources: k8s/devops/roadmap-service/admissionpolicy.yaml, tests/gate/k8s_checks/job_admission_policy.py, docs/CLUSTER.md]
- Rejected: Widen the policy to a CPU range. A range admits a pair with no memory bound. The policy keeps a Job of the Service inside its pod.
- Chosen: Add one admitted pair for each runner size. The policy stays a closed set. The existing gate check holds each row against it and refuses every pair around the rows.
- Rejected: Leave the policy unchanged. The new 2 CPU and 6 CPU rows would be refused.
- Does ADR 0014 stop the full gate in the runner Job?: No. ADR 0014 rejects the full devops ci in the pre-push hook, which runs on every push of a person. The runner Job pushes once per item, so the in-pod gate is a different place. ADR 0004 keeps Static Analysis and Tests & Coverage as the authoritative gate. The in-pod gate adds an earlier check and does not replace CI. (best practice) [sources: docs/adr/0014-required-checks-gate-the-merge-and-the-pre-push-hook-runs-the-fast-static-checks.md, docs/adr/0004-ci-is-the-authoritative-gate.md]
- Rejected: Run the full gate in the pre-push hook. ADR 0014 rejected it for its cost on every push and the duplication with CI.
- Chosen: Run the full gate in the runner Job pod. The pod pushes once per item. The required checks stay the gate.
- Rejected: Keep only the scoped checks. The census week 2026-11-04 to 2026-11-11 had 6 repair heads.
- What timeout budget does the gate get?: Two new settings bound the gate. roadmap.implement.gate_timeout_seconds defaults to 1500 s and bounds the whole gate. roadmap.implement.gate_row_timeout_seconds defaults to 1200 s and bounds each devops ci row inside it. With pytest's per-test bound of 600 s and the unchanged roadmap.implement.command_timeout_seconds of 1800 s, the order is 600 < 1200 < 1500 < 1800. The gate ends 300 s before the command limit, so it writes its record before the kill and a hung row names itself instead of the command. (best practice) [sources: ARCHITECTURE.md, pyproject.toml, src/devops_cli/config/defaults.py, src/devops_cli/commands/ci.py]
- Rejected: Give the gate no timeout. A kill at the 1800 s command limit loses the gate result and the lane record.
- Rejected: Set the gate budget to the 1800 s command limit. There is no margin, and a row bound at or below the gate cannot nest inside it.
- Chosen: Gate 1500 s with a 1200 s row bound. Every inner bound fires first with its own name. The gate keeps a 300 s margin under the command limit, and 1200 s is above the longest measured Tests & Coverage run.
- Does the memory limit change with the CPU rows?: No. The memory limit stays the setting roadmap.implement.max_memory_limit, default 8Gi, which is twice the 4.13 GB that the killed Job reached. The memory request stays 2Gi on the small row and 6Gi on the large row. The config already refuses a limit below the largest request of 6Gi. The admission policy does not pin the limit, and the example ConfigMap of this cluster sets 16Gi. (best practice) [sources: k8s/devops/cronjob-runner.yaml, src/devops_cli/roadmap/implement/implement_size.py, docs/CLUSTER.md, k8s/devops/configmap.example.yaml]
- Rejected: Raise the memory limit. The measured peak is 4.13 GB, and 8Gi is twice it. A higher limit only widens the burst class.
- Chosen: Keep 8Gi and check the setting. The limit holds the measured peak. The config refuses a value below the 6Gi request, and the example ConfigMap's 16Gi passes.
- Rejected: Lower the memory limit below 6Gi. The large row requests 6Gi, so a lower limit would refuse the large row.
- Where do the scoped checks and the repair rounds run before a push today?: _push runs _scoped_checks before it pushes and marks the checked head, so a killed Job does not repeat it. _scoped_rounds runs the scoped checks and gives a failed check to a fix step at most roadmap.implement.repair_rounds times. _scoped_run builds and runs the checks. Each check runs with command_timeout_seconds and returns a ScopedResult of name, pass, seconds, log, command and status. The gate replaces the scoped run at that point and keeps the record. [sources: src/devops_cli/roadmap/implement/implement_run.py, src/devops_cli/roadmap/implement/implement_scoped_ci.py]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 11, 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.It cuts repair heads from 6 to at most 2 per week but does not block a release or fix a defect.Fewer repair rounds and no wasted GitHub CI runs save developer time each week.It needs a full gate in the pod, a CPU limit change, a new lane, and nested timeout tuning.Both gate the implement Job before its push, but the candidate upgrades from scoped checks to the full gate and adds CPU limit and lane changes.dan-petty commentedon Nov 12, 2026
Scope from the cluster integration plan (2026-11-12)
The cluster integration plan #4989 gives this item one more part: rank 2, the runner CPU rows. This issue stays a child of #4667.
The implement Job takes its CPU from two more places that this issue does not name:
RUNNER_SIZESinsrc/devops_cli/roadmap/implement/implement_size.py(lines 63-78).roadmap-service-jobsink8s/devops/roadmap-service/admissionpolicy.yaml(lines 137-149). They admit only 1 CPU with 2Gi and 4 CPU with 6Gi. The CPU request equals the CPU limit, andPYTEST_XDIST_AUTO_NUM_WORKERSequals the CPU limit.This issue names only
k8s/devops/cronjob-runner.yaml, so it must also change both of these:roadmap.implement.max_memory_limitagainst the new rows (runner peak 6.3 GiB of 8Gi).File a separate issue only if the small-row change must land before this item.
Evidence (Prometheus, 7 d to 2026-11-12): the 17 runner pods with a 1-CPU limit were throttled in 46 % of CFS periods (312 min of throttled time, about 18 min for each Job). The 4-CPU pods were throttled in 19 %. pytest runs one xdist worker on the small row. The workers have about 9 CPU of free request. A faster Job gives faster implement rounds and fewer of the 155 deadline extensions in 7 d.
#4989 also plans priority classes that come after this item: the batch class lets a service pod preempt a runner Job after a node loss.
devops-cli-service commentedon Nov 14, 2026
Alternatives check: rejected
Reason: The searches surfaced only generic local-CI runners (act runs GitHub Actions workflows, Dagger runs Dagger pipelines), and neither runs this repository's
devops cirows, so no outside tool covers the need. The issue's owndevops ci --check, already run scoped by the implement Job, runs the same rows as GitHub and the cluster gate, so the full in-pod gate, thein-podlane and the nested timeouts are a wiring, CPU-limit and timeout change around that tool — but ADR 0014 rejected the fulldevops ciin the pre-push hook for its cost on every push and the duplication with CI.Rejected by ADR 0014. A newer fact can change an ADR.
Tool: dan-petty/devops-cli (https://github.com/dan-petty/devops-cli)
Covers:
devops ci --checkruns the same rows as GitHub CI and the cluster gate.Lacks:
--no-cachegate with 8 workers is not wired in.in-podlane record and no nested timeout scheme (test < row < gate < command) yet.devops cibefore a push.Tools considered:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Refine cannot set this item to Ready at cd3e0f9 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 20, 2026
The result in the alternatives block of the issue body changed. Before this check:
rejected, tool https://github.com/dan-petty/devops-cli. A person decides what the new result means for the item.Searches (4)
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.