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:
syntaxandstyleat the bottom,analyzerabove them,emit-web,emit-native,fmtandlintabove that,wasmandclion top. Nothing depends oncli. - Runtime packages never import compiler crates.
kitdepends only onclient. - Only
packages/engineimports@lynx-js/*; onlypackages/clientimports@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.