Expand description
Run state: what happened, where it is stored, and how a run is resumed.
Every node writes its result into RunState and the whole struct is
flushed to run.json before the next node starts. That is what makes a run
resumable: a competition can take an hour, and dying in review round four
should not throw away three implementations, nine judge reads and a
deliberation.
Patches and raw agent transcripts are not in run.json — they live beside
it under artifacts/, so the state file stays small enough to read by hand.
Structs§
- Candidate
- One candidate implementation.
- Command
Outcome - Outcome of one shell command.
- Deliberation
Round - A deliberation round.
- Deliberation
Turn - One judge’s turn in a deliberation round.
- Event
- A timestamped note about a node.
- FixRecord
- The fixer’s response to a round.
- Judgement
- One judge’s independent ranking.
- Merge
Outcome - What happened to the winning branch.
- PrRecord
- What the land loop saw last time it looked at the pull request.
- Quota
Loss - A seat that was taken out by a CLI rate limit / quota, recorded so a run whose panel collapsed does not masquerade as a healthy one.
- Review
Record - One reviewer’s report in a round.
- Review
Round - One review + verify + fix round.
- RunState
- The whole run.
- Tally
- The mechanical count.
- Vote
Record - A final vote, collected privately.
Enums§
- RunStatus
- Where a run got to.
Constants§
- SCHEMA
- 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.
Functions§
- artifact_
path - Path of a run artifact.
- home
- Where magi keeps its runs.
- latest_
id - The most recent run, if any.
- list_
ids - Every run id on disk, newest first.
- read_
artifact - Read an artifact back, e.g. a stored patch on resume.
- resolve_
id - Expand an id prefix to exactly one run id.
- run_dir
- Directory for one run id.
- runs_
root <home>/runs.- set_
home - Pin the run home for this process. The first call wins.
- short_
of - The short form of a run id: the trailing block after the last
-. - tail
- Keep the last
maxbytes oftext, on a line boundary. - write_
artifact - Write an artifact, creating the directory if needed.