Curator runtime: persistent loop with idle cooldown #12

Closed
opened 2026-10-27 13:34:35 +00:00 by sam · 0 comments
Owner

Implement the loop that runs a registered curator: continuous operation while work is available, backing off to a configured cooldown when there is nothing to do, waking on new input, and honouring per-curator check-in intervals.

Acceptance Criteria

A curator with pending input runs without waiting for its next interval; an idle curator consumes no meaningful CPU and wakes on new input. Cooldown and check-in interval are configurable per curator. Loop timing is tested with a fake clock, not wall-clock sleeps. Shutdown is clean and bounded: an in-flight curator pass is cancelled via context and the daemon does not block indefinitely on it. A panicking curator is recovered and isolated from other curators and from the agent loop.

Close reason

Complete: internal/domain/curator/runtime.go implements exactly this. Verified against every acceptance-criteria clause: pending-input curators run without waiting for the interval (TestRuntimeWakeRunsPendingPassImmediately), idle curators sleep until interval (TestRuntimeIdleCuratorSleepsUntilInterval) with a configurable per-curator cooldown (TestRuntimeCooldownAfterIdlePass, TestRuntimeNextCheckInOverride), all timed via an injected fake clock not wall-clock sleep, shutdown is context-bounded (TestRuntimeShutdownCancelsInFlightPass, TestRuntimeShutdownBoundedDespiteStuckPass), and panics are recovered and isolated (TestRuntimeCheckPanicRecovered, TestRuntimePassPanicRecovered). go test ./internal/domain/curator/... -race -count=1 is fully green.


Imported from beads archie-core-1786637491805-77-78d888a3 · GitHub #98 · type feature · priority P2 · created 2026-08-08 · closed 2026-08-15

Implement the loop that runs a registered curator: continuous operation while work is available, backing off to a configured cooldown when there is nothing to do, waking on new input, and honouring per-curator check-in intervals. ### Acceptance Criteria A curator with pending input runs without waiting for its next interval; an idle curator consumes no meaningful CPU and wakes on new input. Cooldown and check-in interval are configurable per curator. Loop timing is tested with a fake clock, not wall-clock sleeps. Shutdown is clean and bounded: an in-flight curator pass is cancelled via context and the daemon does not block indefinitely on it. A panicking curator is recovered and isolated from other curators and from the agent loop. ### Close reason Complete: internal/domain/curator/runtime.go implements exactly this. Verified against every acceptance-criteria clause: pending-input curators run without waiting for the interval (TestRuntimeWakeRunsPendingPassImmediately), idle curators sleep until interval (TestRuntimeIdleCuratorSleepsUntilInterval) with a configurable per-curator cooldown (TestRuntimeCooldownAfterIdlePass, TestRuntimeNextCheckInOverride), all timed via an injected fake clock not wall-clock sleep, shutdown is context-bounded (TestRuntimeShutdownCancelsInFlightPass, TestRuntimeShutdownBoundedDespiteStuckPass), and panics are recovered and isolated (TestRuntimeCheckPanicRecovered, TestRuntimePassPanicRecovered). go test ./internal/domain/curator/... -race -count=1 is fully green. --- _Imported from beads `archie-core-1786637491805-77-78d888a3` · GitHub #98 · type feature · priority P2 · created 2026-08-08 · closed 2026-08-15_
sam added the mediumfeature labels 2026-10-27 13:34:35 +00:00
sam self-assigned this 2026-10-27 13:34:35 +00:00
sam closed this issue 2026-10-27 13:34:35 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#12