Skip to content

11. Boundaries

  • [E] .dependency-cruiser.cjs enforces them in the CI Gate: a feature may import src/core, never another feature; src/core sees features only through the generated index; *.server.ts only from the server. No workspace packages: reuse stays inside the project.

  • [E] Built with #112 as the rules feature-not-feature (a folder src/features/<key>/ or src/features/missions/<m>/ imports only its own files besides the core; the index of all features is no exception), core-sees-features-through-index and server-parts-on-server (*.server.ts only from src/server, other *.server.ts and tests). The rules that were there stay; shared-stays-pure is now core-stays-pure. src/test/boundaries.test.ts runs the real rules on a small project per rule: each violation fails, the allowed imports pass.

  • [E] Built with #112 beyond the first decision and confirmed by the owner (2026-11-13): feature-stays-pure (the files of a feature other than *.server.ts and tests import neither server nor client, because the core reaches them through the index and the browser runs them); server-not-client and server-runtime-deps (no dev dependencies) cover the *.server.ts parts and src/features too; tests may import a *.server.ts part.

  • [E] Built with #116 (owner, 2026-11-14, only src/server imports the server index): the rule server-index-on-server forbids src/features/index.server.gen.ts to every file outside src/server, tests included; server-parts-on-server lets that index import the *.server.ts parts. src/test/boundaries.test.ts checks both.

  • [E] Changed for #542, not built yet (owner, 2026-11-30): every feature gets one folder src/features/<feature>/ with its rules and checks, its action inputs and state shape, its Lexicanum page, its server part (*.server.ts) and its client part (*.client.ts), and its tests; src/core keeps only what two or more features share. This replaces, once #542 is built, the place of the checks in src/core (pattern 7), the ban of client code in a feature folder (pattern 11) and the separate places of pattern 13 and 14. Names are readable (#543), and each rule exists once and is checked by the server (#544).

  • [E] Checked first (owner, 2026-11-30, #546, not built yet): names of at least 4 characters and readable feature folders and catalog keys, as a ratchet; no file in src/core that only one feature imports (a ratchet list of today’s cases); a feature imports only src/core and its own folder; *.server.ts never reaches the client; a hint on a pull request that changes many directories outside its feature’s folder.

  • [E] The older patterns are checked in the CI too (owner, 2026-11-30, #546, not built yet), as ratchets: texts apart from rules (2), stocks changed only by settle and the booking (3), no switch (mission) outside the mission folders (4), no Math.random in src/core and src/features (5), place ids only through placeId()/parsePlaceId() (6), no SQL outside the repositories (8); pattern 7 by the guard of #544; every pattern page names under „Geprüft durch“ its checks, and a meta-test checks that they exist.