MGS1041: a remote spell import is not declared
A magusfile imports a spell by registry path, and magus.yaml has no entry for it:
[error] [MGS1041] import "ghcr.io/team/spells/lint" names a remote spell magus.yaml does
not declare; add `spells: {ghcr.io/team/spells/lint: {tag: <tag>}}` to magus.yaml, then
run the target that writes magus.lock with the update charm (`magus run spell-lock:update`)
Why
A remote spell runs code magus did not ship, so the workspace has to say exactly which
bytes. The import names only the repository; magus.yaml names the tag it tracks, and
magus.lock pins the manifest digest that tag resolved to. An import with no declaration
has no pin, and resolving the path at load would let the bytes change with no diff to
review. The import is also never handed to the file search, where a directory in the
workspace could answer for it.
What to do
Declare the spell in magus.yaml with the tag you want:
spells:
ghcr.io/team/spells/lint:
tag: "1.4"
Then pin it: run the target that declares magus.lock as its output with the update
charm (magus run spell-lock:update in this repository), or magus spell lock --update
when that target's own magusfile imports the spell. Commit magus.yaml and magus.lock
together. To use a local copy instead, declare path: <dir> rather than a tag. See
Remote spells.