Reconcile test placement against explicit ownership rules after the vertical-slice refactor#160
Conversation
Move CLI adapter and registry tests under test/ so cross-cutting runtime-boundary coverage follows the documented ownership model instead of historical placement. Update the debt register to record the remaining intentionally broad cross-cutting suites.
There was a problem hiding this comment.
QA Review — PR #160 (Issue #157)
Decision: APPROVED
What I verified
Scope of this PR (HEAD commit 329dcdd):
src/cli/entrypoint.test.ts→test/cli/entrypoint.test.ts(rename + import update)src/cli/run.test.ts→test/cli/run.test.ts(rename + import update)src/commands/registry/index.test.ts→test/core/command-registry.test.ts(rename + import update)docs/project/debt.md— item #5 updated to reference new file paths
File layout verified:
src/**/*.test.tsglob: onlysrc/commands/**/*.test.tsfiles remain — zero stray test files insrc/cli/,src/core/,src/config/, or anywhere outside command slices ✅test/**/*.test.tsglob: all expected cross-cutting tests are present undertest/, including the three newly moved files ✅test/support/remains intact:cli-test.ts,command-runtime.ts,definition-test.ts,github/,http-test.ts,runtime-fixtures.ts✅
Correctness of moves:
run.test.ts: iterates overlistCommandGroups()andlistCommandNames()— explicitly cross-cutting across all command groups. Correct to move totest/cli/. ✅entrypoint.test.ts: tests process.argv wiring and exit-code forwarding at the CLI process boundary. Tests the entrypoint contract rather than any single slice. Correct to move. ✅command-registry.test.ts: tests registration order, group enumeration, and lookup across the entireCOMMANDSarray — clearly cross-cutting core infrastructure. Correct to move totest/core/. ✅
Import paths after move: All three files have correct relative paths (../../src/... / ../support/...). Verified directly from diff and file content. ✅
vitest config: include: ['test/**/*.test.ts', 'src/**/*.test.ts'] covers both locations — no config change needed. ✅
Debt item #5 update: File references updated from stale test/core.test.ts / test/cli.test.ts to test/core/runtime-routing.test.ts and test/cli/run.test.ts. The update correctly omits test/cli/entrypoint.test.ts (it's small and focused, not "broad coverage") and test/core/command-registry.test.ts (40-line focused suite, not a concern). ✅
Architecture invariants:
- ADR 0007 vertical command-slice ownership: slice tests remain co-located under
src/commands/**. Not touched. ✅ - Wrapper/core plain-data boundary: moved tests reference
src/modules by path, no wrapper contamination. ✅ - No reduction in coverage — pure file moves with import updates only. ✅
PR format: Ref: #157 on first line. ✅
Greg's verification claims:
typecheckindependently confirmed clean (tsc --noEmit, exit 0). ✅- Build, lint, and full test suite: trusting Greg's report. No code or test logic changed, only moves and import paths. Risk of breakage is negligible.
Blockers
None.
Important
None.
Nice to have
- The debt item currently reads "...
test/core/runtime-routing.test.tsandtest/cli/run.test.tsstill carry broad runtime and CLI boundary coverage..." —test/cli/entrypoint.test.tsis now also undertest/cli/but is small enough not to warrant mention. Fine as-is, no action needed.
Docs / invariants
No ADR changes needed (no architectural decision changed). Debt item updated correctly.
All acceptance criteria from issue #157 are satisfied. The resulting layout is fully explainable by the stated ownership rules without interpretation.
Ref: #157
Summary
src/intotest/so test location reflects runtime and entrypoint ownership rather than historical placementsrc/commands/**and document the remaining intentionally broad CLI/core suites in the debt registerTesting
npm testnpm run lintnpm run typechecknpm run build