fix(remote): bound artifact preparation and upload phases

Merged
TH
19h ago
+2196-208

Summary

Remote artifact uploads share a finite 600 s lifecycle across preparation, retries, resume and fallback. Connect and post-flush headers have 30 s ceilings; body inactivity has 120 s. Headers now start at connected request finish, independently of file-close/pipeline cleanup. Typed phase expiry is terminal and caller cancellation preserves its reason.

This changes 17 files. Host-kit owns completed nonempty writes and response reading; the remote reader copy is removed. The header regression retains its progress premises and assertions while pinning the held source fd and real close completion. Duplicate lower phase comments were removed; the header contract remains. Refs #4441. Proxy, daemon and downloads remain separate.

Validation

Tested 13a4c1d9576777989ab3849cda9fb78661a33988, base d78be6c8.

Pinned pnpm 11.17.0 check:affected --run --head <sha> --json passed once: exactCommit=true, checkoutChanged=false, failOpen=false. Nine checks passed, including wire compatibility, 376 related tests and 19,841 unit tests (10 skipped). Seven CI-owned/manual checks were skipped; #4050 full-unit fallback remains.

Cold review found no findings. Focused baseline passed 121 tests. Published 77a5 production, missing finish arming and a late pipeline rearm each fail the same 30,000 ms request-destruction assertion; restored controls pass.

Linux Coverage and Integration passed at this head; all required checks are green (one matrix check skipped). Earlier failures retain their attribution; actual CI close latency remains inferred. The separate /proc fixture correction is in open #4544. Per-byte daemon ticket refresh, Node-floor, Bun and end-to-end slow-transfer evidence remain open.