Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Design model

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

The beskid executable is a thin orchestration layer over beskid_analysis (project graph, semantic pipeline, document snapshots) and backend-specific drivers (JIT for run/test, AOT for build, CLIF introspection). Every project-scoped command shares the same resolution inputs (ProjectResolveArgs, LockfilePolicyArgs) and must provision bundled corelib before dispatch (ensure_corelib_ready in compiler/crates/beskid_cli/src/cli.rs).

flowchart TB
  subgraph cli [beskid_cli]
    Parse[parse / tree / format]
    Analyze[analyze / doc]
    Run[run / test]
    Build[build / mod]
    Pkg[fetch / lock / update / pckg]
  end
  subgraph analysis [beskid_analysis]
    Ctx[CompilationContext]
    Graph[Project graph + CompilePlan]
    Sem[Semantic pipeline + diagnostics]
  end
  subgraph backends [Execution backends]
    JIT[beskid_engine JIT]
    AOT[beskid_aot link]
  end
  Parse --> Ctx
  Analyze --> Ctx
  Run --> Ctx
  Build --> Ctx
  Ctx --> Graph
  Graph --> Sem
  Sem --> JIT
  Sem --> AOT
  Pkg --> Graph
LayerResponsibility
Argv + global flags@file expansion, --log-cranelift, subcommand dispatch
Project resolutionDiscover Project.proj / Workspace.proj, honor lockfile policy, build CompilationContext
Pipeline observationMap beskid_pipeline phase IDs to stderr spinners or --plain lines
Command backendanalyze emits diagnostics only; build lowers + AOT; run/test JIT entrypoints

build, run, test, analyze, doc, clif, and format (when given a project input) must enter analysis through the same helpers that construct a CompilationContext for the resolved manifest path. Mod registration on the host compilation must occur after the dependency graph is materialized and before semantic gates, per Stage ordering and lowering.

File-only commands (parse, tree with a single .bd path) may bypass the project graph but still use the parser and formatter crates directly.

Mod projects are graph-discovered packages compiled AOT and loaded during host builds. CLI beskid mod manages artifact cache lifecycle; beskid build / run / test / analyze route mod work through beskid_analysis orchestration—the same entrypoints the LSP uses—so diagnostic codes, capability denial, and generator round caps match IDE behavior.

ConcernNormative rule
ProgressNew pipeline phase IDs must surface through the CLI PipelineObserver implementation
DiagnosticsMeta and semantic diagnostics share SemanticDiagnostic / miette shaping
ParityChanging mod scheduling must update CLI, LSP, and Diagnostics parity together
  • Subcommand wiring: compiler/crates/beskid_cli/src/cli.rs, compiler/crates/beskid_cli/src/commands/
  • Resolution + pipeline UI: compiler/crates/beskid_cli/src/frontend.rs, compiler/crates/beskid_cli/src/project_args.rs
  • Analysis services: compiler/crates/beskid_analysis/src/services.rs, compilation_context.rs
  • JIT launch: compiler/crates/beskid_engine/
  • AOT link: compiler/crates/beskid_aot/