Every host compilation must see the standard library graph.
Design model
Platform spec article
Design model
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).
Purpose
Section titled “Purpose”Host projects (Host, including template output) always receive an implicit dependency on the canonical corelib aggregate (beskid_corelib, package identity corelib). Injection happens during DAG construction in resolve_dependencies, not via optional manifest flags.
Injection model
Section titled “Injection model”flowchart TB Host[Host Project.proj] Resolver[resolve_dependencies] Std[Implicit Std / corelib path] Graph[Project DAG] Plan[CompilePlan] Sem[Semantic + lowering] Host --> Resolver Resolver --> Std Std --> Graph Graph --> Plan --> Sem
| Input | Resolution |
|---|---|
BESKID_CORELIB_ROOT | Points at workspace or install root containing beskid_corelib/Project.proj |
| Repo discovery | Walk ancestors for compiler/corelib/beskid_corelib |
Explicit Std path dep | Honored when declared; path fallback uses default_corelib_dependency_path() |
| Corelib workspace shards | compiler/corelib/packages/* must not get implicit back-edge (cycle guard) |
Manifest prohibitions
Section titled “Manifest prohibitions”beskid_analysis projects/parser.rs rejects noCorelib and useCorelib: false at parse time. Templates and scaffolds must not emit opt-out keys.
Symbol resolution
Section titled “Symbol resolution”After the graph attaches corelib nodes, semantic resolution treats corelib types and builtins like any other dependency assembly: same CompilationContext, same diagnostic catalog. User-visible names defer to language-meta; this feature covers graph attachment only.
CLI and LSP parity
Section titled “CLI and LSP parity”ensure_corelib_ready in beskid_cli materializes bundled corelib before commands run. LSP uses the same resolver paths via CompilationContext::try_for_analysis_path_with_graph_options.
Implementation anchors
Section titled “Implementation anchors”compiler/crates/beskid_analysis/src/projects/graph/resolver.rs—default_corelib_dependency_path,is_corelib_workspace_shard_manifestcompiler/crates/beskid_analysis/src/projects/parser.rs— opt-out rejectioncompiler/crates/beskid_cli/src/corelib_runtime.rs,build.rs- Tests:
compiler/crates/beskid_tests/src/projects/corelib/compile.rs