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

MGS1017: magusfile is not a spell

A magusfile imported magus/spell/magusfile, or named magusfile in its project's "spells" list. Neither has any effect: magus binds that driver to every project it discovers.

A spell is a library of tool-native operations for one toolchain: the go spell exposes go-build/go-test/go-vet, the rust spell exposes cargo-build/cargo-clippy. The magusfile driver adapts no toolchain and contributes no operations. It is what makes the targets in the file you are writing runnable at all, which is not something an author opts into.

Resolution

Delete the import, and drop magusfile from the "spells" list:

 import "magus";
-import "magus/spell/magusfile";
 import "magus/spell/go";

 magus\project({
-    "spells": [magusfile, go],
+    "spells": [go],
 });

A project whose targets all come from its magusfile binds no toolchain at all, so it needs no list:

 magus\project({
-    "spells": [magusfile],
 });

Your targets keep running exactly as before. magus ls stops reporting spell: magusfile for the project and reports the toolchain it binds, or none.

Why this is an error rather than a warning

Binding the driver became implicit because listing it was never the author's job. That left the import and the list entry as no-ops which still taught every reader, and every generated example, that magusfile was a spell like go or buf. Failing loudly with the one-line fix ends that, rather than leaving a declaration that looks load-bearing and is not.

MGS1017magusfilespellsmigrationbreaking-change
Last updated (353014be)
Earlier changes on this page (2)

Full history ↗ · Blame source ↗

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.

Spell

A language/runtime adapter (e.g. go, md) that maps generic targets onto a toolchain's real commands. Spell 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

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