Skip to content

Commit 0f42856

Browse files
committed
fix(contracts): say what find-focus-dispatch actually enforces
nonHittable claimed runtime for a guarantee whose second half never runs: the seam promotes a non-hittable match to its hittable ancestor but never annotates the one promotion declines, so it cannot claim the whole cell. It is an owned gap on #1081 now, and the Layer-3 scenario that would have overclaimed the waived cell is gone — the promotion half stays proven by the seam's unit test named in the reason. The responseIdentity rationale named a data.ref the focus and type payloads never emit; it describes the omission instead.
1 parent c2117ad commit 0f42856

4 files changed

Lines changed: 9 additions & 47 deletions

File tree

‎packages/contracts/src/interaction-guarantees.ts‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -581,12 +581,14 @@ export const INTERACTION_DISPATCH_PATHS: Record<InteractionPathId, InteractionPa
581581
'gap: the seam aims `centerOfRect` of the resolved node rather than the parent-owned point `resolveInteractionTouchPoint` chooses, so a match whose center is tiled by an independently interactive descendant activates that descendant instead of failing closed — and the keyboard guard above measures the same center the tap uses, which is the point actually dispatched but not the point the acting paths would aim.',
582582
trackingIssue: GAPS_UMBRELLA_ISSUE,
583583
},
584-
// Promotion is the enforcement the guarantee names; the annotation half is not this seam's,
585-
// because its payload is the focus runtime's point response and never the interaction result
586-
// that carries `targetHittable`/`hint` (see `responseIdentity` below).
584+
// The guarantee is promotion AND annotation. This seam runs only the first half, so the
585+
// cell cannot claim `runtime` for the whole guarantee (the same shape `native-ref` classifies
586+
// the other way round, annotation without promotion).
587587
nonHittable: {
588-
kind: 'runtime',
589-
via: 'packages/selectors/src/selector-pipeline.ts#runNodePipelineStages',
588+
kind: 'waived',
589+
reason:
590+
"gap: the promotion half does run — the `findAct` row declares `hittable-ancestor-below-root`, so the seam dispatches the promoted ancestor's center (regression-proven in packages/daemon/src/execution/interaction/internal/__tests__/find.test.ts) — but the annotation half never does: the response is the focus runtime's point payload, so a match still reporting `hittable: false` after promotion is accepted silently, where press/click/fill answer with `targetHittable: false` plus a hint. Closing it needs the annotation composed at this seam, which is response-shape work the `responseIdentity` waiver below also records.",
591+
trackingIssue: GAPS_UMBRELLA_ISSUE,
590592
},
591593
// One construction site per dispatch kind, both shared with the plain commands: the focus
592594
// payload is `executeFocusPoint`'s (the same owner `focus <x> <y>` reaches), and `type`'s
@@ -598,7 +600,7 @@ export const INTERACTION_DISPATCH_PATHS: Record<InteractionPathId, InteractionPa
598600
responseIdentity: {
599601
kind: 'waived',
600602
reason:
601-
"Intentional: the payload is the point-dispatch result, so no refLabel/selectorChain is echoed. Mutating find's `data.ref` is pre-action diagnostic identity that ADR 0014 keeps unpinnable (no `refsGeneration`), and the seam never enters the ref/selector response builder that mints the identity fields.",
603+
"Intentional: the payload is the focus (or text) dispatch result, which omits `refLabel`, `selectorChain`, and `data.ref` entirely — this route issues no pinnable or diagnostic response identity, since ADR 0014 keeps mutating find's pre-action ref diagnostic-only (no `refsGeneration`) and the seam never enters the ref/selector response builder that mints the identity fields.",
602604
},
603605
verifyEvidence: {
604606
kind: 'inapplicable',

‎test/integration/interaction-contract/find-focus-dispatch.contract.test.ts‎

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -105,24 +105,6 @@ test(
105105
PARALLEL_PROVIDER_SCENARIO_TIMEOUT_MS,
106106
);
107107

108-
test(
109-
scenario('nonHittable'),
110-
async () => {
111-
// The match is a non-hittable label inside a hittable row: the `findAct` row's promotion retargets
112-
// the dispatch to the row, so the focus lands at the row's center rather than the label's.
113-
await withIosContractDaemon(
114-
[runnerSnapshotEntry(nonHittableRowTree()), runnerTapEntry({})],
115-
async (daemon) => {
116-
const data = assertRpcOk(
117-
await daemon.callCommand('find', ['label', 'Notifications', 'focus']),
118-
);
119-
assert.deepEqual({ x: data.x, y: data.y }, { x: 200, y: 200 });
120-
},
121-
);
122-
},
123-
PARALLEL_PROVIDER_SCENARIO_TIMEOUT_MS,
124-
);
125-
126108
test(
127109
scenario('responseConstruction'),
128110
async () => {
@@ -204,24 +186,3 @@ function twinFormTree(): unknown[] {
204186
},
205187
];
206188
}
207-
208-
function nonHittableRowTree(): unknown[] {
209-
return [
210-
{ index: 0, type: 'Application', rect: { x: 0, y: 0, width: 400, height: 800 } },
211-
{
212-
index: 1,
213-
parentIndex: 0,
214-
type: 'Cell',
215-
rect: { x: 40, y: 160, width: 320, height: 80 },
216-
hittable: true,
217-
},
218-
{
219-
index: 2,
220-
parentIndex: 1,
221-
type: 'StaticText',
222-
label: 'Notifications',
223-
rect: { x: 60, y: 180, width: 160, height: 30 },
224-
hittable: false,
225-
},
226-
];
227-
}

‎test/integration/interaction-contract/find-focus-dispatch.coverage.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ export const FIND_FOCUS_DISPATCH_COVERAGE = definePathCoverage('find-focus-dispa
88
'find-focus-dispatch keyboardOcclusion: a focus match behind the visible keyboard is refused with tap_keyboard_occludes_target',
99
'find-focus-dispatch keyboardOcclusion: the same match above the keyboard band focuses',
1010
],
11-
nonHittable:
12-
'find-focus-dispatch nonHittable: a non-hittable match focuses its promoted hittable ancestor',
1311
responseConstruction:
1412
'find-focus-dispatch responseConstruction: find focus returns the shared point-focus payload',
1513
errorTaxonomy:

‎test/repo-guards/interaction-guarantees.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ test('acknowledged gaps are visible and bounded', () => {
164164
// (umbrella: https://github.com/callstack/agent-device/issues/1081).
165165
assert.deepEqual(gaps.sort(), [
166166
'coordinate/outcomeObservation',
167+
'find-focus-dispatch/nonHittable',
167168
'find-focus-dispatch/offscreen',
168169
'find-focus-dispatch/outcomeObservation',
169170
'find-focus-dispatch/parentOwnedTouchPoint',

0 commit comments

Comments
 (0)