Files
atomic-design-poc/docs/project/archive/backlog/WP-04-ui-not-infrastructure.md
T
ehoandClaude Opus 5 12f17d9d73 docs: archive the finished backlogs (RD-30)
Two backlog trees are complete: `docs/project/backlog/` (75 files, every
WP done) and `docs/project/refactor-backlog-setup/` (the arc before it).
Move both under `docs/project/archive/` with `git mv`, so history stays
intact through `git log --follow`. `SHOWCASE-ROADMAP.md` moves with them,
because it points at the now-archived backlog README.

Add `docs/project/archive/README.md`. It states that these trees are
historical and names the two directories that are still live.

Repoint every inbound reference named in RD-30's Files table: CLAUDE.md,
the root README, both backend READMEs, `LetterHtml.cs`, `a11y.mdx`, the
`document-feature` and `new-ssp` skills, and the readable-codebase PLAN,
README, and RD-19 ticket. Fix two upward-relative links inside the moved
WP files (WP-68, WP-69) that gained a directory level and would otherwise
break. Repoint `.prettierignore`'s two agent-prompt exclusions to their
new path, so prettier keeps leaving those files' exact wording alone.

Mark RD-30 done and check off its acceptance criteria; flip its README
row to done.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-08 23:00:38 +02:00

3.5 KiB

WP-04 — Boundaries II: ui ↛ infrastructure + showcase sanction

Status: done (035e785) Phase: 0 — enforcement & gates

Why

The documented rule ui → application → domain (CLAUDE.md §1) is not lint-enforced, and three components inject infrastructure adapters directly. This is the biggest refactor of Phase 0 — a pure move of wiring, no behavior change.

Read first

  • CLAUDE.md §1, docs/reference/architecture/ARCHITECTURE.md
  • eslint.config.mjs
  • src/app/registratie/ui/registratie-wizard/registratie-wizard.component.ts (lines ~18-19: BrpAdapter/parseBrpAddress, DuoAdapter/parseDuoLookup)
  • src/app/herregistratie/ui/intake-wizard/intake-wizard.component.ts (~line 28: IntakePolicyAdapter)
  • src/app/registratie/application/big-profile.store.ts (the facade pattern to copy)
  • src/app/showcase/ui/concepts.page.ts

Decisions (pre-made, don't relitigate)

  • Showcase is sanctioned, not fixed: showcase/ is a teaching page whose point is showing multiple contexts side by side. Add an explicit eslint override allowing @registratie/* / @herregistratie/* from src/app/showcase/**, with a message comment — same precedent as the existing debug-state exemption. Document in ARCHITECTURE.md: "showcase may read every context; nothing imports showcase."
  • Move wiring only — do not redesign adapter signatures. Existing machine specs are the safety net.

Files

  • eslint.config.mjs — forbid **/ui/** and **/layout/****/infrastructure/**; add the showcase sanction
  • src/app/registratie/ui/registratie-wizard/registratie-wizard.component.ts — BRP/DUO lookups move behind a registratie application/ facade (command or store methods)
  • src/app/herregistratie/ui/intake-wizard/intake-wizard.component.ts — policy resource moves behind new src/app/herregistratie/application/ (folder doesn't exist yet)
  • docs/reference/architecture/ARCHITECTURE.md — fix "three contexts, four layers" → six contexts (shared, auth, registratie, herregistratie, brief, showcase), five layers (+ contracts); add the showcase sanction
  • CLAUDE.md §1 — add brief to the context list; note the showcase sanction

Steps

  1. Create the application-layer facades (pattern: big-profile.store.ts / submit-*.ts commands); components inject those instead of adapters.
  2. Add the eslint restriction; add the showcase override with rationale message.
  3. Fix any further hits lint finds (letter-composer's infra import is handled in WP-03; if it slipped, fix here).
  4. Update both docs' context/layer inventory.

Acceptance criteria

  • Rule active; lint green; no disables beyond the documented showcase + debug-state exemptions. (Probed: a ui→infra import errors.)
  • No **/ui/** file imports from **/infrastructure/** (production; stories/specs exempted — test scaffolding wires the real client).
  • Both wizards behave unchanged (178 specs pass; storybook a11y suite mounts both wizards green — behaviour is a pure wiring move behind root facades).
  • CLAUDE.md and ARCHITECTURE.md list 6 contexts / 5 layers.

Verification

GREEN + npm run test-storybook:ci. Manual smoke: npm start → run the registratie wizard (BRP prefill + DUO lookup steps) and the intake wizard end-to-end.

Out of scope

Redesigning the adapters or resource loading; parse boundaries (WP-05).

Risks

Resource wiring moving layers can subtly change injection timing — keep facades providedIn: 'root' like existing stores and hand the resource through unchanged.