Every host compilation must see the standard library graph.
Flow and algorithm
Platform spec article
Flow and algorithm
Spec standingStandard
-
Parser rejects noCorelib and useCorelib false.
Context
Decision
Rule Detail Forbidden keys noCorelib,useCorelib: falserejected at parseTemplates Scaffolds must not emit opt-out keys Consequences
Implicit injection in
resolve_dependenciesalways attaches corelib.Verification anchors
projects/parser.rs; template manifest tests. -
Corelib member packages must not implicit-back-link to aggregate.
Context
Shards under
packages/*would create cycles if they gained implicit host edges.Decision
Rule Detail Guard is_corelib_workspace_shard_manifestskips implicit back-edgeHost Only application hosts receive implicit corelib Consequences
Building
packages/runtimealone does not pull beskid_corelib as a hidden parent.Verification anchors
resolver.rs; corelib workspace compile tests. -
Compiler mods compile as carriers without host corelib rules.
Context
Mods are not end-user hosts; injecting corelib would distort mod graphs.
Decision
Rule Detail ModDoes not receive implicit host injection HostReceives implicit corelib per D-CORE-COMP-0005 Consequences
Mod SDK projects declare their own dependency closure.
Verification anchors
Mod project tests in
beskid_tests. -
CLI and LSP share corelib discovery and graph options.
Context
IDE analysis must match CLI compilation attachment.
Decision
Rule Detail CLI ensure_corelib_readybefore commandsLSP CompilationContext::try_for_analysis_path_with_graph_optionsConsequences
Diagnostic drift between CLI and LSP indicates a resolver bug.
Verification anchors
LSP workspace tests;
corelib/compile.rs.
- Contracts and edge cases Corelib injection guarantees and edge cases.
- Design model How the compiler injects and resolves the corelib package into host compilations.
- Examples Observable corelib injection scenarios.
- FAQ and troubleshooting Corelib injection and resolution FAQ.
- Flow and algorithm End-to-end flow for corelib injection during project graph resolution.
- Verification and traceability Tests and traceability for corelib injection and resolution.
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).
Graph build sequence
Section titled “Graph build sequence”sequenceDiagram
participant CLI as CLI or LSP
participant Ctx as CompilationContext
participant Res as resolve_dependencies
participant Core as beskid_corelib
CLI->>Ctx: resolve Project.proj
Ctx->>Res: walk consumer dependencies
alt host without explicit Std
Res->>Core: attach_path_dependency (implicit)
end
Res-->>Ctx: DAG + has_std flag
Ctx->>Ctx: CompilePlan for host target
- Load consumer
ProjectManifest. - For each declared dependency, attach path or registry materialization per Workspace and lock contracts.
- If consumer is a host project, not a corelib shard, and lacks
Std, calldefault_corelib_dependency_path()and attach as path dependency. - Recurse into corelib aggregate and its workspace package shards (
foundation,runtime,console,compiler-sdk). - Build
CompilePlan; semantic pipeline resolves symbols across all assemblies.
Environment and install paths
Section titled “Environment and install paths”BESKID_CORELIB_ROOT may be the aggregate package directory or the parent workspace root (nested beskid_corelib/Project.proj detection in corelib_aggregate_project_dir).
Failure modes
Section titled “Failure modes”| Failure | Stage |
|---|---|
| Corelib root not found | Graph validation — manifest band diagnostics |
| Cycle via shard back-link | Prevented by is_corelib_workspace_shard_manifest guard |
| Opt-out manifest keys | Structural parse error before graph |
Verification
Section titled “Verification”compiler/crates/beskid_tests/src/projects/corelib/compile.rs and mod.rs assert compile success with implicit injection; layout tests ensure workspace shards do not create cycles.