refactor(tests): colocate platform-web, android, host-kit, kernel, webdriver and vega tests
Summary
Colocation renames for the small packages (platform-web, platform-android, host-kit, kernel, provider-webdriver, platform-vega). Every renamed test is now named for the module it exercises and sits beside it. No fixture export is touched here (those come in later PRs), so the fixture decision table is empty.
The rule thread's colocation baseline and R83 list are not on main yet. This PR only shrinks what the seed will contain: 11 offenders removed (web 4, android 2, host-kit 1, kernel 1, webdriver 2, vega 1).
Commits
refactor(tests): name platform-web, android, host-kit, kernel, webdriver and vega tests…— puregit mv. Content changes: the vega test's self-import@agent-device/platform-vega→./index.ts, and the web driver's owning-path string incontracts/src/dispatch-disclosure.fixtures.ts.refactor(webdriver): split the profile-field declaration test…—provider-profile-fields.test.tscovered three modules, so it became one file per module; the sharedconsumedProfileFieldshelper joinedprofile-fields.fixtures.ts.test(web): drop the provider-startup cleanup mock the dispatch-disclosure driver never reaches— per coordinator decision: a temporary spy on the mockedcleanupManagedAgentBrowserOrphansForProviderStartuprecorded 0 calls across all 8 cases (the real function was never reachable), so the mock and its hoisted spy are deleted. 8/8 still pass.refactor(android): name the dispatch-disclosure driver for the package entry—dispatch-disclosure.test.ts→index-dispatch-disclosure.test.ts(it drives input-actions, text-input, touch-helper and the adb executor); both owning-path strings in the contracts fixture follow in the same commit.
Renames
| Old | New | Module under test |
|---|---|---|
platform-web __tests__/agent-browser-boundary-faults | agent-browser-provider-boundary-faults | agent-browser-provider.ts |
platform-web __tests__/agent-browser-dispatch-disclosure | agent-browser-provider-dispatch-disclosure | agent-browser-provider.ts |
platform-web __tests__/agent-browser-record-refresh | agent-browser-provider-record-refresh | agent-browser-provider.ts (its header already says "agent-browser-provider's owned-process record gate") |
platform-web __tests__/agent-browser-record-retention | agent-browser-provider-record-retention | agent-browser-provider.ts |
platform-android __tests__/dispatch-disclosure | __tests__/index-dispatch-disclosure | package entry (drives several android modules against the contracts table) |
platform-android recording/failed-finish | recording/runtime-failed-finish | recording/runtime.ts (bindAndroidScreenRecordingRuntime) |
host-kit internal/durable-file | internal/atomic-file-durable | internal/atomic-file.ts (publishDurableFileSync) |
kernel presented-surface | record-presented-surface | record.ts (readPresentedSurfaceFact) |
provider-webdriver webdriver-mutation-resend | webdriver-interactor-mutation-resend | webdriver-interactor.ts |
provider-webdriver provider-profile-fields | split → browserstack-profile-fields, aws-device-farm-profile-fields, index-profile-fields | browserstack.ts, aws-device-farm.ts, index.ts (BUNDLED_CLOUD_WEBDRIVER_PROVIDERS) |
platform-vega __tests__/plugin | src/index.test.ts | index.ts (vegaPlugin) |
Vega note: index.test.ts is a new file for the module that defines vegaPlugin, not an addition to a legacy aggregation. If the reviewer would rather not have an index.test.ts, say so and I'll pick another module; plugin is not a module in that package.
Test-count parity (vitest --reporter=json, passed/total)
| Before | After |
|---|---|
web agent-browser-boundary-faults 4/4 | agent-browser-provider-boundary-faults 4/4 |
web agent-browser-dispatch-disclosure 8/8 | agent-browser-provider-dispatch-disclosure 8/8 |
web agent-browser-record-refresh 12/12 | agent-browser-provider-record-refresh 12/12 |
web agent-browser-record-retention 3/3 | agent-browser-provider-record-retention 3/3 |
android dispatch-disclosure 20/20 | index-dispatch-disclosure 20/20 |
android failed-finish 1/1 | runtime-failed-finish 1/1 |
host-kit durable-file 6/6 | atomic-file-durable 6/6 |
kernel presented-surface 6/6 | record-presented-surface 6/6 |
webdriver webdriver-mutation-resend 25/25 | webdriver-interactor-mutation-resend 25/25 |
webdriver provider-profile-fields 3/3 | browserstack-… 1/1 + aws-device-farm-… 1/1 + index-… 1/1 |
vega plugin 2/2 | index.test.ts 2/2 |
| Total 90/90 in 11 files | Total 90/90 in 13 files |
Selection: every moved file lives under packages/*/src/**, which the unit-core include covers (vitest.config.ts). pnpm check:affected --run selected and passed 25 files including all of the renamed ones; check:gate-manifest is unchanged.
vi.mock effectiveness
The three moved tests with vi.mock stay in their directories, so the mocked relative paths are unchanged. I still broke each path once (temporarily, reverted):
agent-browser-provider-record-refresh(mocks../agent-browser-process-record.ts): 8 failed | 4 passed.agent-browser-provider-record-retention(mocks../agent-browser-process-record.ts): 2 failed | 1 passed.agent-browser-provider-dispatch-disclosure: its mock was dead (0 calls) and is removed in commit 3.
Surface
- Package
exportscounts before → after: unchanged for every package (0 subpaths added or removed). - Colocation offenders (my recompute matches the coordinator's count): web 4→0, host-kit 1→0, kernel 1→0, vega 1→0, webdriver 2→0, android 3→1 (the remaining one is
input-ownership, handed to the contracts worker).
Reported, not changed
platform-android/src/__tests__/input-ownership.test.tstests the contracts moduleandroid-input-ownership; per the coordinator it moves topackages/contractsvia the selectors/contracts worker, not here.
Gates
Run on the final head (all exit 0): pnpm check:quick, check:layering, check:fallow, check:gate-manifest, check:affected --run (all exit 0), plus pnpm format (clean tree).
🤖 Generated with Claude Code