Repository navigation
refactor(daemon): relocate the server runtime tests by what they assert - #3652
Conversation
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 24 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Evidence (quality bar)Test-count parity.
This is a redesign, not a pure move: the daemon tests were rewritten onto the deps fixture and the tests that asserted root adapter behavior were split out, so there is no Lane selection.
Exports. |
67a3b77 to
141c006
Compare
|
The code looks good at 141c006, and I found nothing that needs to change before merge. CI is still pending: all 12 remaining checks are queued, none has failed, and they must go green before merge. No conflicts. The two open inline threads, on shutdown not in finally and the snapshot.nodes read, both still apply. Please take them, since they are small. Not blocking, take or leave: the same 25-line I did not run the suite. The author's affected-test run covers the earlier head, and I only spot-checked the 47 to 53 test-count parity by reading the split files. |
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…ommand surface fake Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… it is named for Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng surface and always shut the runtime down Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y it forwards snapshots Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sed to carry and fix a stale test-path comment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2787df8 to
fe05f52
Compare
Review follow-up: rebase, mock break-proofs, the dropped artifact fetchRebase. Rebased onto Dropped
Neither covers the env wiring (
The Small follow-ups. The comment in |
Mock evidence on the refined standardEach surviving mock with the positive assertion that proves it took effect. Where none exists the break-proof from the previous comment applies and is repeated here.
So the only mocks that rest on a break-proof alone are the two root composition stubs; every other row has a positive assertion, and the previous comment's break counts stand as extra evidence. Forwarding fake
|
…urface Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The earlier findings from 141c006 are resolved at 12c318b. I found no new problems in the daemon and root test files this PR owns. The diff changes only tests, fixtures and package.json subpath exports, with no production source. CI is still pending. All 17 checks that have not passed are queued, and none has failed. Lint, Repo Guards, Typecheck, Coverage and Integration read the moved test files and the daemon exports, so they must go green. I did not run the test suite myself, and I did not re-check the 47 to 53 test-count parity from the earlier pass. The three bot threads on the shutdown restore, the snapshot tree read and the forwarded raw option are fixed at this head, so the author can resolve them: #3652 (comment), #3652 (comment) and #3652 (comment). There are no conflicts. Once CI is green and the branch stays conflict-free against main, nothing else stands in the way of merge. |
Summary
Batch
serverof the daemon test redesign (no test exports of any kind). The 11 root tests undersrc/__tests__/daemon-composition/server/and three tails (daemon-composition-assembly,daemon-composition-web-cleanup,daemon-entrypoint) are placed by what they assert, not moved wholesale. Theirvi.mocks of root platform modules and of daemon internals are gone or become relative in-package mocks.New package fixture
daemon-runtime-deps-fixture.ts: aComposeDaemonRuntimeDepsfactory of inert ports, so a daemon-runtime test startsstartDaemonRuntimewithout the root composition. AlsoforwardingCreateCommandSurfacein the command-surface fake: its snapshot capture reaches the config backend and writes the session back through the config session store, the two seams the daemon's refusals land on.a / b / c split
daemon-runtime-idle-reap(3)packages/daemon/src/server/http/(besidedaemon-runtime.ts), deps fixture, relativelease-registrymockdaemon-runtime-lease-expiry(2)lease-registryandrequest-execution-scopemocksdaemon-runtime-rpc-flow-failure(2)request-routermockdaemon-runtime-recording-reaper(1)host-kit/processmock keptdaemon-runtime-metadata-ownership(8)daemon-runtime-recording-teardown(2)platformResourceCleanupFixtureinstead of the root cleanupdaemon-runtime-snapshot-shutdown(2)daemon-runtime-lifecycle-shutdown(8)sendRequestreplaced by an/rpcfetchdaemon-runtime-interactor-compositiondaemon-runtime-composition.test.ts(installs what the composition supplied; provider shutdown on a lost lock). c:src/daemon-composition.test.ts(the composed resolution picks the provider that owns the device). b:src/daemon-composition-credentials.test.ts(real composition throughstartDaemonRuntime, an/rpclease allocate)daemon-runtime-xctest-device-setdaemon-runtime-owner-lifecycle.test.ts(configure before readiness publication; owner diagnostics reachdaemon.log; startup survives a refused restore). c:src/platform-runtime-daemon-lifecycle.test.ts(the real darwin restore)daemon-runtime-web-close-teardown(4)src/platform-runtime-resource-cleanup.test.ts(agent-browsercloseargv, refusal rejects, non-web never reaches it)daemon-composition-assemblydaemon-runtime-composition.test.ts; the unreadable-policy case moves with themdaemon-composition-web-cleanupsrc/daemon-composition.ts; it never needed a daemonSessionStore, so the literal session names replace itdaemon-entrypointsrc/daemon.ts, inlines the one-usestartDaemonRuntimeFixture(deleted) and uses the public entry only; thetrackDownloadableArtifactfetch is dropped, sincehttp-server-artifacts.test.tsserves a tracked artifact over bearer authEvery test is named for the module it sits beside (
daemon-runtime-<aspect>.test.tsinserver/http/;daemon-composition-<aspect>.test.ts,daemon-entrypoint.test.ts,platform-runtime-*.test.tsinsrc/), so none lands in the colocation baseline.Mocks
Every surviving mock targets the module the daemon imports relatively from inside the package, so each takes effect. Evidence: the assertions read what the mock recorded (
leaseProbe.registries,ended,shutdownSteps, the failingcreateRequestHandlerflow), and they pass.Subpath exports
daemonDeleted
./testing/entries with no consumer left:__tests__/session-teardown.fixtures,__tests__/support/device-claim-store,application-lifecycle-recovery,server/daemon-runtime,server/server-shutdown,session-teardown-budget. (#3638 also deletesserver/server-lifecycle; the manifest edits will merge on rebase.) No other package grew a subpath.Also
APPROVED_OVER_CEILINGrow forpackages/daemon/src/index.ts: main carries the entry now, so the gate requires it gone.snapshot-interactor-captureis the installedInteractorResolution, anddevice-readyisDaemonPlatformServices.ensureLocalDeviceReady; neither needs a production change.Validation
check:quick,check:layering,check:fallow,check:gate-manifest,check:affected --run(all green except the stale approval row, fixed in the last commit; the eager-closure suite passes) on the pre-final head.🤖 Generated with Claude Code