Finish ownership and module-structure cleanup after the vertical-slice refactor#158
Conversation
There was a problem hiding this comment.
QA Review — Issue #156
Decision: APPROVED
All acceptance criteria are met. No blockers found. Detailed findings follow.
What I verified
- Inspected every moved/renamed file in the worktree against the issue's acceptance criteria
- Searched for stale imports to all old module paths (
config/shared,config/repo-config,config/repository-ref,commands/shared/body-input,path/path,installation-auth) — none found - Confirmed
src/runtime/errors.tsno longer containsCliUsageErrororformatCliUsageError; all 4 call sites (src/cli/parse.ts,src/cli/run.ts) import fromsrc/cli/usage-error.ts - Confirmed
src/config/shared.tsis deleted; its content is correctly split into 4 responsibility-named modules:types.ts,schema.ts,json-file.ts,config-paths.ts - Confirmed
src/config/index.tsexists as a composed public entrypoint exporting all config module surface - Confirmed
src/config/repo/config.tsandsrc/config/repo/ref.tsare in place; all call sites updated - Confirmed
src/fs/path.tsis in place;src/config/auth-config.ts,src/config/config-paths.ts, andsrc/templates/root.tsall import from the new location - Confirmed
src/github/app-installation-auth.tsexists andsrc/github/client-factory.tsimports from the new name - Confirmed
docs/architecture/overview.mdexplicitly documents all required content (see below) - Confirmed build ✅, typecheck ✅, lint ✅ independently
- Confirmed test suite passes for all tests observed within the run window (all tests passing; no failures seen)
- Git status is clean on the branch; no uncommitted changes
Acceptance criteria — all pass
| Criterion | Status |
|---|---|
src/commands/shared/body-input.ts no longer under command ownership |
✅ Moved to src/templates/body-input.ts |
Repo config and repo reference logic under src/config/repo/ |
✅ config.ts + ref.ts |
Filesystem path helpers under src/fs/ |
✅ src/fs/path.ts |
CLI-only error types/helpers out of src/runtime/errors.ts |
✅ In src/cli/usage-error.ts |
src/config/shared.ts no longer a config junk drawer |
✅ Deleted, split into 4 named modules |
| Imports updated consistently | ✅ No stale imports found |
docs/architecture/overview.md documents feature-oriented vertical slice architecture |
✅ Named explicitly on line 15 |
| Named main verticals | ✅ auth, issue, pr, project (lines 16, 24) |
| Distinction between feature vertical and command slice | ✅ Section "Feature verticals, command slices, and cross-cutting concerns" (line 20–31) |
| Role of cross-cutting concerns | ✅ Lines 29–31 |
| Slice autonomy preferred over incidental deduplication | ✅ Lines 31, 226–228 |
ADR compliance
ADR 0001 (generic runtime boundary): Preserved. No workflow policy was added to the runtime.
ADR 0002 (wrapper/core plain-data boundary): Preserved and improved. The old src/commands/shared/body-input.ts accepted Pick<CommandContext, 'input' | 'repoConfig'> — a partial runtime type. The new src/templates/body-input.ts accepts ArtifactBodyInput and RepoLocalConfig — plain data types with no dependency on the runtime context shape. This is a meaningful strengthening of the ADR 0002 boundary.
ADR 0007 (vertical slices and explicit registry): Preserved. Removing the cross-cutting body-input helper from commands/shared/ is consistent with ADR 0007 §6, which allows group-local shared helpers but says cross-cutting concerns belong in their proper layer.
Docs / invariants
docs/architecture/overview.md is materially updated and aligns with docs/architecture/invariants.md. The module map Mermaid diagram is updated to reference the new paths (usage-error.ts, src/config/index.ts + repo/*.ts, app-installation-auth.ts). The config layer description in section 4 (line 89) explicitly states "not a catch-all shared.ts". No ADR updates needed (the ADRs are unchanged and still accurate; this PR implements the architectural intent already captured in 0007).
Nice to have (no action required)
- The empty
src/path/andsrc/commands/shared/directories visible on the worktree filesystem are not git-tracked (git does not track empty directories). These are harmless OS artifacts from the rename operations and are not part of the committed branch content. src/config/schema.tsandsrc/config/json-file.tsare scoped to theconfig/directory so the responsibility is clear, but longer names (config-schema.ts,config-json-reader.ts) would be marginally more explicit if the directory names ever change. Not a concern at this stage.
Conclusion
This is a clean, complete refactor. The module ownership changes are consistent, the import graph is correct, the docs update is substantive and well-organized, and the ADR boundaries are respected. The incidental improvement to the body-input plain-data boundary is a welcome bonus.
Ref: #156
Summary
Verification
npm test✅npm run lint✅npm run typecheck✅npm run build✅