Skip to content

fix: derive interaction wire projection#1149

Open
thymikee wants to merge 2 commits into
mainfrom
fix/derive-interaction-wire-projection
Open

fix: derive interaction wire projection#1149
thymikee wants to merge 2 commits into
mainfrom
fix/derive-interaction-wire-projection

Conversation

@thymikee

@thymikee thymikee commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

Derive interaction wire echo fields from command metadata instead of filtering backend fields in the response builder.

Move Apple runner diagnostic stripping to a runner-owned projection so touch response construction only composes already-projected wire data.

Validation

pnpm --pm-on-fail=ignore format
pnpm --pm-on-fail=ignore typecheck
pnpm --pm-on-fail=ignore lint
pnpm --pm-on-fail=ignore exec vitest run src/commands/interaction/metadata.test.ts src/platforms/apple/core/tests/runner-result-projection.test.ts src/daemon/handlers/tests/interaction.test.ts src/mcp/tests/command-tools.test.ts src/commands/interaction/runtime/interactions.test.ts --project unit-core
pnpm --pm-on-fail=ignore exec vitest run --project interaction-contract test/integration/interaction-contract/interaction-response-shape.contract.test.ts test/integration/interaction-contract/direct-ios-selector.contract.test.ts
pnpm --pm-on-fail=ignore test:integration:provider
pnpm --pm-on-fail=ignore test:coverage
pnpm --pm-on-fail=ignore build
pnpm --pm-on-fail=ignore check:fallow --base origin/main

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.6 MB 1.6 MB +1.5 kB
JS gzip 502.9 kB 503.4 kB +468 B
npm tarball 601.5 kB 601.9 kB +474 B
npm unpacked 2.1 MB 2.1 MB +1.5 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.3 ms 25.8 ms -0.5 ms
CLI --help 51.7 ms 51.4 ms -0.2 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/interaction.js +14.7 kB +4.8 kB
dist/src/sdk-batch.js +510 B +174 B
dist/src/internal/daemon.js 0 B -3 B
dist/src/registry.js -1 B +1 B
dist/src/device-rotation.js 0 B -1 B

@thymikee thymikee force-pushed the fix/derive-interaction-wire-projection branch from c6347bf to 555ee94 Compare July 7, 2026 16:00
@thymikee

thymikee commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

Review finding: the PR adds CommandField.wireEcho and wraps the interaction fields with wireEchoField, but the production projector never reads that command metadata. projectInteractionWireData still uses the separate hand-authored INTERACTION_WIRE_ECHO_FIELDS map, and the new tests call that map-backed projector directly. That leaves the command surface and wire projection able to drift silently: changing a field's wireEcho options would not affect the response shape or fail a drift test. Please either derive the projection specs from the command field metadata, or remove the unused wireEcho metadata and make the duplicated projection map the explicit source of truth with coverage that guards future drift.

@thymikee

thymikee commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

Addressed the drift concern in 37b9ead.

What changed:

  • Removed the unused CommandField.wireEcho / wireEchoField path, so command field metadata can no longer drift from production behavior.
  • Moved wire echo defaults into a small core interaction-wire-echo module and attached the response projection trait to the command descriptor entries for click, press, and fill.
  • Updated projectInteractionWireData to resolve projection specs through resolveCommandWireProjection instead of reading a local command-name map.
  • Added a focused test asserting the descriptor-owned projection for press/fill and no projection for longpress.

Validated locally:

  • pnpm --pm-on-fail=ignore exec vitest run src/core/tests/interaction-wire-projection.test.ts src/platforms/apple/core/tests/runner-result-projection.test.ts src/daemon/handlers/tests/interaction.test.ts --project unit-core
  • pnpm --pm-on-fail=ignore typecheck
  • pnpm --pm-on-fail=ignore lint
  • pnpm --pm-on-fail=ignore format
  • pnpm --pm-on-fail=ignore build
  • pnpm --pm-on-fail=ignore check:layering
  • pnpm --pm-on-fail=ignore check:fallow --base origin/main (rerun with escalation because the sandbox could not create fallow's temporary base worktree)

Remaining blocker: none locally. GitHub CI has restarted for the pushed commit and is still running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant