fix(power): exempt charge-limit oneshot from start rate limiting
All checks were successful
Check / eval (push) Successful in 3m9s

Round 1 of #101's V3 failed on TuringMachine (2026-07-13 18:16): a
SPACED dock/AC event storm — each run finishing before the next event —
never coalesces, so 5 successful sub-second starts inside systemd's
default 10s window tripped start-limit-hit and marked the unit failed
(doctor badge) although every run succeeded. The write is idempotent
and cheap; rate limiting it only manufactures false failures, so the
unit sets StartLimitIntervalSec=0.

checks.battery-charge-limit now asserts the exemption and runs 8
sequential starts expecting a clean, non-failed state; the original
mid-run coalescing phase is unchanged.

Verified: V2 — the check passes under KVM (exit 0). V0 flake check
green. V3 round 2 re-queued in HARDWARE-QUEUE.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-13 18:26:00 +01:00
parent 720d9a38fb
commit f7246941e8
4 changed files with 60 additions and 14 deletions

View File

@@ -64,6 +64,14 @@ in
description = "Apply battery charge end threshold from state or config";
wantedBy = [ "multi-user.target" ];
path = [ pkgs.jq pkgs.coreutils ];
# A sustained dock/AC event storm can land SPACED starts — each run
# finishes (~1s) before the next event, so nothing coalesces and 5
# successful starts in 10s trip systemd's default start limit: the
# unit is marked failed (start-limit-hit) although every run
# succeeded (T14s, 2026-07-13; the #101 coalescing only covers
# events that arrive DURING a run). The write is idempotent and
# sub-second — exempt it from rate limiting.
unitConfig.StartLimitIntervalSec = 0;
serviceConfig = {
Type = "oneshot";
};