Files
noahandClaude Opus 4.8 802f254e9a web: make the flare-ui console fully functional with a live sim backend and operator control
The on-box UI shipped as a half-migrated shell: the schema settings rendered
with no submit form, the flare-ui nav tabs shadowed the legacy pages with empty
cards, and --serve stood the UI up with no runtime so every value read "not
identified" and nothing could be controlled. This makes it work end to end,
driven by flare-ui, and fully exercisable on a workstation with no hashboard.

Live backend (alkane-os --serve-sim): run the reference HAL in-process on a
private unix socket, boot the runtime against it, and run a control loop that
applies the operator intent every period and publishes a live snapshot. On this
workstation the console shows the chain frequency climbing toward the target and
the controls taking effect; --serve keeps serving the same console with no
backend for a board whose HAL is not written yet.

Operator control channel (control.rs): the one mutable path into the runtime -
a mode/target and a run switch, plus a per-process CSRF token. ControlMode maps
one-to-one onto the real TuningTarget variants (power / ambient / hashrate /
max-fan), so the UI never offers a behaviour the controller lacks. runtime.rs /
tuning.rs gain set_target/target so a mode change applies in place, keeping the
PID state instead of snapping to the envelope floor.

flare-ui console (console.rs): every nav tab rendered from flare-ui primitives
(shell, render::card, readings, actions, components) with live data - overview
hero + state, mining hashboards/power/fans, a Control page with Start/Stop
action buttons, a working Tuning form that posts to /settings, and the system/
security/logs/files/terminal pages wired to their existing data. The tuning
form submit persists the setting AND switches the live target; Start/Stop and
the form are CSRF-checked. /api/control exposes the operator state as JSON, the
interface of record behind the page.

Wiring: app::start and web::serve_listener/handle/route carry Arc<Control>;
main.rs gains --serve-sim and threads a Control through the existing serve/boot
paths. README updated: the "no web frontend" note is no longer true.

Verified on this workstation: --serve-sim boots (s19jpro-bm1362-pic, 3 chains),
frequency converges toward power:2400, and the flare-ui pages drive stop ->
switch to ambient:18000 -> start, with a stale CSRF token rejected (403).
Tests: 183 lib + integration green; clippy -D warnings clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBPjAXpCwmigUov5eQk
2026-11-10 20:14:10 -06:00

77 lines
3.7 KiB
Markdown

# Alkane OS
[![CI](https://gitea.bluefla.re/blueflare/alkane-os/raw/branch/ci-badges/main.svg)](https://gitea.bluefla.re/blueflare/alkane-os/actions)
![tests](https://gitea.bluefla.re/blueflare/alkane-os/raw/branch/ci-badges/badges/tests.svg)
![coverage](https://gitea.bluefla.re/blueflare/alkane-os/raw/branch/ci-badges/badges/coverage.svg)
![bench](https://gitea.bluefla.re/blueflare/alkane-os/raw/branch/ci-badges/badges/bench.svg)
![bench coverage](https://gitea.bluefla.re/blueflare/alkane-os/raw/branch/ci-badges/badges/bench-coverage.svg)
![lines of code](https://gitea.bluefla.re/blueflare/alkane-os/raw/branch/ci-badges/badges/loc.svg)
![dependencies](https://gitea.bluefla.re/blueflare/alkane-os/raw/branch/ci-badges/badges/dependencies.svg)
![code quality](https://gitea.bluefla.re/blueflare/alkane-os/raw/branch/ci-badges/badges/quality.svg)
![license](https://gitea.bluefla.re/blueflare/alkane-os/raw/branch/ci-badges/badges/license.svg)
Rust mining and tuning core for Alkane control boards. The
[SDK](https://gitea.bluefla.re/blueflare/alkane-sdk) builds board images and
provides the hardware backend. The on-board web console is the parameterised
`flare-ui`: a sidebar shell with live telemetry (readings) and real controls
(mode/target, start/stop) that drive the runtime, with `/api/...` as the
interface of record behind every page.
## Status
The host miner supports BM1362 and BM1366 through the SDK's simulator HAL and
Stratum V1. Tests have replayed 33 captured BM1366 shares and one BM1362
share to a loopback pool with matching ACCEPT responses. Production board
control is still under development.
The BM1370 module encodes a captured S21 Pro job and parses captured nonce
frames. Work-ID mapping, chain control, and pool acceptance remain open.
The HAL client requests PSU shutdown on sensor faults and reserves work IDs
until a confirmed reset or shutdown. A production backend still needs a
power lease, watchdog, and validated temperature limits. SHA-256d and
Litecoin Scrypt proof verification are implemented; Scrypt chip report
handling and mining remain open.
Run `alkane-os --list-targets` for the target matrix. Set `POOL_PASSWORD` to
the pool password, then mine with a simulator HAL socket and Stratum V1 pool:
```sh
ALKANE_POOL_PASSWORD="$POOL_PASSWORD" alkane-os --mine-simulator HAL_SOCKET POOL_ADDRESS WORKER BM1366
```
Use `BM1362` for that chip. Set `ALKANE_API_LISTEN=127.0.0.1:4028` for
read-only `summary` and `version` commands; reach it remotely through SSH.
To bring up the full web console on a workstation with no hashboard, run
`alkane-os --serve-sim`: a reference HAL runs in-process, the runtime boots
against it, and the printed URL serves the live, controllable console (the
frequency moves toward the target; start/stop and mode changes take effect).
`alkane-os --serve` serves the same console with no backend, for a board whose
HAL backend is not written yet. `ALKANE_WEB_LISTEN=ADDR` overrides the bind
(default port 80, or 8080 without privilege).
## Release gate
`main` runs tests, benchmarks, and conformance before release; `next` builds
release candidates. The release gate is red. It requires all 64 same-vendor
pairings (52 Bitmain, 12 WhatsMiner), unmodified stock firmware, captured
silicon nonces, difficulty-1 pool acceptance, and bench-validated models.
Stock firmware may faithfully reject a pairing; Alkane OS must mine it.
See the [evidence contract](ci/CONFORMANCE.md).
Badges cover host code, not board conformance. See the public
[benchmark history](https://blueflare.gitea.bluefla.re/alkane-benchmarks/os/).
## Local checks
```sh
CARGO_TARGET_DIR=/var/tmp/alkane-os-target cargo test --locked
```
Use an executable target directory if the source mount is `noexec`.
## License
[MIT](LICENSE). Vendored dependencies keep their own licenses.