magus v0.4.3 is out. See what's new
¶ View markdown source · ✎ Suggest an edit
2 min read

The orchestrator plans, workers work, the integrator lands

Delegated work has three roles, and each keeps to its own:

  • The orchestrator (the root) plans and coordinates. It forks job rows, reads the graph, and decides what lands. It does no groundwork.
  • A worker does the work its row hands it: it reads and searches source, edits inside its write paths, and runs its one check, at any context size.
  • The integrator owns the landing checkout. Spawned <parent>/integrate <job> in that checkout, it cherry-picks finished work, builds magus, regenerates outputs and commits. The root coordinates and never builds.

Size and cost never decide whether a session delegates; they only tune the advice given to a session that has handed nothing out. magus knows a session orchestrates from what it recorded, a job row it forked or a spawn bound to one; without that record the guard advises and never refuses.

This prevents the root whose context fills with work a worker would have returned as one finding, and which then pays for that work on every call after it, and the root that becomes the build bottleneck for every worker waiting on it.

Enforced by

  • The guard's orchestrator-groundwork rule refuses a proven orchestrator's searches, source reads, diffs, runs, fetches and edits, and passes its job verbs, graph reads and integration.
  • A spawn's description names its row and role (<parent>/<role> <job>), so the guard binds each worker or integrator to its lease.
  • A person at the keyboard is the human in the loop, not an orchestrator, and is never judged by it.

Good

The root forks a row with a narrow write set and a check, then spawns a worker named for it:

magus job fork design-index --model economy \
  --criteria "design.md lists every design page" \
  --write-paths 'docs/design.md' \
  --check "conventions docs"

Bad

grep -rn "doctrine" .
sed -n 1,400p docs/doctrine.md

The root reads the tree itself. Every line it pulled in rides along on each later call, and a worker would have returned the same answer as one paragraph.

See also

designprincipleagentsjobs
Last updated (2df714e8)
Glossary

Op

A single tool-native command a target composes (long form: operation); the middle of the work hierarchy (Spell to Op to Target). Op in full.

CI

An ordinary target you compose yourself with ctx.needs; magus does not hardcode its stages. It is the anchor magus affected ci keys off, and ci strips the rw charm. CI in full.

Agent

A model working through an agent host such as Claude Code, Codex, Cursor or OpenCode. magus treats an agent as one more caller of its CLI, MCP tools and console, held to the same checks as a person. Agent in full.

Session

An agent host's conversation, by the id the host delivers to its hooks. magus never mints one: a record with no session is unattributed, and the OS user it carries says whose account ran it. Session in full.

Job

The unit of delegated work, and one row of the job store: what an orchestrating agent handed out, with its goal, the checkpoint it was cut against, the paths it may write or must not touch, and the one check it runs. A job's holder is either a session, for work an orchestrator handed out, or the daemon, for its own maintenance. The store records; the agent guard is what reads those facts back when grading a write. Job in full.

Run

One target executing under one magus invocation, such as magus run test web or magus affected ci. A run keeps its captured output behind an output reference. Every magus run is a run whether or not any job asked for it; see Job for how the two relate. Run in full.

Lease

The grant a holder takes on a job: the write and read paths that job declared, enforced in the checkout that took it with magus job exec. A job is the piece of work; a lease is permission over it. Lease in full.

Conventions

Placeholders

Angle brackets mark a value you replace with your own; never type the brackets:

magus run <target>
magus completion <shell>    # e.g. bash, zsh, fish

<target>, <path>, <shell>, <name> and the like are stand-ins, not literal text.