nervネルフ

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 unitwhat refuseswhen
pi-tsnpm packagea script parsing every build file with the compiler APIpre-commit and CI and publish — the same nine-step chain in all three
deepseek-tsnpm packagea gate that checks the manifest against real importsCI only — and its remedy rewrites your manifest to match
nervcargo cratethe compilerevery 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.

A number that was reported wrongly the first time. Build ceremony was quoted as 31.7% against 0.8% until it was checked — three-quarters of that gap was READMEs and translations, which scores nerv's absence of documentation as a win. Like for like it is 20 lines per crate against 57 per npm package. A comparison that faults undocumented seams elsewhere cannot also bank their absence as a saving.

What a test can reach

The sharpest measurable difference, and the one that compounds daily.

to test one unit, this compiles
pi-tsthe whole package — up to 70,067 lines
deepseek-tsabout 22,000, a median of eighteen packages
nervabout 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

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.