Repository navigation
fix(devtools): dispose a verification run's temp and daemon when it ends - #4333
Conversation
`devtools verify` starts dmypy for incremental type checking. The daemon is reparented to the user manager, so it outlives the run that started it and exits only when killed. In the main checkout that is the point: successive runs reuse the cache. A lane or batch worktree gates once and is then disposed, so its daemon is never reused and simply accumulates. Ten were alive holding 9.2 GB, from gates finished up to three and a half hours earlier; killing them took free memory from 3.5 GB to 11 GB. What looked like a ceiling on concurrent verification was this. A non-primary checkout now uses plain mypy; the daemon stays where repeated runs amortise it. Verification: `_is_primary_checkout()` is False in /realm/worktrees/batch-14 and selects `['mypy']`; True in the main checkout, selecting `['dmypy','run']`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
Two things a run created were left for an age sweep days later. pytest's temp trees live under the session TMPDIR, which is per-shell, so its own "keep the last three runs" pruning never fires: every shell starts a fresh root and nothing is ever pruned. 17,707 shell directories held 128 GB, with 191 of them over 100 MB and several at 3.5 GB. The run now owns its basetemp and removes it on success, keeping it when the run fails — that is when the fixtures are worth reading. `devtools verify` also starts dmypy, which is reparented to the user manager and outlives the run. In the main checkout successive runs reuse the cache; a lane or batch worktree gates once and is disposed, so its daemon accumulates. Ten held 9.2 GB from gates finished up to three and a half hours earlier. A non-primary checkout now uses plain mypy. Verification: a green `devtools test` leaves no `.cache/verify/tmp`; a failing one keeps it. `_is_primary_checkout()` is False in a worktree and selects `['mypy']`, True in the main checkout and selects `['dmypy','run']`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e6fa83344
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…#4334) ## Summary Reverts the worktree exemption from #4333 and moves the daemon's shutdown to the point where the workspace is actually gone. ## Problem #4333 stopped using dmypy in non-primary checkouts to prevent the leak. Measured afterwards in a batch worktree: | | time | |---|---| | plain mypy | 50s | | dmypy, cold start | 51s | | dmypy, warm | **1s** | A workspace is gated repeatedly while it is repaired, so only the first run pays for the cache. The exemption bought memory that a lifecycle hook releases anyway, at ~49s per re-gate. mypy's own idle timeout does not solve it either: a daemon started with `--timeout 10` was still running after twenty seconds idle, so that flag cannot be relied on. ## Solution sinnixd stops the daemon when it removes a worktree (sinnix `3f8fcea2`), which releases the cache exactly when the workspace it describes disappears. devtools uses the daemon everywhere again. ## Verification `devtools verify --quick` green in the main checkout with the daemon in use. sinnix side: `nix build .#sinnixd` and `nix develop --command check` green, with a test asserting removal invokes `dmypy stop` and tolerates a workspace with no provisioned venv. ## Residual risk A worktree removed outside `agentctl workspace` — by hand, or by `git worktree remove` directly — still leaks its daemon. The basetemp lifecycle from #4333 is unaffected and stays. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…nds (#4333) ## Summary A verification run left two things behind for an age sweep to collect days later. Both are now disposed when the run no longer needs them. ## Problem **pytest temp.** pytest keeps the last three numbered run directories under one temp root and deletes older ones. The session TMPDIR is per-shell, so every `nix develop --command` starts a fresh root and that pruning never fires. Measured: **17,707 shell directories holding 128 GB**, 191 of them over 100 MB, several at 3.5 GB each. **dmypy.** `devtools verify` starts mypy's persistent daemon, which is reparented to the user manager and outlives the run that started it. In the main checkout that is the point — successive runs reuse the type cache. A lane or batch worktree gates once and is then disposed, so its daemon is never reused and never exits. Measured: **ten alive holding 9.2 GB**, from gates finished up to three and a half hours earlier. Killing them took free memory from 3.5 GB to 11 GB. This is what looked like a ceiling on concurrent verification. An active run is ~1.5 GB; the pressure was dead weight. ## Solution The run owns its basetemp and removes it on success. A failed run keeps its tree, since that is when the fixtures are worth reading. A non-primary checkout uses plain mypy. The daemon stays where repeated runs amortise it. ## Verification A green `devtools test` leaves no `.cache/verify/tmp`; a failing one keeps it (2.6 MB observed). `_is_primary_checkout()` returns False in `/realm/worktrees/batch-14` and selects `['mypy']`; True in the main checkout, selecting `['dmypy','run']`. ## Residual risk Existing shell directories are not retroactively cleaned by this change; `/realm/tmp/shell` still ages out on the 7-day tmpfiles rule. Plain mypy is slower than a warm daemon on repeated runs in the same worktree, which ephemeral worktrees do not do. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…g collected (#4343) ## Summary Fixes a regression from #4333 plus the diagnosis gap that has repeatedly misled integration. ## Problem **Colliding basetemp.** #4333 pointed `--basetemp` at a fixed path. pytest creates that directory itself and fails when it exists, so two runs in one checkout collide: ``` INTERNALERROR> FileExistsError: [Errno 17] File exists: '.cache/verify/tmp' ``` Lanes, batches and the coordinator all run concurrently in the same checkout here, so this fires routinely — and an INTERNALERROR mid-run is a plausible source of the empty collections that were being written off as flakes. **Cleanup that silently failed.** Tests seal archive generations read-only, so `rmtree(ignore_errors=True)` could not unlink them and left the tree behind — exactly the accumulation #4333 set out to stop. **Indistinguishable exit 5.** pytest exits 5 both when a selection genuinely matches nothing and when a path in it does not exist. A selection derived from `git diff --name-only` contains files the branch deleted, so the run collects nothing and reads as "no work to do". That has already produced false conclusions during integration, including a report that multi-path selections were broken. ## Solution The basetemp is unique per invocation. Cleanup clears permissions before removing. On exit 5 the runner names the absent paths, or states that every path existed so the caller looks at the `-k`/`-m` expression or contention instead. ## Verification `devtools verify --quick` → exit 0. `devtools test tests/unit/devtools/test_run_tests.py` → exit 0. A selection naming a deleted file prints `collected nothing because these paths do not exist: tests/unit/gone.py`. Repeated green runs leave no `.cache/verify/tmp-*` behind; a failed run keeps its own for inspection. ## Residual risk A failed collection still keeps an empty temp directory, which is litter rather than a leak. Callers deriving selections from a diff should still filter to files that exist — this makes the failure legible rather than preventing it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…nds (#4333) ## Summary A verification run left two things behind for an age sweep to collect days later. Both are now disposed when the run no longer needs them. ## Problem **pytest temp.** pytest keeps the last three numbered run directories under one temp root and deletes older ones. The session TMPDIR is per-shell, so every `nix develop --command` starts a fresh root and that pruning never fires. Measured: **17,707 shell directories holding 128 GB**, 191 of them over 100 MB, several at 3.5 GB each. **dmypy.** `devtools verify` starts mypy's persistent daemon, which is reparented to the user manager and outlives the run that started it. In the main checkout that is the point — successive runs reuse the type cache. A lane or batch worktree gates once and is then disposed, so its daemon is never reused and never exits. Measured: **ten alive holding 9.2 GB**, from gates finished up to three and a half hours earlier. Killing them took free memory from 3.5 GB to 11 GB. This is what looked like a ceiling on concurrent verification. An active run is ~1.5 GB; the pressure was dead weight. ## Solution The run owns its basetemp and removes it on success. A failed run keeps its tree, since that is when the fixtures are worth reading. A non-primary checkout uses plain mypy. The daemon stays where repeated runs amortise it. ## Verification A green `devtools test` leaves no `.cache/verify/tmp`; a failing one keeps it (2.6 MB observed). `_is_primary_checkout()` returns False in `/realm/worktrees/batch-14` and selects `['mypy']`; True in the main checkout, selecting `['dmypy','run']`. ## Residual risk Existing shell directories are not retroactively cleaned by this change; `/realm/tmp/shell` still ages out on the 7-day tmpfiles rule. Plain mypy is slower than a warm daemon on repeated runs in the same worktree, which ephemeral worktrees do not do. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…#4334) ## Summary Reverts the worktree exemption from #4333 and moves the daemon's shutdown to the point where the workspace is actually gone. ## Problem #4333 stopped using dmypy in non-primary checkouts to prevent the leak. Measured afterwards in a batch worktree: | | time | |---|---| | plain mypy | 50s | | dmypy, cold start | 51s | | dmypy, warm | **1s** | A workspace is gated repeatedly while it is repaired, so only the first run pays for the cache. The exemption bought memory that a lifecycle hook releases anyway, at ~49s per re-gate. mypy's own idle timeout does not solve it either: a daemon started with `--timeout 10` was still running after twenty seconds idle, so that flag cannot be relied on. ## Solution sinnixd stops the daemon when it removes a worktree (sinnix `3f8fcea2`), which releases the cache exactly when the workspace it describes disappears. devtools uses the daemon everywhere again. ## Verification `devtools verify --quick` green in the main checkout with the daemon in use. sinnix side: `nix build .#sinnixd` and `nix develop --command check` green, with a test asserting removal invokes `dmypy stop` and tolerates a workspace with no provisioned venv. ## Residual risk A worktree removed outside `agentctl workspace` — by hand, or by `git worktree remove` directly — still leaks its daemon. The basetemp lifecycle from #4333 is unaffected and stays. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…g collected (#4343) ## Summary Fixes a regression from #4333 plus the diagnosis gap that has repeatedly misled integration. ## Problem **Colliding basetemp.** #4333 pointed `--basetemp` at a fixed path. pytest creates that directory itself and fails when it exists, so two runs in one checkout collide: ``` INTERNALERROR> FileExistsError: [Errno 17] File exists: '.cache/verify/tmp' ``` Lanes, batches and the coordinator all run concurrently in the same checkout here, so this fires routinely — and an INTERNALERROR mid-run is a plausible source of the empty collections that were being written off as flakes. **Cleanup that silently failed.** Tests seal archive generations read-only, so `rmtree(ignore_errors=True)` could not unlink them and left the tree behind — exactly the accumulation #4333 set out to stop. **Indistinguishable exit 5.** pytest exits 5 both when a selection genuinely matches nothing and when a path in it does not exist. A selection derived from `git diff --name-only` contains files the branch deleted, so the run collects nothing and reads as "no work to do". That has already produced false conclusions during integration, including a report that multi-path selections were broken. ## Solution The basetemp is unique per invocation. Cleanup clears permissions before removing. On exit 5 the runner names the absent paths, or states that every path existed so the caller looks at the `-k`/`-m` expression or contention instead. ## Verification `devtools verify --quick` → exit 0. `devtools test tests/unit/devtools/test_run_tests.py` → exit 0. A selection naming a deleted file prints `collected nothing because these paths do not exist: tests/unit/gone.py`. Repeated green runs leave no `.cache/verify/tmp-*` behind; a failed run keeps its own for inspection. ## Residual risk A failed collection still keeps an empty temp directory, which is litter rather than a leak. Callers deriving selections from a diff should still filter to files that exist — this makes the failure legible rather than preventing it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…nds (#4333) ## Summary A verification run left two things behind for an age sweep to collect days later. Both are now disposed when the run no longer needs them. ## Problem **pytest temp.** pytest keeps the last three numbered run directories under one temp root and deletes older ones. The session TMPDIR is per-shell, so every `nix develop --command` starts a fresh root and that pruning never fires. Measured: **17,707 shell directories holding 128 GB**, 191 of them over 100 MB, several at 3.5 GB each. **dmypy.** `devtools verify` starts mypy's persistent daemon, which is reparented to the user manager and outlives the run that started it. In the main checkout that is the point — successive runs reuse the type cache. A lane or batch worktree gates once and is then disposed, so its daemon is never reused and never exits. Measured: **ten alive holding 9.2 GB**, from gates finished up to three and a half hours earlier. Killing them took free memory from 3.5 GB to 11 GB. This is what looked like a ceiling on concurrent verification. An active run is ~1.5 GB; the pressure was dead weight. ## Solution The run owns its basetemp and removes it on success. A failed run keeps its tree, since that is when the fixtures are worth reading. A non-primary checkout uses plain mypy. The daemon stays where repeated runs amortise it. ## Verification A green `devtools test` leaves no `.cache/verify/tmp`; a failing one keeps it (2.6 MB observed). `_is_primary_checkout()` returns False in `/realm/worktrees/batch-14` and selects `['mypy']`; True in the main checkout, selecting `['dmypy','run']`. ## Residual risk Existing shell directories are not retroactively cleaned by this change; `/realm/tmp/shell` still ages out on the 7-day tmpfiles rule. Plain mypy is slower than a warm daemon on repeated runs in the same worktree, which ephemeral worktrees do not do. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…#4334) ## Summary Reverts the worktree exemption from #4333 and moves the daemon's shutdown to the point where the workspace is actually gone. ## Problem #4333 stopped using dmypy in non-primary checkouts to prevent the leak. Measured afterwards in a batch worktree: | | time | |---|---| | plain mypy | 50s | | dmypy, cold start | 51s | | dmypy, warm | **1s** | A workspace is gated repeatedly while it is repaired, so only the first run pays for the cache. The exemption bought memory that a lifecycle hook releases anyway, at ~49s per re-gate. mypy's own idle timeout does not solve it either: a daemon started with `--timeout 10` was still running after twenty seconds idle, so that flag cannot be relied on. ## Solution sinnixd stops the daemon when it removes a worktree (sinnix `3f8fcea2`), which releases the cache exactly when the workspace it describes disappears. devtools uses the daemon everywhere again. ## Verification `devtools verify --quick` green in the main checkout with the daemon in use. sinnix side: `nix build .#sinnixd` and `nix develop --command check` green, with a test asserting removal invokes `dmypy stop` and tolerates a workspace with no provisioned venv. ## Residual risk A worktree removed outside `agentctl workspace` — by hand, or by `git worktree remove` directly — still leaks its daemon. The basetemp lifecycle from #4333 is unaffected and stays. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…g collected (#4343) ## Summary Fixes a regression from #4333 plus the diagnosis gap that has repeatedly misled integration. ## Problem **Colliding basetemp.** #4333 pointed `--basetemp` at a fixed path. pytest creates that directory itself and fails when it exists, so two runs in one checkout collide: ``` INTERNALERROR> FileExistsError: [Errno 17] File exists: '.cache/verify/tmp' ``` Lanes, batches and the coordinator all run concurrently in the same checkout here, so this fires routinely — and an INTERNALERROR mid-run is a plausible source of the empty collections that were being written off as flakes. **Cleanup that silently failed.** Tests seal archive generations read-only, so `rmtree(ignore_errors=True)` could not unlink them and left the tree behind — exactly the accumulation #4333 set out to stop. **Indistinguishable exit 5.** pytest exits 5 both when a selection genuinely matches nothing and when a path in it does not exist. A selection derived from `git diff --name-only` contains files the branch deleted, so the run collects nothing and reads as "no work to do". That has already produced false conclusions during integration, including a report that multi-path selections were broken. ## Solution The basetemp is unique per invocation. Cleanup clears permissions before removing. On exit 5 the runner names the absent paths, or states that every path existed so the caller looks at the `-k`/`-m` expression or contention instead. ## Verification `devtools verify --quick` → exit 0. `devtools test tests/unit/devtools/test_run_tests.py` → exit 0. A selection naming a deleted file prints `collected nothing because these paths do not exist: tests/unit/gone.py`. Repeated green runs leave no `.cache/verify/tmp-*` behind; a failed run keeps its own for inspection. ## Residual risk A failed collection still keeps an empty temp directory, which is litter rather than a leak. Callers deriving selections from a diff should still filter to files that exist — this makes the failure legible rather than preventing it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…nds (#4333) ## Summary A verification run left two things behind for an age sweep to collect days later. Both are now disposed when the run no longer needs them. ## Problem **pytest temp.** pytest keeps the last three numbered run directories under one temp root and deletes older ones. The session TMPDIR is per-shell, so every `nix develop --command` starts a fresh root and that pruning never fires. Measured: **17,707 shell directories holding 128 GB**, 191 of them over 100 MB, several at 3.5 GB each. **dmypy.** `devtools verify` starts mypy's persistent daemon, which is reparented to the user manager and outlives the run that started it. In the main checkout that is the point — successive runs reuse the type cache. A lane or batch worktree gates once and is then disposed, so its daemon is never reused and never exits. Measured: **ten alive holding 9.2 GB**, from gates finished up to three and a half hours earlier. Killing them took free memory from 3.5 GB to 11 GB. This is what looked like a ceiling on concurrent verification. An active run is ~1.5 GB; the pressure was dead weight. ## Solution The run owns its basetemp and removes it on success. A failed run keeps its tree, since that is when the fixtures are worth reading. A non-primary checkout uses plain mypy. The daemon stays where repeated runs amortise it. ## Verification A green `devtools test` leaves no `.cache/verify/tmp`; a failing one keeps it (2.6 MB observed). `_is_primary_checkout()` returns False in `/realm/worktrees/batch-14` and selects `['mypy']`; True in the main checkout, selecting `['dmypy','run']`. ## Residual risk Existing shell directories are not retroactively cleaned by this change; `/realm/tmp/shell` still ages out on the 7-day tmpfiles rule. Plain mypy is slower than a warm daemon on repeated runs in the same worktree, which ephemeral worktrees do not do. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…#4334) ## Summary Reverts the worktree exemption from #4333 and moves the daemon's shutdown to the point where the workspace is actually gone. ## Problem #4333 stopped using dmypy in non-primary checkouts to prevent the leak. Measured afterwards in a batch worktree: | | time | |---|---| | plain mypy | 50s | | dmypy, cold start | 51s | | dmypy, warm | **1s** | A workspace is gated repeatedly while it is repaired, so only the first run pays for the cache. The exemption bought memory that a lifecycle hook releases anyway, at ~49s per re-gate. mypy's own idle timeout does not solve it either: a daemon started with `--timeout 10` was still running after twenty seconds idle, so that flag cannot be relied on. ## Solution sinnixd stops the daemon when it removes a worktree (sinnix `3f8fcea2`), which releases the cache exactly when the workspace it describes disappears. devtools uses the daemon everywhere again. ## Verification `devtools verify --quick` green in the main checkout with the daemon in use. sinnix side: `nix build .#sinnixd` and `nix develop --command check` green, with a test asserting removal invokes `dmypy stop` and tolerates a workspace with no provisioned venv. ## Residual risk A worktree removed outside `agentctl workspace` — by hand, or by `git worktree remove` directly — still leaks its daemon. The basetemp lifecycle from #4333 is unaffected and stays. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…g collected (#4343) ## Summary Fixes a regression from #4333 plus the diagnosis gap that has repeatedly misled integration. ## Problem **Colliding basetemp.** #4333 pointed `--basetemp` at a fixed path. pytest creates that directory itself and fails when it exists, so two runs in one checkout collide: ``` INTERNALERROR> FileExistsError: [Errno 17] File exists: '.cache/verify/tmp' ``` Lanes, batches and the coordinator all run concurrently in the same checkout here, so this fires routinely — and an INTERNALERROR mid-run is a plausible source of the empty collections that were being written off as flakes. **Cleanup that silently failed.** Tests seal archive generations read-only, so `rmtree(ignore_errors=True)` could not unlink them and left the tree behind — exactly the accumulation #4333 set out to stop. **Indistinguishable exit 5.** pytest exits 5 both when a selection genuinely matches nothing and when a path in it does not exist. A selection derived from `git diff --name-only` contains files the branch deleted, so the run collects nothing and reads as "no work to do". That has already produced false conclusions during integration, including a report that multi-path selections were broken. ## Solution The basetemp is unique per invocation. Cleanup clears permissions before removing. On exit 5 the runner names the absent paths, or states that every path existed so the caller looks at the `-k`/`-m` expression or contention instead. ## Verification `devtools verify --quick` → exit 0. `devtools test tests/unit/devtools/test_run_tests.py` → exit 0. A selection naming a deleted file prints `collected nothing because these paths do not exist: tests/unit/gone.py`. Repeated green runs leave no `.cache/verify/tmp-*` behind; a failed run keeps its own for inspection. ## Residual risk A failed collection still keeps an empty temp directory, which is litter rather than a leak. Callers deriving selections from a diff should still filter to files that exist — this makes the failure legible rather than preventing it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
|
Closing out open Codex review threads on this PR (evidence checked against master at bf68918):
Resolving every thread listed; confirmed defects are fixed under the named bead. |
Summary
A verification run left two things behind for an age sweep to collect days later. Both are now disposed when the run no longer needs them.
Problem
pytest temp. pytest keeps the last three numbered run directories under one temp root and deletes older ones. The session TMPDIR is per-shell, so every
nix develop --commandstarts a fresh root and that pruning never fires. Measured: 17,707 shell directories holding 128 GB, 191 of them over 100 MB, several at 3.5 GB each.dmypy.
devtools verifystarts mypy's persistent daemon, which is reparented to the user manager and outlives the run that started it. In the main checkout that is the point — successive runs reuse the type cache. A lane or batch worktree gates once and is then disposed, so its daemon is never reused and never exits. Measured: ten alive holding 9.2 GB, from gates finished up to three and a half hours earlier. Killing them took free memory from 3.5 GB to 11 GB.This is what looked like a ceiling on concurrent verification. An active run is ~1.5 GB; the pressure was dead weight.
Solution
The run owns its basetemp and removes it on success. A failed run keeps its tree, since that is when the fixtures are worth reading.
A non-primary checkout uses plain mypy. The daemon stays where repeated runs amortise it.
Verification
A green
devtools testleaves no.cache/verify/tmp; a failing one keeps it (2.6 MB observed)._is_primary_checkout()returns False in/realm/worktrees/batch-14and selects['mypy']; True in the main checkout, selecting['dmypy','run'].Residual risk
Existing shell directories are not retroactively cleaned by this change;
/realm/tmp/shellstill ages out on the 7-day tmpfiles rule. Plain mypy is slower than a warm daemon on repeated runs in the same worktree, which ephemeral worktrees do not do.🤖 Generated with Claude Code
https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA