Repository navigation
refactor(daemon): relocate the handler tests by what they assert - #3666
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 39 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
The 615c162 head has one test that no longer guards what it claims. The ADR 0014 case "snapshot re-activates a complete frame; diff preserves it" in snapshot-handler.test.ts runs its diff step with Could one fake do the whole job? If Not blocking: The open cubic-dev-ai threads still apply. The two that matter most are the diff fake storing an empty tree and the ADR 0014 diff step, whose anchor is on line 64 but whose substance is the line 263 test above. Seven lower-priority threads also still apply, and the old tests had the same gaps in those cases. None of the threads can be resolved yet. I read the Cubic-flagged files, the guards, claims, cleanup and snapshot-handler pairs, and the Android IME and declarations diffs. I did not compare the wait-landmark, doctor-warmup, lease-provider-credentials and close-lifecycle-teardown moves against their originals. I did not recount the test-count table, run any tests, or mutation-check the new daemon-side tests. All 14 checks are still queued on this head, so there is no CI result to attribute yet. There are no conflicts. Before merge, fix the diff step, show the mutation going red, and let the queued checks finish. |
Size Report
Startup median (7 runs, lower is better):
|
615c162 to
488ccd9
Compare
|
Re the ADR 0014 case: fixed in 488ccd9. The shared forwarding surface (#3652) now forwards |
488ccd9 to
e3e3137
Compare
…sal (a) and root TestMu fingerprint (c) lease-provider-credentials: (a) lease.ts refusal/passthrough against providerCredentialsFixture in sessions/handlers; (c) bundled TestMu manifest fingerprints in src/provider-credential-fingerprint.test.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ost diagnostics wiring (c) session-doctor-warmup: (a) handleDoctorCommand warmup routing against hostDiagnosticsFixture in sessions/handlers; (c) createHostDiagnostics warmup delegation in src/platform-runtime-host-diagnostics.test.ts. Runner skip rules stay pinned by packages/platform-apple doctor.test.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…open-target validator (c) session-relaunch-guards: (a) extend sessions/handlers/__tests__/session-relaunch-guards.test.ts with the platform-services port refusal routing; (c) real validateOpenRelaunchTarget rules in src/platform-runtime-open-target-relaunch.test.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (a) plus Android IME sequencing (c) session-device-claims-cancellation: (a) cancellation retains the claim, in sessions/handlers/__tests__/session-device-claims.test.ts; (c) activate-test-ime after launch dispatch in packages/platform-android/src/lifecycle.test.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a) and cleanup rule (c)
session-close-runner-retention: (a) close hands the platform retention decision to
finalizeApplicationClose in session-close-lifecycle-teardown.test.ts; (c) retainExecutionHostAfterClose rule in
src/platform-runtime-resource-cleanup-retention.test.ts. releaseRunnerOnClose({retain}) stays pinned by
packages/platform-apple lifecycle.test.ts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pple lifecycle/tools behavior (c) session-relaunch-close (15): (a) session-open-execution-relaunch.test.ts and session-close-lifecycle-teardown.test.ts drive the daemon against the port fixtures; (c) Apple relaunch/close sequencing in packages/platform-apple/src/lifecycle-relaunch-close.test.ts and macOS close-alert dismissal in src/platform-runtime-apple-application-tools-close-alerts.test.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… routing (a) and command-family output (c) snapshot-handler (13): (a) sessions/handlers/snapshot-handler.test.ts on forwardingCreateCommandSurface; the filtered-to-zero guidance assertion is (c) already pinned by runtime/snapshot.test.ts. snapshot-handler-freshness (9): (a) sessions/handlers/snapshot-handler-freshness.test.ts and core/__tests__/snapshot-capture.test.ts; (c) src/commands/capture/runtime/snapshot-freshness.test.ts and output.test.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (a) and wait command options (c) snapshot-handler-wait (8): (a) sessions/handlers/snapshot-handler-wait.test.ts (backend capture freshness, forced fresh capture, current-surface decoration wiring, stalled-capture non-decoration) and execution/wait-current-surface.test.ts (surface summary shaping); (c) src/commands/interaction/runtime/wait-capture-options.test.ts (hidden-content hints off on every poll). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
snapshot-scoped-refs (3): (a) sessions/handlers/snapshot-scoped-refs.test.ts on a storing command surface fake; support/snapshot-command-surface-fakes.ts (new, additive) also hosts the diff variant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and runner-host teardown (c) snapshot-session-cleanup (3): (a) core/snapshot-session.test.ts against platformResourceCleanupFixture; (c) src/platform-runtime-resource-cleanup-sessionless-host.test.ts for the real runner-host teardown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…actor (c) snapshot-alert-android-occlusion (2): pure move to src/core/interactors/android-alert-occlusion.test.ts (only the module specifier changes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ime (a) wait-landmark-recording (5): (a) execution/wait-runtime-landmark.test.ts with a wait command surface double; the polling-loop landmark semantics stay pinned by runtime/wait-selector.test.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…test typing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…aunch/close suite Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… without importers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ce and tighten the order and claim assertions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e3e3137 to
4b07e86
Compare
|
The code in 4b07e86 looks good. The new commit fixes the earlier concerns: the diff step now writes the session, the empty-tree diff fake is gone, and the ordering and typed assertions are in place. The change is test-only apart from a small production edit (+4/-4), and I found no production route that the queued jobs exercise differently. All 14 checks are still queued and none has failed, so there is no CI result to read yet. I did not run the expire-the-frame mutation myself, so that result is your claim. I also did not recount the 86-to-118 test table or re-diff the earlier moves, since this commit does not touch them. The inline threads from cubic-dev-ai are all handled at this head, so you can resolve them. These cover the ADR 0014 diff step (#3666 (comment)), the empty-tree diff fake (#3666 (comment)), the task and cleanup order (#3666 (comment)), the runner stop ordering (#3666 (comment)), the abandoned claim timestamp (#3666 (comment)), the sessionless-host call order (#3666 (comment)), the bundle id mock (#3666 (comment)) and the bound devices check (#3666 (comment)). The active-session platform thread (#3666 (comment)) was resolved with a reply and the gap it names is not new, so it can stay resolved. Once the queued checks pass and #3652 lands so the base retargets to main, this can merge. It needs no further code change. |
Summary
Batch
handlersof the daemon test redesign (no test exports of any kind). The 13 root tests undersrc/__tests__/daemon-composition/handlers/are placed by what they assert; the directory is gone. Stacked on #3652 for its runtime-deps fixture and the backend-forwarding command surface fake; it retargets to main when #3652 merges.Daemon halves (a) run against the package fakes (
hostDiagnosticsFixture,providerCredentialsFixture,platformResourceCleanupFixture, the forwarding surface, the services port). Assertions about what real adapters or command-family code do (c) moved to tests beside that code. Thesnapshot-interactor-capture,device-readyandprovider-device-runtimemocks are all gone: handler tests go through the boundcaptureSnapshotoperation andDaemonPlatformServices.ensureLocalDeviceReady.a / c split and test-count parity
Before = exact count on the source file at its old path (vitest JSON reporter); after = run count per destination on this head.
lease-provider-credentials(10)sessions/handlers/lease-provider-credentials.test.ts(13)src/provider-credential-fingerprint.test.ts(+1: bundled TestMu manifest; Limrun cases were already there)session-doctor-warmup(9)sessions/handlers/session-doctor-warmup.test.ts(8)src/platform-runtime-host-diagnostics.test.ts(2)session-relaunch-guards(5)sessions/handlers/__tests__/session-relaunch-guards.test.ts(3 → 6)src/platform-runtime-open-target-relaunch.test.ts(4)session-device-claims-cancellation(1)sessions/handlers/__tests__/session-device-claims.test.ts(10 → 11)packages/platform-android/src/lifecycle.test.ts(+1: IME activated after launch dispatch)session-close-runner-retention(3)session-lifecycle/internal/session-close-lifecycle-teardown.test.ts(7, shared)src/platform-runtime-resource-cleanup-retention.test.ts(5)session-relaunch-close(15)session-lifecycle/internal/session-open-execution-relaunch.test.ts(6)packages/platform-apple/src/lifecycle-relaunch-close.test.ts(9),src/platform-runtime-apple-application-tools-close-alerts.test.ts(4)snapshot-alert-android-occlusion(2)src/core/interactors/android-alert-occlusion.test.ts(2), puregit mv(97% similarity)snapshot-handler(13)sessions/handlers/snapshot-handler.test.ts(13),git mv(78%)snapshot-handler-freshness(9)sessions/handlers/snapshot-handler-freshness.test.ts(4),core/__tests__/snapshot-capture.test.ts(6 → 8)src/commands/capture/runtime/snapshot-freshness.test.ts(6),src/commands/capture/output.test.ts(5 → 6)snapshot-handler-wait(8)sessions/handlers/snapshot-handler-wait.test.ts(5),execution/wait-current-surface.test.ts(4 → 6)src/commands/interaction/runtime/wait-capture-options.test.ts(2)snapshot-scoped-refs(3)sessions/handlers/snapshot-scoped-refs.test.ts(3),git mv(89%)snapshot-session-cleanup(3)core/snapshot-session.test.ts(5)src/platform-runtime-resource-cleanup-sessionless-host.test.ts(3)wait-landmark-recording(5)execution/wait-runtime-landmark.test.ts(6),git mv(53%)86 tests before; 118 declared across the destinations including tests added to existing twins. No test disappeared without a named owner. The assertions that were dropped because an existing test already pins them:
session-relaunch-close:totalDurationMs(asserted inserver/__tests__/request-router-open.test.ts); Android relaunch sequencing (platform-android/lifecycle.test.ts); physical-iOS ordering (platform-apple/lifecycle.test.ts); runner release on close (platform-apple/lifecycle.test.ts).session-doctor-warmup: the non-macOS skip and the non-simulator/provider skips (platform-apple/src/__tests__/doctor.test.ts).snapshot-handler: filtered-to-zero guidance text (src/commands/capture/runtime/snapshot.test.ts).wait-landmark-recording: polling-loop landmark semantics (runtime/wait-selector.test.ts, two named tests).The macOS close claim in
test/integration/command-coverage/declarations.tsnamed the deletedsession-relaunch-closetest; it now namesplatform-apple/lifecycle-relaunch-close.test.ts"close finalization releases the runner before it dismisses close alerts" (the ordering owner), and its note says the daemon close tests own session deletion.smoke-macos-coveragepasses.Selection
All destinations are
packages/*/src/**/*.test.tsorsrc/**/*.test.ts, sounit-coreselects them (pnpm test:unit,test:coverage); the sources were already inunit-core, so no test changes project.check:affected --runruns thevitest relatedleg over them and passes.vi.mock(all target an external package or the exact module the code imports)session-open-execution-relaunch.test.ts,device-selection/dispatch-resolve: "relaunches without a session…" and "ambient provider claim…" get a non-emptyopenedlist only because the mocked device resolves.snapshot-handler.test.ts,core/ios-app-session-hint.ts: the hint test asserts the response hint equals the mocked value andtoHaveBeenCalledWith(iosSimulatorDevice, platformServices).platform-runtime-host-diagnostics.test.ts,platform-apple/doctor:toEqual(check)andtoHaveBeenCalledWith(IOS_SIMULATOR, context).platform-runtime-apple-application-tools-close-alerts.test.ts,platform-apple/macos:runMacOsAlertActioncalled with'dismiss'in three tests, not called in the fourth.platform-runtime-resource-cleanup-sessionless-host.test.ts,runner/operationsandapp-lifecycle:stopIosRunnerSession/closeIosAppasserted called and not called.android-alert-occlusion.test.ts,platform-android/mechanics:snapshotAndroidresolves the covered capture, the alert isnull,pressAndroidis not called.session-device-claims.test.tskeeps its own mocks unchanged.Subpath exports
daemonDeleted:
__tests__/support/provider-device-admission-fixture,handlers/session-doctor,handlers/session-doctor-app,handlers/session-doctor-metro,session-lifecycle/index,snapshot-capture,snapshot-session. No other package changed; no new subpath, barrel orexport *.Notes
forwardingCreateCommandSurface(refactor(daemon): relocate the server runtime tests by what they assert #3652) now stores the backend'ssnapshot(flat-nodes fallback) and forwardsdiffSnapshotthe same way;command-surface-fake.test.tspins both.packages/daemonand the daemon-composition tree (c halves, additive):platform-android/lifecycle.test.ts, newplatform-apple/lifecycle-relaunch-close.test.ts,src/commands/**tests,src/provider-credential-fingerprint.test.ts,test/integration/command-coverage/declarations.ts.-relaunch,-retention,-sessionless-host,-landmark) keep the new files from colliding with parallel moves ofwait-runtime,platform-runtime-resource-cleanupandplatform-runtime-open-targettests.Validation
check:quick,check:layering,check:fallow,check:gate-manifestandcheck:affected --runpassed on the first head (the run caught the stale coverage claim above). After the review fixes,check:quickand the touched suites pass; the full gates rerun on the final head are recorded in the thread.🤖 Generated with Claude Code