Skip to main content

Module cron_names

Module cron_names 

Source
Expand description

The schedule each fired prompt came from, keyed by the prompt’s own id.

The CronPromptAppended frame carries the pairing once, when the fire is delivered; a row replayed from a transcript afterwards holds the prompt’s prose alone. This is the read half of that pairing - written when the fire is delivered, read when a conversation page is built - so a page that reloads later titles the row as the live frame did (rule 25’s read/live symmetry).

Machine-local, like the transcript it describes, and one row per fired prompt: the boot sweeps a row once it is past the retention window.

Re-exports§

use std::collections::BTreeMap; 🔒
use std::time::SystemTime; 🔒
use std::time::UNIX_EPOCH; 🔒
use forge_primitives::cron::CronName; 🔒
use redb::ReadableTable; 🔒
use redb::TableDefinition; 🔒
use serde::Deserialize; 🔒
use serde::Deserialize; 🔒
use serde::Serialize; 🔒
use serde::Serialize; 🔒
use super::Db; 🔒

Structs§

Stored 🔒
The stored value: the name plus when the fire happened.

Constants§

CRON_NAMES 🔒
RETENTION_SECS 🔒
How long a fired prompt’s pairing is kept: long enough that a row replayed after a reload still names its schedule, bounded so the store stops growing.

Functions§

epoch 🔒
Seconds since the epoch, with a clock before it read as the epoch rather than as an error: a wrongly set clock costs retention accuracy, not a boot.
for_uuids
The schedules for the prompts in uuids, keyed by the prompt’s id. An id this store never saw is absent from the answer rather than an error.
prune_expired
Drop the pairings older than the retention window and stamp the ones written before the stamp existed, so they age out one window from the upgrade.
put
Remember the schedule a fired prompt came from, replacing any prior record for the same prompt.