Boundary Enforcement

Copy Markdown View Source

ASM uses compile-time boundary checks to keep core runtime modules isolated from optional extension domains.

Compile-time Boundary rules are only one part of the contract. Runtime shape ownership is now explicit too:

Compiler Setup

mix.exs enables the boundary compiler before the default Mix compilers:

compilers: [:boundary | Mix.compilers()]

Boundary support is added as a compile-time dependency:

{:boundary, "~> 0.10.4", runtime: false}

Declared Boundaries

Core boundary:

  • ASM with deps: []

Extension boundaries:

Each extension boundary currently declares deps: [ASM].

Lifecycle Rule

Extension lifecycle ownership stays outside core application child specs:

  • The core ASM OTP application starts core-only children.
  • Host applications (or extension-owned supervisors) decide which extension processes to start.

This keeps both compile-time coupling and runtime ownership clean.

Enforcement Signal

Running compile with warnings-as-errors executes the boundary compiler:

mix compile --warnings-as-errors

Any core-to-extension dependency without a declared boundary dependency fails compilation.