refactor(replay): move four daemon tests of replay-port code into replay-port
What
Four daemon tests that only exercise replay-port modules move into replay-port, beside the module they test and importing it relatively. Their package export (./session-test-source-discovery) loses its last importer and is dropped. Second slice of the replay-package sweep (first: #3647, independent).
Commits
refactor(replay): move four daemon tests of replay-port code beside their modules—git mvonly.git diff -M --stat: four renames, 0 insertions / 0 deletions.refactor(replay): import the moved tests relatively— specifier rewrites only, plus one type:attachRemoteReplayTestArtifactstakesDaemonWireRequest, which daemon-privateDaemonRequestonly widened, so the test'sreq()helper is typedDaemonWireRequestfrom@agent-device/contracts/command.chore(gates): drop the replay-port session-test-source-discovery export.
Moves
From (packages/daemon/src/sessions/__tests__/replay-suite/) | To (packages/replay-port/src/daemon-port/__tests__/) | Module |
|---|---|---|
session-test-suite-command-cancellation.test.ts | test-command-cancellation.test.ts | test-command.ts (bindReplayTestAttemptCancellation) |
session-test-suite-command-nested-flags.test.ts | test-command-nested-flags.test.ts | test-command.ts (buildNestedReplayFlags) |
session-test-suite-command-remote-artifacts.test.ts | test-command-remote-artifacts.test.ts | test-command.ts (attachRemoteReplayTestArtifacts) |
session-test-source-discovery.test.ts | session-test-source-discovery-inspection.test.ts | session-test-source-discovery.ts |
The last one takes an -inspection aspect suffix because replay-port already has a different session-test-source-discovery.test.ts (the lazy-backend-resolution cases). Both stay; the existing one is untouched.
None of them uses vi.mock.
Fixture decision (these tests' fixture imports)
| Fixture | Importers moved | Outcome |
|---|---|---|
test-kit/tmp-dir mkdtempForTestSync | 2 tests | replay-port's own tmp-dir.fixtures.ts (already there for the package's tests) |
replay-port/replay-script-source-fixtures | 1 test | relative import of ../../replay-script-source.fixtures.ts; the export itself stays until test-kit's single entry lands (20 daemon + root importers remain) |
Test-count parity (vitest run <files> --reporter=json, passed/failed)
| Test | Before (daemon path, a907a919a) | After (replay-port path) |
|---|---|---|
| cancellation | 5/0 | 5/0 |
| nested-flags | 6/0 | 6/0 |
| remote-artifacts | 3/0 | 3/0 |
| source-discovery(-inspection) | 4/0 | 4/0 |
existing session-test-source-discovery.test.ts (untouched) | n/a | 3/0 |
Total moved 18 → 18. Selection: destination is under packages/*/src/**/*.test.ts (unit-core include); vitest collected all five files by path. check:gate-manifest ok; check:affected selected the moved files (they appear in its related-test command).
Surface
replay-port exports 32 → 31 (cumulative with #3647: 33 → 31 against main). No new subpath, barrel or export *. bindReplayTestAttemptCancellation and buildNestedReplayFlags keep their module-level export for the colocated tests; their package subpath (./test-command) still has production and integration importers.
Remaining non-package importer of attachRemoteReplayTestArtifacts: test/integration/provider-scenarios/remote-test-artifacts-materialization.test.ts (root worker's file). Not touched.
Gates (on 1162edeac)
check:quick, check:layering, check:fallow, check:gate-manifest, pnpm format: clean. check:affected --run: all pass except scripts/__tests__/eager-closure-budgets.test.ts > no APPROVED_OVER_CEILING row is stale, which names packages/daemon/src/index.ts and fails on any branch off a907a919a (passes on a907a919a itself only because the check is deferred when merge-base equals head). Left stale by the daemon single-entry PR #3633; daemon thread to remove that row.
R83 and the colocation baseline are not on main yet, so this only shrinks what the seed will contain.
🤖 Generated with Claude Code