operator app: hold a sleep inhibitor for the whole stand-up — the laptop suspended mid hand-over and corrupted the config repo #1327
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1327
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Observed (manual trial, laptop .deb from db1d1b23, rented path, community Whakatohea, 2026-09-08): the gateway deploy went live at 00:32:14 local and the finish leg (hand over authority) began committing the config repo. At 00:32:30 the laptop suspended (systemd-logind), the box hard-crashed on resume, and four zero-byte objects were left in
~/.config/IDSS/clan-config/.git/objects—git status --porcelain: exit status 128 … bad object HEAD. Recovered by hand (drop the empty objects, resetrefs/heads/masterto the last good commit); the retry then reached hand-off.Cause: nothing in the app holds a sleep inhibitor while a stand-up is in flight. A stand-up on an operator laptop is 30–90 min of unattended work (build, copy, switch, post-deploy legs, seeding), which is exactly the window a desktop idle timer fires in. Greps for
powerSaveBlocker/systemd-inhibit/caffeinateacross app, helper, internal, scripts return nothing.Fix (two-way door, ADR 0174): the Electron shell holds
powerSaveBlocker.start('prevent-app-suspension')for exactly as long as the founding client observes a stand-up in flight, and releases it the moment the stand-up rests (fault, failed deploy, spec-gate fail, a human gate such as consent or hand-off) or finishes. Derived from theStandupViewevery stand-up op already returns, so no new helper op. Best-effort: on a headless host or without a session D-Bus the blocker is a no-op and never a gate, so the drives and the sandboxed unit tests see no change.Out of scope, stated: a lid-close on GNOME ignores inhibitors by default (
LidSwitchIgnoreInhibited), so this covers idle-timer and menu suspend, not a closed lid. A corrupt config repo after a crash still surfaces as a raw git error — separate ticket.Ruled by agent under ADR 0174 — veto anytime.
Ruling:
bug+ready-for-agent.Why a two-way door: the fix is ordinary Electron/TS product code (hold a
powerSaveBlockerwhile a stand-up is in flight), revertible by a single commit, and — per the filer's own "best-effort" clause — a no-op on a headless host or without a session D-Bus, so drives and the sandboxed unit tests see no behaviour change. No host credentials, no protected.sandcastle/paths, no live doors, no member-facing trust surface, no security widening. Not on the one-way-door list. The filer already tagged the fix a two-way door.What proves it: a sandboxed vitest unit test that drives the stand-up lifecycle and asserts the inhibitor is held on the in-flight steps and released on every rest step — provable on this workstation, no re-drive needed (the real inhibitor is a no-op in the sandbox, so only the start/stop decision is under test).
Verified against the codebase (grounds the brief):
grep -rniE 'powerSaveBlocker|systemd-inhibit|caffeinate|prevent-app-suspension'acrossapp/,internal/,helper/,scripts/returns nothing — nothing holds an inhibitor today.StandupView(app/src/lib/founding.ts:750, ops at:893+), whosestandup.stepis aStandupStep(app/src/lib/founding.ts:351). In-flight steps:deploying,seeded,hand-off(plus the install/reachability legs); rest steps/fields:spec-gate-fail, andstandup.fault/deploy.failurefor a faulted or failed deploy. Human gates (consent, hand-off waiting on a person) are also rest for inhibitor purposes.app/src-electron/electron-main.ts(429 lines) — wherepowerSaveBlocker.start('prevent-app-suspension')/.stop(id)lives. No new helper op is needed; derive the held/released decision from theStandupViewthe client already returns.Agent brief
Goal: the operator app must not sleep mid stand-up. Hold an Electron power-save inhibitor for exactly the window a stand-up is in flight, release it the instant the stand-up rests or finishes.
Do:
app/src-electron/electron-main.ts, holdpowerSaveBlocker.start('prevent-app-suspension')when the observedStandupViewreports an in-flight step, andpowerSaveBlocker.stop(id)when it rests. Keep exactly one blocker id; never leak or double-start (guard onpowerSaveBlocker.isStarted(id)).StandupView/Standupthe founding client already returns — do not add a new seam op. In flight = actively working (deploying,seeded,hand-off, and the install/reachability legs that precede them). Rest =spec-gate-fail, a setfault, a faileddeploy, a human gate (consent / hand-off awaiting a person), no active stand-up, or finished.Prove: a sandboxed vitest unit test (sibling of
app/tests/unit/founding.test.ts) that feeds the lifecycle through the in-flight steps then each rest step and asserts the inhibitor decision (held ↔ released) tracks it, withpowerSaveBlockermocked.pnpm --filter app testmust stay green.Out of scope (stated by the filer): a closed lid on GNOME ignores inhibitors by default (
LidSwitchIgnoreInhibited) — this covers idle-timer and menu suspend, not a closed lid. Surfacing a corrupt config repo as something friendlier than a rawgit statuserror is a separate ticket.Touch
STATUS.mdin the same commit if this changes a tracked row.Landed on main as d329ec7b (GOTCHAS #189). Shell holds powerSaveBlocker(prevent-app-suspension) while standupInFlight is true; released at rest/fault/failed deploy/hand-off; 12 unit tests; full app suite green (1439). Not yet in a packaged build — the next .deb Ben packages carries it. Lid-close and corrupt-repo recovery remain out of scope as stated above.