WS-3 sessie 1c: enable eslint-plugin-boundaries in apps/app/ #1

Closed
bert.hausmans wants to merge 0 commits from ws3-session-1c-boundaries into main

Workstream WS-3, sessie 1c uit de architectuur consolidatie sprint
(/dev-docs/ARCH-CONSOLIDATION-2026-04.md). Introduceert architecturale
import-boundaries in apps/app/ via eslint-plugin-boundaries.

Scope

apps/app/ only. apps/portal/ blijft buiten scope tot WS-3 PR-B
(na WS-6 sessie 2 merge).

Commits

  1. 403be99docs(ws3): add session 1c audit report (boundaries plugin)
    Phase A read-only audit → dev-docs/WS-3-SESSION-1C-AUDIT.md met zone-inventaris,
    voorgestelde matrix, forward-compat check vs §4.2.
  2. af1c549chore(deps): add eslint-plugin-boundaries to apps/app
    eslint-plugin-boundaries@6.0.2 als directe devDep (TECH-PORTAL-ESLINT-DEPS lesson).
  3. de71d31chore(tooling): enable eslint-plugin-boundaries in apps/app
    Layered-architecture matrix actief in apps/app/.eslintrc.cjs.
  4. fe3a2e1chore(apps/app): mark lib/axios store imports for deferred refactor
    4 lib → stores violations in lib/axios.ts met per-line disables + TODO references
    naar nieuw backlog item.
  5. 9cccbe0docs(ws3): record session 1c completion (boundaries enforcement)
    ARCH-CONSOLIDATION-2026-04.md, CLAUDE.md, BACKLOG.md.

Architecturele beslissingen (Phase B)

  • Q1 (lib → stores): matrix blijft strict; 4 sites in lib/axios.ts gemarkeerd voor
    deferred structural decoupling (TECH-AXIOS-STORE-COUPLING). Optie A (rule loosening)
    afgewezen — permanente escape hatch. Optie B-extract (refactor nu) afgewezen —
    scope-creep richting architectuurwerk binnen een tooling-sessie.
  • Q2 (views/): dood Vuexy-bestand toegevoegd aan boundaries/ignore; fysieke
    verwijdering als TECH-DELETE-DEAD-VIEWS.
  • Q3 (navigation): mag importeren uit types, utils (forward-headroom).
  • Q4 (sub-zones): components/{organizer,portal,shared} enforcement uitgesteld
    tot WS-3 PR-B; TECH-WS3-BOUNDARIES-SUBZONES.

Acceptance

  • pnpm lint 0 problems in apps/app/
  • pnpm build succeeds
  • pnpm test 49 passed (geen regressie)
  • Geen wijziging in apps/portal/, api/, packages/, docs/
  • Conventional Commits + Co-Authored-By: Claude op alle commits

Follow-up backlog items

Item Prio Trigger
TECH-AXIOS-STORE-COUPLING Middel meelift met eerste WS-3 PR die lib/ raakt, of dedicated sessie na WS-6
TECH-DELETE-DEAD-VIEWS Laag meelift met housekeeping PR
TECH-WS3-BOUNDARIES-SUBZONES Middel na WS-3 PR-B merge + sub-folder structuur
TECH-WS3-BOUNDARIES-ROUTER-ZONE Laag wanneer plugins/1.router/router/ verhuizing landt
TECH-BOUNDARIES-V6-SELECTOR-MIGRATION Laag v5→v6 selector-syntax deprecation warning vanuit eslint-plugin-boundaries v6

Merge

--no-ff (web UI: kies "Create merge commit") per CLAUDE.md commit hygiene.

