Commit Graph
2 Commits
Author SHA1 Message Date
noahandClaude Opus 5.5 dce31c8784 style: rustfmt the console/runtime work (no behaviour change)
source-pr / source (pull_request) Failing after 9s
source-pr / source (pull_request) Canceled after 0s
The source-pr gate runs cargo fmt --check; the afw OS-bundle line had not been
formatted. Pure cargo fmt output. 250 tests pass; clippy -D warnings clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
2026-11-12 14:53:52 -06:00
noahandClaude Opus 4.8 43a09c158a os: re-seat the UI and API on a command/state bus (wardenOS-style)
Introduce a single command point - the bus - that the HTTP API, the web console,
and any future remote/flare client all go through, mirroring wardenOS's
architecture (flare-edge `sprint`). wardenOS runs this as an MQTT broker over a
Unix socket; per its own porting note the right first step is to implement the
Bus facade (publish_state / read_state / request / emit) over an in-process
broker with the registry as the contract, swappable for a socket broker later
without touching callers. alkane-os is std-only and headless, so that is what
this does - no tokio, no MQTT.

- bus.rs: the in-process hub. Retained `state` topics (reads), `req`/`reply`
  verbs dispatched to one owning handler (the single write path), and a bounded
  `evt` ring. BusError carries warden-style E_* codes.
- registry.rs: the contract - every topic and verb as typed constants plus a
  machine-readable description. A test asserts the live bus matches it, the
  property busgen gives warden, so the contract cannot drift from the code.
- service.rs: the miner service owns the control/settings/dashboard verbs and
  publishes the hardware/summary/control state. Like a warden service it
  republishes the affected state the instant a command applies, so a reader
  never sees a command lag the periodic telemetry publish (the bus is held Weak
  to avoid an Arc cycle).
- web.rs is now a thin HTTP->bus translator (WebContext{bus, csrf}): writes are
  bus.request, miner-state reads are bus.read_state, the legacy hand-rendered
  page arms are gone (the console renders every nav tab). console.rs reads the
  state docs and the csrf is passed in. app::start/main.rs build the bus, register
  the service, and publish each control period.

Verified on --serve-sim: stop -> switch to ambient:18000 -> start now each
reflect immediately in /api/control, live frequency tracks the target, and a
stale CSRF is rejected. 193 lib tests pass (incl. bus/registry/service), full
suite green, clippy -D warnings clean, no emojis.

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