Skip to content

refactor(test-kit): host the target classification capture fixture - #3691

Merged
thymikee merged 2 commits into
mainfrom
refactor/target-classification-fixtures
Oct 16, 2026
Merged

thymikee merged 2 commits into
mainfrom
refactor/target-classification-fixtures

Conversation

@thymikee

@thymikee thymikee commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

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

  1. git mv packages/replay-port/src/target-classification.fixtures.ts packages/test-kit/src/target-classification-fixtures.ts (pure).
  2. 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

…to test-kit

Pure git mv; imports, exports and manifests follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 10 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.24 MB 5.24 MB -5.9 kB
Package (unpacked) 5.24 MB 5.24 MB -5.9 kB
Package (download) 1.58 MB 1.57 MB -1.6 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.8 ms 26.1 ms -0.7 ms
CLI --help 77.8 ms 77.7 ms -0.1 ms

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-16 06:01 UTC

…it from replay-port and daemon

bottomTabsRealCaptureFixture and recordArticleEvidence become test-kit named exports; the local
toSnapshotNodes folds into test-kit's buildNodes. recordArticleEvidence takes the evidence
function as a parameter, so test-kit does not depend on selectors. replay-port declares test-kit
as a devDependency and drops its target-classification-fixtures export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee
thymikee force-pushed the refactor/target-classification-fixtures branch from ace5d2e to 99f3a6f Compare October 15, 2026 19:17
@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready to merge at 99f3a6f. The code looks right, and all 23 checks are green. I did not run the tests or the build myself. The 19/6/6 parity table and the gate results come from the PR body and the green CI. I also did not read attachRefs, so the claim that buildNodes differs from toSnapshotNodes only by setting kind is unchecked, though the unchanged assertions passing in CI support it. I checked for cycles by reading each package.json's workspace dependencies, and I checked tsconfig references only for replay-port and test-kit. There are no conflicts.

Not blocking, and fine to take or leave: repair-hint.test.ts still has a local toSnapshotNodes copy that could use buildNodes from @agent-device/test-kit as a follow-up; recordArticleEvidence takes computeTargetEvidence as a hand-written structural type that could drift, so typeof computeTargetEvidence through a type-only import would pin it if that ever matters; and the private bottomTabsRealCaptureFixture in target-evidence.test.ts can be deduplicated once #3686 and #3687 land.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 15, 2026
@thymikee
thymikee merged commit dde9e0f into main Oct 16, 2026
23 checks passed
@thymikee
thymikee deleted the refactor/target-classification-fixtures branch October 16, 2026 06:01
thymikee added a commit that referenced this pull request Oct 16, 2026
…ctions-1

* origin/main:
  feat(react-devtools): inspect React components and profile renders through the Metro inspector (#3613)
  refactor(daemon-contracts): drop the registration and claims fixture exports (#3689)
  refactor(test-kit): drop the daemon-contracts dependency (#3686)
  refactor(test-kit): drop command-registry by making the replay-script generator a root fixture (#3687)
  fix(ios): handle delayed launch confirmations without stopping XCTest (#3682)
  refactor(test-kit): move the dispatch-disclosure harness out of contracts (#3690)
  refactor(test-kit): host the target classification capture fixture (#3691)
  ci: fold six CI jobs into four with parallel and background steps; cancel superseded and closed-PR runs (#3658)
  build(typescript): move root project references into tsconfig.typecheck.json (#3688)
  chore(daemon): declare @agent-device/proxy as a devDependency, since only a test imports it (#3685)
  refactor(settings): declare settings once and admit them per setting (#3662)

# Conflicts:
#	packages/platform-android/src/alert.ts
#	website/docs/docs/limrun.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant