Skip to content

test(daemon): fold the touch-forwarding command-surface fake into the touch fake - #3708

Merged
thymikee merged 1 commit into
mainfrom
refactor/daemon-fold-touch-fakes
Oct 16, 2026
Merged

thymikee merged 1 commit into
mainfrom
refactor/daemon-fold-touch-fakes

Conversation

@thymikee

@thymikee thymikee commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #3698's review note: the daemon package had two touch command-surface fakes. touch-forwarding-surface-fake.ts is folded into touch-command-surface-fake.ts, which now serves every touch suite through createTouchCommandSurface(options); touchCreateCommandSurface is createTouchCommandSurface().

What the folded fake takes from the forwarding one:

  • observeSettle and members options (a matchSelector option, defaulting to the || key=value grammar);
  • a @ref resolves against the authorized ref frame before the latest observation;
  • each selector capture is stored as the session snapshot (captureAndStoreSnapshot);
  • a missing target refuses with the typed ref_not_found / selector_not_found reason and dispatched: 'no';
  • the selector chain is built action-aware (click / fill) for press and fill.

No test file changes beyond the import and identifier rename (git diff origin/main -- '*.test.ts' shows only those lines), so no assertion changed and none was dropped.

Evidence

  • Parity for every caller: the 21 test files that use either fake run 149 tests before and after, with identical per-file counts and 0 failures (before: touch callers on the new fake, forwarding callers on the old one; after: all on the folded fake).
  • Break-proofs (fake mutated once, restored): ignoring observeSettle fails 7 tests (interaction-settle*); dropping the ref-frame preference fails 3 (interaction-common, selector-runtime-get-reads, interaction-touch-android-freshness); dropping the typed selector refusal fails 2 (interaction-capture-disclosure, interaction-touch-android-freshness).
  • check:quick, check:layering (no new R83/R84 entries), check:fallow and check:gate-manifest pass.
  • No vi.mock is added or changed; no package exports change; no barrels.

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

… touch command-surface fake

One fake serves every touch suite: createTouchCommandSurface takes matchSelector, observeSettle and members, resolves a ref against the authorized frame first, stores each selector capture as the session snapshot, and refuses a miss with the typed ref_not_found / selector_not_found reason. No assertion changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.29 MB 5.29 MB 0 B
Package (unpacked) 5.29 MB 5.29 MB 0 B
Package (download) 1.59 MB 1.59 MB +8 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 20.8 ms 19.0 ms -1.8 ms
CLI --help 53.7 ms 52.7 ms -0.9 ms

@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 8 files

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

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at 6823a2e, and all 16 checks pass. The change only touches test support, so no production route overlaps. There are no conflicts, and nothing else needs to happen before merge. Not blocking: the default matchSelector in touch-command-surface-fake.ts now uses the touch fake's " || " key=value grammar instead of the old label=/id= grammar. It accepts the same single-term selectors, and I found no forwarding caller that reads differently, so you can take this or leave it. I did not run the 149-test parity run or the mutation break-proofs myself. I also did not read every line of the new touchInteractions body, and I did not scan the 15 other callers already on the touch fake for the new refusal behavior.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 16, 2026
@thymikee
thymikee merged commit 91918b9 into main Oct 16, 2026
16 checks passed
@thymikee
thymikee deleted the refactor/daemon-fold-touch-fakes branch October 16, 2026 10:49
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-16 10: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