Skip to content

fix(roadmap): the implement runner still fills its 8 Gi home volume #6076

Closed

Description

@dan-petty

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, log du -sh of 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.yaml are also asserted in tests/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

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, .cache and .local with 900 MiB, 100 MiB and 10 MiB
  • THEN the job writes one line to stderr that holds .data=943718400, .cache=104857600 and .local=10485760, and names .data with 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/scratch exists 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 home volume to sizeLimit: 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 mutants tree in the checkout, only_mutate keeps it to the target files, and run_mutation removes it after the results are read (fix(roadmap): the strength check fills the runner home volume #5960). The scratch folder .data/agent/scratch of 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_targets returns no target when the changed files hold none under src/, and run_mutation then returns an empty outcome. The outcome states no reason, so report_lines shows only strength: 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 _groups loop of the implement run, after run_step returns 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.scandir walks each top folder without following symlinks, sums st_blocks * 512 of 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.scandir and st_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 sums st_size and counts a hard link twice, so it does not match the kubelet and can overstate the uv cache and the venv.
    • Rejected: du -sh from coreutils. It needs a binary in the runner image, and the gate that checks the image tools must name it.
    • Rejected: shutil.disk_usage alone. It gives the free space of the node filesystem, not the usage of the volume or of a folder.
  • 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 separate emptyDir cannot 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 emptyDir with a sizeLimit. 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 tmpfs with a sizeLimit. 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) times CONST_ROADMAP_IMPLEMENT_HOME_LIMIT_BYTES (8 Gi, the manifest's sizeLimit), and raises _StopError with FailureClass.LIMIT_REACHED when 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 as stopped with class=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_reached is the class of a used budget.
    • Rejected: Let the kubelet evict the pod. The Service records the eviction as class=limit_reached infra=true and 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, which limit_reached already 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 emptyDir has a sizeLimit for 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.
  • 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/, and report_lines puts 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]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    on Nov 16, 2026
  2. dan-petty commented on Nov 16, 2026

    @dan-petty
    OwnerAuthor
    • Priority: P0-Critical. Implement jobs are failing at 0 of 5 graded attempts in 24 h due to pod eviction, which is a service job failure.
    • Related: fix(roadmap): the strength check fills the runner home volume #5960, which asks for a different change. 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.
  3. added
    scope/roadmap
    status/new
    effort/medium
    value/high
    priority/p0-critical
    owner/agent
    on Nov 16, 2026
  4. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.

  5. added
    status/in-progress
    and removed
    status/new
    on Nov 17, 2026
  6. added
    status/in-review
    and removed
    status/in-progress
    on Nov 17, 2026
  7. removed
    status/in-review
    owner/agent
    on Nov 17, 2026
  8. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-17 08:08 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/mediumpriority/p0-criticalscope/roadmapsource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions