refactor: complete the find cutover onto the request-bound runtime - #1944
Conversation
The deferred Wave 4 unit for #1739 (R35), unblocked by focus (R40) and type (R41). Find's read-only legs, focus leg, and type leg already ran bound; the one remaining direct platform execution was the mutating-target capture, which built createSelectorCaptureRuntime without a bound capture and fell through the legacy dispatch branch reserved for "the last one to migrate". - The mutating path now enters resolveBoundSelectorCapture — the selector family's shared admit-then-bind entry, which already named find in its intent table — and threads the bound capture into the target capture. - Find was that last one: `capture` on SelectorCaptureRuntimeParams is now required and the legacy fallback branch is deleted. The backend's `bound` becomes required-to-state, with the observation-free duration wait (`wait 400`) as the one declared absence — its runtime now carries no capture backend at all, so an accidental capture fails loudly instead of falling anywhere. - The descriptor flips to device-runtime with findRuntimePlanUses (the selector-text plans shared with get, plus focusRuntimeUse and typeTextRuntimeUse); the capability bucket and both overlay memberships (HARMONYOS_SUPPORTED_COMMANDS, WEB_QUERY_COMMANDS) are deleted. - R35 lands with the selector family's shared operation owners; the capture and backend tests move off the dispatch mock onto the bound seam, which is where the poll-deadline and private-ax-pin assertions actually live now. Wave 4 is complete: layering recognizes 26 migrated commands.
Size Report
npm unpacked components
Startup median (7 runs, lower is better):
Top changed chunks:
Top changed packed files
|
|
P1 — R35 still violates the ADR 0019 one-bind-per-handler invariant. A mutating find first calls resolveBoundSelectorCapture; find focus then calls resolveBoundFocusRuntime, and find type calls that plus resolveBoundTypeTextRuntime. The type leg therefore performs three separate facts/admit/bind projections in one handler. The request binding cache may reuse the broad owner, but that does not make this the single action-selected execution use required by ADR 0019 section 9, and the new tests do not assert the find handler bind count. Resolve an action-specific combined plan (capture + focusPoint, or capture + focusPoint + typeText) and bind once, then project those operations to the existing capture/focus/type executors. Add a regression proving one facts inspection and one bindDevice call for find focus and find type. |
Review P1 on #1944: a mutating find performed up to three separate facts/admit/bind projections — capture, then focus, then type re-admitted per leg. The request handler now resolves ONE action-selected plan and binds once: - New selector intents find-focus / find-type carry combined uses (capture + focusPoint, capture + focusPoint + typeText) through the same admit-then-bind path and plan machinery every selector capture uses; the new bind arms reuse the existing capture selectors, so the shared operation owners stay single. Delegated click/fill resolve targets on the plain capture pair. - The handler threads the one bind's operations to the shared executors: executeFocusPoint is extracted as the single lexical owner of the focusPoint call (R40's owner claim follows it), and executeBoundTypeText's runtime param narrows to the operations it actually uses so find can pass its own broader bind through it. - findRuntimePlanUses becomes the full action-selected set (eight uses), and the descriptor test pins each use's exact requirement list. - Regression: find focus and find type each assert exactly one facts inspection and one bindDevice call — the pre-fix handler fails both (two and three binds respectively). Live re-verified on iPhone 17 Pro at this head: find focus and find type both execute through the single bind, route synthesized-first-responder, typed text visible in the captured tree.
P1 addressed at
|
|
Re-reviewed exact head 63af689. The prior multi-bind blocker is resolved: each mutating find action selects one complete plan, performs one facts inspection and bind, and threads capture plus the direct focus or type operation through the shared executors. The single-bind regression is non-vacuous and completed checks are green. Code review is clean; iOS and macOS Smoke are the remaining in-progress readiness gates. |
|
The deferred Wave 4 unit for #1739 — R35, reserved since the wave started, unblocked by
focus(R40, #1925) and
type(R41, #1935). Unit record posted to the tracker before work began.This completes Wave 4: layering now recognizes 26 migrated commands.
What was actually left of legacy find
Less than the reservation implied, which is why this is a small PR: the read-only legs ran bound
since #1877, the focus leg since #1925, the type leg since #1935, and click/fill re-invoke their
own commands. The one remaining direct platform execution was the mutating-target capture —
createFindTargetCapturebuilt the selector capture runtime without a bound capture and fellthrough the legacy dispatch branch whose own comment reserved it for "the last one to migrate".
What changed
resolveBoundSelectorCapture— the shared admit-then-bind entry thatalready named
findin its intent table — and threads the bound capture into the targetcapture. No new operation, binder, or facts: admission flip plus deletion.
captureonSelectorCaptureRuntimeParamsis required and the legacy fallback branch is deleted. Thebackend's
boundbecomes required-to-state; the one declared absence is the observation-freeduration wait (
wait 400), whose runtime now carries no capture backend at all — anaccidental capture fails loudly instead of falling through to anything.
findRuntimePlanUses(the selector-text plans shared withget, plusfocusRuntimeUseandtypeTextRuntimeUse). The capability bucket and both overlaymemberships (
HARMONYOS_SUPPORTED_COMMANDS,WEB_QUERY_COMMANDS— the latter is now['audio']) are deleted.operationOwnersare the selector family's shared owners — find introduces no parallelroute to any operation.
dispatchCommandmock onto the bound seam, where thepoll-deadline and private-ax-pin assertions actually live now.
Live evidence
All five legs on a real iPhone 17 Pro simulator at this head:
find General existsFound: truefind General get textGeneralfind General click(delegated)find Search --first focus(bound R40)Focused (201, 822), search overlay openedfind Search --first type "r35 live"(bound R41)synthesized-first-responder, and the tree shows[search] "r35 live"— committedThe other platform/provider cells inherit their evidence from the shared owners: every operation
this unit's plans admit (
captureSnapshot,readTextAtPoint,focusPoint,typeText) carriesper-cell live evidence from the R32/R36/R40/R41 rounds, and this unit adds no new operation or
route — it changes who admits, not what executes.
Gate
pnpm check:affected --runall runnable checks passed; layering green with R35 among 26single-path migrated commands. 15 files, +214/−136 — deletion-dominated, per the unit record.