Severity: error | Blocks morph build: yes
A source file or directory name violates the module naming gates, or two modules normalize to the same C++ namespace:
error : mx-naming : directory `Ledger` in `src/Ledger/list.mx` should be `ledger` (lowercase `[a-z0-9_]` only). Rename it.
Learn more: https://morph.levizr.com/docs/errors/mx-namingerror : mx-naming : `src/Shop/item.mx` and `src/shop/item.mx` both normalize to `shop::item` — rename one.
Learn more: https://morph.levizr.com/docs/errors/mx-namingModule paths become C++ namespaces mechanically: entry-relative segments,
lowercased, [a-z0-9_] only (src/components/shop/ShopStore.mx →
components::shop::shopstore). The rules exist because C++ namespaces cannot
contain uppercase, dashes, or dots, and two files normalizing to one namespace
would emit colliding symbols — a linker error pages away from its cause.
Enforcing the gates at graph time keeps namespaces human-computable: you can
predict the generated namespace from the path. Digit-leading segments are
_-prefixed; anything outside the entry tree is rejected.
src/
Ledger/ # ❌ should be `ledger`
list.mx
shop/
Item.mx # ❌ should be `item.mx`Routes share the same source root, so shared components are fine:
src/
add/
route.mx # ✅ `import NavBar from "../components/NavBar.mx"`
components/
NavBar.mx # ✅ same `src/` tree — one namespace `components::navbar`A file genuinely outside src/ is still rejected:
error : mx-naming : `shared/NavBar.mx` is outside the source tree `src` — move it under `src/`.
Learn more: https://morph.levizr.com/docs/errors/mx-namingsrc/
shop/ # ✅ lowercase, unique segments
item.mx
checkout/
cart.mxRules:
[a-z0-9_] only (src/ledger, not
src/Ledger; item.mx, not Item.mx).src/).
Routes (src/add/route.mx) and the entry (src/App.mx) share it, so
../components/… imports are in-tree._-prefixed automatically — avoid them where possible.Steps:
morph check.Do not disable this rule. The gates protect namespace generation — violating names cannot produce valid C++.