Expand description
The run ledger: one row per time a job was meant to run, including the times it didn’t (docs/specs/SPEC_JOBS_AND_TEMPLATES_2026_10_24.md §3.1).
It lives in the always-global identity store, beside the work queue, so
every channel and version on this computer sees one ledger. The unique
index on (job_id, scheduled_for_ms) is the slot lease: a scheduler
inserts its slot’s row before it fires, and a second scheduler sharing the
job finds the slot taken and doesn’t fire.
Nothing here deletes a run: history is kept forever (§3.1, “Retention:
none”). A skip folded into the previous row of the same job and reason
keeps its own row, marked collapsed_into that row and left out of
history, so its slot stays leased.
Modules§
- infra
- Infrastructure status (§3.1; the ones P1 writes).
- reason
- Why a run was skipped, missed or stopped, or how a pending one ended (§3.1; the ones P1 writes).
- state
- Run states (§3.1).
Structs§
- JobFlag
- A switch in
db_job_flags: its value, when it was set and by whom. - JobRun
- One row of
db_job_runs. Field meanings are the spec’s table (§3.1). - RunCost
- A finished turn’s figures, from the turn ledger (§3.2).
Constants§
- OUTCOMES
- What a run concluded, separate from whether it ran (§2).
- SUMMARY_
MAX_ CHARS - The longest
summarykept (§3.1).
Functions§
- clip_
summary textcut toSUMMARY_MAX_CHARS, on a character boundary.