Drift risk.
Design model
Platform spec article
Design model
Spec standingStandard
-
Hub authority
Context
Decision
Hub owns MUST/SHOULD.
Consequences
Articles defer.
Verification anchors
trudoc.
-
Shared pipeline
Context
CLI/LSP divergence.
Decision
Use beskid_analysis aligned with LSP.
Consequences
Parity.
Verification anchors
pipeline tests.
- Contracts and edge cases Strict guarantees and failure modes for build, analyze, and run CLI behavior.
- Design model Conceptual model for `Build, analyze, and run contract` and its subsystem boundaries.
- Examples Concrete CLI invocations for build, analyze, and run workflows.
- FAQ and troubleshooting Common questions and fixes for build, analyze, and run CLI behavior.
- Flow and algorithm Lifecycle and execution flow for `Build, analyze, and run contract`.
- Verification and traceability Tests and traceability for the build, analyze, and run CLI contract.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Purpose
Section titled “Purpose”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).
Layered model
Section titled “Layered model”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
| Layer | Responsibility |
|---|---|
| Argv + global flags | @file expansion, --log-cranelift, subcommand dispatch |
| Project resolution | Discover Project.proj / Workspace.proj, honor lockfile policy, build CompilationContext |
| Pipeline observation | Map beskid_pipeline phase IDs to stderr spinners or --plain lines |
| Command backend | analyze emits diagnostics only; build lowers + AOT; run/test JIT entrypoints |
Shared resolution contract
Section titled “Shared resolution contract”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.
Compiler mods on the CLI
Section titled “Compiler mods on the CLI”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.
| Concern | Normative rule |
|---|---|
| Progress | New pipeline phase IDs must surface through the CLI PipelineObserver implementation |
| Diagnostics | Meta and semantic diagnostics share SemanticDiagnostic / miette shaping |
| Parity | Changing mod scheduling must update CLI, LSP, and Diagnostics parity together |
Implementation anchors
Section titled “Implementation anchors”- 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/