Repository navigation
Description
Problem
The kubelet still evicts implement runner pods for a full home volume after #5960 raised it from 4 Gi to 8 Gi:
| Pod | Time (UTC) | Limit | Run |
|---|---|---|---|
devops-cli-implement-devops-cli-3458-34b094-tr2sg |
2026-11-16 21:09 | 8Gi | 11,431 s, 30.5M model units |
devops-cli-implement-devops-cli-3782-be7cc0-hftsn |
2026-11-16 23:29 | 8Gi | 2,196 s, 5.5M model units |
Event message of both: Usage of EmptyDir volume "home" exceeds the limit "8Gi". The Service records each as class=limit_reached infra=true, so the grade of the implement job leaves them out. Implement is at 0 of 5 graded attempts in 24 h, and 16 of its 21 attempts are infrastructure attempts.
In the run of #3782, the plan changes only tests/core/test_k8s_local_path_placement.py. After it pushed that work (PR #6062, all checks pass), the agent edited src/devops_cli/roadmap/implement/implement_strength.py and its tests, which are outside the plan. From 23:23 to 23:26Z it wrote and ran probe_coverage.py, probe_targets.py and probe_mutation.py under .data/agent/scratch/ in the worktree. The pod was evicted 3 minutes later. The run of #3458 has no such log in the window that was read.
Expected behavior
- Measure what fills
home(clone, worktree, venv, uv cache,mutants/, scratch probes): for example, logdu -shof each top folder at each step end, or at the eviction signal. - Fix the cause: keep the mutation trees and the scratch runs of the agent inside a bounded folder that the job removes, or stop a step that writes more than its share.
- Until the cause is fixed, size the volume from the measure (the owner rule of 2026-11-11 for jobs under 80%: double a limit, then tune from real use). The volume lines of
k8s/devops/cronjob-runner.yamlare also asserted intests/gate/k8s_checks/runner.py, which test(k8s): Drop the tests that repeat third-party version pins #6060 removes, so change the size after test(k8s): Drop the tests that repeat third-party version pins #6060 merges. - A strength check of a change with no source target in
src/does not lead the agent to change the strength check itself.
Related
- fix(roadmap): the strength check fills the runner home volume #5960 (closed: 4 Gi to 8 Gi, removes
mutants/after the run), test(k8s): Drop the tests that repeat third-party version pins #6060, fix(k8s): State the NVMe rule and cover CNPG claims #6062, fix(k8s): the placement rule fits the NVMe and covers CNPG clusters #3782, fix(roadmap): Verify a claimed member against the staged source #3458.
Proposed design
Problem statement
The implement runner Job still loses pods to a full home volume at 8 Gi: 16 of its 21 attempts in 24 h are infrastructure attempts, and the Service records each eviction as class=limit_reached infra=true, so the grade leaves the attempt out. The job logs no measure of what fills the volume, so nobody knows which folder grows. It keeps the agent scratch folder of the worktree for the whole run, and it stops no step that writes more than its share. A change of tests alone makes the strength check skip with no reason, so the agent looks for the cause in the strength module and edits a file outside its plan.
Acceptance criteria
Requirement: home-usage-at-each-step-end
The implement job SHALL log one line at the end of each step that holds the disk usage of each top folder of the home volume in bytes and names the largest folder.
Scenario: A step end logs the usage of each top folder
- WHEN a step ends and the home volume holds the folders
.data,.cacheand.localwith 900 MiB, 100 MiB and 10 MiB - THEN the job writes one line to stderr that holds
.data=943718400,.cache=104857600and.local=10485760, and names.datawith 943718400 bytes
Requirement: home-usage-counts-each-inode-once
The measure of a folder SHALL count a file with several hard links once and SHALL use its allocated blocks.
Scenario: A hard link is counted once
- WHEN a folder holds one file of 4096 allocated bytes and a hard link to it
- THEN the measure of the folder is 4096 bytes
Requirement: scratch-folder-emptied-at-step-end
The implement job SHALL remove every file under .data/agent/scratch of the worktree at the end of each step and SHALL keep the folder.
Scenario: A step end empties the scratch folder
- WHEN a step ends and the worktree holds
.data/agent/scratch/probe_coverage.py - THEN
.data/agent/scratchexists and holds no file after the step end
Requirement: stop-a-step-over-its-share
The implement job SHALL stop the item with the class limit_reached when the home usage is at or above the configured share of the volume limit at a step boundary.
Scenario: A home volume over its share stops the item
- WHEN the home usage is at or above 0.8 of the 8 Gi volume limit at a step boundary
- THEN the item stops with the class
limit_reached, and the reason names the largest folder and its size in bytes
Requirement: home-volume-limit-matches-the-manifest
The limit that the stop reads SHALL equal the sizeLimit of the home volume of k8s/devops/cronjob-runner.yaml.
Scenario: The stop limit follows the manifest
- WHEN the manifest sets the
homevolume tosizeLimit: 8Gi - THEN the constant that the stop reads is 8589934592 bytes
Requirement: strength-check-names-the-missing-source-target
The strength check SHALL give the reason when the changed paths hold no source file under src/.
Scenario: A test-only change gives the reason
- WHEN the changed paths hold only files under
tests/ - THEN the mutation outcome holds no survivor and its reason states that no source target exists under
src/
Requirement: strength-reason-in-the-pull-request-comment
The strength report of the pull request comment SHALL hold the reason of a strength skip.
Scenario: The report holds the strength reason
- WHEN the strength check skips a change of tests alone
- THEN the report lines hold the reason and an empty list of survivors
Existing Tool Considered
No alternatives check has run. Kubernetes emptyDir.sizeLimit is the bound (k8s/devops/cronjob-runner.yaml:127), and the Python standard library's os.scandir is the measure (src/devops_cli/ai/ast/graph.py:27); both are open, maintained and already in the project. emptyDir.sizeLimit lacks a value that the pod can read, so the stop reads CONST_ROADMAP_IMPLEMENT_HOME_LIMIT_BYTES, and a test holds it equal to the manifest. shutil.disk_usage gives the free space of the node filesystem, not the usage of the volume or of a folder, so it does not cover the measure. The existing directory_size of src/devops_cli/git/worktree_inventory.py:359 sums st_size and counts a hard link twice, so it does not match the kubelet. GNU du gives the same measure, but it needs a binary in the runner image and no test can run it offline. The change writes no replacement for these tools: about 60 lines of Python in a new implement_home.py and no manifest change. The written cost of that code is about 3k tokens to build, about 1k tokens for each later fix, and about half a day of elapsed time.
Key questions
- What fills the runner home volume, and which of those folders does the job already remove?: The clone, the worktree, the venv and the uv cache measure 1.8 GB together, and a step can add the agent's scratch folder, whose probe scripts run tests and mutation runs. mutmut 3.8.1 writes the
mutantstree in the checkout,only_mutatekeeps it to the target files, andrun_mutationremoves it after the results are read (fix(roadmap): the strength check fills the runner home volume #5960). The scratch folder.data/agent/scratchof the worktree stays until the pod ends. [sources: src/devops_cli/roadmap/implement/implement_strength.py:42, src/devops_cli/roadmap/implement/implement_strength.py:157, src/devops_cli/roadmap/implement/implement_strength.py:237, openspec/changes/archive/2026-11-16-5960-runner-home-volume/proposal.md:23, src/devops_cli/roadmap/implement/implement_run.py:526, AGENTS.md:18] - Does the strength check already skip a change with no source target under
src/?: Yes.mutation_targetsreturns no target when the changed files hold none undersrc/, andrun_mutationthen returns an empty outcome. The outcome states no reason, soreport_linesshows onlystrength: passed, and the run of fix(k8s): the placement rule fits the NVMe and covers CNPG clusters #3782 looked for a cause in the strength module and edited it, outside its plan. [sources: src/devops_cli/roadmap/implement/implement_strength.py:126, src/devops_cli/roadmap/implement/implement_strength.py:217, src/devops_cli/roadmap/implement/implement_strength.py:450, src/devops_cli/ci/mutate.py:199] - When does the job measure the home usage?: At the end of each step, in the
_groupsloop of the implement run, afterrun_stepreturns and before the next step starts; the same measure runs when a step stops, so a stopped step leaves its usage in the log. (best practice) [sources: src/devops_cli/roadmap/implement/implement_run.py:1198, src/devops_cli/roadmap/implement/implement_run.py:1213, src/devops_cli/roadmap/implement/implement_run.py:1234, src/devops_cli/roadmap/implement/implement_run.py:1246, docs/roadmap/implement.md:70]- Chosen: At the end of each step. The step loop holds the step boundary, and the line reaches the pod log before the next step writes, so a later eviction keeps the last measure.
- Rejected: At the eviction signal. The kubelet evicts the pod when the volume passes its limit, and the job cannot rely on a hook in the evicted pod; the measure must be written while the pod lives.
- Rejected: From a node metric. The metric shows the volume of the node and no folder, so it cannot name the cause.
- How does the job measure the size of a folder?: With the Python standard library:
os.scandirwalks each top folder without following symlinks, sumsst_blocks * 512of each regular file, and counts each(st_dev, st_ino)pair once, so a hard link counts once as the kubelet counts it. (best practice) [sources: src/devops_cli/ai/ast/graph.py:27, src/devops_cli/git/worktree_inventory.py:359, openspec/changes/archive/2026-11-16-5960-runner-home-volume/proposal.md:23]- Chosen: The Python standard library with
os.scandirandst_blocks. The step already runs Python, a test checks it on a temporary folder, the runner image needs no new binary, and the inode set matches the kubelet's hard-link rule. - Rejected: The existing
directory_size. It sumsst_sizeand counts a hard link twice, so it does not match the kubelet and can overstate the uv cache and the venv. - Rejected:
du -shfrom coreutils. It needs a binary in the runner image, and the gate that checks the image tools must name it. - Rejected:
shutil.disk_usagealone. It gives the free space of the node filesystem, not the usage of the volume or of a folder.
- Chosen: The Python standard library with
- Where does the agent scratch folder go?: It stays in the worktree at
.data/agent/scratch, as the agent rules and the job require, and the job removes its files at each step end and keeps the folder for the next step. A separateemptyDircannot mount at that path because the worktree path holds the repository and the item. (best practice) [sources: AGENTS.md:18, CONTRIBUTING.md:209, docs/ROADMAP_WORKFLOW.md:310, src/devops_cli/roadmap/implement/implement_run.py:526, src/devops_cli/roadmap/implement/implement_run.py:530]- Chosen: Keep it in the worktree and empty it at each step end. The agent rules put scratch there, the worktree path differs for each item, and the empty folder is ready for the next step.
- Rejected: A separate
emptyDirwith asizeLimit. The scratch path is inside the worktree, and the worktree name holds the repository and the item, so no manifest sets a mount there. - Rejected: A
tmpfswith asizeLimit. It counts against the memory limit of the pod. - Rejected: Remove the whole worktree at each step end. The worktree holds the branch, the commits and the venv that the next step uses.
- How does the job stop a step that writes more than its share?: At each step boundary the job compares the measured home usage with
CONST_ROADMAP_IMPLEMENT_HOME_SHARE(0.8) timesCONST_ROADMAP_IMPLEMENT_HOME_LIMIT_BYTES(8 Gi, the manifest'ssizeLimit), and raises_StopErrorwithFailureClass.LIMIT_REACHEDwhen the usage is at or above it. The reason names the largest folder and its bytes; the runner exits 0, and the Service records the attempt asstoppedwithclass=limit_reached, which the grade treats as infrastructure. The measure and the scratch removal are what raise the graded attempts. (best practice) [sources: k8s/devops/cronjob-runner.yaml:127, src/devops_cli/roadmap/implement/implement_run.py:1198, src/devops_cli/roadmap/failure.py:150, src/devops_cli/roadmap/job_result.py:189, src/devops_cli/roadmap/implement/implement_submit.py:449]- Chosen: A typed stop from the job at the step boundary. The stop comment and the record name the cause, the pod is not evicted with the run's work lost, and
limit_reachedis the class of a used budget. - Rejected: Let the kubelet evict the pod. The Service records the eviction as
class=limit_reached infra=trueand loses the pod's log and the run's work; the grade leaves the attempt out. - Rejected: A new failure class
disk_full. The class list is fixed and every class has one action; a used volume share is a used budget, whichlimit_reachedalready names, and a new class would change the metrics, the dashboards and the docs for no new action. - Rejected: A quota on the volume. An
emptyDirhas asizeLimitfor the whole volume and no quota for one folder. - Rejected: A stop inside the agent shell. The shell is no security boundary and the agent owns it; the job owns the step boundary and the stop.
- Chosen: A typed stop from the job at the step boundary. The stop comment and the record name the cause, the pod is not evicted with the run's work lost, and
- How does the strength check keep the agent from editing the strength module?: The mutation outcome names the reason that no source target exists under
src/, andreport_linesputs it in the strength report of the pull request comment, so the step shows that the check has nothing to do. A test-only change is valid work, so the step does not fail. (best practice) [sources: src/devops_cli/roadmap/implement/implement_strength.py:126, src/devops_cli/roadmap/implement/implement_strength.py:217, src/devops_cli/roadmap/implement/implement_strength.py:450, src/devops_cli/roadmap/implement/implement_run.py:1727, docs/roadmap/implement.md:72]- Chosen: Name the reason in the outcome and the report. The step shows the cause with no model call, and a test checks the reason offline.
- Rejected: Fail the step. A change of tests alone is valid work, and the failure stops a good item.
- Rejected: Let the agent add a source target. It edits a file outside the plan, as the run of fix(k8s): the placement rule fits the NVMe and covers CNPG clusters #3782 did.
- Does the volume size change in this item?: No. The size comes from the measure of real runs, and the volume lines wait for test(k8s): Drop the tests that repeat third-party version pins #6060 to remove the assertion in
tests/gate/k8s_checks/runner.py. A later item sets the size; this item keeps the manifest's 8 Gi and makes the stop read a constant that a test holds equal to it. (best practice) [sources: docs/roadmap/job-success.md:3, k8s/devops/cronjob-runner.yaml:98, tests/gate/k8s_checks/runner.py:122]- Chosen: Set the size in a later item. The owner rule needs the measured peak of real runs, and the measure starts with this item; test(k8s): Drop the tests that repeat third-party version pins #6060 must merge first.
- Rejected: Double the limit to 16 Gi now. It hides the cause and spends cluster disk with no measure.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 16, 2026
Implement jobs are failing at 0 of 5 graded attempts in 24 h due to pod eviction, which is a service job failure.Both target the implement runner home volume, but #5960 delivered a size increase and cleanup, while the candidate asks for measurement, a bounded-write fix, and a strength-check guard.devops-cli-service commentedon Nov 17, 2026
Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.
fix(roadmap): Stop the false strength failure and log the volume use
docs(openspec): plan #6076 the implement runner home volume
docs(openspec): archive #6076 the implement runner home volume
devops-cli-service commentedon Nov 17, 2026
Released in v0.170.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.170.0
devops-cli-service commentedon Nov 17, 2026
Live since 2026-11-17 08:08 UTC