Skip to main content

SCHEMA

Constant SCHEMA 

Source
pub const SCHEMA: u32 = 3;
Expand description

On-disk format version. Bumped when a field changes meaning, so a resumed run never half-reads a state file written by a different magi.

2: added RunStatus::Stalled, RunState::quota (rate-limit losses), and the quorum fields on Tally. RunState::load already fails loudly and clearly on a schema mismatch; an old run.json from schema 1 now says so instead of silently half-reading.

3: added RunState::judge_skipped. A solo candidate makes judge write only an event, leaving judgements empty forever — indistinguishable from “not yet judged” on every later reentry, which is what let judge re-run on a finished run and clobber its status back to Judging. The flag is the missing record of the fact that judging was skipped on purpose.

Also 3: a single-viable-candidate tally records Tally::judges as 0 and fills Tally::uncontested, instead of leaving the full roster size sitting next to a panel that never sat. A schema-2 record keeps reading as “0 of 3 judges present” forever, because a tally is computed once and never recomputed on resume; the bump keeps that stale reading from being mixed with the new meaning.