Skip to content

fix(rig-control): brightness restore after sleep + kill orphaned fade children - #359

Open
ZacxDev wants to merge 2 commits into
mainfrom
fix/rig-control-fade-restore
Open

fix(rig-control): brightness restore after sleep + kill orphaned fade children#359
ZacxDev wants to merge 2 commits into
mainfrom
fix/rig-control-fade-restore

Conversation

@ZacxDev

@ZacxDev ZacxDev commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Rescued from a diverged shared checkout

These two commits were authored in an earlier session directly on main in the workbench checkout and never pushed. They are moved onto a branch here unmodified — same SHAs, same authorship, no rebase, no squash.

commit subject
3a9cae1 fix(rig-control): reliable brightness restore after sleep
a8e82d6 fix(rig-control): kill orphaned fade children, harden timer restore

Why this had to happen: the workbench's main had diverged from origin/main, so ship.sh correctly skipped that host on every deploy (rc8 = skipped:diverged). That host stopped converging — and it is the host that runs the ClickHouse regrowth timer due to fire 2026-08-11. The divergence was silently blocking a scheduled check from receiving its own bug fix.

The commits are preserved on this branch and were verified present on origin from a second host before the workbench's main was moved back. Nothing was rebased, force-pushed, or discarded; the workbench's untracked files were left exactly as found.

Why this wants review rather than a straight fast-forward

scripts/claude-hooks/tests/test_guard_core.py and scripts/monitor-blackout.sh were also touched by #356, which unbroke the pytests gate. Per-PR review structurally cannot see a cross-PR interaction, so these changes have never been gated against the tree they now land in. That is exactly what this PR is for.

Not yet verified

I have not run the gate on this branch or on the merged tree, and I did not write these changes. Before merging, the merged tree (main + this branch) should be built and counted:

nix build .#checks.x86_64-linux.pytests --no-link --print-build-logs

main is currently green at collected=6507 passed=6506 skipped=1 failed=0. Note that an empty nix build output means the derivation was cached, not that nothing ran — read it with nix log rather than treating silence as success.

Two loose ends in the workbench checkout, left alone deliberately because they may be live work:
claudedocs/handoff-rig-control-brightness.md and claudedocs/proposed-rules-cut/ are untracked there. Docs written into a working tree are unsaved work, one routine checkout away from silent deletion.

🤖 Generated with Claude Code

ZacxDev added 2 commits August 6, 2026 13:36
Three bugs causing dark screen after wake:

1. Race: background fade_blackout overwrites restore — kill the fade
   process (via PID file) before restoring, make do_wake() blocking
2. Saved brightness of 0 from stale state file — treat 0 as invalid,
   default to 60
3. DDC-CI flakiness — retry setvcp 3x with 0.5s backoff, tolerates
   individual failures in fade loops
Two remaining race conditions causing brightness drop after wake:

1. fade_to_zero spawned set_brightness as background children (&);
   killing the parent left orphans that kept setting brightness to 0.
   Fix: run set_brightness in the foreground — clean termination on kill.

2. schedule_restore created a systemd-run timer calling raw ddcutil
   with no retry and no 0-default. Fix: write state file and call
   'monitor-blackout.sh restore' instead, which has both.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant