Expand description
§alp-core
Pure, I/O-free domain logic for the ALP SDK
embedded toolchain — the shared engine behind the
alp CLI.
This crate is the Rust home of the board.yaml model, parsing, and validation, plus the
build-plan / system-manifest contracts, the SoM/SKU catalogue, and the debug/doctor
reports. It contains no terminal, filesystem-walking, or process logic — only
deterministic, serde-based transforms — so the same logic can be reused by the CLI today
and bridged to the TypeScript extension/LSP (via napi-rs or WASM) later.
§What’s inside
| Module | Responsibility |
|---|---|
model | The board.yaml data model + normalize_board_model. |
validate | Schema + semantic validation; outcome classification. |
loader | Generation-target planning (Zephyr conf / DTS overlay / CMake args / Yocto conf). |
build_plan | Parse + summarize the SDK’s build-plan contract. |
system_manifest | The post-build system-manifest v1 contract (per-core slices, ipc, helper MCUs). |
build_readiness | Per-OS build-toolchain readiness reports. |
presets, sdk_catalogue | SoM/SKU catalogue, chip/board presets, topology. |
project | Workspace / project / board.yaml resolution. |
sdk | SDK release listing + active-SDK resolution + readiness. |
debug, debug_launch | Debug-doctor reports + launch.json drafting. |
diff, preview | Model-vs-normalized diff; effective-config preview. |
wizard | Project / module scaffolding plans. |
clock | Deterministic ISO-8601 UTC timestamps (SOURCE_DATE_EPOCH-aware). |
§Usage
[dependencies]
alp-core = "0.1"The full API reference is on docs.rs/alp-core.
Stability.
alp-coreis published primarily as the implementation crate for thealpCLI. It is pre-1.0 — the public API may change between minor versions. If you depend on it directly, pin a minor range.
§License
Re-exports§
pub use build_plan::BUILD_PLAN_SCHEMA_VERSION;pub use build_plan::Backend;pub use build_plan::BuildPlan;pub use build_plan::BuildPlanError;pub use build_plan::BuildSlice;pub use build_plan::GeneratedFile;pub use build_plan::PlanWarning;pub use build_plan::ToolStep;pub use build_plan::parse_build_plan;pub use build_plan::summarize_plan;pub use build_readiness::BuildOs;pub use build_readiness::BuildReadinessReport;pub use build_readiness::BuildToolProbe;pub use build_readiness::board_os_set;pub use build_readiness::build_readiness_report;pub use clock::format_iso8601_utc;pub use debug::DebugGenerationTraceDecision;pub use debug::DebugResolvedValue;pub use debug::DebugRuntimeCapabilities;pub use debug::DebugServerKind;pub use debug::DebugTargetKind;pub use debug::DebugTraceOutcome;pub use debug::DebugValueSource;pub use debug::DebugWorkspaceContext;pub use debug::DebuggerExtensionsState;pub use debug::DoctorCheck;pub use debug::DoctorReport;pub use debug::DoctorStatus;pub use debug::DoctorSummary;pub use debug::build_doctor_report;pub use debug::collect_resolved_values;pub use debug::collect_runtime_capabilities_from_commands;pub use debug::create_debug_workspace_context;pub use debug::is_server_supported_for_target;pub use debug::parse_server_kind;pub use debug::parse_target_kind;pub use debug::server_choices_for_target;pub use debug_launch::LaunchJsonWritePlan;pub use debug_launch::create_launch_draft;pub use debug_launch::create_launch_json_write_plan;pub use debug_launch::launch_preview_document;pub use debug_launch::launch_preview_notes;pub use diff::DiffEntry;pub use diff::DiffKind;pub use diff::collect_diff_entries;pub use diff::prune_nulls;pub use loader::ALL_EMIT_MODES;pub use loader::GenerationTargetSupport;pub use loader::LoaderPlan;pub use loader::create_loader_plan;pub use loader::generation_target_support;pub use loader::list_generation_target_support;pub use model::BoardModel;pub use model::normalize_board_model;pub use presets::PresetCatalogueDefaults;pub use presets::empty_preset_catalogue;pub use preview::EffectiveConfigPreviewPayload;pub use preview::create_effective_config_preview_payload;pub use project::ProjectContext;pub use project::ProjectResolutionInput;pub use project::ProjectSettings;pub use project::resolve_project_context;pub use sdk::GITHUB_RELEASES_URL;pub use sdk::SdkReadinessReport;pub use sdk::SdkReadinessState;pub use sdk::SdkRelease;pub use sdk::check_sdk_readiness;pub use sdk::parse_remote_sdk_releases;pub use sdk::resolve_active_sdk;pub use sdk_catalogue::AcceleratorAvail;pub use sdk_catalogue::BoardPreset;pub use sdk_catalogue::ChipChoice;pub use sdk_catalogue::ChipDef;pub use sdk_catalogue::ChipKconfig;pub use sdk_catalogue::I2cDevice;pub use sdk_catalogue::MemorySpec;pub use sdk_catalogue::PadRoute;pub use sdk_catalogue::SdkCatalogue;pub use sdk_catalogue::SocCore;pub use sdk_catalogue::SocSpec;pub use sdk_catalogue::SomPreset;pub use sdk_catalogue::TopologyCore;pub use sdk_catalogue::accelerator_availability;pub use sdk_catalogue::boards_for_som;pub use sdk_catalogue::chip_defaults;pub use sdk_catalogue::chip_family_for_sku;pub use sdk_catalogue::chips_for_som;pub use sdk_catalogue::core_ids_for_som;pub use sdk_catalogue::effective_chip_choices;pub use sdk_catalogue::effective_populated;pub use sdk_catalogue::parse_board_preset;pub use sdk_catalogue::parse_chip_def;pub use sdk_catalogue::parse_soc_spec;pub use sdk_catalogue::parse_som_preset;pub use validate::Outcome;pub use validate::ParseError;pub use validate::Severity;pub use validate::ValidationIssue;pub use validate::ValidationResult;pub use validate::ValidatorExecution;pub use validate::analyze_validation_result;pub use validate::classify_validation_outcome;pub use validate::parse_board_model;pub use validate::validate_board_yaml_local;
Modules§
- build_
plan - Build-plan contract (Wave C) — the consumed shape of the SDK’s
alp_orchestrate.py --emit build-planJSON, locked as ADR 0014 (alp-sdkdocs/adr/0014-build-plan-emit-cli-contract.md, 2026-06-04). - build_
readiness - Build-readiness preflight — the toolchains a build (and the Yocto
.wicflash) needs, keyed off the OSes the activeboard.yamldeclares. Used byalp doctor --build(and, later, asalp build’s preflight). - clock
- Pure timestamp formatting. The clock read lives in the CLI; this module only turns an epoch into an ISO-8601 string, so it stays IO-free and deterministic (and therefore unit-testable).
- debug
- Debug
doctordomain — a port of the TypeScript@alp-sdk/core/debugdoctor logic (buildDoctorReport,serverChoicesForTarget, and the runtime-capability/workspace-context adapters). - debug_
launch - Debug launch-config generation — a port of TS
createDebugProfile+debugProfileToLaunchDraft+createLaunchPreviewand thelaunchJsonCoremerge plan. Produces VS Codelaunch.jsondrafts foralp debug-config. - diff
- Structural diff between two JSON values — a port of the TS
diffcommand’scollectDiffEntries/collectRecursiveDiff. Used to surface whatnormalize_board_modelchanged relative to the parsed board.yaml. - loader
- Generation-target catalog — a port of the TS loader
GENERATION_TARGET_CATALOG/listGenerationTargetSupport. Static metadata describing the four emit targets (used byexplain, and latergenerate). - model
- Board configuration model — Rust mirror of the TypeScript
@alp-sdk/coreboard/configurator model. - presets
- Built-in preset catalogue defaults — a port of TS
createEmptyPresetCatalogue. SKUs/carriers come from the SDK metadata tree (read by the CLI); the lists below are the SDK-independent defaults. - preview
- Effective-config preview helpers (Rust mirror of LSP preview payload).
- project
- Workspace/project resolution — a port of the TypeScript
resolveProjectContext. Filesystem access is injected as apath_existspredicate so the resolution logic stays pure and unit-testable; the CLI supplies the realPath::existsprobe. - sdk
- SDK release catalogue + local readiness — a port of the IO-free parts of TS
@alp-sdk/core/sdk/service. Network (GitHub) and filesystem effects stay in the CLI; this module parses the releases payload and inspects a local SDK path through injected predicates. - sdk_
catalogue - Rust mirror of
packages/alp-core/src/sdkCatalogue/{parse,derive}.ts. - system_
manifest - The ALP system manifest (
build/system-manifest.yaml) — the single derived projection of aboard.yamlthatwest alp-buildemits, and the IDE/tool CONTRACT for a (possibly multi-image) project. Tools read THIS for folder layout + build/flash wiring instead of re-deriving from board.yaml + the SoM presets. - validate
- Local (offline) board.yaml validation.
- wizard
- Wizard and module-scaffold domain logic.
Constants§
- DEFAULT_
SOM_ SKU - Default SoM SKU written into a scaffolded
board.yamlwhen none is supplied (alp initwithout--som). Single source of truth for the literal, shared by the wizard (wizard::service) and the CLI’s app-core guard.