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

Cache

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

Elsewhere

Bazel's action cache and Gradle's build cache are the same idea: work keyed by a hash of its inputs. An HTTP cache keys a response by URL and headers instead. A magus cache entry is keyed by the inputs a target declares, so an undeclared input is a bug the sandbox reports.

Example

A second run of an unchanged target replays from the cache instead of running.

magus run build libs/xdg

Used in

In the docs:

In the code (magus refs <name> lists every site):

  • cache.Cache (Go)
  • config.Cache (Go)

See also

glossaryexecution-and-caching
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.

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.

Remote cache

A CI-only backend that shares content-addressed artifacts across runners: a cold machine replays a build another runner already did instead of rebuilding. Every remote artifact must be signed by a trusted key. Remote cache in full.

Knowledge graph

The queryable graph of a workspace's spells, targets, docs, and code relationships; query it with magus query/explain/path. Knowledge graph 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.

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

Placeholders

Angle brackets mark a value you replace with your own; never type the brackets:

magus run <target>
magus completion <shell>    # e.g. bash, zsh, fish

<target>, <path>, <shell>, <name> and the like are stand-ins, not literal text.