What a module is
Three systems, three units, three things that refuse a violation — and only one of them refuses at compile time.
What refuses a violation
| the unit | what refuses | when | |
|---|---|---|---|
| pi-ts | npm package | a script parsing every build file with the compiler API | pre-commit and CI and publish — the same nine-step chain in all three |
| deepseek-ts | npm package | a gate that checks the manifest against real imports | CI only — and its remedy rewrites your manifest to match |
| nerv | cargo crate | the compiler | every build, always. There is no mode in which it does not. |
pi-ts's is the discipline worth envying: because every rule runs at commit time and not only in CI, its 21-edge graph has zero cycles, no relative import escaping a package, and declared dependencies matching actual imports exactly. nerv's declared graph was ten per cent fiction at the time of measurement — six declared-but-never-imported edges of fifty-nine.
Nothing constrains anything below the crate
This is the honest gap. Cargo enforces the crate edge and enforces nothing inside it, so a single crate can grow any shape it likes. pi-ts constrains boundary depth on a walked graph with a stated cost model, and can mark a subtree as excluded-from-build-but-imported — making it a boundary rather than a comment. nerv has no equivalent.
What nerv legislates instead is one ceiling: files, at 800 lines, and it holds across every file in every repository. But deepseek-ts keeps 97% of its files under 800 with no file-size gate at all — so the rule buys the absence of a long tail rather than a better median. And the unit is unruled: two crates are half of magi.
What a test can reach
The sharpest measurable difference, and the one that compounds daily.
| to test one unit, this compiles | |
|---|---|
| pi-ts | the whole package — up to 70,067 lines |
| deepseek-ts | about 22,000, a median of eighteen packages |
| nerv | about 8,200, a median of two crates — and all 25 pass their suites alone |
A test's reach here is exactly its declared dependencies and dev-dependencies. It is not a convention: there is no way to import something you did not declare. deepseek-ts has 76 undeclared test edges across 50 packages, because its gate does not glob the test tree.
What a process boundary buys that a package edge cannot
- Absence as an ordinary value. A missing sibling returns an empty list or a
None, not an error path — so “not installed” is the same shape as “nothing to say”. - A typed refusal. Four faults where an in-process call has one result, and a method separating “this cost you a feature” from “this cost you a turn”.
- Authority split by link. casper answers read-only verbs on its socket and will run a command only when spawned. The same program, two different authorities, decided by how you reached it.
The whole cross-program surface in magi is 1,632 lines — under five per cent of production — carrying in one crate what deepseek-ts spreads across seventeen.