2.7 KiB
2.7 KiB
AGENTS.md - alkane-toolkit
Short standing orders for working in this repo. Read HANDOFF.md first on any
resume; it names the live threads. Parent project rules live in
../AGENTS.md (bench discipline, live-fleet-ops).
Build / run (this machine)
- Never build or run inside the synced repo tree (noexec, slow FS). Cargo target
is
~/.cache/alkane-tk-target(set in~/.cargo/config.toml, not committed); wx builds go to~/.cache/wxbuild/~/.cache/wx-3.3.3-linux. scripts/build-wx-linux.sh(once) thenscripts/build-gui-linux.sh(release).- CI sets
CARGO_TARGET_DIR=targetand removes target, coverage, bench, and release staging after each job, including failed runs. For local builds, runscripts/clean-old-builds.shat the end of each task; keep only the current release binary and the pinned wxWidgets cache. - The GUI is pure-Rust wxWidgets on the vendored, patched
wx-rs(thirdparty/wx-rs/wx-rs-0.2.0-patched). When you change it, regenerate the matchingthirdparty/wx-rs/patches/NNNN-*.patchand commit both.
Development / review / visual-feedback loop
Every UI change goes through this loop before it is considered done:
- Edit, then
scripts/ui-selftest.sh-- builds and runs the app headless inALKANE_SELFTESTmode: it renders the bench-fleet fixtures through the real widgets and compares the table cells + KPIs to the expected hardware output. Non-zero exit = a regression. Also runcargo test -p alkane-gui --offlinefor the transform-layer unit tests. scripts/ui-screenshot.sh out.png-- captures the running UI to a PNG on a private Xvfb display (never the real desktop). Defaults to the offline fixtures (ALKANE_FAKE_SCAN) so the shot is deterministic;--livescans the network. Eyeball the PNG for layout regressions.- Only after both pass, wire in real hardware (a live scan) per parent rules.
Headless X gotcha: the GTK window only maps under Xvfb with GDK_BACKEND=x11
set; without it the app runs but never shows a window. The scripts set it.
Offline modes (no hardware needed)
ALKANE_FAKE_SCAN=1-- feedcrates/alkane-gui/src/fixtures.rs(the 9 bench boards' expected output) instead of scanning. Use for demos and screenshots.ALKANE_SELFTEST=1-- run the workflow self-test and exit (see the loop).
Keep the fixtures in step with the bench inventory (HANDOFF.md section 7).
Conventions
- Keep discovery, protocol parsing, artifact checks, flash safety, and GUI runtime in Rust. Use Python for CI, release, reporting, and host tests only.
- Confidence tags (CONFIRMED/DERIVED/EXTERNAL) on doc claims; cite file paths.
- Single-line imperative commit summaries.
- No emojis in any file (parent-project + global rule).