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

MGS1045: a magus\guard.spawn, command or write registration is unusable

The root magusfile registers a spawn, command or write rule in a way magus cannot use:

[error] [MGS1045] magus\guard.spawn: already registered in this magusfile; a workspace
has one such rule, so fold the second one into the first

Why

magus\guard.spawn, magus\guard.command and magus\guard.write each hand the agent guard one function to call on every spawn, every shell command, or every file write. A registration that is ignored is worse than none: the workspace reads as guarded and nothing is judged. So each of these stops the load instead:

  • the argument is not a function;
  • a second call to the same member in the same load, which would leave it unclear which rule runs;
  • a call from a project's magusfile rather than the workspace root's, since the rule answers for every agent in the workspace.

What to do

Register exactly one function per member, from the root magusfile.buzz. To combine several checks, call them from that one function and return the strictest answer. See magus\guard.spawn and magus\guard.command.

MGS1045magusfileguardagentsspawncommandwrite
Last updated (cc2ee2ea)
Earlier changes on this page (1)

Full history ↗ · Blame source ↗

Glossary

Workspace

The magus root directory that owns a set of projects and shared config; the unit magus operates over. Workspace in full.

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.

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.

Buzz

The language magusfiles are written in (the .buzz engine). Buzz 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.

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.