PELS Architecture Contract
This document defines dependency boundaries to keep changes local and reduce coupling. The boundaries are enforced by dependency-cruiser (npm run arch:check).
Layers
- Entry points
app.tsdrivers/**packages/settings-ui/src/script.ts
- App wiring and adapters
lib/app/**flowCards/**
- Domain modules
lib/core/**lib/plan/**lib/price/**lib/dailyBudget/**
- Shared utilities
lib/utils/**packages/contracts/src/**packages/shared-domain/src/**
- Test code
test/**packages/settings-ui/test/**packages/settings-ui/tests/**
Dependency Rules (Current)
- No circular dependencies.
- Runtime code (
app.ts,lib/**,flowCards/**,drivers/**,packages/**/src/**) must not import test code. - Runtime backend code (
app.ts,lib/**,flowCards/**,drivers/**) must not import settings UI code. - Settings UI code must not import runtime backend code directly; it must consume shared contracts and shared-domain modules instead.
- Non-entry modules must not import
app.ts. - Domain modules must not import
lib/app/**. flowCards/**must not importpackages/settings-ui/**ordrivers/**.drivers/**must not importpackages/settings-ui/**or test code.
Transitional Allowances
These are intentionally allowed for now, and tracked as tightening TODOs:
lib/utils/**still has a few imports fromlib/coreandlib/plan.
Shared packages are now the only allowed bridge between the settings UI and runtime code. The remaining lib/utils/** layering issue is still tracked in TODO.md.