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:
tiersis not an enum, or the enum has no cases;defaultis not a case of that enum;- a key in
hostsis not the harness id thatmagus\harness.providerreturns, or names a harness the magusfile did not wire; hosts,boundsorskillsraises, 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.modelTieris 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, thenmagus\job.modelTiers(ModelTier, default: ModelTier.standard, ...). - Key
hostsby the harness. Keep whatmagus\harness.providerreturns when you wire the harness, and use it as the key. - Cover every case. Write
hosts,boundsandskillsas exhaustivematchexpressions, so a tier added to the enum failsmagus checkuntil 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.