Workstream WS-3, sessie 1c uit de architectuur consolidatie sprint (`/dev-docs/ARCH-CONSOLIDATION-2026-04.md`). Introduceert architecturale import-boundaries in `apps/app/` via `eslint-plugin-boundaries`. ## Scope `apps/app/` only. `apps/portal/` blijft buiten scope tot WS-3 PR-B (na WS-6 sessie 2 merge). ## Commits 1. **403be99** — `docs(ws3): add session 1c audit report (boundaries plugin)` Phase A read-only audit → `dev-docs/WS-3-SESSION-1C-AUDIT.md` met zone-inventaris, voorgestelde matrix, forward-compat check vs §4.2. 2. **af1c549** — `chore(deps): add eslint-plugin-boundaries to apps/app` `eslint-plugin-boundaries@6.0.2` als directe devDep (TECH-PORTAL-ESLINT-DEPS lesson). 3. **de71d31** — `chore(tooling): enable eslint-plugin-boundaries in apps/app` Layered-architecture matrix actief in `apps/app/.eslintrc.cjs`. 4. **fe3a2e1** — `chore(apps/app): mark lib/axios store imports for deferred refactor` 4 `lib → stores` violations in `lib/axios.ts` met per-line disables + TODO references naar nieuw backlog item. 5. **9cccbe0** — `docs(ws3): record session 1c completion (boundaries enforcement)` ARCH-CONSOLIDATION-2026-04.md, CLAUDE.md, BACKLOG.md. ## Architecturele beslissingen (Phase B) - **Q1 (`lib → stores`):** matrix blijft strict; 4 sites in `lib/axios.ts` gemarkeerd voor deferred structural decoupling (TECH-AXIOS-STORE-COUPLING). Optie A (rule loosening) afgewezen — permanente escape hatch. Optie B-extract (refactor nu) afgewezen — scope-creep richting architectuurwerk binnen een tooling-sessie. - **Q2 (`views/`):** dood Vuexy-bestand toegevoegd aan `boundaries/ignore`; fysieke verwijdering als TECH-DELETE-DEAD-VIEWS. - **Q3 (`navigation`):** mag importeren uit `types`, `utils` (forward-headroom). - **Q4 (sub-zones):** `components/{organizer,portal,shared}` enforcement uitgesteld tot WS-3 PR-B; TECH-WS3-BOUNDARIES-SUBZONES. ## Acceptance - ✅ `pnpm lint` 0 problems in `apps/app/` - ✅ `pnpm build` succeeds - ✅ `pnpm test` 49 passed (geen regressie) - ✅ Geen wijziging in `apps/portal/`, `api/`, `packages/`, `docs/` - ✅ Conventional Commits + `Co-Authored-By: Claude` op alle commits ## Follow-up backlog items | Item | Prio | Trigger | |------|------|---------| | `TECH-AXIOS-STORE-COUPLING` | Middel | meelift met eerste WS-3 PR die `lib/` raakt, of dedicated sessie na WS-6 | | `TECH-DELETE-DEAD-VIEWS` | Laag | meelift met housekeeping PR | | `TECH-WS3-BOUNDARIES-SUBZONES` | Middel | na WS-3 PR-B merge + sub-folder structuur | | `TECH-WS3-BOUNDARIES-ROUTER-ZONE` | Laag | wanneer `plugins/1.router/` → `router/` verhuizing landt | | `TECH-BOUNDARIES-V6-SELECTOR-MIGRATION` | Laag | v5→v6 selector-syntax deprecation warning vanuit eslint-plugin-boundaries v6 | ## Merge `--no-ff` (web UI: kies "Create merge commit") per CLAUDE.md commit hygiene.
bert.hausmans added 5 commits 2026-05-04 20:45:52 +02:00
Phase A deliverable per the WS-3 1c session prompt. Read-only audit
establishing the proposed eslint-plugin-boundaries matrix from
filesystem evidence in apps/app/src/.

Findings summary:
- 14 zones inventoried; views/ contains a single dead Vuexy file
  (zero importers) and is recommended for ignore alongside @core/@layouts.
- Proposed matrix refines the prompt's starting-point with three
  evidence-based additions:
  * composables → stores (2 actual usages: api composables read auth)
  * plugins → stores (1 actual usage: router guards read auth + org)
  * pages → layouts (forward-compat with §4.2 route-meta layout binding)
- Forward-compat verified vs ARCH-CONSOLIDATION-2026-04.md §4.2
  sub-zones — all resolve cleanly under the proposed pattern set.
- Plugin: eslint-plugin-boundaries@6.0.2, MIT, peerDeps eslint>=6
  (compatible with v8.57.1), as direct devDep per TECH-PORTAL-ESLINT-DEPS.
- Estimated violation count: 0 if Q1=yes (allow lib→stores), 2 if Q1=no.

Four open questions for Bert before Phase B sign-off:
- Q1 lib→stores: allow/refactor/extract-seam? (recommendation: allow)
- Q2 views/ ignored: confirm
- Q3 navigation imports scope: keep types+utils as headroom?
- Q4 sub-zone enforcement = backlog (TECH-WS3-BOUNDARIES-SUBZONES)?

No .eslintrc.cjs or package.json edits in this commit. STOP at Phase B
per the prompt — Phase C executes only after Bert's sign-off in chat.

Co-Authored-By: Claude <noreply@anthropic.com>
Adds eslint-plugin-boundaries@6.0.2 (MIT, peerDeps eslint>=6,
engines node>=18.18) as a direct devDep in apps/app/package.json,
matching the exact-pin style of the other 14 eslint-plugin-* deps.

Direct dep — not hoisted transitive — per the
TECH-PORTAL-ESLINT-DEPS lesson (Cursor's ESLint extension uses
strict module resolution and silently fails on plugins reachable
only via pnpm hoisting).

Plugin not yet enabled in .eslintrc.cjs; enabling lands in the next
commit per WS-3 1c sequence (audit Phase A → install → enable →
refactor axios.ts → docs).

Tests + typecheck verified green post-install.

Co-Authored-By: Claude <noreply@anthropic.com>
Adds 'boundaries' to plugins, the layered-architecture matrix to
rules, and the boundaries/elements + boundaries/ignore + boundaries/
include settings per the WS-3 1c audit (Phase A:
dev-docs/WS-3-SESSION-1C-AUDIT.md). Phase B sign-off (Bert):

