Compilation and activation stay separate. Entry assembly selects roots and builds a reachable function union.
Compilation and activation are different verbs.
A module can compile completely, including its dormant entry work, and still do nothing at runtime until an entry selects it. The seed can be fully formed and still sleep. Dependencies do not secretly run initialisers because someone mentioned a name.
Project entries are exactly the directories with an @entry.moth root. Presence is the only selection fact. An entry may be empty, static-only or metadata-only. @mod.moth and @package.moth never become entries, and importing a module or package never activates its entry.
Only an @entry root may carry dormant top-level runtime work and fragments. That work is parsed, type-checked, lowered and borrow-validated before any entry activates it. Local lifetime-region and escape analysis belongs to the same accepted sequence, but its implementation is still deferred.
The compiler synthesises an implicit entry for an @entry root. The entry has no source-level name, so start remains an ordinary identifier. Properties that matter:
Error! alongside the existing fragment-collection success slots, including for a synthetic single-file rootCompilation never activates the entry. Entry assembly may activate it once after the module already compiled.
Implicit checked failure materialises as Error in the entry. Typed Error! propagates with !; custom errors need explicit recovery. Builders consume that typed outcome without adding an error-fragment channel. The Progress matrix records current support.
Support facades, the project package facade and @mod roots have no implicit entry.
In the walkthrough, @entry.moth owns dormant root work and a page fragment. greeting.moth is an ordinary source file inside that same directory-scoped module, not a separate module with a root of its own. Binding greet runs no entry statements, because only an activated entry root runs root work.
Naming a dependency never runs its root work. Activation is explicit and entry-scoped, so importing a module can't quietly execute code.
Fragments split into useful kinds:
Dependency modules do not run their root work merely because a consumer bound a function. Activation is explicit and entry-scoped.
For an HTML entry, fragments belong to the selected @entry root. The root's presence selected the entry, not the fragments themselves.
The paragraph in @entry.moth enters through fragment metadata and, if needed, runtime production. It does not require the backend to re-read the .moth file.
The build system selects entry candidates from @entry.moth presence and builds an EntryAssembly from existing facts: which entry root activates, which fragments apply, which builder slot destinations the builder needs. An empty, static-only or metadata-only entry still assembles. Route derivation uses the directory position, never source activity.
Contrast ProjectPackageAssembly, which carries project-wide assembly privilege for the facade. Different job, shared taste for explicit data.
Builders consume compiled graphs and explicit plans. They do not rediscover source structure by walking directories again.
From the activated entry, the linker walks call edges through:
greet and other source functionsThe result is a reachable function union for the entry. Unreachable private helpers are still fully compiled and validated as HIR. What they skip is backend emission and the target validation that walks the selected union, so an unsupported feature in an unreachable private function does not sink the build.
Reachability here records syntactic function and CFG reachability. It does not perform clever constant-branch tree shaking as its definition of truth. Some target checks may still inspect semantic types with the paired environment when raw reachability is not enough.
Link facts also carry capabilities and assets the entry will need.
The exact reachable union is also the point where local lifetime summaries can be instantiated against actual callers, entry/package roots and builder-supplied lifecycle roots.
In the accepted design, project and link validation completes the lifetime topology before target assignment. That topology validation is not implemented yet. Linking does not reopen source or mutate HIR either way.
Linking consumes compiled facts. It never triggers source compilation of a module that should have been in the graph already.
If a function is missing, the graph or artefact stage failed earlier. Link planning does not become a second compiler driver.
Link planning consumes published artefacts, so the failures it owns are narrow:
Failures that feel like linking but land earlier: an invalid root filename or a missing command-required entry are Stage 0 or early frontend concerns, and fragment destinations and builder slot values are validated before an artefact is ever published.
Target capability failures wait for the next article even when they appear adjacent in real builds.
Alternative: activate dependency-module initialisers automatically, or parse only the active root and discover callees late.
Choice: compile dormant work once, activate selected roots explicitly.
Benefit: dependencies remain predictable and entry planning stays data-driven.
Cost: the builder must carry explicit entry facts, fragment destinations and builder slot values.
@entry root exactly once. Imported entries and facade roots expose interfaces without activating anything.You leave with explicit roots and a reachable function union. Complete project and link lifetime-topology validation sits in the accepted design and remains deferred. Next: target assignment.