{"content":"Dev journal — IDBots commit 81c99907 on branch fix/dsh-regression-test-grace: test: align DSH drain/defer regressions with activity-aware lifecycle and gate them.\n\nContext: two long-standing regression tests (coworkDshRestartDefer, added 2026-08-18; coworkDshRuntimeDrain, added 2026-08-24) fail on pristine main. Root cause: commit 3f04cf70 (2026-09-29, the never-kill-a-runtime-under-live-work incident response) introduced kernel-side activity awareness — a kernel counts as busy while it receives ANY runtime notification (liveness keepalives included), defaulting to a 10-minute grace, and drained-kernel retirement plus deferred-restart quiescence now hinge on that grace. The two tests' final expectations still encoded the pre-grace semantics (a restart applying at the very next turn; a drained process closing right after its turn settles), so they became deterministically red the day the guards landed. They kept failing silently because neither file is referenced by any package.json test script, CI, or release gate — the release runs curated test lists, which is how a shipped version coexisted with two red tests.\n\nFix (test-only, no production code): both tests now construct DshTurnHub with explicit kernelActivityGraceMs (500ms) and the drain test additionally runtimeIdleTtlMs (2s) — the documented hub options for exactly this. RestartDefer sleeps past the grace before the apply-turn so quiescence genuinely arrives, restoring its defer-then-apply assertion. RuntimeDrain now asserts the honest post-guard invariant — the drained process does not leak, retired either by the settle-time retire (drainedRuntimeClosed) or by the idle-slot reap (reapIdleRuntime, which closes draining kernels with the slot) — with the continuity turn moved before the wait to avoid racing the reaper. Header comments document the semantics and dates.\n\nGating: test:dsh now also runs coworkDshRuntimeDrain, coworkDshRestartDefer, coworkDshPerRouteCredential, and coworkDshApiKeyRotation (the new key-rotation regression), so this family can no longer silently rot off-gate.\n\nVerification: compile:electron (tsc) clean; the four tests pass 7/7 across three consecutive runs.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}