Skip to content

fix(roadmap): the strength check fills the runner home volume #5960

Description

@dan-petty

Problem

On 2026-11-16 the kubelet evicted the implement runner pod of #3648 (devops-cli-implement-devops-cli-3648-ff7ce1-ssxws, v0.161.0) after 2 h 7 min and 25.8M tokens: Usage of EmptyDir volume "home" exceeds the limit "4Gi". (event Evicted, 08:05:32Z). The runner is PID 1 and ignored the SIGTERM, so the kubelet killed it at the end of the grace period (ExceededGracePeriod, exit 137, container reason Error). Its memory was 0.8 to 2.7 GB in the last 12 minutes (peak 6.5 GB at 07:50Z), far below the 8Gi limit.

Two defects:

  1. The home volume is too small for a run that reaches the test-strength check. k8s/devops/cronjob-runner.yaml gives home (clone, worktree, venv, uv cache) sizeLimit: 4Gi, measured on 2026-10-29 as 1.1 GB for the venv and the cache (feat(roadmap): run the implement job as a cluster Job #2698). Since fix(roadmap): the strength check sets a denied env key #5892 (v0.160.0) the strength check runs uv run mutmut run in the worktree, and mutmut 3 copies the trees of [tool.mutmut] (source_paths = ["src/devops_cli"] and the tests) into mutants/. The agent of feat(roadmap): explain and inbox show the state of a stopped item #3648 was reading mutmut's source at 08:03Z, two minutes before the eviction.
  2. The Service classes the eviction as oom. src/devops_cli/roadmap/failure.py:219 maps exit 137 to FailureClass.OOM with the action raise_limit (a memory limit). The pod status said Evicted with the volume message, and the container reason was Error, not OOMKilled. A retry with more memory fails the same way.

Expected behavior

  • A run that reaches the strength check fits in the home volume: measure the size of mutants/ for a typical change, and size the volume (and the container ephemeral-storage limit) with a margin, or make the check use less space (for example remove mutants/ after the run, or copy only what the targets need).
  • A pod that the kubelet evicts gets a class from the pod status (reason: Evicted and its message), not from the exit code, and the stop comment names the volume and its limit. Exit 137 is oom only when the container reason is OOMKilled.

Test first: a pod status with reason: Evicted, an ephemeral-storage message and exit 137 gives a class that is not oom.

Related

Proposed design

Problem statement

The kubelet evicted the implement runner pod of #3648 because the home emptyDir volume (4Gi) overflowed during the strength check. mutmut copies its source paths and the tests into mutants/, and the copy exceeded the volume. The failure classifier also maps exit 137 to FailureClass.OOM with the action raise_limit, so a retry with more memory fails the same way. The change sizes the volume for the measured peak, removes mutants/ after the run, and classifies a failure from the pod status before the exit code.

Acceptance criteria

Requirement: Eviction is not OOM

The failure classifier SHALL read the pod reason and message before the exit code.

Scenario: Evicted pod with exit code 137

  • WHEN a pod status has reason Evicted, an ephemeral-storage message and exit code 137
  • THEN the classifier returns a class that is not FailureClass.OOM

Requirement: OOM needs the container reason

The failure classifier SHALL return FailureClass.OOM for exit code 137 only when the container reason is OOMKilled.

Scenario: Exit code 137 with container reason Error

  • WHEN the exit code is 137 and the container reason is Error
  • THEN the classifier returns a class that is not FailureClass.OOM

Requirement: Stop comment names the volume

The stop comment of an evicted pod SHALL name the evicted volume and its limit.

Scenario: Home volume eviction

  • WHEN the pod status reason is Evicted and the message is Usage of EmptyDir volume "home" exceeds the limit "4Gi".
  • THEN the stop comment contains home and 4Gi

Requirement: Eviction action is not raise_limit

The action of an evicted pod SHALL not be raise_limit.

Scenario: Action of an eviction

  • WHEN the classifier returns the class of an evicted pod
  • THEN the action of the class is not raise_limit

Requirement: Strength check removes mutants

The strength check SHALL remove the mutants/ directory after the run.

Scenario: No mutants directory after the run

  • WHEN the strength check ends, with success or failure
  • THEN no mutants/ directory remains in the worktree

Requirement: Home volume covers the measured peak

The runner manifest SHALL size the home volume for the measured peak of the strength check plus 1 GiB.

Scenario: Manifest covers the measured peak

  • WHEN the test reads the measured peak and the manifest
  • THEN the home sizeLimit is at least the peak plus 1 GiB, and the container ephemeral-storage limit is at least the sum of the emptyDir sizeLimits plus 1 GiB

Requirement: Mutants copy excludes the virtual environment

The [tool.mutmut] configuration SHALL not list the virtual environment or the uv cache in also_copy.

Scenario: Mutants config of the worktree

  • WHEN the test reads pyproject.toml
  • THEN also_copy lists no .venv path and no uv cache path

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers this need: the change edits the project's own k8s/devops/cronjob-runner.yaml and src/devops_cli/roadmap/failure.py. The written cost is about 30k tokens to build the classifier and the manifest change with tests, about 5k tokens a month to keep and fix them, and about half a working day.

Key questions

  • Which source decides the failure class of a runner pod?: The pod status decides first: its reason, its message and the container's terminated reason. The exit code decides only when the pod status gives no class. Exit code 137 is oom only when the container reason is OOMKilled. (best practice) [sources: src/devops_cli/roadmap/failure.py:219, src/devops_cli/models/k8s.py:120, tests/k8s/test_k8s_models.py:184, docs/guidelines/kubernetes.md:37]
    • Chosen: Pod status first. The kubelet writes Evicted and the volume message in the pod status, and the exit code cannot tell an eviction from an OOM kill.
    • Rejected: Exit code map only. Exit code 137 covers an eviction and a SIGKILL, so the map labels the eviction as oom.
    • Rejected: Container reason only. An eviction sets no OOMKilled reason, and the pod reason and message carry the volume and its limit.
  • How should the runner home volume fit the strength check?: Measure the peak of the strength check in the runner. Set the home sizeLimit to the peak plus 1 GiB, and the container ephemeral-storage limit to the sum of the emptyDir limits plus 1 GiB. Remove mutants/ after the run. Keep the virtual environment and the uv cache out of mutants/. (best practice) [sources: k8s/devops/cronjob-runner.yaml, docs/guidelines/kubernetes.md:37, pyproject.toml]
    • Rejected: Raise the limits with no measurement. A guessed limit can overflow again, and a large emptyDir risks a node-pressure eviction (T9).
    • Rejected: Only remove mutants after the run. The run needs the copy while it runs, so cleanup after the run does not lower the peak.
    • Chosen: Measure the peak, remove mutants, and exclude the venv and cache. It lowers the peak and sets a limit with a stated margin.
  • Where does the change record the measured peak?: The change records the measured peak as a constant in the test that checks the manifest, and in the comment of the home volume. (best practice) [sources: k8s/devops/cronjob-runner.yaml]
    • Chosen: Manifest comment and test constant. The limit and its reason stay together, and the test enforces the margin.
    • Rejected: A new document. It splits the limit from its reason.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    effort/medium
    on Nov 16, 2026
  2. dan-petty commented on Nov 16, 2026

    @dan-petty
    OwnerAuthor
    • Priority: P0-Critical. The runner pod was evicted and the job failed, and the misclassification causes retries that fail the same way.
    • Related: feat(roadmap): size the runner Job resources from the plan #3193, which asks for a different change. Both concern runner Job resource limits, but #3193 sizes memory and CPU from the plan while the candidate sizes the home volume for mutmut and fixes a failure-classification bug.
  3. added
    value/high
    priority/p0-critical
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 16, 2026
  4. devops-cli-service commented on Nov 16, 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-review
    and removed
    status/in-progress
    on Nov 16, 2026
  6. removed
    status/in-review
    owner/agent
    on Nov 16, 2026
  7. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-16 11:49 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