feat(doctor): #147 — flag machine state the flake never set; linger is the worked example
Some checks failed
Check / eval (push) Has been cancelled

/var/lib survives a migration untouched, and a stray pre-Nomarchy
Linger=yes marker shaped the QA box's session behavior for six months
with nothing in the flake to show for it. Ship the class as guards:

- nomarchy-doctor: new machine-state-drift check after the flake-checkout
  check — loginctl show-user -p Linger; "yes" warns (nothing is broken —
  it is drift) and prints the disable-linger fix; unknown-to-logind skips.
- docs/MIGRATION.md § Post-migration cleanup: "/var/lib machine state
  survives migration" — the worked example and the general suspicion rule.
- checks.doctor: linger sub-case — warn fires under enable-linger, exit
  stays 0, warning clears after disable-linger.

Deliberately NOT hardening the session wiring against the portal-gtk
restart race linger enabled: a clean install cannot reach that state.
The Waybar exec-once loose thread survives as BACKLOG #149.

Verification: V2 — shellcheck clean, nix flake check --no-build green,
nix build .#checks.x86_64-linux.doctor green (both branches exercised).
Implementation by a Sonnet subagent; design and review on Fable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-17 07:44:43 +01:00
parent 8fc0a9bc29
commit e324876eb7
6 changed files with 80 additions and 57 deletions

View File

@@ -19,6 +19,21 @@ Template:
---
## 2026-07-17 — #147: doctor learns to see machine state the flake never set
- **Task:** BACKLOG #147 (promoted from PROPOSED by Bernardo in-session).
- **Did:** `nomarchy-doctor` gains a machine-state-drift check — linger as the
worked example (`loginctl show-user -p Linger`; `yes` → warn + fix command,
unknown-to-logind → skip); MIGRATION.md § Post-migration cleanup gains
"`/var/lib` machine state survives migration"; `checks.doctor` grew the
warn-fires/warn-clears linger sub-case. Implementation delegated to a
Sonnet agent, design + review here. Loose thread preserved as #149.
- **Verified:** V2 — shellcheck clean, `nix flake check --no-build` green,
`nix build .#checks.x86_64-linux.doctor` green (linger sub-case exercised
both branches, doctor exit 0 throughout).
- **Pending:** nothing hardware-blocked; the real-world case (QA box linger)
was already fixed by hand 2026-07-16.
- **Next suggestion:** hardware hints, then #148 review.
## 2026-07-17 — Live triage with Bernardo: #114 ships as docs; rulings on #120/#134; #143 checked
- **Task:** Bernardo triaged PROPOSED in-session: #148/#147/hardware-hints
promoted (in flight as separate commits), #120 re-affirmed deferred, #134