refactor(test): colocate sdk, remote and metro tests with their modules

Merged
TH
8h ago
+22-27

Summary

First slice of the root test-colocation burn-down (class r, root code in the wrong place): 12 tests move from src/__tests__ (and src/commands/batch) beside the module they test.

FromTo
android-adb-public, contracts-schema-public, metro-publicsrc/sdk/
commands/batch/publicsrc/sdk/batch-public.test.ts
remote-config-public, upload-client, upload-client-cancellationsrc/remote/__tests__/
client-metro, client-metro-auto-companion, client-metro-companion, client-metro-startup-cleanup, metro-session-hintssrc/metro/

Commit 1 is a pure git mv (0 content lines). Commit 2 is relative-specifier edits plus the mutation-exclusion path in vitest.config.ts (git diff -M similarity 90โ€“99%). No exports change anywhere (root exports 13 โ†’ 13, no package touched), no barrels, no new fixtures. Seeds no colocation baseline yet (rule not on main).

Validation

Head 9221fd0a6. check:quick, check:layering, check:fallow, check:gate-manifest, pnpm format pass.

  • Parity: 88 tests before, 88 after, per file identical (vitest run <files> --reporter=json): android-adb-public 1, contracts-schema-public 7, metro-public 2, batch-public 5, remote-config-public 1, upload-client 18, upload-client-cancellation 3, client-metro 20, -auto-companion 6, -companion 12, -startup-cleanup 6, metro-session-hints 7.
  • Selection: all run under unit-core (src/**/*.test.ts); vitest list shows the new paths.
  • vi.mock effectiveness (broken once, failed, reverted): client-metro-auto-companion ./client-metro-companion.ts โ†’ real module: 6/6 fail; client-metro-companion host-kit/command without runCmdDetached: 8 fail; client-metro-startup-cleanup same: 6/6 fail.
  • check:affected --run: 1 failure, eager-closure-budgets โ€บ no APPROVED_OVER_CEILING row is stale names packages/daemon/src/index.ts (row added by #3633). Not from this diff: it passes on origin/main only because the check is deferred when merge-base == head, so any branch off main fails it. For the daemon thread to drop that row.

๐Ÿค– Generated with Claude Code