Context

The defining property of a modular monolith is that modules communicate through published interfaces and keep internals private. Without enforcement, that erodes into a big ball of mud.

Decision

The build macro statically checks import specifiers: a module may only import another module's index.ts, never a deeper path. Violations are build errors with file:line and a fix hint.

Consequences

The architecture is enforced, not just documented — cheaply, with no runtime cost and no annotations. Cost: the check must understand the module-root convention and resolve relative/aliased paths correctly; barrel-file gymnastics could be used to dodge it (a lint rule, not a guarantee).

Patties design specifications · a design exploration · All decisions