Expand description
Run configuration: the agent roster, the shape of the graph, and the blindness / verification policy.
Layers, lowest precedence first: <config_dir>/magi/config.toml (machine),
.magi/config.toml, magi.toml. With none, built-in defaults apply, the
agent roster derived from the agent CLIs actually installed on this
machine. --config <path> replaces the whole stack with that one file.
The repository layers are read from <remote>/<base>, never from the
working tree. A primary checkout is often stale or on a detached HEAD, so
a gate read from it can be older than the one the branch under review is
cut from (run ce6e failed on a gate step origin/main had already
dropped). git show <sha>:magi.toml of the remote-tracking ref’s commit is
written to a content-addressed directory under the git common dir
(<common>/magi/config/<sha>-<hash of repo>/, temp dir when that is not
writable) and loaded from there.
remote and base are themselves in the file, so they are resolved in a
fixed order, first hit wins:
[merge] base/remoteof the machine layer, rendered as a real load would (env templates, includes);- the same keys, read minimally (only
[merge], nothing deserialized intoConfig) from the checkout’smagi.toml, then.magi/config.toml- only to locate the ref; an unreadable file is ignored; remotedefaults toorigin,baseto whatrefs/remotes/<remote>/HEADpoints at.
Config::discover is synchronous and reads the remote-tracking ref as it
is (daemon::fetch_loop keeps it fresh); Config::discover_fetched runs
git fetch first and is what every path that starts work uses. A failed
fetch, a missing ref or an unresolvable base is an error, never a
silent fall back to the working tree or a local branch. Two cases are not
that: an explicit --config, and a repo that is not a git working tree
at all (no branch exists, so nothing can be stale).
A repository layer that declares include = [...] gets the whole tree of
that commit extracted, so relative includes resolve against the same
commit. The directory is built beside its name and renamed in, so a
concurrent discover never reads a half-written layer.
Structs§
- Agent
Spec - One addressable agent in the roster.
- Blind
- Blindness policy.
- Config
- Top-level configuration.
- Daemon
- How the daemon loop itself behaves, as opposed to what one run does.
- Disk
- Disk hygiene: how hard magi is allowed to press on the machine’s free space.
- Graph
- Graph shape and limits.
- Merge
- Merge policy.
- Notify
- How the operator is told that a run is waiting on them.
- Prompts
- Project-specific text appended to each node’s prompt.
- Release
[release]: releasing without GitHub Actions. Opt-in per repository.- Repos
- Where
magi reposandGET /api/reposlook for local checkouts. - Resolved
Roles - Roles resolved to concrete agent specs for one run.
- Roles
- Explicit role assignment. Empty lists are filled in by
Config::resolve_rolesby rotating the roster. - Talk
- Policy for
crate::talk, the standing conversation. - Update
- Self-update policy.
- Verify
- Shell commands that gate the winner.
Enums§
- Agent
Choice - A standalone seat’s agent: one roster id, or an ordered fallback chain.
- Agent
Kind - Which CLI drives an agent.
- Delivery
- How the prompt reaches the agent process.
- Incomplete
Review Policy - What a review round does when a reviewer seat never answered.
- Leak
Policy - What to do when vendor-identifying text is found in material shown to judges.
- Merge
Mode - What to do with the winning branch.
- Merge
Style - How the winning branch is attached to the base branch: what
mode = "local"runs, and whatmode = "none"’s printed guidance tells the operator to run by hand. - Release
Mode - Who performs the release after a
chore/release-vX.Y.Zpull request merges. - Update
Mode - How magi keeps itself current.
Functions§
- find_
program - The file a bare
programname resolves to onPATH, the way the OS shell would find it. - find_
program_ on find_programagainst an explicitPATH, for a child whose environment overrides it.- primary
- The first id of an optional choice: what a single-seat caller resolves.
- which
- Is
programonPATH?