ADRs: recipes-as-data, GUI binding decision; cli as bin target
This commit is contained in:
@@ -1,2 +0,0 @@
|
|||||||
//! Headless driver over the same engine the GUI uses.
|
|
||||||
fn main() { println!("alkane-toolkit-cli: scaffold"); }
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
//! Headless driver over the same engine the GUI uses.
|
||||||
|
fn main() {
|
||||||
|
println!("alkane-toolkit-cli: scaffold");
|
||||||
|
}
|
||||||
@@ -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).
|
||||||
@@ -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.
|
||||||
Reference in New Issue
Block a user