test(session-test-source-discovery-inspection): write remote test attempt artifacts from shipped script sources
Summary
A Maestro test sent to a daemon on another machine fails with ENOENT while the attempt directory is prepared, and the run never reaches a device. The missing path is the flow file from the caller, which that daemon host does not have. Refs #4561. Each attempt called prepareReplayTestAttemptArtifacts with only entry.path, and copyReplaySourceFile always used copyFileSync on that path. Source inspection had already read the shipped script, but inspectReplayTestSource returned only the path and manifest, so discoverReplayTestEntries never placed the text on the run entry.
inspectReplayTestSource now returns the script it read as sourceText, and discoverReplayTestEntries copies that field onto a run entry when the source has it. runSingleReplayTestAttempt passes entry.sourceText into prepareReplayTestAttemptArtifacts. When the value is a string, including an empty string, copyReplaySourceFile writes it to replay.ad and to the original flow filename and leaves the caller path unopened; when sourceText is absent, it still copies the local file.
Refs #4561
Test plan
npx --no-install vitest run on the source-inspection, artifact, attempt, and discovery test files passed 4 files and 35 tests.
Ran pnpm run test-app:install in a Linux container (localhost/osc-linux-node:22) for the agent-device inspectReplayTestSource change; it passed.
The changed test packages/replay-port/src/daemon-port/session-test-source-discovery.ts did not run here: no test runner for it was available.
The changed test packages/replay-test/src/index.ts did not run here: no test runner for it was available.
The changed test packages/replay-test/src/internal/session-test-artifacts.ts did not run here: no test runner for it was available.
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.