Move command shared types into owning slices#154
Conversation
There was a problem hiding this comment.
QA Review — Issue #149 / PR #154
Decision: APPROVED
What I verified
Structural compliance (all pass ✅)
- PR body opens with
Ref: #149on first line — correct. - Branch is
issues/orfe-149— correct. - All three old broad
shared.tsfiles are removed:issue/shared.ts,pr/shared.ts,project/shared.ts. Glob confirms zero remaining**/shared.tsfiles undersrc/commands. - All required issue shared modules exist:
github-errors.ts,github-response.ts,state.ts. - All required PR shared modules exist:
github-errors.ts,github-response.ts,review.ts. - All required project shared modules exist:
github-errors.ts,graphql-types.ts,lookup.ts,mutations.ts,queries.ts,status-field.ts. - All 14 required command-local
output.tsfiles exist (issue/get, issue/create, issue/comment, issue/update, issue/validate, pr/get, pr/get-or-create, pr/comment, pr/reply, pr/submit-review, pr/update, pr/validate, project/get-status, project/set-status). src/commands/shared/body-input.tsis present and was not re-renamed.
Separation of concerns (correct ✅)
github-response.tsin each group owns the raw GitHub API transport shapes (IssueGetResponseData,PullRequestGetResponseData, etc.) plus the normalization functions that map them to public DTOs. Public DTOs stay in command-localoutput.ts.graphql-types.tsin the project group owns raw GraphQL response shapes exclusively.ProjectGetStatusDataandProjectSetStatusDatalive in their respectiveoutput.ts.- No transport shapes are mixed into the public
output.tsfiles.
Handler diffs (no payload/behavior changes ✅)
- All handler diffs verified: issue/get, issue/comment, issue/update, issue/validate, issue/set-state, pr/get, pr/comment, pr/reply, pr/update, pr/validate, pr/get-or-create, pr/submit-review, project/get-status, project/set-status.
- Changes are import-path updates and helper-function moves only.
- The one structural change in
project/set-status/handler.ts— inlining thenormalizeProjectSetStatusResultcall into two explicit return statements — is logically equivalent and confirmed correct against theProjectSetStatusDatainterface. Typecheck passed. pr/submit-review/errors.tscorrectly removes the duplicatereadPullRequestReviewEventlocal copy and imports fromshared/review.js.
Verification claims confirmed ✅
npm run build— passes (no output, clean).npm run typecheck— passes.npm run lint— passes.npm test— all command-group test files pass:issue/set-state: 17/17 ✅issue/get,issue/comment,issue/update: 30/30 ✅issue/validate: 7/7 ✅issue/create: 28/28 ✅pr/get,pr/comment,pr/reply,pr/update,pr/validate: verified ✅pr/get-or-create: 16/16 ✅ (run twice across separate batches)pr/submit-review: 12/12 ✅project/get-status: 15/15 ✅project/set-status: 12/12 ✅
Docs updates (correct ✅)
docs/architecture/overview.mdupdated in three places: the Mermaid diagram nodes for IssueGroup, PrGroup, and ProjectGroup; the file tree diagram (addsoutput.ts, renamesshared.ts→shared/<named-module>.ts); and the prose guidance (removes "Group-localshared.tsfiles exist only when..." paragraph, replaces with responsibility-named module guidance).- ADR 0007 §6 updated from
shared.tstoshared/directory with responsibility-named modules. - No stale
shared.tsreferences remain in docs for the command layer.
Architecture invariants ✅
docs/architecture/invariants.md— no changes required; this issue is a locality/ownership cleanup within already-agreed architectural boundaries.- Command contract invariant is preserved: public output types are unchanged, only their file locations moved.
Blockers
None.
Important
None.
Nice-to-have
-
issue/set-statepublic DTO still lives inhandler.ts—IssueSetStateDatais exported fromsrc/commands/issue/set-state/handler.tsrather than from a command-localoutput.ts. This is intentionally out of scope for this issue (set-state is not in the requiredoutput.tslist), but it creates a small inconsistency with the rest of the command group post-refactor. Worth capturing as follow-up for the next cleanup round. -
src/config/shared.tsis listed inoverview.mdline 61 while line 208 prescribes "avoidshared.ts" —src/config/shared.tsis a pre-existing config-layer file outside this issue's scope. The prescriptive advice at line 208 is in a commands-specific section, so there is no logical contradiction, but it could be made clearer that the anti-pattern guidance applies to the command layer, not all layers. Non-blocking follow-up. -
validate/output.tsfiles are minimal type aliases —type IssueValidateData = ArtifactTemplateValidationResultandtype PullRequestValidateData = ArtifactTemplateValidationResult. These are correct and give the commands their own named export points, but they are very thin. IfArtifactTemplateValidationResultever changes, these files provide stable re-export points. Acceptable as-is.
Docs / invariants
overview.md and ADR 0007 are both updated correctly. No invariants gap. No debt update required.
Ref: #149
Summary
Testing