feat(local): real display-powersave drain-gate condition
Make the inert display_powersave drain-gate seam real. While the host's
primary display is asleep/in powersave the deferred-processing drain gate
opens (debounced ~120s, wake closes immediately); when display state can't
be reliably detected the condition reports undetectable and the owner falls
back to the time window — it never claims asleep when it can't tell.
New solstone/think/display_powersave.py: a read-only, exception-total
detector (Linux DRM sysfs dpms aggregation; macOS CoreGraphics
CGDisplayIsAsleep via ctypes + a pmset-log fallback when there is no
window-server session) plus an in-memory monotonic-clock debouncer.
evaluate_display_powersave/evaluate_drain_gate become pure functions of a
passed-in display reading; only the supervisor gate-tick polls the detector
(and only when the condition is enabled), while the health surface reads the
last-known snapshot, so health reads do no OS I/O and never advance the
debounce. A sticky display_powersave_detectable field is exposed on the
health surface (data only; never feeds gate open/closed).
Supersedes note: the parent spec names the Linux mechanism "X11 DPMS" and
calls Wayland the undetectable case. This beneficially supersedes that — the
DE-independent sysfs DRM signal works under both X11 and Wayland on atomic
drivers (amdgpu/i915/nouveau), narrowing the undetectable population from
"all of Wayland" to "NVIDIA-proprietary / headless". Recorded so a future
reader does not "fix" it back to X11-only.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>