fix(test): migrate the daemon stack's tests to complete runtime snapshots

Merged
TH
12h ago
+38-57

What

Main fails tsc -b with 7 errors. #3642 changed BackendSnapshotResult in @agent-device/contracts/backend to require a complete snapshot and removed the flat nodes, truncated and backend fields. The daemon test relocations (#3652 and #3666) were written against the old shape and merged after #3642. Neither side conflicted textually, so the break appeared only on main. It is not only a type error: on main all 6 snapshot-freshness tests fail at runtime too (6/6 failed, run against the main copy of the file), because the runtime no longer reads flat nodes.

  • src/commands/capture/runtime/snapshot-freshness.test.ts: the five backend results now pass snapshot: makeSnapshotState(nodes, { truncated: false, backend: 'android' }), the same migration #3642 applied to snapshot.test.ts. No test was added or removed: 6 tests before (all failing on main) and 6 passing after.
  • src/commands/interaction/runtime/wait-capture-options.test.ts: the indexed array read typed as SnapshotState | undefined. It is now a plain conditional over the two captures; the behaviour is unchanged.
  • packages/daemon/src/__tests__/support/command-surface-fake.ts: the forwarding fake no longer reads captured.nodes. Its own test for "falls back to a flat node list from a backend that returns no snapshot" is deleted, because the backend contract no longer permits that shape.

Validation

  • pnpm exec tsc -b: 0 errors (7 on main).
  • pnpm check:quick and pnpm check:layering pass. R83 reports 99 = 99 and R84 reports 202 = 202.
  • vitest run on the three files: 11 passed.

🤖 Generated with Claude Code