You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(pause): per-folder/repo scheduled pause windows (quiet hours), defer + auto-resume
Add scoped, time-bounded pauses: hold a folder's (local) or repo's (github) runs
"between certain times" and resume automatically after — recurring daily, with
optional weekday and date-range bounds and a per-window IANA timezone (default
UTC, DST-correct via built-in Intl, no new dependency).
Enforcement — defer, don't drop (DES-SCOPED-PAUSE-VIA-MOVE-TO-DELAYED)
- worker/src/pause-windows.mjs: pure, fs-injectable validator (parsePauseWindows),
loader (loadPauseWindows), and the timezone-aware predicate (pauseUntilMs +
windowEndAt). Fully unit-testable with injected `now`.
- The processor gate is FIRST in the wrapper, before the kill timer and the budget
reservation: if the job's scope is in an active window, job.moveToDelayed(end,
token) + throw DelayedError. The job keeps its dedup identity, survives restart,
reserves NO budget slot, and auto-resumes when BullMQ re-picks it. Consistent
with CONST-BUDGET-BEFORE-TOKENS (a deferral is not a job start).
- pause-windows.json (PI_PAUSE_WINDOWS_FILE) is boot-loaded fail-loud and
live-reloaded via the same dir-watch machinery as triggers.json; a bad edit keeps
the last-good windows.
Admin control (mirrors the confirm-gated triggers CRUD)
- read/writePauseWindows (shared validator, atomic, fail-closed); resolvePaths gains
pauseWindowsPath. Tools: dispatch_pauses (read) + dispatch_pause_add/_delete
(confirm-gated, fail-closed without an operator). Operator `w` key -> add/delete
dialogs. A PAUSES panel section marks each window ● paused (with a resume
countdown) or ○ open. The operate-pi-dispatch skill documents the gate.
Specs: REQ-SCOPED-PAUSE-WINDOWS, DES-SCOPED-PAUSE-VIA-MOVE-TO-DELAYED,
INT-PAUSE-WINDOWS-FILE-CONTRACT, a constitution changelog note (before-budget
placement), and a job-budget rule pause-gate-before-budget.
Tests: worker 432 pass (pause-windows predicate matrix incl. overnight/days/dates/
non-UTC tz; pause-gate defers-before-budget + identity preservation), admin 167
pass (gate tests + panel section), receiver unaffected.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D3npQvQXLWsW6qsrRMAmNL
0 commit comments