Sibling articles under this feature previously restated requirements in inconsistent forms.
mod host bridge - Flow and algorithm
Platform spec article
mod host bridge - Flow and algorithm
Spec standingStandard
-
This feature hub owns normative MUST/SHOULD contract text for Mod host bridge.
Context
Decision
This feature hub owns normative MUST/SHOULD contract text. Sibling articles must not redefine hub requirements and should link here for authority.
Consequences
Contract changes start on the hub or in linked ADRs, then propagate to articles and implementation anchors.
Verification anchors
site/website/src/content/docs/platform-spec/compiler/compiler-mods/mod-host-bridge/index.mdxarticle bundle under the same feature directory.
-
Platform-spec text supersedes informal crate comments for Mod host bridge.
Context
Implementation crates accumulated informal notes that diverged from published contracts.
Decision
Normative platform-spec prose and ADRs under this feature supersede informal comments in implementation crates until explicitly migrated into spec text.
Consequences
Engineers file spec/ADR updates when behavior changes; crate comments are non-authoritative for conformance arguments.
Verification anchors
compiler/crates/beskid_analysis/compiler/crates/beskid_codegen/compiler/crates/beskid_analysis/src/services.rs
-
Mods previously risked manifest attach lists for discovery.
Context
Modpackages must export public Beskid types implementing SDK contracts; host loads AOT artifacts andmod.descriptor.jsonregistrations—not manifest attach metadata.Decision
Contract discovery uses
(contractId, typeId, entrySymbol)tuples; failures emit E1821–E1870 beforemod.collect.Consequences
JIT mod execution is not normative; rebuild uses
beskid mod rebuild.Verification anchors
compiler/crates/beskid_analysis/mod artifact store paths in analysis services.
- Mod host bridge - AOT artifact contract On-disk mod artifact layout, cache keys, export descriptor schema, and load-failure diagnostics.
- mod host bridge - Contracts and edge cases Reference compiler-owned execution, capability policy, and communication with compile-time Beskid modules.
- mod host bridge - Design model Rust-side mod host execution, AOT artifact lifecycle, capability policy, and typed merge.
- mod host bridge - Examples Reference compiler-owned execution, capability policy, and communication with compile-time Beskid modules.
- mod host bridge - FAQ and troubleshooting Reference compiler-owned execution, capability policy, and communication with compile-time Beskid modules.
- mod host bridge - Flow and algorithm Reference compiler-owned execution, capability policy, and communication with compile-time Beskid modules.
- mod host bridge - Verification and traceability Reference compiler-owned execution, capability policy, and communication with compile-time Beskid modules.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
Compile-time mod execution flow
Reference ordering from parse through mod collection, generation, semantic analysis, rewrite, and lowering.
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Mod host orchestration
Section titled “Mod host orchestration”flowchart TB
load[Load Mod AOT artifacts]
collect[mod.collect target sets]
gen[mod.generate typed AST]
merge[Merge contributions]
reparse{Syntax changed?}
sem[semantic.snapshot]
analyze[mod.analyze diagnostics]
rewrite[mod.rewrite optional]
load --> collect --> gen --> merge --> reparse
reparse -->|yes bounded rounds| collect
reparse -->|no| sem --> analyze --> rewrite
Primary flow
Section titled “Primary flow”- After
parse(andmacro.expand),mod.loadregisters contracts from resolvedModprojects in the dependency graph. mod.collectrecords generator/analyzer/rewriter target sets per mod.mod.generateemits typed AST contributions; the host merges and re-parses affected units when syntax changed (bounded bymaxGeneratorRounds).- Builtin semantic rules run on the merged program; emit
semantic.snapshotbefore analyzers read frozen state. mod.analyzepublishes diagnostics;mod.rewriteapplies typed replacements when enabled.- Emit
lower.readyonly when the merged tree is consistent for HIR lowering.
Ordering constraints
Section titled “Ordering constraints”- No mod body runs before a parseable
Programsnapshot exists for its compilation unit. - Analyzers must not mutate syntax after
semantic.snapshot; rewrites go throughmod.rewriteonly. - Capability checks and step budgets are enforced in the Rust host before Beskid mod entrypoints run (see Incremental scheduling and determinism).