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

Enforcement, not pinky promises

A rule that exists only as a sentence in an agent's context is a pinky promise. The model may follow it, may forget it after the context compacts, and may route around it the first time it is in the way. We measured the difference: advice that only prints gets ignored, and the guard now denies (ADR 0013). The point of a harness is to move a rule below the prose, to a place where breaking it is not an option the model gets to weigh.

That needs a clear answer to where each thing lives. Here "tool" means the broader agent sense, an action a model can call (an MCP tool, a host's built-in tool), not magus's own Go types.

layer what lives there in magus
the application the facts and the work: what exists, what a change reaches, running a target the graph, the cache, targets, the job store
the harness what must hold whoever acts, checked deterministically before or as the action runs the guard, lint and format targets, the drift gate, affected ci
a tool one typed action over the application, with its inputs and outputs declared magus run, magus query, the MCP tools that mirror them
a skill how to combine tools for a kind of task, and why; loaded when the task calls for it the installed magus-* skills
prose in context orientation only: where to look, what the words mean AGENTS.md, MAGUS.md

The rule is to put each thing at the lowest layer that can carry it. A rule that can be checked belongs in the harness. A fact belongs in the application and reaches the model through a tool. A skill is not a wrapper around one tool; a skill that maps one-to-one onto a tool is a tool description in the wrong place. A skill teaches a workflow across several tools and the judgment between them, and when it states a rule, the rule is already enforced below it and the skill only explains it. Whatever is left as prose in context is what nothing can enforce, and it should be short.

Enforced by

  • The guard denies an action a rule forbids and returns the command to run instead; a skill fires when a hook asks for it rather than on the model's memory.
  • Installed skills are rendered from the binary and stamped, and magus doctor reports one that drifted.
  • An edit to AGENTS.md draws the guard's reminder that it loads whole into every session, so it holds only what no tool says.

Good

The rule lives in the harness, and the agent meets it at the moment it matters:

`sed -i` reads differently on GNU and macOS; use your editor tool.

Bad

## IMPORTANT RULES

- NEVER use sed -i. ALWAYS use the editor tool.
- ALWAYS run the tests before committing!!!

Capital letters are not enforcement. Each line is a promise the model makes to itself, and nothing notices when it breaks one.

See also

designprincipleharnessagentsskills
Last updated (2df714e8)
Glossary

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.

Cache

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

Affected

The set of projects touched by a change; magus affected <target> runs a target only over them. Affected 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.

MAGUS.md

The committed routing index at a workspace root, regenerated from the knowledge graph: it lists every node and points at the exact query for a given question, so it is the entry point an agent reads first. MAGUS.md 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.

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.

Conventions

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