diff --git a/crates/alkane-cli/src/lib.rs b/crates/alkane-cli/src/lib.rs deleted file mode 100644 index c6a08f70..00000000 --- a/crates/alkane-cli/src/lib.rs +++ /dev/null @@ -1,2 +0,0 @@ -//! Headless driver over the same engine the GUI uses. -fn main() { println!("alkane-toolkit-cli: scaffold"); } diff --git a/crates/alkane-cli/src/main.rs b/crates/alkane-cli/src/main.rs new file mode 100644 index 00000000..56e67f69 --- /dev/null +++ b/crates/alkane-cli/src/main.rs @@ -0,0 +1,4 @@ +//! Headless driver over the same engine the GUI uses. +fn main() { + println!("alkane-toolkit-cli: scaffold"); +} diff --git a/docs/adr/0001-recipes-as-data.md b/docs/adr/0001-recipes-as-data.md new file mode 100644 index 00000000..ddb8fb28 --- /dev/null +++ b/docs/adr/0001-recipes-as-data.md @@ -0,0 +1,35 @@ +# ADR 0001: Recipes as data, interpreted by one engine + +Status: ACCEPTED +Date: 2026-09-14 + +## Context + +alkane-sdk defines per `{board, source-OS}` install recipes as prose with +five facts (foothold, transfer channel, write target, verify, revert) plus +a universal stage pattern. Hardcoding each combination as imperative Rust +would fork control flow per combination and make the recorded false +positives (UBI volume-name trap, "Success: 1" booting stock) easy to +reintroduce. + +## Decision + +Every recipe is a declarative pipeline (ordered stages + typed parameters, +board/OS-keyed data files in the repo), executed by a single engine. The +five SDK invariants are enforced by the engine and the domain types, not by +individual recipes: + +1. secure-partition writes refused unconditionally +2. independent-channel verification + >= 2 power-cycle persist gate +3. reboot timeout = candidate success, re-classified via liveness channel +4. packer formats are board-owned enum values; cross-board misuse is + unrepresentable +5. boot-switch is an explicit stage with its own verification + regression + tests for known traps + +## Consequences + +- Adding `{board, source-OS}` support = data + tests, no new control flow. +- The audit log is a natural by-product (one entry per stage). +- Resume/rollback operates on the same stage list the log describes. +- The engine is identical for CLI and GUI (D4 in the plan). diff --git a/docs/adr/0002-gui-bindings.md b/docs/adr/0002-gui-bindings.md new file mode 100644 index 00000000..57866a2c --- /dev/null +++ b/docs/adr/0002-gui-bindings.md @@ -0,0 +1,37 @@ +# ADR 0002: GUI bindings — wxWidgets shell in C++ + Rust core, spike to revisit + +Status: PROPOSED (default; reversible until M3) +Date: 2026-09-14 + +## Context + +The toolkit must present a native cross-platform GUI (wxWidgets chosen). +Rust bindings to wxWidgets checked on crates.io 2026-09-14: + +- `wxRust` 0.0.1-alpha — unmaintained since 2022. +- `wx-rs` 0.2.0 (2023, self-contained) — ~6k downloads, no 1.0. + +Betting the GUI on alpha bindings risks weeks of binding-gap debugging +(paste-heavy widgets, worker threads + event loops, GTK/WinCocoa quirks). + +## Decision + +Default: **thin C++17 wxWidgets shell (`gui/`) + Rust core exposed over a +small stable C ABI** (cdylib from `alkane-core`, header generated with +cbindgen). The shell holds frames, lists, the install wizard, and event +glue only — no business logic, no safety logic. All invariants, engines, +and tests live in Rust where they are testable headlessly. + +Gate: M0 runs a time-boxed `wx-rs` spike (window + list/tree + wizard flow ++ worker-thread progress + cancel on Linux and Windows). If the spike is +solid, flip to pure Rust; either way the decision is recorded before M3. + +## Consequences + +- The repo builds two things: a Rust workspace and a small C++ app linked + against the core cdylib. CMake in `gui/`. +- Core API surface stays small and event-oriented (discover, identify, + plan, execute, cancel, progress events, log tail) — good FFI hygiene and + a natural match for the CLI too (D4). +- If wx-rs wins the spike, the C ABI is kept as an integration boundary for + scripted/HIL use anyway.