Purpose
PR #2397 (selector pipeline move into @agent-device/selectors) introduced a second copy of shared test fixtures, forced by the layering rule that packages cannot import root src/:
packages/selectors/src/internal/__tests__/snapshot-builders.ts mirrors root src/__tests__/test-utils/snapshot-builders.ts (duplicated makeSnapshotState; root copy keeps buildNodes for remaining root tests).
packages/selectors/src/internal/__tests__/property-arbitraries.ts holds selector-chain arbitraries beside root src/__tests__/test-utils/property-arbitraries.ts (replay/gesture arbitraries).
Required behavior
- Shared test fixtures (snapshot builders, selector arbitraries) live in one canonical location; both root tests and
packages/selectors tests import from it.
- Options: (a) a new test-fixtures subpath on
@agent-device/selectors that root re-imports, or (b) a shared test-utils package. Choose whichever fits the existing layering model (root may import packages; packages may not import root src/).
Observable completion
- Exactly one copy of each fixture helper exists in the repo.
- Root and package tests import it through the chosen subpath/package.
pnpm check:affected --run passes.
Dependencies
Purpose
PR #2397 (selector pipeline move into @agent-device/selectors) introduced a second copy of shared test fixtures, forced by the layering rule that packages cannot import root
src/:packages/selectors/src/internal/__tests__/snapshot-builders.tsmirrors rootsrc/__tests__/test-utils/snapshot-builders.ts(duplicatedmakeSnapshotState; root copy keepsbuildNodesfor remaining root tests).packages/selectors/src/internal/__tests__/property-arbitraries.tsholds selector-chain arbitraries beside rootsrc/__tests__/test-utils/property-arbitraries.ts(replay/gesture arbitraries).Required behavior
packages/selectorstests import from it.@agent-device/selectorsthat root re-imports, or (b) a shared test-utils package. Choose whichever fits the existing layering model (root may import packages; packages may not import rootsrc/).Observable completion
pnpm check:affected --runpasses.Dependencies
scripts/layering/package-boundaries.test.tspins and the contracts exports snapshot when adding a new subpath.