feat(doctor): battery health readout (#80)
Some checks failed
Check / eval (push) Has been cancelled
Some checks failed
Check / eval (push) Has been cancelled
Report-only cycle_count + retained capacity (charge_* or energy_*) as % of design on system batteries; soft warn below 70% of design; skip when attrs missing. NOMARCHY_POWER_SUPPLY_ROOT for the checks.doctor fixture (test_power has no cycle/design attrs). Verified: V2 — nix flake check --no-build; checks.doctor green (fake BAT0 cycles/% + Device-scope ignore); local BAT0 smoke (energy_*).
This commit is contained in:
@@ -378,11 +378,10 @@ For contributors (and power users who will PR):
|
||||
## 10. Doctor and hardware health (current vs target)
|
||||
|
||||
**Today** (`nomarchy-doctor`): failed units, disk space, theme-state
|
||||
validity/git, generation age, snapper timer. **No** Wi‑Fi, GPU, fwupd,
|
||||
or fingerprint checks.
|
||||
|
||||
**Target checks** (queued, all read-only, each failure prints one fix
|
||||
command — same doctor contract):
|
||||
validity/git, generation age, snapper; hardware section self-gates per
|
||||
machine (NetworkManager, audio sink, GPU smoke, fprintd, fwupd, charge
|
||||
limit, battery health, hibernate/zram). All read-only; each ✖ prints one
|
||||
fix command.
|
||||
|
||||
| Check | Pass condition | Suggested fix line |
|
||||
|-------|----------------|--------------------|
|
||||
@@ -391,7 +390,9 @@ command — same doctor contract):
|
||||
| GPU accel | `glxinfo`/`vainfo` smoke (if installed) | check `hardwareProfile` / drivers |
|
||||
| Fingerprint | if USB VID matched / fprintd unit | `fprintd-enroll` or enable option |
|
||||
| fwupd | daemon active; optional “updates pending” warn | `fwupdmgr get-updates` |
|
||||
| Battery threshold | if laptop + limit set, sysfs writable | power docs |
|
||||
| Battery threshold | if laptop + limit set, sysfs reports it | power docs / restart charge-limit unit |
|
||||
| Battery health | cycle_count and/or charge\|energy_full÷design % when sysfs exports them | report-only (warn if <70% of design) |
|
||||
| Hibernate / zram | disk swap + resume=; zram active | docs/MIGRATION.md → Enabling hibernation |
|
||||
|
||||
## 11. Option quick reference
|
||||
|
||||
|
||||
@@ -363,6 +363,12 @@ Design/decision records and a running log of shipped work (items marked
|
||||
`checks.doctor` VM test asserts the `hibernate` row renders. (Gotcha
|
||||
recorded: the script runs `set -euo pipefail`, so a no-match `grep` inside
|
||||
`$(…)` or a `cond && action` aborts it — use `|| true` and `if`.)
|
||||
✓ **Doctor battery health (#80, `VISION § C`):** report-only
|
||||
`cycle_count` + retained capacity (`charge_full`/`charge_full_design` or
|
||||
`energy_*`) as `% of design`, system batteries only (not Device-scope
|
||||
peripherals). Self-gates when attrs missing; soft warn below 70% of
|
||||
design. `NOMARCHY_POWER_SUPPLY_ROOT` for the `checks.doctor` fixture
|
||||
(`test_power` has no cycle/design attrs).
|
||||
- ✓ **Hibernate double-unlock:** on resume from hibernate the LUKS
|
||||
passphrase already gates the machine, but locking hyprlock before sleep
|
||||
meant a second password. Fixed by *not locking* before an encrypted
|
||||
|
||||
@@ -82,7 +82,7 @@ Reference: [HARDWARE.md](HARDWARE.md) §4–§5, §10.
|
||||
|------|--------|-------|
|
||||
| **Dock life** | Lid closed + external only, wake, default audio sink on undock | Display profiles exist — polish edge cases |
|
||||
| **Hibernate/sleep confidence** | Doctor: resume device, swap size, clean suspend journal | Trust > new power UI |
|
||||
| **Battery health readout** | Cycles / charge limit where sysfs allows | Report-only |
|
||||
| **Battery health readout** ✓ | Cycles + design capacity % in doctor where sysfs allows | ✓ shipped #80 (report-only; charge limit is a separate row) |
|
||||
| **Charge-limit instant apply** | Already PROPOSED `[blocked:hw]` | Keep privilege tradeoff explicit |
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user