Expand description
The cron cluster on Workspace: the durable-cron store accessor
and its mutation helpers, the asleep-slot prompt buffers, the fire
router, the scheduler task, and the cross-crate seed helper.
Everything here stays on Workspace as a second impl block, so
every caller (the boot path in crate::workspace, the
mcp::cron facade, spawn::deliver_cron_prompt, a viewβs boot)
keeps its path. The crons and update_tx fields these methods own
are pub(crate) for the same reason db is:
so this sibling module can reach them without a wrapper. A fired cron
with no live session parks in crate::parked. Schedule math lives in
crate::mcp::cron::schedule; the MCP tool surface in
crate::mcp::cron; delivery in crate::spawn.
Re-exportsΒ§
use std::sync::Arc;πuse std::time::Duration;πuse tracing::Instrument;πuse crate::protocol::SessionUpdate;πuse crate::target::ProjectKey;πuse crate::workspace::Workspace;π
StructsΒ§
- Pending
Cron π - A cron prompt buffered for a sleeping slot: the raw prompt plus whether this fire is overdue (delivered with a missed marker on drain), and the entryβs identity, which the drained echo names.
ConstantsΒ§
- COOLING_
REWARN_ πINTERVAL - The gap between warnings while one cooling episode lasts; the ticks in
between repeat at
debug. - CRON_
TICK_ πINTERVAL - How often the cron scheduler wakes to fire due crons. Minute granularity matches the cron-expression resolution.
- IST_
OFFSET_ πMINUTES - India Standard Timeβs offset from UTC, the clock a reader of the notice is on.
FunctionsΒ§
- cooling_
reset_ πtext - The reset a deferred cron names: the wall clock in IST plus the wait ahead, so a reader needs no arithmetic on a duration. A reset no clock can spell falls back to the wait alone rather than panicking the scheduler.
- wait_
text π - A wait as the two largest units that describe it (β1h 5mβ, β3m 20sβ).