refactor(test-kit): drop command-registry by making the replay-script generator a root fixture
What
Cuts test-kit's workspace dependency on command-registry. The .ad replay-script generator (replayScriptArb) is derived from PUBLIC_COMMANDS / INTERNAL_COMMANDS, which was the only reason test-kit imported command-registry. It has two consumers, both in root, so it becomes a private fixture beside them:
| Helper | Was | Consumers | Now |
|---|---|---|---|
replayScriptArb | test-kit property-arbitraries.ts | src/commands/replay/ad-script-round-trip.test.ts, scripts/fuzz/arbitraries.ts | src/commands/replay/replay-script.fixtures.ts (unexported; both consumers import it relatively). It still reads refArb / formatRef from test-kit. |
The code is moved verbatim; the other changes are two import specifiers, the generator's error-message path, the test-kit manifest/tsconfig/entry/lockfile (command-registry removed), and docs/agents/testing.md. scripts/fuzz/envelope.ts also adds the new file to CASE_GENERATION_INPUTS, so the fuzz run envelope's configHash covers the generator (review thread resolved).
Scope with #3686
#3686 owns spawnLegacyDaemonFixture and the daemon-contracts cut; this PR no longer touches either. Until #3686 merges, test-kit still reaches selectors through daemon-contracts > command-registry, so selectors cannot yet declare test-kit. After both merge, test-kit reaches only capture-kit, contracts, host-kit and kernel. Expect a trivial conflict in packages/test-kit/package.json / tsconfig.json with #3686; the second to merge rebases.
Fixture decision
| Fixture | Importers by package | Outcome | Reason |
|---|---|---|---|
replayScriptArb | root src 1, scripts 1 | case 1 (own consumers only, root) | needs the command catalog, so it cannot sit in test-kit |
Parity
vitest run <files> --reporter=json, origin/main against this branch: ad-script-round-trip, scripts/fuzz/{corpus-replay,harness,envelope}, ad-script/script.test: 89/89 -> 89/89 (5 files). No test file moved, so selection is unchanged. No vi.mock.
Surface
No package exports changed; test-kit's single "." entry loses replayScriptArb. No barrels or export *. test-kit dependencies 6 -> 5.
Gates
check:quick, check:layering, check:fallow, check:gate-manifest, pnpm format, check:affected --run: all pass on head.
🤖 Generated with Claude Code