I2787 — A build never lets the shared build directory's crate artifacts fill the disk
Bound the shared build directory's debug/deps the way I2713 bounds debug/incremental: before a bounded build starts, remove the crate's own test binaries and libraries (majordomus_cli-*, libmajordomus_cli-*, and each tests/*.rs binary) of generations no live tree is building and older than a declared age, never a file a running process holds open, never another crate's dependency artifacts, and say on stderr what was reclaimed.
DONE wave 1 · p0 · implementation profile · runs alone
Part of development-runtime — The runtime has a development surface.
Objective
Bound the shared build directory's debug/deps the way I2713 bounds debug/incremental: before a bounded build starts, remove the crate's own test binaries and libraries (majordomus_cli-*, libmajordomus_cli-*, and each tests/*.rs binary) of generations no live tree is building and older than a declared age, never a file a running process holds open, never another crate's dependency artifacts, and say on stderr what was reclaimed.
Why
2026-10-16 ~22:50Z the shared Mac reached 238 MiB free and every session's build failed with ENOSPC. Idle incremental sessions (48 GiB, I2713's subject) were removed by hand; the landing seat then deleted 43 GiB of majordomus_cli-* test artifacts older than 3 h from build-shared/majordomus/debug/deps, which still held 41 GiB and 11026 majordomus_cli-* files afterwards: every worktree generation leaves one crate test binary and library behind, and nothing ever removes them short of a cargo clean that would wipe every live tree's build.
Current state
lib/rust_bin.sh refuses a build below a free-space floor; I2713 (#1279) prunes idle incremental sessions; nothing prunes debug/deps.
Desired state
mj_cargo_bounded prunes the crate's stale artifacts in debug/deps beside the incremental sweep, with the same age and liveness predicates asked again of each path before it is removed, and a case holds that a live or recent artifact survives and a stale one does not.
Scope
- lib/rust_bin.sh
- test/cases
- docs/WORKTREES.md
Dependencies
Acceptance criteria
- A stale crate artifact in debug/deps older than the declared age, held open by no process, is removed before a bounded build and named on stderr
- An artifact a running process holds open, a recent one, and a dependency crate's artifact all survive
- Free space stays above the declared floor through a day of concurrent sessions on the shared machine
Validation
- majordomus plan validate
Evidence required
- case_deps_pruned
Evidence
| covers | type | command | result | at commit |
|---|---|---|---|---|
| case_deps_pruned | test | bash test/run.sh 3196_stale_crate_artifacts_are_pruned_under_cargos_lock | 3 passed, 0 failed, 0 skipped on master dd4c0a87cba (with 1060 and 2988); delivered by PR #1349 (36de9d12699, f6d28ada933), not by the plan commit cc536298674 | dd4c0a8 |
Timeline
- started
- 2026-10-19T15:30:54Z
- verified
- —
- completed
- 2026-10-19T15:31:11Z
Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.
Canonical record: .ai/repo/project/issues/I2787.yaml. Read it back with majordomus plan show I2787.