Enforce a byte budget while downloading pinned SDK archives
Motivation
SDK fetch reads catalog identity/hash but does not pass size_bytes to download. curl writes an unbounded temporary output until the time limit or end of stream, and SHA-256 is checked only afterward.
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: sdk::fetch calls download(url, archive, sha256) without the catalog size_bytes; sdk::download sets a 600-second process timeout and --output temporary, but no download-file byte bound. No large network transfer or live SDK publication was performed. Hash and HTTPS validation are present and were not shown to be bypassed.
Scope
Use validated catalog size or an explicit compressed-download budget during transfer, independently from the expanded archive budget. Preserve pinned hashes, HTTPS and activation rules.
Starting points: tools/src/sdk.rs:397, tools/src/sdk.rs:434.
Completion criteria
- [ ] An oversized controlled stream is stopped and reaped before unbounded temporary growth.
- [ ] Size mismatch, hash mismatch, timeout and successful download remain distinct and tested.
- [ ] Failure removes temporary output and preserves installed SDK state.
Related: #1070. Related broad trackers or completed implementations are context, not claims that their entire scope is unfinished.