The dead r610 pools behind alkane-fast and alkane-verify were disabled
after their SSD failure, leaving only offline runners on those labels.
The required source-pr gate runs on alkane-fast, so every PR to main is
unmergeable (the check never gets a runner), and next-build/pages jobs on
alkane-verify never run either.
Repoint the four jobs on the dead pools to the healthy GARM-backed
alkane-ci pool, matching main.yml which already runs there:
- fast-pr.yml (source-pr gate) alkane-fast -> alkane-ci
- next.yml (next-build) alkane-verify -> alkane-ci
- bench-pages.yml alkane-verify -> alkane-ci
- ci-badge.yml alkane-verify -> alkane-ci
The pinned runner-image digest is unchanged, so ci/check-runner-image.py
still passes (verified locally), and workflow/job names are unchanged so
the required context source-pr / source is preserved.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
alkane-toolkit's fleet scan (asic-rs) recognises miners by their cgminer
socket or vendor web UI; an Alkane board has neither exposed, so it never
appeared and could not be right-clicked to flash. Add an open, read-only
identity endpoint beside /api/summary: os, os_version, board, sdk_revision,
hostname, mac, kernel - nothing a stock miner does not already expose, no
secret. The .afw packager stamps the bundle version into
/etc/alkane-os-version for it. Tests: served without a session; every field
read from the board files; absent files read as null.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
main replaced source-pr.yml with fast-pr.yml (same workflow name, same
concurrency group, newer runner image); the merge kept both, so every PR ran
two "source-pr / source" jobs that cancelled each other, and fast-pr's
runner-image check failed on the stale pin in source-pr.yml. Remove
source-pr.yml and carry its checks into fast-pr for non-documentation changes:
the patch-whitespace check (vendored trees excluded) and the CI/evidence tool
tests. Locally: runner-image pins PASS, ci tests pass, cargo test --locked 250
passed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
The afw line adds the cargo vendor tree (vendor/) and the flare-ui source
(third-party/). Their upstream files carry trailing whitespace and SSE golden
fixtures end with a blank line by format; editing them would break cargo's
vendor checksums and the fixtures. Exclude both trees from git diff --check in
source-pr and fast-pr, as the toolkit's gate does. No first-party file fails
the check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
Bring the Oct 18-20 CI hardening on main into the afw OS-bundle line before
promoting it to main. Resolution:
- src/{main,lib,hal_wire,management}.rs, Cargo.toml, Cargo.lock: the branch
side; it is a superset of main's (main's ALKANE_API_LISTEN management API now
lives in src/app.rs and is wired for every run mode).
- workflows: main's runner-image pin (ad56db2f) and conditional SSH install,
main's workflow_run triggers for the badge and Pages publishers, next's
CARGO_BUILD_JOBS=2; the branch's extra gates (image safety, .afw tests,
research/evidence, version checks, evidence-status artifact) are kept.
- ci/last-attempt-badge.py + its test, ci/publish-bench-pages.py: main's
(workflow_run events; stderr detail on failure). ci/cleanup-generated.py: the
branch's (also cleans the evidence-status file the kept step writes).
- README.md, ci/CONFORMANCE.md: the branch's (documents the web console and
the evidence-status report, both present in the merged tree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
Four-dimension review (correctness/security/reliability/maintainability) of today's
console/bus/login/dashboard/image work found no Critical/High; the HTTP parser,
login gate (un-bypassable), bus semantics and the HMAC/PBKDF2/SHA-256 math were
verified correct. The Medium findings are fixed here.
Security:
- Token-gate /api/files and /api/file (were session-only despite the docs/Security
page claiming token-gated - arbitrary root-readable file exfiltration).
- Neutralize settings-redirect header-splitting: __section/__tab are constrained to
safe slugs before going into the Location header (CRLF no longer injects).
- One token source (auth::rand_hex): fail loud + non-constant fallback instead of the
published "dev-csrf-token" / second-granular wsid when /dev/urandom is unreadable.
- Constant-time UI-token compare (auth::ct_eq); write auth.json 0600, dir 0700.
- Cap concurrent connections (64, 503 beyond) + 10s head-read deadline, bounding the
thread-per-connection flood on the open :80.
Reliability/correctness:
- Settings persistence now propagates its write error (was swallowed and reported as
success with a misleading comment) and writes atomically (temp+rename); deck save
atomic too. Auth::login returns None if the session insert failed.
- TuningLoop::set_target resets the PID accumulator on a mode change (the old target's
integral is in the old units) while keeping the operating point.
- Editable-deck JS: monotonic new-block ids (no collision after remove+add), default
source frequency (was power_w, not in the live map), symmetric drag-drop placement,
re-render after save. Drivers "stopped" shows the bare reason, not JSON-quoted.
Maintainability:
- New `form` module consolidates the three divergent percent_decode/field copies
(web/service/dashboard). Added a test asserting published state topics match the
registry contract.
Report in code-review-report.md (verdict, accepted-by-design posture incl. the
no-TLS / factory-creds residual risk, and a deferred list: ui.rs dead code, deck
assets extraction, target_label dedup). 206 lib tests + integration pass, clippy
-D warnings clean, no emojis. Image rebuilt with the fixed binary.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBPjAXpCwmigUov5eQk
Produce a flashable zynq-7010 image carrying the current console, and make the
image serve it on boot.
- image/make-zynq-afw.sh: cross-compiles alkane-os for armv7 (static musl,
matching the SDK rootfs; the ARM cross-gcc is the linker since the host cc
cannot link ARM objects), drops the binary and the image overlay into the SDK's
zynq rootfs, repacks the ramdisk under fakeroot (device nodes + root ownership
preserved), and packages zImage + dtb + rootfs into a .afw via ci/make-afw.sh.
- image/overlay/etc/init.d/S60alkane-web: starts `alkane-os --serve` after the
network, so the booted image serves the console (login + read-only API) on :80.
The SDK init owns board-detect/network/ssh and leaves the console to this.
- main.rs: fix serve_only to default the cgminer API to loopback (127.0.0.1:4028)
instead of 0.0.0.0, which bind_local (loopback-only) rejected - so plain
`--serve` now starts instead of failing to bind.
Verified: the build produces dist/alkane-os-0.1.0-zynq-7010-armv7.afw (check-afw
OK: kernel 4.3MB, dtb 11KB, rootfs 3.26MB), the rootfs carries the new binary +
the web-init overlay, and the static armv7 binary runs under qemu-arm and serves
the console end to end (login page renders, admin/admin -> 303 session,
/api/hardware open). dist/ is gitignored, so the artifact is not committed.
clippy -D warnings clean, no emojis.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBPjAXpCwmigUov5eQk
Make the main dashboard an editable deck, like wardenOS's dashboard, and split
the remaining settings into their own tabs.
- console.rs: dashboard/overview is now an editable deck - a .wdash-style
document stored on the box (bus dashboard/* verbs behind /api/dashboard) whose
blocks draw live values from the open miner-state API. A self-contained island
(CSS + JS in the flare-ui shell) renders the grid and, in edit mode, adds,
removes, reorders and saves blocks; Reset restores the template. Drivers,
Services and Monitor are now distinct settings tabs rather than bundled into
System/Security.
- schema/alkane-bb.json: add the settings/drivers, settings/services and
settings/monitor menus so the nav shows them (settings now has 11 tabs).
- service.rs: the deck directory falls back to a writable path off the miner so
the editable dashboard saves in a dev run too.
Verified on --serve-sim: the dashboard renders with an Edit toolbar, a deck
saves and reloads from /api/dashboard and Reset restores the 5-block template,
and every settings tab (system/tuning/pools/network/drivers/security/services/
monitor/logs/files/terminal) answers. 203 tests pass, clippy -D warnings clean,
no emojis.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBPjAXpCwmigUov5eQk
Gate the web console behind a sign-in, modeled on wardenOS's local auth (spec
d05): a local account whose password is stored only as a salted KDF hash, and a
`wsid` session cookie issued on login. wardenOS uses Argon2 from warden-verifier;
alkane-os is dependency-light, so auth.rs implements PBKDF2-HMAC-SHA256 on the
crate's own pure-Rust SHA-256 (pow::sha256) - a standard password KDF with no
new dependency (RFC 4231 / PBKDF2 test vectors included). Factory account is
admin/admin, persisted to /etc/alkane/auth.json when writable. OIDC and FLARE
bundle users are out of scope (no portal here).
- auth.rs: Account (salt+iters+hash), Auth (account + live sessions), login ->
wsid, valid, logout. Iterations tuned for the pure-Rust hash so a login stays
sub-second on a slow board while staying strong as defense-in-depth behind SSH.
- web.rs: WebContext gains the Auth; the request parser reads the wsid cookie;
route() gates everything behind a live session EXCEPT the read-only miner-state
JSON (/api/hardware|summary|control), which stays open as the interface of
record (also on the cgminer socket). /login, POST /auth/local (CSRF-checked,
sets the HttpOnly SameSite=Lax cookie) and POST /auth/logout added.
- console.rs: login_page - a standalone flare-ui card.
Verified on --serve-sim: unauthenticated GET / serves the login page, admin/admin
issues a session and the console renders, host/mutation endpoints 401 without a
session, miner-state reads stay open. 203 lib tests pass, 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
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
The vendored flare-ui was a Nov-4 snapshot with no recorded pin. Advance it to
the furthest-along upstream branch: blueflare/flare-ui `sprint`
(0e1f5a259faa), which is 247 commits beyond `main`, 71 beyond `next`, and
already contains `next` in full. The scattered 1-3 commit leads on individual
sp/* feature branches are unmerged side-work, not a more-ahead integration line,
so vendoring one of those would drop the 247-commit integration; `sprint` is the
single most-ahead branch.
This brings sprint's flare-ui crate additions (form.rs, page.rs, page/, table.rs
and the flare-ui-axum / flare-plugin-host crates) into the tree. Record the pin
in flare-ui.lock so the next re-vendor is reproducible.
alkane-os builds against it with no source changes: the console (console.rs) and
the rest compile clean, clippy -D warnings is clean, and 183 lib + integration
tests pass (including the dashboard schema tests, so the wschema model stayed
compatible). Re-verified the live console on sprint: --serve-sim boots, the
flare-ui shell and control pages render, and stop -> ambient:18000 -> start all
succeed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBPjAXpCwmigUov5eQk
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
Add the S21 Pro-class Amlogic A113D/AXG control board to the .afw producer
and the CI brick-prevention gate, matching the Zynq-7010 treatment.
- ci/afw_boards.py: a113d producer profile (arm64, preserve, buildable). Maps
the 7-mtd layout, names nvdata (mtd6) the only image-bearing partition, and
stages three images vmlinux.bin/devicetree.dtb/uramdisk.image.gz
(arm64-image/fdt/uimage) into it.
- ci/afw_manifest.py: validate_a113d enforces exactly those three images, the
formats, per-image ceilings, total <= nvdata usable, and that no
bootloader/spl/fip/tpl member is present and no non-nvdata partition carries
an image.
- ci/check-afw.py: the independent checker re-validates the produced bundle
(arm64, preserve, no FIP member, three named images with formats/ceilings,
total <= nvdata, mtd0-5 carry no image) and knows the arm64 Image magic.
- ci/test-afw.py: a113d bundle passes and installs all three into nvdata;
non-arm64 kernel, oversize kernel, an added FIP member, and a preserved mtd
made to carry an image are each refused.
All 37 afw tests pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qHxYpv7yf7Ah57g4rQ
Adds a buildable zynq-7010 profile and its .afw brick-prevention gate, so the
proven Zynq image is a first-class .afw like cv1835/am335x.
- afw_boards.py: full zynq-7010 profile (armv7, preserve; kernel(zimage)+dtb(fdt)
into mtd0, rootfs(cpio-gzip) into mtd1); new strict 'zimage' SAFE_IMAGE_FORMAT.
- afw_manifest.py + check-afw.py: validate_zynq / the zynq-7010 gate - exactly the
kernel/dtb/rootfs image set, correct formats, size ceilings (kernel <= 0x500000
fits the slot, dtb <= 0x20000, rootfs <= 0x2000000 fits mtd1), and NO
bootloader/spl/BOOT.bin member (stock BOOT.bin + FPGA bitstream preserved). The
per-unit kernel-slot offset is placed by the install method (differs S17/S19),
so the gate enforces formats+ceilings+policy, not a fixed offset map.
- check-afw: strict zimage magic (0x016f2818 at 0x24).
- tests: good bundle, non-zImage kernel, oversize kernel, bootloader-member refusals.
Built + double-gated the real bundle: alkane-os-0.1.0-zynq-7010-armv7.afw
(kernel 4.1 MiB, dtb 11 KB, rootfs 2.5 MiB). Full afw suite green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qHxYpv7yf7Ah57g4rQ
Mirrors the alkane-sdk tier-3 plan gate on the producer side so a from-stock
bundle can be built and verified. The am335x-stock profile writes our non-RSA
U-Boot to mtd4 (legacy firmware uImage, ih_type 5) plus kernel/dtb/root, and:
- afw_boards.py: am335x-stock profile (bootloader_policy include, mtd4 write
target at order 3, kernel at order 4, u-boot image).
- afw_manifest.py + check-afw.py: validate_am335x_stock - shares the 12-part map
and 0x780000 hole with tier-2 but asserts policy include, the 4-image set,
mtd4 ceiling 0x1c0000, the U-Boot member is a type-5 firmware uImage, and that
no SPL copy (mtd0-3) or bootenv (mtd5) is ever a write target.
- check_format: am335x uImage checks now cover am335x-stock, incl. u-boot type 5.
- tests: 3 am335x-stock producer cases (good 4-install bundle, wrong U-Boot type,
SPL-write refusal). Full afw suite 28 green; am335x tier-2 + cv1835 unchanged.
Built and double-gated the real bundle locally: alkane-os-0.1.0-am335x-stock-arm.afw
(u-boot 723440 B type5 -> mtd4, kernel -> mtd7, dtb -> mtd6, rootfs -> mtd8).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qHxYpv7yf7Ah57g4rQ
The producer verified the bundle but never wrote the SHA256SUMS release
artifact, so a stale file from a previous build could describe a different
bundle. Write it (overwrite) from the finished file.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B1W6qHxYpv7yf7Ah57g4rQ
Assert that the checker accepts a matching plan size and rejects a plan
whose p1 size disagrees with the manifest.
Co-Authored-By: DeepSeek Harness <noreply@deepseek.com>
Replace the release-tree producer with a board-aware schema-2 manifest,
fixed-order ustar packing, optional Ed25519 signing, and a checker that
rejects a wrong board or arch, a missing or oversized image, a bootloader
member under preserve, a hash or size mismatch, and a traversal member.
Document the format and add offline fixtures for every refusal.
Co-Authored-By: DeepSeek Harness <noreply@deepseek.com>
Dashboard (src/dashboard.rs): the on-box UI now renders from
schema/alkane-bb.json through flare-ui and wschema. The sidebar, the tab strip
and all 20 settings controls come from the schema; the host boundary does what
the crates require - validate the submitted batch with wschema before persisting,
ignore keys that are not in the schema, and never write on a rejected form.
Settings live in /etc/alkane/settings.json (temp dir when the root is read-only).
Web: GET /<section> and /<section>/<tab> render the dashboard, /assets/* serves
the crate's embedded token/component/theme stylesheets, POST /settings applies a
form. The existing JSON API routes are untouched.
Settings wired (all from real runtime knobs): tuning target mode and its four
values, frequency ceiling, the PID gains and limits in milli-units (the schema
has integer kinds only), fan zones/duty/sweep, detection ports and budget,
profile database path, board name.
Tests: 10 dashboard tests (schema loads, all settings present, page renders
inputs, valid submit persists and reloads, out-of-range rejected with nothing
written, unknown keys ignored, percent decoding) plus the existing 162. 172 pass.
Packaging (ci/make-afw.sh): .afw modelled on the Warden .wfw bundle - strict
POSIX ustar, manifest first, payload verified by size and sha256 - with three
deliberate differences: the payload is gzip-compressed, the manifest carries
and x86_64, and both appear in the file name
(alkane-os-0.1.0-am335x-bb-armv7.afw) so a bundle cannot be mistaken for another
family. Signature is declared in the manifest until a release key
exists; the sha256 is the only integrity claim today.
Spike, not the final UI: it answers whether flare-ui can drive Alkane OS's
on-box pages, and what it costs.
What works:
- schema/alkane-bb.json authors the sidebar as data (3 sections, 14 tabs);
- src/bin/ui-spike.rs renders it through flare_ui::nav + flare_ui::shell, so
the unified sidebar, ordering and surface filtering come from the schema
rather than from hand-written HTML;
- the render uses the shared bf- design tokens, the same ones the rest of the
suite uses.
Size, measured rather than assumed (armv7, release, stripped):
ui-baseline 323 KiB (maud + serde_json, no flare-ui)
ui-spike 771 KiB (flare-ui + wschema + sha2)
marginal 448 KiB
Vendoring: third-party/flare-ui is the full v0.2.9 tree pinned in
flare-ui/flare-ui.lock (a partial archive does not compile, since the crate
include_str!s assets from dash-editor/). vendor/ is re-generated as a cargo
directory source with the new registry dependencies (maud, sha2, typenum,
digest, generic-array, block-buffer, crypto-common, cfg-if, etc.) so the build
still works offline. third-party/README.md records how to re-pin.
The SDK refuses a bad payload before writing it; this is the same rule on the
producing side, so a release cannot ship an image that would not boot or would
not fit the partition it targets.
Checks every payload artefact it can find: magic must match the claimed format
(FDT d00dfeed, legacy uImage 27051956, raw ARM zImage 016f2818 at 0x24) and the
size must fit the partition. Absent artefacts pass with a note, so the gate can
be wired before the first image exists.
Proven both ways: it accepts the four payload files that actually installed
OurOS, and rejects a zImage renamed to the ramdisk slot on size.
The design system retired every radius step on 2026-07-14 (tokens/radius.json
resolves xs..pill to 0), so the cards, buttons, inputs, pills and code blocks
lose their rounded corners.
Below 901px the rail is now the design's mobile menu: a full-screen drawer on
the page background with the brand and a close control in its head, rows split
by 1px dividers. It closes by the X, the backdrop, Escape, or picking a
destination; without a script the :target fragment still opens it.
Settings stops being a bare list: System now groups Identity, Network and
Updates the way the Warden console does, and Drivers groups Chains and
Firmware. Verified on the bench S21 Pro at port 80.
Follows the rebuild's design rather than inventing a palette: the 232px navy
rail from portal.css (#192858), its 44px head and appbar, cyan-400 for the
current page and its 2px left marker, 18px stroke icons, 11px uppercase
headings with 2px tracking, and the navy surface/border steps from tokens.css.
Behaviour comes from the same place: one native <details> per group so the tree
opens without a script and the current page's path renders open, a one-item
group rendered as a plain link, aria-current instead of a class, inward focus
rings because the rail scrolls, and an off-canvas rail below 901px reopened by
a :target fragment. A collapse toggle shrinks it to the 40px icon cell and
remembers the choice.
Verified on the bench S21 Pro: the page on port 80 renders the rail with icons
and the open Mining section.
The UI follows the Warden/FLARE console shape rather than inventing one: a
fixed sidebar of groups and items, hash-routed pages, and dashboards that are a
JSON document an operator edits in place, with a default template per deck and
server-side caps on what a save may contain.
Sections: Dashboard and Mining/Overview are editable dashboards (drag to
reorder, add a block, save, reset). Mining also serves Hashboards, Power Supply
and Fans from the hardware document. Settings serves System, Drivers, Security,
Services, Monitor, Logs, Files and Terminal. Files and Terminal are gated on a
token at /var/lib/alkane/ui-token so a shared network cannot use them.
Served on port 80 of the miner's own address (8080 if 80 cannot be bound), and
started from the runlevel so the page is up without an operator. The JSON API
remains the interface of record: every value shown is also at /api/, and nothing
is reachable only through the page.
Verified: 165 tests, clippy clean, all 13 pages answering, and on the bench S21
Pro the UI answers on port 80 after an unattended reboot.
A client watching the API during a run saw the boot-time snapshot: status was
published at boot and again when the loop exited, so frequency and voltage were
frozen at their starting values for the whole run. The loop now publishes each
period, which is what makes the UI and the API honest while the machine is
actually mining.
--check-profiles parses a database and reports schema, count and validation,
so envelope work can be checked before an image ever boots with it. An inverted
envelope is rejected with a non-zero exit.
The conformance power check now sets 500 MHz before reading, because a backend
that always reports 0 W passed a range check while being useless to a
power-target loop. It must now report a plausible non-zero draw at a known
operating point.
A family backend is only useful if it answers the contract the OS expects, and
until now the only way to know was to boot a board and watch it fail somewhere
downstream. --check-hal walks the contract in order (capabilities, probe,
EEPROM, PSU, frequency and temperature, power, fan) and reports each check
separately, using a fresh connection per check so one desynchronised exchange
cannot invalidate the rest.
It catches the failure modes that matter for autodetect: a backend that does
not advertise chain probing, one that reports an inverted envelope, one that
returns an implausible temperature or power, and one that cannot accept
frequency or fan commands.
The codec and session had only ever been tested in memory. This runs the real
path over TCP: the client handshakes, opens a channel, receives SetNewPrevHash
and an active NewMiningJob, submits a share and consumes the acknowledgement,
against a mock pool that speaks the same frames.
It also pins the ordering the protocol depends on: the job is interpreted only
after the prev hash, and the submit sequence starts at one.
Zones now respond to the fan that actually cools them (round-robin by zone
index), so the active fan sweep can be demonstrated end to end without
hardware: with two fans and three zones the learned map is fan 0 -> zones 0,2
and fan 1 -> zone 1, persisted to the map file.
The settle interval is configurable (ALKANE_FAN_SETTLE_MS) because the real
twenty-second settle makes an interactive sweep last minutes.
The reference server answers the real ALKH contract from a fixed machine
description, so the whole OS path can run on a development host and a backend
author has a concrete example of every opcode. It serves detection, frequency,
fan, temperature and power over one socket.
Power was the missing measurement: a power target could not regulate because
the HAL had no way to report watts, so READ_POWER joins the verbs behind
CAP_POWER. With it, --boot against the reference server settles the loop at
623 MHz for a 2400 W target (4 W per MHz in the model) instead of holding at
the boot frequency.
Fan mapping stays opt-in for --boot (ALKANE_FAN_FANS/ALKANE_FAN_ZONES) because
it perturbs the machine and takes minutes.
The tuner produced a frequency the hardware contract had no way to apply, so
detection and tuning could not affect a real board. SET_CHAIN_FREQUENCY joins
the HAL verbs behind its own capability bit, and HalClient refuses to use it
when the backend does not advertise it.
--boot HAL_SOCKET PROFILES.json TARGET [PIC|NOPIC] [TICKS] now runs the real
path: detect over the socket, serve the API and UI, read the hottest sensor,
tick the runtime, apply the frequency to each active chain and the fan duty
when the target owns the fan, then print the published document. A missing
socket exits 1 with a backend error instead of a half-booted miner.
boot_from_hal connects the board backend, detects through the actual HAL
verbs, runs the one-time fan sweep through the same socket, publishes the
snapshot and returns the runtime and the learned map.
The tests drive it against a mock backend that speaks the real wire protocol
(ALKH framing, CAPABILITIES, PROBE_CHAIN, READ_EEPROM, IDENTIFY_PSU), so the
detection path is exercised end to end rather than assumed, and a missing
socket surfaces as a backend error instead of a half-booted miner.
The live frequency and the boot-time operating point were both in the
hardware document, so a client could read 563 MHz in one field and 300 MHz in
another. The document and the cgminer stats now both derive the operating point
from the live frequency and the envelope, which is also what makes the reported
voltage correct.
Boards do not run at a fixed voltage across their frequency range, so the
reported operating point was describing a machine that does not exist: the
voltage stayed at the boot value while the tuner moved the frequency.
Envelope::voltage_for interpolates linearly between the profile floor and
ceiling and clamps outside it, and MinerRuntime now reports the voltage that
pairs with the applied frequency. A single-frequency envelope reports its
floor without dividing by zero.
alkane-os --self-check drives the whole chain without hardware: parse the
example profile database, detect three BM1362 chains with a dead EEPROM,
identify an APW12, boot the runtime, tick toward a power target and print the
published hardware document. It fails loudly if the profile database does not
parse, detection refuses, the tuner does not move, or the chain set is wrong,
which makes it usable as a bench smoke test on a bare control board.
profiles.example.json is a shape example, not validated hardware data: the
envelopes are placeholders until real captures fill the database.
Mapping fans perturbs the machine, so it is done once and stored. ensure_map
reuses a stored map only when the fan and sensor counts match the current
machine; a mismatch is ignored rather than trusted, because applying a map
learned on four fans to a two-fan machine would mis-control thermals.
The store is a small schema-1 document; corrupt or foreign files are ignored
and trigger a fresh sweep instead of failing the boot.
app::boot is the sequence a family image runs at start-up: validate the
profile database, detect the hardware through the backend, build the runtime
with the operator target and fault policy, and publish the API snapshot in one
step. It returns the runtime or an explicit BootError, so a refusal is visible
to the caller instead of a half-configured miner.
Target labels are defined once (power:3000, hashrate:200, ambient:20000,
fan:100) so the API, UI and logs cannot drift apart.
Add an app layer that binds and starts the management API and the web UI,
publishes the runtime snapshot, and exposes a bound-address result so callers
can discover ephemeral ports. The binary now uses the same function the tests
use, so the wiring CI exercises is the wiring that runs on a board, and it
gained ALKANE_WEB_LISTEN alongside ALKANE_API_LISTEN.
The snapshot is built from the live runtime: active chains, stop reason and
the last applied frequency rather than the boot default.
TcpLink turns a TCP stream into framed SV2 messages: it buffers partial reads
and returns one frame at a time, so a frame split across packets is not a
protocol error and two frames in one read are still delivered separately. A
closed stream is an error, never an empty frame.
The fallback policy permits Stratum V1 only when the operator allowed it and
the failure is not transport-level: a dead route or a dropped stream fails
identically on V1, so falling back there would only delay the real error. V1
failures never loop back to V2.
Tie the detection plan, the fault ladder and the tuner together, where their
order is decided: a stopped machine is never tuned, a disabled chain is never
dispatched to, and a missing measurement holds the last command instead of
inventing one.
MinerRuntime exposes the active chain set, the stop reason and an operating
point that reflects the last applied command rather than the boot-time
default, which is what the API snapshot reports.
The miner now serves a single page that polls /api/hardware and shows profile,
chip, PSU, operating point, chains and EEPROM state, active chains, target and
whether hashing stopped. The page is a convenience; the API routes it uses are
the interface of record, so a JSON-only client loses nothing.
No framework and no new dependency: the request parser is bounded, only GET is
accepted, responses close the connection and are not cached. MiningStatus now
exposes its hardware and summary documents so the UI and the cgminer-style
server build them once, in one place.
Drive the client half of an SV2 mining connection: send SetupConnection,
verify the success reply, open a standard channel and remember its id, target
and extranonce prefix. Afterwards the session interprets NewMiningJob,
SetNewPrevHash, SetTarget and share acknowledgements, and submits standard
shares with a monotonic sequence number.
State is explicit rather than assumed: a job that arrives before any
SetNewPrevHash reports no previous hash instead of a zero one, a setup or
channel rejection carries the server's error code, and an unknown message is
ignored instead of killing the session.
Implement the client half of SV2 as framed messages: the 6-byte header
(extension_type U16, msg_type U8, msg_length U24), SetupConnection and its
success reply, OpenStandardMiningChannel and its success reply, NewMiningJob
with both the active and future ntime forms, SetNewPrevHash and
SubmitSharesStandard.
Field layouts and message identifiers come from the published specification
(03-Protocol-Overview 3.2/3.6, 08-Message-Types, 05-Mining-Protocol 5.3) and
were checked against it rather than recalled. Decoding is strict: truncated
payloads, bad option markers, bad UTF-8 and a non-finite or negative hashrate
are protocol errors, never defaults.
Each dispatched work slot comes from exactly one pool, and the router hands
out slots in proportion to the configured weights. Smooth weighted
round-robin is used instead of a plain repeating pattern because it keeps the
mix correct at every prefix: a miner with three chains still gets the intended
ratio in the first three slots, not only after a hundred.
Weights parse from a simple list, a zero-weight pool never receives work, and
malformed configurations (empty, all zero, non-numeric, too many pools) are
refused rather than silently normalised.
The cgminer-compatible surface only answered summary and version, which hides
everything detection learned. The API now also answers hardware (profile, chip,
PSU, envelope, operating point, per-chain chip count and EEPROM state, fan
zones, active chains, stop reason, target and live frequency) and stats (the
same data in cgminer's flat STATS shape).
MiningStatus carries an optional HardwareSnapshot behind a mutex, so a client
can tell unavailable apart from an empty machine, and unknown commands still
refuse. Chip models gained a stable API name so the wire strings do not drift
from the enum.
Ambient mode holds the hottest sensor a configured margin above the measured
intake temperature, which is the efficiency-at-this-ambient operating point;
missing either sensor is an error rather than a guess. Max-fan mode pins the
fan at its cap, ramps frequency toward the envelope ceiling, and still defers
to the thermal guard.
step() now returns a Command carrying the frequency and, when the target owns
the fan, the duty to apply. The max-fan ramp is explicit rather than a
setpoint loop: a P controller fed its own output settles at half the ceiling,
which the ramp test caught.