I2882 — A remote derive builds only inside its own run directory
The derive offload's remote script pins cargo's build directory, not only its target directory, to the run directory `<shared>-<tag>` that its traps remove, so nothing a remote derive compiles outlives the derive on the host, whether it succeeds or fails.
DONE wave 0 · p0 · implementation profile · parallel safe
Part of development-runtime — The runtime has a development surface.
Objective
The derive offload's remote script pins cargo's build directory, not only its target directory, to the run directory `<shared>-<tag>` that its traps remove, so nothing a remote derive compiles outlives the derive on the host, whether it succeeds or fails.
Why
2026-10-18 lundra reached 0 bytes free twice. The checkout declares build-dir = {cargo-cache-home}/build-shared/majordomus, so the offload's CARGO_TARGET_DIR alone kept every intermediate in the host's shared build directory (87 GB, 48 GB of it llvm-cov-target), outside what the run's traps remove; the owner ordered disk space solved systemically on every machine.
Current state
offload/run.rs DERIVE exports CARGO_TARGET_DIR=$private and removes $private on EXIT/HUP/INT/TERM; CARGO_BUILD_BUILD_DIR is inherited, so the declared shared build-dir receives the intermediates.
Desired state
DERIVE exports CARGO_BUILD_BUILD_DIR=$private beside CARGO_TARGET_DIR; a unit test runs the real script locally with a decoy build directory in the environment and holds that the derive saw only the run directory, that nothing landed in the decoy, and that the run directory is gone after a successful and after a failed derive.
Scope
- apps/majordomus-cli/src/offload
- docs/OFFLOAD.md
Dependencies
None. This issue is a root of the graph.
Acceptance criteria
- The remote derive's build and target directories are both the run directory, whatever build directory the caller's environment names
- The run directory is removed after a derive that succeeds and after one that fails (exit 10)
- Nothing is written to the build directory the caller's environment named
Validation
- cargo test --lib -- offload::run::tests::a_remote_derive_builds_only_inside_its_run_directory_and_removes_it
- majordomus plan validate
Evidence required
- offload_run_dir_test
Evidence
| covers | type | command | result | at commit |
|---|---|---|---|---|
| offload_run_dir_test | ci | cargo test --lib -- offload::run::tests::a_remote_derive_builds_only_inside_its_run_directory_and_removes_it | ok in validate run 39192952944, job rust (2) 117890228077 (3482 passed, 0 failed), every job green at master dd4c0a87cba, which contains the fix a4c19d60f0c | 9a5a9b7 |
Timeline
- started
- 2026-10-20T15:29:44Z
- verified
- —
- completed
- 2026-10-20T15:30:47Z
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/I2882.yaml. Read it back with majordomus plan show I2882.