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

Sit next to the tools, never in front of them

A build tool is in an odd meta position: its whole job is running other tools. The most useful thing it can do is stay out of the space between you and them. You should be able to see which command runs and how its arguments were assembled, because software breaks in ways nobody designed for, and at that moment the only thing that matters is whether you can work out what happened. Every layer between you and the actual command is a layer you peel back first, usually while something is on fire.

Engineers are drawn to abstracting things away, and it is usually the right instinct. So one team wraps a tool, another wraps that wrapper, and a third builds on the second. Each layer looks reasonable to whoever wrote it. Whoever writes layer three can see layer two; they cannot see the tool at the bottom, its failure modes, or which of its features layer two quietly dropped, so they abstract over a model of the thing rather than the thing. Skaffold is where I feel this most: magic for a week, then you need something its authors did not picture and there is no seam, because the machinery you need to reason about is the machinery it exists to hide. Temporal says the opposite out loud: a thin shim is fine, a friendly layer is fine, as long as people can still reach the SDK directly.

The tightly built wrapper has a social cost too. Someone writes an executor around one job, it works, and when it breaks everyone goes through that one person, because they are the only one who can see what it does. That is a bus factor of one, manufactured by the design.

Enforced by

  • A spell is a library of tool-native ops: its op runs the tool with arguments you can read, and the run records the command it executed.
  • magus query output <ref> prints a run's full log, the command included.
  • Automation you can interrogate requires each step to be expressible as the toolchain call it made.

Good

The run names the tool and its arguments, so you can run it yourself without magus:

magus run test . -v
magus query output <ref>

Bad

build:
  artifacts:
    - image: app
      custom:
        buildCommand: ./build.sh

Skaffold's escape hatch: the tool that actually builds is a script behind a type field, behind the wrapper. When it fails, the wrapper's error is about the wrapper.

See also

designprinciplespellsabstraction
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.

Spell

A language/runtime adapter (e.g. go, md) that maps generic targets onto a toolchain's real commands. Spell in full.

Engine

The interpreter a magusfile runs on; magus embeds the Buzz engine. Engine 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.

Tool

An action a model can call through its host: a name, a description, a typed input and a result. magus serves its tools over MCP, each a read of the workspace model or a run of the CLI it already has. Tool 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.

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.