Skip to content

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

Merged
thymikee merged 1 commit into
mainfrom
fix/main-typecheck-complete-snapshots
Oct 15, 2026
Merged

thymikee merged 1 commit into
mainfrom
fix/main-typecheck-complete-snapshots

Conversation

@thymikee

@thymikee thymikee commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

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 refactor(capture): require complete runtime snapshots #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

View guided diff Turn on auto-fix

…hots

#3642 made BackendSnapshotResult carry a required snapshot and dropped the
flat nodes fields; the daemon test relocations (#3652, #3666) landed after it
with the old shape, so main fails tsc -b.

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

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

@thymikee

Copy link
Copy Markdown
Member Author

I found no code problems at 872908b. The change is test-only (production +0/-0), and I read the diff against the snapshot contract. I did not run tsc -b or vitest. I also did not grep every test for other flat-nodes backend results.

Not blocking: the fallback snapshot in command-surface-fake.ts is hand-written. It only runs when config.backend.captureSnapshot is absent, and no test covers that branch. You could build it with makeSnapshotState([], { backend: 'android' }) from @agent-device/capture-kit, which the daemon package already depends on. Take it or leave it.

All 16 checks are queued and none has failed. Typecheck & Package, Integration Tests, Coverage and Repo Guards (R83/R84) are the ones that exercise these files. Please check those when they finish. No conflicts.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 15, 2026
@thymikee
thymikee merged commit e8f24cd into main Oct 15, 2026
17 checks passed
@thymikee
thymikee deleted the fix/main-typecheck-complete-snapshots branch October 15, 2026 17:41
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.24 MB 5.24 MB 0 B
Package (unpacked) 5.24 MB 5.24 MB 0 B
Package (download) 1.57 MB 1.57 MB -4 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.5 ms 27.0 ms -0.5 ms
CLI --help 79.2 ms 78.5 ms -0.7 ms

@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-15 17:49 UTC

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