Skip to content
Beskid The Beskid Book

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

15.5 Pipeline phases

mod.collect through mod.rewrite in the host pipeline and beskid_pipeline phase IDs.

Pipeline phases

Mods insert between parse and lowering—after you have syntax, before you pretend Cranelift will save you.

From Compiler Mod SDK — pipeline interaction:

flowchart TB
  collect[mod.collect — Collector scopes targets]
  generate[mod.generate — merge + reparse loops]
  analyze[mod.analyze — diagnostics on merged program]
  rewrite[mod.rewrite — apply fixes]
  semantic[Semantic rules continue]
  lower[codegen.lower]
  collect --> generate --> analyze --> rewrite --> semantic --> lower
PhaseHost concern
discovery / loadFind AOT artifacts, build schedule
collectNarrow work per mod instance
generate / merge / reparseTyped AST contributions
analyzeRun analyzers on merged snapshot
rewriteApply rewriter results

Map: Mod host bridge flow, Crate-to-spec anchors.

Rust host composition shares phase IDs across CLI, analysis, and codegen services—avoid ad-hoc logging strings in random crates (Pipeline composition, Stage ordering).

Dependency injection inside the Rust host is compile-time and read-only to mods/SDK—do not expect to register services from Beskid mod code.