refactor(daemon): move the daemon-only transport tests into the package

Merged
TH
7h ago
+21-22

Summary

Layer 3a of the daemon single-entrypoint work, on main after #3633: the seven test files that needed nothing from root code move into packages/daemon/src/server/http/, each named for the module it sits beside and importing its subject relatively. Category (a) in the redesign: daemon logic, no root code. Two commits: the pure moves (renames plus specifier edits, boundary-fault-matrix evidence path), then the manifest edit @agent-device/proxy needs.

Per-file parity (before = old path at a907a919a, after = this head; both from the vitest JSON reporter)

Old pathTestsNew pathTestsgit diff -M
test/integration/provider-scenarios/daemon-http-boundary-cancellation.test.ts4server/http/http-server-boundary-cancellation.test.ts497%
test/integration/provider-scenarios/daemon-http-disconnect.test.ts3server/http/http-server-disconnect.test.ts399%
test/integration/provider-scenarios/daemon-http-lease-allocate.test.ts1server/http/http-server-lease-allocate.test.ts196%
test/integration/provider-scenarios/daemon-http-resumable-upload.test.ts1server/http/http-server-resumable-upload.test.ts195%
test/integration/provider-scenarios/daemon-transport.test.ts2server/http/transport.test.ts297%
test/integration/provider-scenarios/daemon-lifecycle.test.ts1server/http/server-lifecycle.test.ts196%
src/__tests__/daemon-proxy.test.ts13server/http/http-server-proxy.test.ts1399%
Total2525

Every changed line in the renamed files is an import specifier (@agent-device/daemon/testing/... and @agent-device/daemon type imports to relative paths). Test declarations are untouched.

Selection

  • unit-core includes packages/*/src/**/*.test.ts; vitest list --project unit-core --filesOnly lists all seven destinations. pnpm test:unit and test:coverage run that project.
  • Six files leave provider-integration (test/integration/provider-scenarios/**, pnpm test:integration:provider, which still selects daemon-http-server.test.ts and the rest); --project provider-integration selects none of the moved names. http-server-proxy was already in unit-core (src/**/*.test.ts).
  • pnpm check:affected --json on this head selects unit, unit-ci and provider-integration (the manifest edit fails the selector open) and lists every moved path; check:affected --run passes, including the vitest related leg.

vi.mock

No vi.mock in any moved file (rg vi.mock over the seven destinations returns nothing).

Subpath exports

PackageBeforeAfter
daemon103102 (./testing/server/server-lifecycle deleted; no importer remains)
every other packageunchangedunchanged

No new subpath, barrel or export *.

Follow-up

@agent-device/proxy is declared in packages/daemon dependencies because R11 currently demands it for a test-file import. It belongs in devDependencies, since only http-server-proxy.test.ts uses it. Once thread mcp:231499d6 lands R11 accepting devDependencies for test-file imports, a follow-up commit flips it.

Validation

check:quick, check:layering, check:fallow, check:production-exports, format:check and check:affected --run pass on the pre-rename head; after the renames check:quick, check:layering and check:fallow pass again. The Coverage failure on the earlier head was the stale APPROVED_OVER_CEILING row for packages/daemon/src/index.ts (dropped by #3653); rebase after it merges.

🤖 Generated with Claude Code