Skip to main content

Module run

Module run 

Source
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.
CommandOutcome
Outcome of one shell command.
DeliberationRound
A deliberation round.
DeliberationTurn
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.
MergeOutcome
What happened to the winning branch.
PrRecord
What the land loop saw last time it looked at the pull request.
QuotaLoss
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.
ReviewRecord
One reviewer’s report in a round.
ReviewRound
One review + verify + fix round.
RunState
The whole run.
Tally
The mechanical count.
VoteRecord
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 max bytes of text, on a line boundary.
write_artifact
Write an artifact, creating the directory if needed.