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

MGS1052: a model tier declaration cannot be used

magus stops loading a workspace when a magus\job.modelTiers or magus\job.modelTier call cannot be used as written:

  • tiers is not an enum, or the enum has no cases;
  • default is not a case of that enum;
  • a key in hosts is not the harness id that magus\harness.provider returns, or names a harness the magusfile did not wire;
  • hosts, bounds or skills raises, or answers a case with the wrong type, an empty model alias, a negative bound, or two cases the same alias on one host;
  • magus\job.modelTier is not given a function;
  • a call is made twice, or from a project's magusfile instead of the root one.

The error names the call and the case it failed on.

Why

A declaration that failed to register would leave a workspace that reads as tiered while every job gets the default, and a mapping that names a harness nothing wired would pick no model at all. Both stay invisible until a job runs, so the load refuses instead.

Resolution

  • Declare an enum and pass it. enum ModelTier { economy, standard, principal }, cheapest first, then magus\job.modelTiers(ModelTier, default: ModelTier.standard, ...).
  • Key hosts by the harness. Keep what magus\harness.provider returns when you wire the harness, and use it as the key.
  • Cover every case. Write hosts, bounds and skills as exhaustive match expressions, so a tier added to the enum fails magus check until each covers it.
  • Call each member once, in the root magusfile.
  • Turn tiers off with magus\job.modelTiers(null) when the workspace wants none.

See model tiers.

MGS1052magusfilejobsmodel-tiers
Last updated (73992e6a)
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.

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.

Harness

The deterministic scaffolding around the work on a change, for a person or an agent: compiler errors, formatters, linters, checks, gates, leases and hooks, placed at points a person chose. Around an agent's loop, magus supplies one and keeps it outside. Harness in full.

Skill

A packaged set of instructions an agent host loads when a task matches its description: a directory holding a SKILL.md. magus ships its magus-* skills in the binary and writes them with magus agent install. Skill 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.