refactor(daemon): move the daemon-only transport tests into the package
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 path | Tests | New path | Tests | git diff -M |
|---|---|---|---|---|
test/integration/provider-scenarios/daemon-http-boundary-cancellation.test.ts | 4 | server/http/http-server-boundary-cancellation.test.ts | 4 | 97% |
test/integration/provider-scenarios/daemon-http-disconnect.test.ts | 3 | server/http/http-server-disconnect.test.ts | 3 | 99% |
test/integration/provider-scenarios/daemon-http-lease-allocate.test.ts | 1 | server/http/http-server-lease-allocate.test.ts | 1 | 96% |
test/integration/provider-scenarios/daemon-http-resumable-upload.test.ts | 1 | server/http/http-server-resumable-upload.test.ts | 1 | 95% |
test/integration/provider-scenarios/daemon-transport.test.ts | 2 | server/http/transport.test.ts | 2 | 97% |
test/integration/provider-scenarios/daemon-lifecycle.test.ts | 1 | server/http/server-lifecycle.test.ts | 1 | 96% |
src/__tests__/daemon-proxy.test.ts | 13 | server/http/http-server-proxy.test.ts | 13 | 99% |
| Total | 25 | 25 |
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-coreincludespackages/*/src/**/*.test.ts;vitest list --project unit-core --filesOnlylists all seven destinations.pnpm test:unitandtest:coveragerun that project.- Six files leave
provider-integration(test/integration/provider-scenarios/**,pnpm test:integration:provider, which still selectsdaemon-http-server.test.tsand the rest);--project provider-integrationselects none of the moved names.http-server-proxywas already inunit-core(src/**/*.test.ts). pnpm check:affected --jsonon this head selectsunit,unit-ciandprovider-integration(the manifest edit fails the selector open) and lists every moved path;check:affected --runpasses, including thevitest relatedleg.
vi.mock
No vi.mock in any moved file (rg vi.mock over the seven destinations returns nothing).
Subpath exports
| Package | Before | After |
|---|---|---|
daemon | 103 | 102 (./testing/server/server-lifecycle deleted; no importer remains) |
| every other package | unchanged | unchanged |
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