Skip to main content

Module dream_schedule

Module dream_schedule 

Source
Expand description

Which queued dream runs next, and why a dream waits (SPEC_DREAMS §3, §5).

A trigger only adds a dream to the queue; this module decides whether a queued dream may run now. It is a pure decision over facts the caller reads (the person’s activity, the host’s load, the queue, the memory), so every rule is tested without a machine and the caller’s loop stays small. It reads nothing and runs nothing.

Not here yet (step 4 of the build): the pull-forward into a quota window about to reset, and the cheaper-route choice beyond the cheaper_route flag below.

Modules§

hold
Why a dream waits. The strings are what the entry shows.

Structs§

Candidate
One queued dream and the facts about its memory.
Signals
What is true of the machine and the settings right now.

Enums§

Verdict

Functions§

nightly_due
Whether the nightly sweep (T4) is due for a memory: its last sweep was on an earlier local day. Days are counted in the person’s local time by the caller, so the sweep follows their day, not UTC.
pick
The index of the dream to run next among those that may run now, or None. Order of value: one a person asked for, then Global Memory, then the memory with the most conflict copies, then the largest, then the oldest.
verdict
May this dream run now, and if not, why.