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

Design principles

Scope records what belongs in magus. This section records how it is allowed to behave, and it is opinionated on purpose. Bad developer experience gets under my skin, and most of what is here started as a tool that made me dig through layers of configuration, guess which default won, or read a keymap to see my own build output. Each page says what I believe, why, and what in the tree holds the line.

This is the project's north star. Features, flags and whole subsystems come and go; these are what stay. When a change and a page disagree, one of them is wrong, and the page wins unless the change brings new evidence, in which case the page changes in the same commit.

Every page has the same shape, so a person or an agent finds the same thing in the same place:

  • The page opens with the argument: why the rule exists and the failure it prevents.
  • Enforced by names the test, lint, guard rule or review step that holds it. A rule with no mechanism yet is a debt in Where this is strained, because a rule that lives only in prose holds about half the time.
  • Good and Bad each show a real example, and a sentence after the bad one says why it is bad.
  • See also links the pages and the code the rule touches.

Checking a new feature against this section is a graph query, not a reread:

magus query "kind=docsection id=~design/ <terms>"

Before reversing one of these, read A record of refusals and the decisions; reopen a settled question only with new evidence.

Pages

Principles say how the tool is built. Judgment pages say when magus automates a decision and when it hands the decision to you.

Principles

Judgment

  • Agents propose, humans dispose: An agent integration can suggest work but never accept it; authorship comes from the transport, never the writer's claim.
  • The host wiring is yours: magus owns the guard rules and the verdict; the part that knows your agent host is a template you copy and edit.
  • The outer harness stays outside: magus judges and informs, and never transforms what reaches the model; the host owns the loop.
  • Determinism at chosen points: magus fixes a step where it can prove the answer and leaves the rest to the model; a person chooses which steps are fixed.
  • A refusal carries its reason: A refusal names the mechanism and a next step; an error that leaves you with no next step is a design bug.
  • No silent defaults: A default that changes what happens without saying so is a bug; misconfiguration is an error, never a warning.
  • Told, never guessed: magus never sniffs where it runs to change what it does; a caller that needs different behavior asks for it.
  • Provider I/O is Buzz: A CI or VCS provider is reached only by a Buzz op that names the act; Go opens no provider socket of its own.
  • Automation you can interrogate: Each automated verdict ships with a lens that shows its inputs, and each step magus runs is expressible as the tool call it made.
  • Manual on purpose: Automate a repetition, never a rep; each act that forms judgment stays a person's keystroke.
  • The loop keeps you able to notice: What reaches a person is the deviation, the batch and the absence, never a confirmation of a pattern they already trust.
  • Corrective competence: The skill this section protects is your ability to fix the thing yourself when the agent is wrong, or gone.

Also in this section

  • The standard: Wendell Berry's nine standards for a new tool, held against magus in both directions.
  • Where this is strained: where the principles cost more than they claim, and the rules that live only in prose so far.
  • A record of refusals: what magus could have had and does not, with what decided each.
designprinciplesjudgmentphilosophy
Last updated (2df714e8)
Glossary

Project

A directory magus recognizes as a unit of work (it has a magusfile); the unit of caching, scheduling, and dependency tracking. Project in full.

Magusfile

The magusfile.buzz that declares a project's targets (as export funs) and binds its spells. Magusfile in full.

Target

A named operation (build, test, ...) you invoke with magus run <target>; it may compose a spell's tool-native operations and depend on other targets. Target in full.

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.

Module

A magus stdlib namespace a magusfile imports for host capabilities: filesystem, exec, vcs, and more. Module in full.

Buzz

The language magusfiles are written in (the .buzz engine). Buzz in full.

Engine

The interpreter a magusfile runs on; magus embeds the Buzz engine. Engine in full.

Cache

The content-addressed store magus consults before running a target, so unchanged work is skipped. Cache in full.

Sandbox

The restricted filesystem and environment a target runs in, so builds stay reproducible and side-effect-free. Sandbox 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.

Concurrency

How many targets run at once. It is bounded by the pool's capacity and set with --concurrency, MAGUS_CONCURRENCY, or the concurrency config key. Concurrency 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.

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.

Harness

The deterministic scaffolding around the work on a change, for a person or an agent: compiler errors, formatters, linters, checks, gates, leases and hooks, placed at points a person chose. Around an agent's loop, magus supplies one and keeps it outside. Harness in full.

Skill

A packaged set of instructions an agent host loads when a task matches its description: a directory holding a SKILL.md. magus ships its magus-* skills in the binary and writes them with magus agent install. Skill in full.

Invocation

One magus process's recorded facts (the targets it finished, their outcomes, the lease it acted as, and the session it ran in when a host delivered one), kept in a repo-scoped store every worktree shares. magus session lists them; the store prunes itself by last-fact age. Invocation in full.

Dispose

The human act of closing an attention request: a judgment rendered, recorded with who and why. Distinct from resolving a review thread or a merge conflict: a disposition answers a request; it does not merge anything. Dispose 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

This page uses none of the site's convention markers. The full set is on the conventions page.