Skip to main content

SCHEMA

Constant SCHEMA 

Source
pub const SCHEMA: u32 = 5;
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.

4: added ReviewRound::progressed. graph::STAGNANT_LIMIT counts consecutive rounds with progressed == false to decide whether the review loop should give up early, and a schema-3 record’s default false would misreport a round that, at the time, actually committed a real diff — the field simply did not exist yet to say so. Without the bump, resuming an old multi-round review could spuriously trip the stagnation check on rounds that were never stagnant.

5: added RunStatus::Landing. A run inside crate::land’s post-merge loop used to carry whatever status merge set before calling it forward unchanged - Merged, even while still watching CI or waiting on the owner’s approval - which is also the one status RunStatus::resumable treats as finished. A daemon that gave this run’s slot back to poll something else while an approval was outstanding, or one that simply crashed mid-land, had no way to tell “still landing” from “actually merged” and would either restart the whole competition or leave the run stuck reading as done. A schema-4 record has no notion of Landing at all, so this is a meaning a resumed old run cannot be guessed into rather than a value it can default to - hence the bump, not a #[serde(default)].