refactor(test-kit): host the target classification capture fixture
What
replay-port/target-classification-fixtures (the bottom-tabs real-capture snapshot and the Article-tab target evidence) moves into test-kit as two named exports, and the export is dropped (replay-port exports 31 → 30). replay-port declares test-kit as a devDependency (manifest + tsconfig reference).
Fixture decision
| Fixture | Importers by package | Outcome | Reason |
|---|---|---|---|
bottomTabsRealCaptureFixture, recordArticleEvidence | replay-port 1 (target-classification.test.ts), daemon 2 (session-replay-repair-empty-tail, session-replay-dispatch-selector-miss) | test-kit named exports | Shared across packages. The daemon tests exercise daemon replay repair and dispatch (SessionStore, replay runtime), so they are not replay-port tests and cannot move (case 3, not case 2). The snapshot data uses kernel/contract types only. recordArticleEvidence takes the evidence function as a parameter (recordArticleEvidence(computeTargetEvidence)), so test-kit does not depend on selectors; each of the three consumers imports computeTargetEvidence from @agent-device/selectors/target-evidence itself. |
toSnapshotNodes | same three files | merged into the existing buildNodes | toSnapshotNodes only minted e<n> refs; buildNodes is attachRefs, which mints the same refs and additionally sets kind. All three files pass unchanged assertions with it. |
Manifest walk (workspace dependencies + devDependencies, transitive): test-kit gains no dependency in this PR. Today its reach is capture-kit, command-registry, contracts, daemon-contracts, host-kit, kernel, plus ad-script and selectors transitively through command-registry and daemon-contracts. With #3686 (drops daemon-contracts) and #3687 (drops command-registry) both landed, its reach is capture-kit, contracts, host-kit and kernel only: it excludes selectors and replay-port, so replay-port → test-kit closes no cycle and selectors can later declare test-kit.
Commits
git mv packages/replay-port/src/target-classification.fixtures.ts packages/test-kit/src/target-classification-fixtures.ts(pure).- Export from test-kit's entry (sorted position), drop
toSnapshotNodes, importer specifiers/identifiers in three files (await recordArticleEvidence()→recordArticleEvidence(computeTargetEvidence), plus the selectors import in the two daemon files), replay-port manifest + tsconfig reference + lockfile, delete the replay-port export.
Test-count parity (vitest run … --reporter=json)
| File | origin/main | here |
|---|---|---|
replay-port target-classification.test.ts | 19/0 | 19/0 |
daemon session-replay-repair-empty-tail.test.ts | 6/0 | 6/0 |
daemon session-replay-dispatch-selector-miss.test.ts | 6/0 | 6/0 |
No vi.mock in any of the three. The fixture file itself is not a test; the destination project collects nothing new.
Surface
replay-port exports 31 → 30; no new subpath anywhere; test-kit adds two named exports from its one entry; no barrels or export *. replay-port gains devDependencies: @agent-device/test-kit and the tsconfig reference.
Gates (on the pushed head)
check:quick, check:layering, check:fallow, check:gate-manifest, pnpm format, check:affected --run: clean.
🤖 Generated with Claude Code