Skip to main content

Module reservation

Module reservation 

Source
Expand description

Spending caps at work (docs/specs/SPEC_JOBS_AND_TEMPLATES_2026_10_24.md §5.3): the reservation before a run starts, the stop when a run reaches its own cap, and the skips a cap makes. The rules are caps.rs; this reads the spend from the ledger and writes the rows.

The reservation. A run starts only if its job’s spend today plus its per-run cap fits the job’s daily cap, and the same for its account. The spend counts the runs that ended, and, for each run still going, its whole per-run cap: so the day’s total can’t pass a daily cap even if every run spends all of its own.

The stop. The turn ledger’s cost is the sum of the result frames of the passes that ended (blockcontroller::health), so the follower sees a run’s spend between passes, not inside one: a turn of several passes is stopped at the first pass that brings it to its cap, and a single pass costs what it costs. The reservation is what bounds the day.

No cost reported. A run on a provider whose turns carry no cost counts $0 toward the dollar caps (caps::reports_cost) and is bounded by its timeout.

Structs§

CapSources
Target
The account and provider a run would use. Empty when not known.

Type Aliases§

LimitsSource
The caps Settings → Jobs holds, read at each decision so a change takes effect at once.
TargetOf
Where a job’s next run would go: the server knows (a message’s target pane, the account a spawn picks).