fix: normalize interaction response wire shapes#1114
Conversation
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
|
#1114 is blocked on the Fallow Code Quality job. All other reported checks are passing. The actionable gate findings are:
I asked the worker to reduce the new complexity/size findings, rerun |
|
Re-reviewed after the Fallow fix at No blockers found. The PR now has:
I attempted the requested independent |
|
Follow-up from the latest review: this PR needs to be stacked after #1106 before it can be merge-ready.
I am removing |
|
Sequencing update after #1106: #1106 has left the open PR set and latest Please rebase/refresh #1114 onto current |
Summary
Closes #1111.
Normalizes
press/fill/longpressresponse data behindbuildInteractionResponseDataso all typed interaction wire payloads use one envelope: shared target/coordinate/evidence fields plus a small per-command extension. Updates MCP output schemas and adds provider-backed contract tests for@ref, selector, and point paths.Design Decision
The wire response envelope is:
targetKind, canonicalx/ywhen known,referenceWidth/referenceHeightwhen a runtime snapshot frame exists, normalized identity (refwithout@orselector), optionalrefLabel,selectorChain,targetHittable,hint,warning,evidence, andmessage.Command extensions:
press@refx/y, frame,ref,refLabel,selectorChain, optionaltargetHittable/hint/evidence/button/message; backend passthrough could leak default tap fields and override canonical coordinates.button; backend internals/default tap fields are removed from wire.pressx/y, frame, selector metadata, and optional evidence; direct selector-style data had no durable discriminant.targetKind: "selector"and selector identity.pressx/yplus possible backend default tap fields; no target identity/discriminant.targetKind: "point"and canonical coordinates.fill@refx/y,text, and generatedmessage.text,delayMs, warning/evidence when present, and canonical resolved coordinates.fillselectorChain/frame until that path has a runtime snapshot, but now carriestargetKindand selector identity.filltextanddelayMs.longpress@refdurationMs/gesture; backend timing internals could leak.durationMsandgesture: "longpress".longpressdurationMs/gesture; backend timing internals could leak.durationMsandgesture: "longpress".longpressx/y,durationMs,gesture, and message; no target discriminant.durationMsandgesture: "longpress".Migration Notes
This intentionally makes breaking wire-shape changes instead of preserving accidental shims:
fill @refnow returns the canonical envelope instead of the historical backend-only sparse shape.targetKind.count: 1,intervalMs: 0,holdMs: 0,jitterPx: 0,doubleTap: false) are removed from response data.refremains normalized without the@prefix.No docs/skills were changed; this is a command wire/schema/test update, not workflow guidance.
Touched-file count: 7.
Validation
node ./node_modules/oxfmt/bin/oxfmt --write ..../node_modules/.bin/tsgo -p tsconfig.json./node_modules/.bin/oxlint . --deny-warnings./node_modules/.bin/vitest run --project unit src/daemon/handlers/__tests__/interaction.test.ts./node_modules/.bin/vitest run --project interaction-contract test/integration/interaction-contract/interaction-response-shape.contract.test.ts./node_modules/.bin/vitest run --project interaction-contract(43 tests)./node_modules/.bin/vitest run --project provider-integration(95 tests)./node_modules/.bin/vitest run --coverage --reporter=dot(386 files, 3,397 tests)