fix(remote): materialize test suite artifacts against a remote daemon - #2272
Conversation
…#2246) `agent-device test` crashed with ENOENT against a remote daemon because the scheduler resolved `--artifacts-dir` against the caller's `cwd`, sent over the wire, on the daemon's own filesystem. Mirrors #1802's read-side fix for the same command: the CLI now redirects `--artifacts-dir` to a temp directory the daemon owns before the suite runs, and the daemon rewrites every artifact path in its response back to the caller-local root and registers the suite directory as one downloadable artifact through the existing screenshot/record transport, extended here to also support directories via the codebase's existing safe archive extractor (the archive comes from a remote daemon, a different trust domain, so a raw `tar` invocation was not enough).
Size Report
npm unpacked components
Startup median (7 runs, lower is better):
Top changed chunks:
Top changed packed files
|
|
BLOCKED at exact head 99615f8. Two production composition bugs remain despite green CI. First, Second, staging under Also provide the linked issue’s real remote-daemon/device evidence for default and relative Size review: headline +776 is ~275 production LOC, below the 700-line trigger, and package growth is +2.5 kB. Still, the path bug shows ownership is split between daemon rewriting and generic client materialization. Please itemize growth and explain why one client-side owner returning both download destination and final reported path was rejected. |
|
Resolved the blocking review at
Local gate: Live acceptance used the pushed source checkout, an isolated HTTP proxy/daemon, and the discovered booted Both invocation directories contained CI note: the first Android smoke attempt timed out waiting for an unrelated landscape snapshot with |
|
Follow-up exact head |
|
Summary
Fixes #2246.
Remote
agent-device testrequests now keep daemon-owned suite artifacts off caller-only paths, transfer the completed suite through the existing tracked-artifact transport, and report the exact caller-local invocation directory for the suite, tests, and failures.Directory downloads use the existing safe archive extractor. They stage beside the caller's destination, propagate one cancellation signal through download and extraction, clean up before timeout rejection, and publish with one atomic rename. The client-side download owner returns the exact materialized path; generic response materialization no longer reconstructs it independently.
The follow-up reduces the original
src/remote/daemon-artifacts.tsgrowth by extracting its download machinery into the 191-linesrc/remote/artifact-download.ts. Overall scope is 15 files (+1040/-124), mostly 6 focused test files (+631 lines). Production growth remains below the repository's 700-line escalation threshold, while the shipped bundle is +2.2 kB raw / +784 B gzip on the latest size report.Validation
99615f818c05a388b7cf1d17fc7285c032857d9e: composed materialization returned the bare caller root instead of<root>/<suite-id>, and directory staging was outside the destination filesystem.pnpm check:affected --run: 484 files and 3,610 tests passed, including build, layering, Fallow, and daemon wire compatibility.iPhone 17 ProSimulator atf1bda16b72ad9a141a9f168c1ea1f331e3c5f543: default artifact root 1/1 passed; relative--artifacts-dir relative-artifacts1/1 passed. Both returned the caller-local<root>/<suite-id>and materializedreplay.adplusresult.txtunder the per-attempt directory.