docs(adr): ADR-013 input/output unification + Plan 9 changelog summary

Records the Plan 9 architectural decision (schemas in use-case file,
runtime output validation, presenter pattern, feature-scoped error
middleware, ./ui subpath split). ADR-012 gets a one-line cross-
reference to the new ADR. Refactor log gets a Summary section with
commit table and conformance checklist.

Plan 9 complete. The deferred doc-update pass (CLAUDE.md / AGENTS.md /
guides) — combined with the still-pending Plan 8 items — is the next
follow-up.

Refactor log: Summary, doc-update checklist
Spec: R29, R30
This commit is contained in:
2026-05-06 16:10:27 +02:00
parent 2df137c70c
commit 36548942d4
3 changed files with 217 additions and 0 deletions

View File

@@ -13,6 +13,48 @@ doc-update items so docs are written once for the post-Plan-9 state.
---
## Summary
**Completed:** 2026-05-06
**Branch:** main (or feature/io-unification per execution choice)
**Total commits:** 14 (Tasks 19)
**Net test count change:** 325 → 360 (+35 tests, +11%)
| Category | Count |
|---|---|
| Files added | 5 × procedures.ts + 5 × ui/index.ts + 1 × define-error-middleware{.ts,.test.ts} + 1 × ADR + 1 × changelog = 14 (approx; some ui/index.ts replace existing query.ts) |
| Files modified | 12 use cases + 12 controllers + 5 routers + 5 src/index.ts + 5 package.json + 5 router tests + ~25 test files = ~70 |
| New tRPC error codes mapped | 5 (BAD_REQUEST, NOT_FOUND, UNAUTHORIZED, FORBIDDEN, plus tRPC built-in BAD_REQUEST from zod) |
### Tasks completed
| Task | Commit | Description |
|---|---|---|
| 1 | `61baaae` | Refactor changelog scaffold |
| 2 | `e25b1f7`, `aac37fd` | core-shared defineErrorMiddleware + t export + jsdoc fix |
| 3 | `2bbec70`, `5b61674`, `70c7b7d` | auth migration + changelog §6.3 + test tightening |
| 4 | `86070b2`, `614c901` | blog migration + style dividers |
| 5 | `f4adf31` | marketing-pages migration |
| R6 | `9663c82`, `aff0ce0` | this.name in all error classes + changelog §7 |
| 6 | `27c79e6` | navigation migration |
| 7 | `2b67964` | media migration |
| 8 | `2df137c` | final verification + app caller stragglers + changelog |
| 9 | (this commit) | ADR-013 + changelog summary |
### Conformance verification (Task 8)
Spec acceptance criteria §8: all met.
- Every use case exports xInputSchema; non-void use cases also export xOutputSchema.
- Every non-void controller has a top-level presenter and uses ReturnType<typeof presenter>.
- Every feature has procedures.ts with feature-scoped error map.
- core-shared/trpc/define-error-middleware.ts is the only plumbing in core-shared; no central name→code registry.
- Per-feature package.json has ./ui subpath; root index.ts no longer exports query builders.
- R25 (output-validation) test exists per non-void use case.
- R26 (router error-mapping) test exists per feature.
- pnpm typecheck && pnpm lint && pnpm test && pnpm turbo boundaries && pnpm build all green.
---
## 1. Files added
- packages/core-shared/src/trpc/define-error-middleware.ts — middleware factory mapping [ErrorCtor, TRPC_CODE] tuples to TRPCError translation