Third review round (over the wave 3/4 fixes) surfaced further findings, mostly in
new code paths; this clears them:
- HIGH the fully-built "Boards" column (Column::Hashboards: renderer, sort/filter
logic, tests, a self-test check) was missing from ALL_COLUMNS, so it was
unreachable in the UI and its self-test check was dead. Added to ALL_COLUMNS
(opt-in; Health still shows composite board health by default) and the self-test
now makes it visible -- the dot-sentinel check is live again.
- HIGH apply_pools() could start a pool write during a restore-to-stock (it sets
self.action directly, bypassing start_action's guard) -> same restore guard.
- HIGH superseding an in-flight action/pools job left the old miners' Health cells
frozen on the "…ing" label forever (the replaced handle's drain never runs) ->
clear the superseded action's op-status.
- HIGH clean_antminer() byte-sliced a miner-supplied model string without a
char-boundary check (panic DoS) -> use get(..9).
- MED access-probe errors were silently discarded -> surfaced in the indicator.
- MED the pool-password file was briefly world-readable before chmod -> created
0600 from the start (OpenOptions mode).
- MED a miner-controlled log response was buffered unbounded (OOM DoS) -> capped.
- MED the language-menu id range was hardcoded (and 790-794 collided with the
pool-preset / fw-preset dialog ids!) -> derived from Lang::all() and moved the
dialog ids to a clear block.
- LOW restore_vnish now sends the unlock body via stdin (password off argv), and
the LuxOS restore treats a reboot-dropped/empty reply as success.
Remaining round-3 findings are the previously-accepted perf tradeoffs (bulk-serial
writes, per-tick refill, per-render health recompute, linear upsert), documented
in code and in code-review-report.md.
99 tests + clippy-clean + selftest green (Boards-column check now live).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
Clears the rest of the second review round's confirmed findings:
- HIGH the Boards numeric filter compared the composite sort score (online*100+
total) instead of the board count, so a filter like "Boards <= 3" matched
nothing on healthy 3-board miners. num_value now returns the detected count;
regression-tested with per-board health present (the path the old test missed).
- HIGH the WhatsMiner access probe ignored the operator's saved scan password
(tried only admin/super), mis-reporting writable miners as locked. It now tries
the caller's password first.
- HIGH firmware flash and config actions were not blocked during a restore-to-
stock; start_action and both flash guards now refuse while a restore runs.
- MED log tail() could panic slicing at a non-UTF8 char boundary -> nudge to a
boundary first (regression-tested).
- MED board_index_from_text grabbed an unrelated number far past the keyword
(e.g. a temperature) -> only accept a number immediately after the keyword.
- MED a restore worker-thread spawn failure wedged the restore subsystem forever
-> emit Done on spawn failure and treat a disconnected channel as done.
- MED LuxOS restore reported failure when the miner rebooted mid-reply -> an empty
reply or dropped connection after a successful logon is the expected reboot.
- MED two tests raced on the process-global $HOME -> a shared serialization lock.
- LOW CSV export now neutralizes spreadsheet formula-injection prefixes on
miner-supplied fields.
- Made miner_probe's global-only credential resolution explicit (it can't share
the GUI's per-firmware configured_factory across the bin boundary).
99 tests (+3 regression tests) + clippy-clean + selftest green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
Second review round (over the wave 1/2 fixes) surfaced further, mostly new-path
findings; this clears the substantive ones:
- HIGH log_scan.rs passed miner admin credentials on the curl command line (same
class as the access-probe leak fixed in wave 1). Its curl() now takes optional
stdin: the Antminer digest login goes through a curl config on stdin (-K -),
the VNish unlock password through the POST body on stdin (-d @-), and the
timeout path reaps the child so it no longer leaks a zombie.
- MEDIUM JSON injection/breakage: the VNish unlock body and the LuxOS
uninstall command spliced a password / miner-supplied SessionID into JSON with
format!. Both now build the JSON with serde_json, which escapes correctly.
- MEDIUM column scan cost: fill_rows computed table_columns() twice (my wave-2
built_columns check added one), and with auto-hide-empty on that scans every
cell of every row each time. It is now computed once and reused.
Accepted, documented tradeoffs from this round: miner_probe's setpools takes the
pool password as a CLI arg (inherent to a diagnostic CLI; it is the low-sensitivity
mining worker password), MinerRow::upsert_into's linear scan is fine at the tool's
fleet scale (hundreds), and bulk config-action writes stay serial deliberately.
96 tests + clippy-clean + selftest green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
From the recursive multi-agent review (18 confirmed findings). This wave clears
the critical, four highs, and several mediums/lows:
- CRITICAL restore.rs: a Braiins SSH restore reported SUCCESS on a wrong password
or unreachable miner. run_with_timeout now captures the exit code and drains
stderr on its own thread (also fixing the medium stderr-pipe stall), and a new
testable classify_braiins() treats an ssh auth/connection failure (stderr
diagnostic, empty stdout, non-zero exit) as failure while still reading a
dropped connection / timeout as the expected reboot. Unit-tested.
- HIGH restore exclusivity: apply_restore_confirm now refuses when a scan/refresh/
action/flash or another restore is in flight, so this destructive action never
overlaps or orphans a running restore handle.
- HIGH secrets off the command line: Braiins SSH uses `sshpass -e` (env, not -p),
and the access-probe curl passes credentials through a config on stdin (-K -)
instead of `-u user:pass`; both were visible in the process list. New masked
password field (wxTE_PASSWORD bridge) so the Credentials dialog no longer
renders saved passwords in the clear.
- MEDIUM correctness: per-board Chip-temp readings are now index-aligned with the
boards (a missing middle board shows "-" instead of shifting later boards left).
- MEDIUM: saved pool lists (which can hold a pool password) are chmod 0600.
- LOW: access-probe curl timeout now reaps the child (no zombie).
95 tests (+classify_braiins) + clippy-clean + selftest green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
Cleared all clippy findings in alkane-gui (cargo clippy --no-deps): mechanical
fixes via clippy --fix (redundant imports, useless format!, manual_contains,
manual_is_multiple_of, unnecessary_map_or, unused parens) plus manual fixes:
- type_complexity: factored the segment tuple into model::{Rgb, Segment} aliases.
- large_enum_variant: #[allow] on ScanMsg/RefreshMsg with a note -- Row is the
common variant, so boxing it to shrink the rare Started/Done would add an
allocation per miner on the hot path.
- dead code: removed unused SHAPE_PULSE_DOT, ColorKind::Accent, clear_op_status,
and RestoreMsg's unread `total`; kept the restore/access-probe cancel handles
(workers honour cancellation; UI stop control pending) under #[allow].
- question_mark, needless_range_loop, drop_non_drop, doc_lazy_continuation fixes.
Only vendored wx-rs warnings remain (out of scope). Added LICENSE-MIT and
LICENSE-APACHE (Cargo.toml already declares MIT OR Apache-2.0). 94 tests +
selftest green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Djv3oncM4LxTS5tb61Ako6
Adds a right-click "Restore to stock firmware..." action for aftermarket-firmware
miners, behind a strong typed (RESTORE) confirmation that lists exactly which
miners will be reverted. All three supported firmwares self-restore for free (the
stock image is retained on-device; no image is uploaded), per the live-confirmed
flows in the miner-firmware wiki:
- VNish: POST /api/v1/unlock -> bearer -> POST /api/v1/firmware/remove (~3 s)
- LuxOS: luxminer :4028 logon -> uninstallluxos (credential-free)
- Braiins: SSH `uninstall.sh` (re-flashes the on-NAND stock backup)
New crates/alkane-gui/src/restore.rs runs the revert on a background thread with a
result channel and a fake-scan demo path; VNish password reuses the round 12 #13
per-firmware default, Braiins uses the saved SSH login. The menu item only appears
when the selection includes a revertible firmware.
Also fixes an event-routing bug introduced in #12/#8a: the log-viewer Close and
restore OK/Cancel buttons were mistakenly handled in the MenuItem match instead
of ButtonClicked, so they never fired -- this restores #12's log-viewer Close
button too. Moved them to the ButtonClicked match.
Verified under Xvfb + openbox: the menu item shows for VNish/LuxOS/Braiins rows;
the confirm dialog renders the targets and typed gate; typing RESTORE runs the
(fake) revert and closes the dialog; a wrong value is rejected and the dialog
stays open. restore unit test + GUI self-test pass. NOTE: no live restore was
run -- the designated test range 10.2.1.0/24 is currently empty, and production
miners were not touched; the live flash awaits a unit in that range.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh