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

read-navigation

An advisory by default: it explains, and blocks nothing, on a whole read of a Go, Buzz or Markdown file past the workspace's line limit.

What it catches

A whole read of a Go, Buzz or Markdown file past the workspace's line limit.

Why

The deny carries the file's declarations or headings with their lines, and the command that prints one of them, so the refused read costs nothing. The map is parsed from the file itself, so a stale index still gets one: where the index vouches for every name, magus refs <name> --definition --source prints one checked against it and the graph lists the map; where it does not, and for Buzz, which nothing indexes for refs, sed -n <first>,<last>p <file> prints one by its lines. A Go declaration spans its doc comment to its closing brace, each member of a grouped var, const or type is its own entry, and a method is named Type.Method. A Buzz entry is a top-level fun, test, object or enum, from its doc comment to the line before the next statement. Every file a cat or nl prints is judged, so cat a.go b.go is refused for whichever mapped file is over the threshold. A host's read tool is restated as the same line (cat <file>, or sed -n over its offset and limit, a limit over 300 counting as whole) and judged the same way. The size worth flagging is the rule's lines setting, which a workspace sets: the binary ships no number for it. Silent on a short file, TypeScript (no parser here), SKILL.md, AGENTS.md and a host's own instruction file (written to be read whole), a generated output, a path outside the workspace, a file that does not parse, and a read feeding a pipe or redirect.

Default and override

By default this rule takes the decision advise. A workspace sets it by name, in its root magusfile, to deny, advise or off:

magus\guard.builtins({"read-navigation": "deny"})

A loosening takes effect once it is committed; a tightening applies at once.

Seeing it

A verdict names its rule in brackets, which is how you got here:

advise [read-navigation]: ...

magus describe rule read-navigation prints the same entry at a terminal, and magus describe rules lists every rule this workspace enforces.

See also

guardrulesread-navigationadvise
Last updated (1a76274f)
Earlier changes on this page (3)

Full history ↗ · Blame source ↗

Glossary

Workspace

The magus root directory that owns a set of projects and shared config; the unit magus operates over. See workspace.

Magusfile

The magusfile.buzz that declares a project's targets (as export funs) and binds its spells. See targets.

Op

A single tool-native command a target composes (long form: operation); the middle of the work hierarchy (Spell to Op to Target). See operations.

Buzz

The language magusfiles are written in (the .buzz engine). See engines.

CI

An ordinary magusfile-defined target you compose yourself with magus\needs: magus does not hardcode its stages. Magus.RunCI treats it specially only in that it strips the rw charm, it is the anchor magus affected ci keys off, and a selected scope with no project declaring it is a load error rather than a silent no-op. See targets.

Span

OpenTelemetry's name for one unit of work under a trace: a target execution, whose sub-operations are child spans. An output reference points at a span's captured output. See telemetry.

Advisor

One read-only check from the advice suite: it reads the changeset through magus and writes one titled section of findings. The same advisors run as a pull request comment in CI and inside magus diff --impact locally.

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.