Immutable artefact lanes and fingerprints let one module serve every entry without entry-specific recompilation.
Later stages need a coherent object, not a loose mutable AST they have to second-guess. One shared module must serve every entry that needs it without recompiling once per page.
A successful module compilation produces an immutable CompiledModuleArtifact. Think of a sealed growth ring: later stages can graft onto it without cutting the trunk open again.
Think of four layers plus records of what changed:
Public semantic interface. Exported identities, types, values, access and effect facts, plus stable lifetime summaries. The accepted set of summaries covers fresh roots, aliases, retained parameters and outlives constraints. What actually ships today is narrower: fresh roots, parameter aliases and an imprecise unknown.
Executable state. Module-local TypeEnvironment, validated HIR, the resource table, borrow facts and optional statement-keyed numeric-proof facts paired with the executable. Local lifetime-region and escape facts belong to this lane in the accepted design, and their validation is deferred.
Link facts. Backend-neutral per-function edges, binding-backed call ids, helpers, capabilities, numeric and cast operations, resource uses, provenance and generated-function requests. Resource uses are the compiler's business. Physical paths, URLs and asset placement stay with the builder.
Compiler and builder metadata. Dormant entry-root activity, folded fragment values with body or builder-slot destinations and insertion indexes, documentation fragments, resource origins, non-executable fragment uses, materialisation context and structured warnings. Direct named builder contributions are folded metadata, not a runtime side channel.
Fingerprints are an accepted design layer over those lanes, meant to let reuse say what changed. They are not a lane the current artefact retains. The compiler computes fingerprint facts during a build and today's builds do not keep them for later comparison.
Where the design does bite already: project-level topology never uses donor-local region IDs, and exported lifetime summaries use stable semantic relationships.
Backend planning facts do not live in the public interface. Private bodies do not leak into consumer-visible identity.
For greeting.moth, the constant and function land in the interface when exported, in executable state as HIR and types and in link facts as call and capability edges as needed.
Backend planning facts never enter the public interface, and private bodies never leak into consumer-visible identity.
Accepted design records separate fingerprints, including:
Invalidation meaning follows the split:
Stable origin identities and export bindings keep re-exports honest. Renaming a re-export alias changes the exporting module's public fingerprint. It does not rewrite the origin declaration's identity.
Outcomes stay strict:
A diagnosed provider cannot expose "half of greet" for experimental linking. Partial linkable data only breeds bugs.
To monomorphise a call is to stamp out a concrete version of a generic function for one set of types, so a greet written once against a type parameter becomes real code for each type that actually calls it.
That stamping has to put the new code somewhere, and the declaring module is sealed. So concrete generic functions live in generated sidecars owned by the consuming project or package compilation. New code grows beside the base. The base stays put.
In the accepted design each sidecar carries its request identity, generated-local type context, concrete HIR, borrow facts, lifetime facts and summaries, link facts and fingerprints. Today a sidecar stores its identity and module, keeps its completed summary separately and leaves lifetime and fingerprint retention deferred. Its module executable carries its own statement-keyed numeric-proof table, computed from its final HIR after validation and the last private-failure rewrites. A generated function may itself request further instances.
Two owners meet here, and the split matters.
The compiler, for one module compilation:
The build system, across the boundary:
The build system never drives a semantic stage and never schedules a second pass to converge generated work. The fixed point happens inside one module's compiler transaction, so the boundary only ever sees one finished delta per module.
The compiler assigns canonical identity before workers race. Canonical merge order applies after workers finish. Semantic, implementation, root, link and documentation fingerprints record change readiness.
Targeted module/consumer reuse, including dev-server configuration invalidation, is deferred to the existing incremental and persistent artefact work. Current dev rebuilds do not consume an invalidation report.
A consumer that folded an imported const call depends on the provider's exported body and the transitive private const helpers and constants that body reached. The public callable record carries the callable's type and Const evaluation contract, not that implementation closure. Before any warm semantic consumer reuse is enabled, provider publication must therefore expose one compiler-owned implementation digest over exactly that reachable closure. The digest must use stable semantic identity, not source text, formatting, source positions or donor-local numeric IDs, and it must not publish private declaration names or values into the public interface. A body-only or private-helper edit then invalidates a consumer that folded the affected origin, while unrelated public interfaces and consumers remain reusable. Until that reuse path exists, builds recompile consumers and no dormant cache digest is maintained.
Alternative: recompile each module for every entry, or let backends inspect mutable frontend state.
Choice: immutable canonical artefacts with explicit lanes and fingerprints.
Benefit: reuse and parallel scheduling preserve one semantic result.
Cost: invalidation and sidecar ownership need precise contracts.
CompiledModuleArtifact lanes and semantic fingerprints.You leave with successful immutable module artefacts. Fingerprints remain accepted design and ephemeral information rather than a retained lane or a working reuse mechanism. Next: which compiled roots and functions form one entry when the builder finally chooses what runs.