Enforce the XZ extraction disk budget while decompression is running
Motivation
The XZ path materializes the entire input.tar before comparing its size with MAX_EXPANDED. A post-write 16 GiB check does not cap temporary disk consumption; the xz memory limit controls a different resource.
Reproduction and evidence
Audited canonical master 69a67c6e0fb700f37ee6114f5a66d37ee13771a5 (0.0.1-alpha-dev). Matching checkout-built compiler/std were used for compiler probes on Linux amd64 with Rust 1.89.0 and LLVM 21.1.8. Artifact inspection, mocked/projection checks and foreign-target object emission are identified below and are not native execution on those operating systems.
Source-derived resource-control finding: extract_policy copies the archive to input.tar.xz, runs xz --decompress --memlimit-decompress=1GiB, then calls metadata(input.tar).len() > MAX_EXPANDED. No multi-gigabyte disk-filling reproduction was run. The gzip/ZIP integrity reproductions are a separate issue.
Scope
Apply an expanded-byte budget during XZ output production and terminate/reap the producer on overflow before activating any tree.
Starting points: tools/src/sdk.rs:313.
Completion criteria
- [ ] A small injectable budget stops expansion as it crosses the limit.
- [ ] Failures clean staging and preserve existing destinations.
- [ ] Keep checksum/path/link checks, normal archive support and subprocess resource limits.
Related: #1020, #1070. Related broad trackers or completed implementations are context, not claims that their entire scope is unfinished.