refactor(command-registry): name registry descriptor tests for the module they test
What
Colocation burn-down for @agent-device/command-registry: 22 tests in src/__tests__/ were named for neither a registry module nor an aspect of one. Every one asserts on commandDescriptors / applyCommandDefaults / resolveCommandDeviceClaimPolicy (all defined in registry.ts) or on flag-registry.ts, so they are renamed <module>-<aspect>.test.ts. No content changes except where noted.
- Commit 1: 22 pure
git mvrenames (similarity 100% for 21;platform-executionis paired as R063 after commit 2). - Commit 2:
platform-execution.test.tscovered two modules (registry.tsandderive.ts), so it is split:registry-platform-execution.test.ts(inventory-use test) andderive-platform-execution.test.ts(daemon-projection test). Bodies are verbatim. - One comment path in
registry.tsupdated to the newregistry-device-claim-policy.test.tsname.
Colocation delta
| Package | Tests not beside a named module, before | After |
|---|---|---|
| command-registry | 22 | 0 |
Measured with a local scan: a test is colocated when <name> equals, or starts with <module>- / <module>. of, a non-test source file in the same directory or in the parent of __tests__. The shrink-only baseline is not on main yet, so there are no entries to delete; this just shrinks what the seed will contain.
Class to flag for the coordinator: 17 of the 22 are one-test-per-command *-runtime-execution files, each pinning one descriptor in registry.ts (registry-<command>-runtime-execution). They are registry-completeness checks, not cross-module integration tests, so I named them for the module under test. If you would rather have them folded into one registry-runtime-execution.test.ts, that is a content merge and I left it out of this pure-rename PR.
Parity
Test counts from vitest run <files> --reporter=json:
| files | tests passed | |
|---|---|---|
| before (old names on origin/main) | 22 | 33 / 33 |
| after (new names) | 23 (22 renamed + registry-platform-execution half of the split) | 33 / 33 (32 + 1) |
Selection: vitest.config.ts unit-core includes packages/*/src/**/*.test.ts; check:affected --run selected and ran all of the renamed files under |unit-core| (605 files, 4432 tests, all passed). No vi.mock in any moved file, so there is nothing to break-check.
Surface
exportscount: command-registry 21 -> 21. No new subpaths, barrels orexport *. No new dependencies.
Gates
pnpm check:quick, check:layering, check:fallow, check:gate-manifest, pnpm format (repo-wide, clean), check:affected --run: all passed on head.
Self-review: no subagent run; I reread the full diff cold. It is renames, one verbatim split, and one comment path.
🤖 Generated with Claude Code