Type to search pages and rules.

Browse pages

Dependencies

Layer dependencies and package ownership make the application boundary visible to review.

Markdown11 provisions

Intent#

Layer dependencies and package ownership make the application boundary visible to review. Each layer accepts only the dependencies its owning provisions allow, and each project rejects packages introduced without a current requirement.

Standards#

Follow the declared dependency graph#

ruleguidance

Requirement A dependency between layers or modules MUST follow the declared graph and add no other edge.

Rationale An undeclared edge lets a layer reach past its boundary, and review cannot refuse what no graph forbids.

litespec/workspace/dependencies#follow-the-declared-dependency-graph

Keep Domain dependency-free#

ruleguidance

Requirement The Domain layer MUST depend on no external package or framework.

Rationale Persistence, messaging, web, injection, serialization, and logging libraries all stay outside.

litespec/workspace/dependencies#keep-domain-dependency-free

Keep Application free of provider packages#

ruleguidance

Requirement Application MUST depend only on messaging abstractions, required read abstractions, and the one declared read boundary.

Rationale A provider package in Application makes the coordination layer depend on the technology Infrastructure was meant to hide. The Requirement names the one read boundary this allows.

litespec/workspace/dependencies#keep-application-free-of-provider-packages

Keep providers in Infrastructure#

ruleguidance

Requirement A database provider, external SDK, resilience, discovery, or serialization adapter MUST live in Infrastructure.

Rationale Infrastructure is the only layer that a provider change may reach, except the read boundary the ownership table assigns to Application.

litespec/workspace/dependencies#keep-providers-in-infrastructure

Pin every dependency version centrally#

ruleguidance

Requirement Every dependency version MUST resolve through central management or the committed lockfile, at the pin litespec.manifest.json states where it states one.

Rationale An inline version in one module file is invisible to the manifest that is supposed to own it. The manifest pins the baseline stack, which is the set these standards name. A consumer also carries packages for its own product, and it cannot add those to a manifest it does not own. Those versions live in the consumer's own central file or its lockfile, and litespec/workspace/dependencies#approve-new-packages-explicitly is what admits them.

Example A consumer generating invoices pins its PDF library in its central version file with a decision record. The manifest never names it, and the pin is still central.

litespec/workspace/dependencies#pin-every-dependency-version-centrally

Approve new packages explicitly#

ruleguidance

Requirement A package absent from the manifest MUST have a decision naming its use case, alternatives, owning layer, operating cost, and removal condition.

Rationale A package arrives with a cost nobody revisits, so the decision names the removal condition while the alternatives are still fresh. A baseline package lands in the manifest in the same change as its decision. A consumer-owned package lands in the consumer's central file instead, because the manifest belongs to the LiteSpec release rather than to the consumer.

litespec/workspace/dependencies#approve-new-packages-explicitly

Keep frontend applications isolated#

ruleguidance

Requirement A frontend MUST NOT import another application's source or another module's internal feature files.

Rationale A shared package exposes a documented public entry point and depends on no application.

litespec/workspace/dependencies#keep-frontend-applications-isolated

Keep the approved web UI dependency boundary#

ruleguidance

Requirement A React web frontend MUST take its UI packages from the uiBaseline in litespec.manifest.json, and a Svelte web frontend from uiBaselineSvelte.

Rationale Each baseline pins its design system, styling, base components, icons, and the utility packages the installed source imports directly.

litespec/workspace/dependencies#keep-the-approved-web-ui-dependency-boundary

Conventions#

Keep generated packages dependency-light#

conventionguidance

Default Keep generated API types free of dependencies and limit the shared client to the pinned generator's runtime, its query plugin, and those types.

Replacement A consumer departs from this default only through an Exception record naming this provision, with a reason and a review date.

Rationale A generated package that owns state, UI behavior, or authentication policy stops being regenerable.

litespec/workspace/dependencies#keep-generated-packages-dependency-light

Keep test dependencies in test projects#

conventionguidance

Default Keep assertion, substitution, host, container, and architecture-test packages inside test projects.

Replacement A consumer departs from this default only through an Exception record naming this provision, with a reason and a review date.

Rationale A test package referenced by a production project ships to production.

litespec/workspace/dependencies#keep-test-dependencies-in-test-projects

Assign each baseline package to its owning layer#

conventionguidance

Default Assign each baseline package to the owning layer named in the table in this section.

Replacement A consumer departs from this default only through an Exception record naming this provision, with a reason and a review date.

Example

LayerDirect package groups
DomainNone
ApplicationRequired abstractions only, plus the declared read boundary
InfrastructureProviders and adapters required by implemented ports
DeliveryHost, authentication, and documentation packages
Test codeTest-only packages

The example adds a package to the narrowest owning layer. A central version entry does not authorize every layer to reference that package. A consumer references conditional packages only after their extension activates.

litespec/workspace/dependencies#assign-each-baseline-package-to-its-owning-layer

Verification#

IDMarkEvidence
litespec/workspace/dependencies#follow-the-declared-dependency-graphguidanceDoes each layer or module dependency follow the declared graph with no added edge?
litespec/workspace/dependencies#keep-domain-dependency-freeguidanceDoes Domain depend on no external package or framework?
litespec/workspace/dependencies#keep-application-free-of-provider-packagesguidanceDoes Application depend only on abstractions and the declared read boundary?
litespec/workspace/dependencies#keep-providers-in-infrastructureguidanceDoes each provider adapter live in Infrastructure apart from the read boundary?
litespec/workspace/dependencies#pin-every-dependency-version-centrallyguidanceDoes every version resolve through central management or the lockfile at the manifest or consumer pin?
litespec/workspace/dependencies#approve-new-packages-explicitlyguidanceDoes each package outside the manifest carry a decision with use case, alternatives, layer, cost, and removal condition?
litespec/workspace/dependencies#keep-frontend-applications-isolatedguidanceIs each frontend free of imports from another application's source or internal feature files?
litespec/workspace/dependencies#keep-the-approved-web-ui-dependency-boundaryguidanceDoes each React frontend take UI packages from uiBaseline and each Svelte one from uiBaselineSvelte?
litespec/workspace/dependencies#keep-generated-packages-dependency-lightguidanceDoes the generated types package stay dependency-free with a thin client?
litespec/workspace/dependencies#keep-test-dependencies-in-test-projectsguidanceDo production projects reference no test package?
litespec/workspace/dependencies#assign-each-baseline-package-to-its-owning-layerguidanceDoes each baseline package sit in the layer the ownership table assigns?