Expand description
What a job’s policy decides about a run before it starts, and what to do
when it failed (docs/specs/SPEC_JOBS_AND_TEMPLATES_2026_10_24.md §5.1
“Policy”). Pure: the ledger gathers who is running and acts on the answer
(admission.rs).
Structs§
- Occupancy
- Who is running, as the ledger found it, for one job’s next run.
Enums§
- Decision
- What to do with a run that wants to start.
Constants§
- GLOBAL_
LIMIT - Unattended agent runs at once, across all jobs (§5.1): the providers’ rate limits.
- GROUP_
DEPLOY - The built-in concurrency group infrastructure deploys run in, one at a time (§5.1, operator decision 6).
- RETRY_
BACKOFF_ MIN - The wait before retry number 1, 2 and 3, in minutes (§5.1).
Functions§
- decide
- The policy’s answer for a run of
job.waitingis a run that already waits (it keeps its place; the buffer’s one place isn’t counted against it, and it is never skipped). - group_
of - The job’s concurrency group: the one it names, or
deploywhen it declares a deploy output (deploy,deploy:prod…). - infra_
retryable - Whether a run that ended should be tried again (§5.1 “Retries”): only an
infrastructure failure: the agent never started, its process exited, or
the provider answered with a transient error. A run whose agent concluded
failed, one that hit its own timeout, and one that finished are never retried; they alert. - retry_
delay_ ms - Attempt
attempt’s retry delay in ms (attempt 1 failed: wait 1 minute). - starts_
an_ agent - Whether a run of the job is an agent working unattended: a message starts a turn, a spawn starts a worker, a drone can run Agent blocks. Filing a task starts nothing. A job for which this holds is under the spending caps and the limit on agents running at once.