Skip to content

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

Merged
thymikee merged 3 commits into
mainfrom
refactor/daemon-test-move-seven
Oct 15, 2026
Merged

thymikee merged 3 commits into
mainfrom
refactor/daemon-test-move-seven

Conversation

@thymikee

@thymikee thymikee commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

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-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

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

thymikee and others added 2 commits October 15, 2026 12:59
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 11 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.25 MB 5.25 MB 0 B
Package (unpacked) 5.25 MB 5.25 MB 0 B
Package (download) 1.58 MB 1.58 MB -16 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 24.8 ms 25.0 ms +0.2 ms
CLI --help 68.1 ms 64.9 ms -3.3 ms

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstack.github.io/agent-device/pr-preview/pr-3638/

Built to branch gh-pages at 2026-10-15 12:14 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at 50382fa. The change moves the daemon-only transport tests into the package, and production code is unchanged. Not blocking: @agent-device/proxy in packages/daemon/package.json (line 21) is only used by daemon-proxy.test.ts, so devDependencies may fit better if R11 allows it, and the seven loopback-server tests now sit under packages/*/src, so please confirm the mutation ownership scripts schedule them as intended; take or leave both. Smoke Tests and Coverage were still running when I checked, so merge waits for them to finish green. I did not run the gates or the moved tests, so the PR body's gate claims are unverified on my side. There are no conflicts.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 15, 2026
…ts beside

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

Evidence (quality bar)

Pure moves, git diff -M similarity (main..HEAD; the only changed lines are import specifiers and the rename):

  • provider-scenarios/daemon-http-boundary-cancellation → server/http/http-server-boundary-cancellation: 97%
  • provider-scenarios/daemon-http-disconnect → http-server-disconnect: 99%
  • provider-scenarios/daemon-http-lease-allocate → http-server-lease-allocate: 96%
  • provider-scenarios/daemon-http-resumable-upload → http-server-resumable-upload: 95%
  • provider-scenarios/daemon-transport → transport: 97%
  • provider-scenarios/daemon-lifecycle → server-lifecycle: 96%
  • src/__tests__/daemon-proxy → http-server-proxy: 99%

Test-count parity. Specifier-only diffs keep the test declarations byte-identical. Run counts at the destination: boundary-cancellation 4, disconnect 3, lease-allocate 1, resumable-upload 1, transport 2, server-lifecycle 1, http-server-proxy 13 (25 total; they passed before the move at the same counts per the PR #3638 run).

Lane selection. The six provider-scenarios files leave provider-integration (pnpm test:integration:provider, which still selects daemon-http-server.test.ts and the rest) for unit-core (pnpm test:unit, test:coverage). vitest list --project unit-core --filesOnly selects all seven destinations; --project provider-integration selects none of the moved names.

vi.mock. None of the seven files mocks anything.

Exports. daemon 103 → 102 (./testing/server/server-lifecycle deleted; no importer remains). No other package changed (the new @agent-device/proxy workspace dependency is a manifest edge, not a subpath); no new subpath, barrel or export *.

@thymikee
thymikee merged commit fb61e68 into main Oct 15, 2026
24 of 25 checks passed
@thymikee
thymikee deleted the refactor/daemon-test-move-seven branch October 15, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant