From 322b0299939a0abf90fd5cc1bd2b846e61043e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Fri, 16 Oct 2026 09:23:33 +0200 Subject: [PATCH 1/2] refactor(test-kit): move the interaction-targeting node fixtures from selectors Co-Authored-By: Claude Opus 5.5 --- .../{selectors => test-kit}/src/interaction-targeting.fixtures.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/{selectors => test-kit}/src/interaction-targeting.fixtures.ts (100%) diff --git a/packages/selectors/src/interaction-targeting.fixtures.ts b/packages/test-kit/src/interaction-targeting.fixtures.ts similarity index 100% rename from packages/selectors/src/interaction-targeting.fixtures.ts rename to packages/test-kit/src/interaction-targeting.fixtures.ts From 8084aa04667aab8c419dcc2156fc9ec59dc756f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Fri, 16 Oct 2026 09:28:35 +0200 Subject: [PATCH 2/2] refactor(selectors): import the interaction-targeting node fixtures from test-kit Co-Authored-By: Claude Opus 5.5 --- .../__tests__/target-classification.test.ts | 8 +++----- packages/selectors/package.json | 7 ++----- packages/selectors/src/interaction-targeting.test.ts | 2 +- packages/selectors/src/selector-pipeline.test.ts | 2 +- packages/selectors/tsconfig.json | 3 ++- packages/test-kit/src/index.ts | 11 +++++++++++ pnpm-lock.yaml | 3 +++ scripts/layering/package-boundaries.test.ts | 1 - .../interaction/runtime/__tests__/test-utils/index.ts | 2 +- .../runtime/selector-action-resolution.test.ts | 2 +- 10 files changed, 25 insertions(+), 16 deletions(-) diff --git a/packages/replay-port/src/daemon-port/__tests__/target-classification.test.ts b/packages/replay-port/src/daemon-port/__tests__/target-classification.test.ts index 992a9f1b51..ccbfecd122 100644 --- a/packages/replay-port/src/daemon-port/__tests__/target-classification.test.ts +++ b/packages/replay-port/src/daemon-port/__tests__/target-classification.test.ts @@ -9,14 +9,12 @@ import { readNodeLocalIdentity } from '@agent-device/ad-script'; import { makeSnapshotState } from '@agent-device/selectors/snapshot-geometry-fixtures'; import { classifyReplayTarget } from '../target-classification.ts'; import { resolveElementReportedTwice } from '@agent-device/selectors/interaction-targeting'; -import { - ELEMENT14_DISTINCT_SUBTREE_NODES, - UNVERIFIED_HITTABILITY_WRAPPER_CHAIN_NODES, -} from '@agent-device/selectors/interaction-targeting-fixtures'; import { bottomTabsRealCaptureFixture, - recordArticleEvidence, buildNodes, + ELEMENT14_DISTINCT_SUBTREE_NODES, + recordArticleEvidence, + UNVERIFIED_HITTABILITY_WRAPPER_CHAIN_NODES, } from '@agent-device/test-kit'; /** Verified outcomes carry the verified member + matchCount (for the post-resolution guard). */ diff --git a/packages/selectors/package.json b/packages/selectors/package.json index 0b53d1f786..972a6c0f4a 100644 --- a/packages/selectors/package.json +++ b/packages/selectors/package.json @@ -4,7 +4,7 @@ "private": true, "sideEffects": false, "type": "module", - "description": "Shared selector matching, argument, and replay semantics for agent-device. `.` is string-only; `./ast` is the published parser surface behind `agent-device/selectors`; `./engine` is the resolve/list surface reserved for the selector-pipeline owner (R19); `./parameterized-recorded-fill` parameterizes recorded fill payloads against their selectors; the interaction-resolution subpaths (`./selector-pipeline`, `./interaction-targeting`, `./interaction-touch-point`, `./press-retarget`, `./absence-observation*`, \u2026) host the engine execution surface owned by the pipeline; `./snapshot-geometry-fixtures` is the canonical home for the geometry/touch-point test fixtures this package and root tests both build on (it re-exports `makeSnapshotState` from `@agent-device/capture-kit/snapshot-state-fixtures`, its own canonical home).", + "description": "Shared selector matching, argument, and replay semantics for agent-device. `.` is string-only; `./ast` is the published parser surface behind `agent-device/selectors`; `./engine` is the resolve/list surface reserved for the selector-pipeline owner (R19); `./parameterized-recorded-fill` parameterizes recorded fill payloads against their selectors; the interaction-resolution subpaths (`./selector-pipeline`, `./interaction-targeting`, `./interaction-touch-point`, `./press-retarget`, `./absence-observation*`, …) host the engine execution surface owned by the pipeline; `./snapshot-geometry-fixtures` is the canonical home for the geometry/touch-point test fixtures this package and root tests both build on (it re-exports `makeSnapshotState` from `@agent-device/capture-kit/snapshot-state-fixtures`, its own canonical home).", "dependencies": { "@agent-device/ad-script": "workspace:*", "@agent-device/capture-kit": "workspace:*", @@ -52,10 +52,6 @@ "types": "./src/interaction-targeting.ts", "default": "./src/interaction-targeting.ts" }, - "./interaction-targeting-fixtures": { - "types": "./src/interaction-targeting.fixtures.ts", - "default": "./src/interaction-targeting.fixtures.ts" - }, "./interaction-touch-point": { "types": "./src/interaction-touch-point.ts", "default": "./src/interaction-touch-point.ts" @@ -86,6 +82,7 @@ } }, "devDependencies": { + "@agent-device/test-kit": "workspace:*", "fast-check": "^4.9.0" } } diff --git a/packages/selectors/src/interaction-targeting.test.ts b/packages/selectors/src/interaction-targeting.test.ts index 284fd2ce56..26271c41fb 100644 --- a/packages/selectors/src/interaction-targeting.test.ts +++ b/packages/selectors/src/interaction-targeting.test.ts @@ -20,7 +20,7 @@ import { INDEXED_PARITY_POLICY_NODES, TWO_ACTIONABLE_WRAPPER_CHAIN_NODES, UNVERIFIED_HITTABILITY_WRAPPER_CHAIN_NODES, -} from './interaction-targeting.fixtures.ts'; +} from '@agent-device/test-kit'; test('collapses one same-label wrapper chain to its shared actionable node', () => { const snapshot = makeSnapshotState(EQUIVALENT_WRAPPER_CHAIN_NODES); diff --git a/packages/selectors/src/selector-pipeline.test.ts b/packages/selectors/src/selector-pipeline.test.ts index c129cc4c2e..db4f0f3492 100644 --- a/packages/selectors/src/selector-pipeline.test.ts +++ b/packages/selectors/src/selector-pipeline.test.ts @@ -15,7 +15,7 @@ import { RN_TEXT_ECHO_OFFSET_RECT_NODES, TWO_ACTIONABLE_WRAPPER_CHAIN_NODES, UNVERIFIED_HITTABILITY_WRAPPER_CHAIN_NODES, -} from './interaction-targeting.fixtures.ts'; +} from '@agent-device/test-kit'; import { listSelectorPipelineMatches, resolveActionSelectorPipeline, diff --git a/packages/selectors/tsconfig.json b/packages/selectors/tsconfig.json index 666dbe33e4..eb442ff373 100644 --- a/packages/selectors/tsconfig.json +++ b/packages/selectors/tsconfig.json @@ -14,6 +14,7 @@ { "path": "../ad-script" }, { "path": "../capture-kit" }, { "path": "../contracts" }, - { "path": "../kernel" } + { "path": "../kernel" }, + { "path": "../test-kit" } ] } diff --git a/packages/test-kit/src/index.ts b/packages/test-kit/src/index.ts index b38c283df3..5a994b945e 100644 --- a/packages/test-kit/src/index.ts +++ b/packages/test-kit/src/index.ts @@ -51,6 +51,17 @@ export { withMockedPlatform, } from './host-execution.ts'; export { pinOwnProcessStartTime } from './host-process-mock.ts'; +export { + ELEMENT14_DISTINCT_SUBTREE_NODES, + EQUIVALENT_WRAPPER_CHAIN_NODES, + INDEXED_PARITY_POLICY_NODES, + RN_TEXT_ECHO_AUTHORED_CHILD_NODES, + RN_TEXT_ECHO_DISTINCT_SUBTREE_NODES, + RN_TEXT_ECHO_NODES, + RN_TEXT_ECHO_OFFSET_RECT_NODES, + TWO_ACTIONABLE_WRAPPER_CHAIN_NODES, + UNVERIFIED_HITTABILITY_WRAPPER_CHAIN_NODES, +} from './interaction-targeting.fixtures.ts'; export { closeLoopbackServer, listenOnLoopback, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cbdaf4a136..ed4700223a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -729,6 +729,9 @@ importers: specifier: workspace:* version: link:../kernel devDependencies: + '@agent-device/test-kit': + specifier: workspace:* + version: link:../test-kit fast-check: specifier: ^4.9.0 version: 4.9.0 diff --git a/scripts/layering/package-boundaries.test.ts b/scripts/layering/package-boundaries.test.ts index 518dd3abf8..b81f53f9d4 100644 --- a/scripts/layering/package-boundaries.test.ts +++ b/scripts/layering/package-boundaries.test.ts @@ -775,7 +775,6 @@ test('the real tree parses, declares, and passes R11', () => { '@agent-device/selectors/interaction-error', '@agent-device/selectors/interaction-positionals', '@agent-device/selectors/interaction-targeting', - '@agent-device/selectors/interaction-targeting-fixtures', '@agent-device/selectors/interaction-touch-point', '@agent-device/selectors/parameterized-recorded-fill', '@agent-device/selectors/press-retarget', diff --git a/src/commands/interaction/runtime/__tests__/test-utils/index.ts b/src/commands/interaction/runtime/__tests__/test-utils/index.ts index df199692a1..5333bc03cb 100644 --- a/src/commands/interaction/runtime/__tests__/test-utils/index.ts +++ b/src/commands/interaction/runtime/__tests__/test-utils/index.ts @@ -12,7 +12,7 @@ import { RN_TEXT_ECHO_NODES, RN_TEXT_ECHO_OFFSET_RECT_NODES, UNVERIFIED_HITTABILITY_WRAPPER_CHAIN_NODES, -} from '@agent-device/selectors/interaction-targeting-fixtures'; +} from '@agent-device/test-kit'; import { createMemorySessionStore } from '../../../../../command-runtime/runtime-factory.ts'; export function selectorSnapshot(): SnapshotState { diff --git a/src/commands/interaction/runtime/selector-action-resolution.test.ts b/src/commands/interaction/runtime/selector-action-resolution.test.ts index c12ab6f9ec..87e1152419 100644 --- a/src/commands/interaction/runtime/selector-action-resolution.test.ts +++ b/src/commands/interaction/runtime/selector-action-resolution.test.ts @@ -5,7 +5,7 @@ import { ELEMENT14_DISTINCT_SUBTREE_NODES, EQUIVALENT_WRAPPER_CHAIN_NODES, UNVERIFIED_HITTABILITY_WRAPPER_CHAIN_NODES, -} from '@agent-device/selectors/interaction-targeting-fixtures'; +} from '@agent-device/test-kit'; import { SELECTOR_PIPELINE_POLICIES } from '@agent-device/selectors/selector-pipeline-policy'; import { resolveActionSelector } from './selector-action-resolution.ts';