From d834055eacad5e7ac04806521133367fa9cce67a Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Wed, 7 Oct 2026 14:29:41 +0000 Subject: [PATCH] MF-11 update-return (0.3.21), the app half on release-0.3.21: the Windows update helper owns the return (the exe set kept beside the app, the app launched by the helper, api/state polled 120 s, the kept set restored when nothing answers, one intake line either way; the installer stays silent under /IGNOTA=2), the window host restarts a dead engine and answers the Restart Manager, the first act after an update is the read-back line and a FAULT pc-restart line when the PC came up from a power loss; the tuner never asks above a card's measured efficient point (the 5090 at 308 W, floored at the vendor's 400 W) unless Power control is on and the user raised the cap, and a refused cap is asked again at 2 and 10 min then reported as FAULT power-cap; the job-channel ping on every wake request (7 October 2026, PC 2 lost power at 10:46Z; the relay half stays on update-return) Co-Authored-By: Claude Fable 5.1 --- app/igneum-app/src/bootcheck.rs | 73 ++++++ app/igneum-app/src/ember.rs | 112 ++++++++- app/igneum-app/src/engine.rs | 80 +++++- app/igneum-app/src/jobrun.rs | 79 +++++- app/igneum-app/src/main.rs | 1 + app/igneum-app/src/ota.rs | 382 ++++++++++++++++++++++++++--- app/igneum-app/src/platform.rs | 2 +- app/windows/host.cpp | 75 +++++- packaging/windows/Igneum-Miner.iss | 5 +- 9 files changed, 752 insertions(+), 57 deletions(-) create mode 100644 app/igneum-app/src/bootcheck.rs diff --git a/app/igneum-app/src/bootcheck.rs b/app/igneum-app/src/bootcheck.rs new file mode 100644 index 000000000..0f289b181 --- /dev/null +++ b/app/igneum-app/src/bootcheck.rs @@ -0,0 +1,73 @@ +//! Did this PC come up from a power loss or a hard reset? (MF-11, 7 October 2026: PC 2 dropped twice in one day with +//! Kernel-Power 41 and EventLog 6008 at the next boot, no bugcheck, no dump, and nothing said so until a person read +//! the event log.) Windows: the System log's event 41 (Kernel-Power, critical) or 6008 (EventLog, "the previous +//! shutdown was unexpected") inside the last 15 minutes, read once at the engine's start through wevtutil; the engine +//! logs one `FAULT pc-restart:` line to the intake. Other platforms: nothing (a Mac's power log is not this class). + +use std::process::Command; +use std::time::Duration; + +/// How far back the start-up check looks: an engine starts at login, inside a minute or two of the boot. +pub const WINDOW_MS: u64 = 15 * 60 * 1000; + +/// One line naming the event, or None when the boot was clean, the query failed, or this is not Windows. +pub fn unexpected_restart() -> Option { + if !cfg!(windows) { + return None; + } + let query = format!("*[System[(EventID=41 or EventID=6008) and TimeCreated[timediff(@SystemTime) <= {WINDOW_MS}]]]"); + let mut c = Command::new(crate::platform::tool("wevtutil")); + c.args(["qe", "System", &format!("/q:{query}"), "/f:text", "/c:2", "/rd:true"]); + let out = crate::detect::run_timeout(&mut c, None, Duration::from_secs(20))?; + parse_events(&out) +} + +/// The reading of wevtutil's text output: the newest 41 or 6008 as "event 41 (Kernel-Power) at