- Q1=B — `lib → stores` is DISALLOWED in the matrix; lib/axios.ts is
  refactored in the next commit.
- Q2 — src/views/** added to boundaries/ignore (dead Vuexy file;
  TECH-DELETE-DEAD-VIEWS backlog item lands with the docs commit).
- Q3 — `navigation` allowed to import `types`, `utils` (forward
  headroom).
- Q4 — sub-zone enforcement deferred to TECH-WS3-BOUNDARIES-SUBZONES
  (lands when WS-3 PR-B brings the §4.2 components/{organizer,portal,
  shared} + pages/{(auth),portal,…} structure).

Forward-flag carried into the inline comment: when src/plugins/1.router/
migrates to a top-level src/router/ in a later WS-3 PR, add a
{ type: 'router', pattern: 'src/router/**' } element and a
{ from: 'router', allow: ['types','utils','lib','plugins','stores'] }
rule. Doc-side flag also lands in the ARCH-CONSOLIDATION 1c entry.

Boundaries plugin v6 emits a deprecation warning that the
'element-types' selector format is legacy (v5 syntax); the rule
still works on v5-compatible config and migrating to v6 object-
selector syntax is out of scope per the prompt's "only the two
.eslintrc.cjs changes listed are permitted" constraint. Filing a
TECH-BOUNDARIES-V6-SELECTOR-MIGRATION backlog item (in the docs
commit) so the migration happens deliberately.

Lint count after this commit: 4 errors, all in lib/axios.ts (lines
3, 4, 61, 72 — the 2 static + 2 dynamic store imports). The plugin
treats both static AND dynamic `await import('@/stores/...')` as
boundary edges; this is a deliberate intermediate state. The next
commit (refactor) resolves all 4 to land at lint = 0.

Tests + typecheck verified green (boundary errors are lint-only).

Co-Authored-By: Claude <noreply@anthropic.com>
WS-3 session 1c — Phase B Q1=B-revised (Bert's call after the
plugin-reality discovery).

eslint-plugin-boundaries treats both static `import` and dynamic
`await import(...)` as boundary edges. The original Q1=B mechanism
("convert static→dynamic to satisfy the rule") doesn't actually
satisfy the rule — all 4 store accesses in lib/axios.ts trip
boundaries/element-types: lines 3, 4 (static, pre-1c) and lines
61, 72 (dynamic, from 1b-iii).

Three options were on the table; Bert chose B-revised:
- A-reversal (allow lib→stores in matrix) was rejected because it
  permanently loosens the boundary for 4 imports — exactly the
  silent exception the zero-compromise principle forbids.
- B-extract (decouple axios.ts from stores via callback-injection)
  is real architectural work and deserves a focused session, not
  the tail-end of a tooling sprint. Filed as TECH-AXIOS-STORE-
  COUPLING in the next docs commit; the four sites carry per-line
  TODO references to it.
- B-revised (this commit) preserves the strict matrix:
  boundaries/element-types stays at 'error' globally; the four
  axios.ts sites are explicit per-line exceptions, not a rule
  loosening. Future lib/X.ts writers still hit the wall.

Behavior unchanged. Only lint visibility changed — 4 disable
comments added at:
- src/lib/axios.ts:3 (static useNotificationStore import)
- src/lib/axios.ts:5 (static useOrganisationStore import; was line 4)
- src/lib/axios.ts:63 (dynamic useImpersonationStore await import; was line 61)
- src/lib/axios.ts:75 (dynamic useAuthStore await import; was line 72)

Each comment is exactly:
  // eslint-disable-next-line boundaries/element-types -- TECH-AXIOS-STORE-COUPLING: deliberate HTTP↔state seam, refactor scheduled per backlog.

Commit verb is `chore` not `refactor` per Bert: the code's behavior
doesn't change, only its lint-visibility does. Honest naming.

Tests + typecheck + build verified green:
- apps/app vitest: 49 passed
- apps/app vue-tsc: clean
- apps/app pnpm build: succeeded in 11.24s

Lint baseline: 4 → 0 errors. WS-3 1c acceptance criterion satisfied.

Co-Authored-By: Claude <noreply@anthropic.com>
- ARCH-CONSOLIDATION-2026-04.md: add Sessie 1c entry under WS-3 voortgang
- CLAUDE.md: add Frontend import boundaries section
- BACKLOG.md: add four follow-up tickets
  - TECH-AXIOS-STORE-COUPLING
  - TECH-DELETE-DEAD-VIEWS
  - TECH-WS3-BOUNDARIES-SUBZONES
  - TECH-WS3-BOUNDARIES-ROUTER-ZONE

Co-Authored-By: Claude <noreply@anthropic.com>
bert.hausmans closed this pull request 2026-05-04 20:52:24 +02:00
bert.hausmans deleted branch ws3-session-1c-boundaries 2026-05-04 20:52:25 +02:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bert.hausmans/crewli#1