Duolith docs

0004. Dependency rules, enforced in CI

  • Status: Accepted
  • Date: 2026-11-14
  • Decided by: integrator (technical), on the Build plan's layout

Context

Boundaries that are only written down erode. The engine adapter promise, that Lynx can be replaced without changing page files, holds only if nothing else imports Lynx.

Decision

Allowed dependency directions are data in tools/boundaries.yaml, checked by tools/check-boundaries.ts on every change:

  • spec/ depends on nothing.
  • Rust crates depend downward only: syntax and style at the bottom, analyzer above them, emit-web, emit-native, fmt and lint above that, wasm and cli on top. Nothing depends on cli.
  • Runtime packages never import compiler crates. kit depends only on client.
  • Only packages/engine imports @lynx-js/*; only packages/client imports @tanstack/*.
  • No cycles.

New third-party dependencies need a one-line reason in the pull request and a licence compatible with MIT OR Apache-2.0.

Consequences

Adding an edge between contexts is a reviewed change to tools/boundaries.yaml, which makes it visible. A licence check (cargo-deny) joins CI when the first third-party crate arrives.