Compiling

Diagnostics

The checker reports provable defects as errors (they block build) and best-practice violations as warnings. Every code is explainable with typeglish --explain <code>.

Diagnostic codes

Every diagnostic carries {code, severity, range, message} and often a machine-applicable fix. Errors block build; warnings and info are advisory. Explain any code with typeglish --explain <code>.

CodeSeverityWhat it proves
clarity/dead-rulewarnA rule whose condition can never hold, so it never fires.
clarity/duplicatewarnTwo rules say the same thing; one is redundant.
clarity/unused-definitionwarnA $DEFINE condition no $IF, $SWITCH, or guard references.
clarity/unused-variablewarnA $REQUIRE variable no @{reference} ever fills into the prompt.
config/bad-numberwarnA numeric config param (max_tokens, temperature) is not a number.
config/dangling-serviceerrorA config param's via names a $SERVICE that is not defined.
config/missing-conditionalwarnA glish cross-field rule ($REQUIRE X when Y is Z) is unmet: the condition holds but the required kind is absent.
config/missing-paramwarnA config kind is missing a required param (e.g. model's via) — a nudge, not a block.
config/out-of-rangewarnA config param value violates its declared refinement (a numeric range, character length, or pattern).
config/unknown-kinderrorA $CONFIG kind the schema does not know - the line was stripped and configured NOTHING. The $-command contract: silent misconfiguration errors.
config/unknown-modelwarnThe $CONFIG model is not a recognized model id.
config/unknown-paraminfoA config param is not in the kind's schema.
flow/reassignmentinfoState re-assigned along the flow — a later stage changes an earlier value. Legal (state evolves); surfaced so nothing changes silently.
grammar/agreementwarnNumber/person concord broken — subject × copula (the cars is) or determiner × noun (these car); collectives and PP objects abstain (THE GRAMMATICALITY NET).
grammar/articlewarna/an chosen against the word’s spoken onset (a hour, an formal) — the onset table owns the phonology (THE GRAMMATICALITY NET).
grammar/confused-wordwarnA homophone/near-form in a seat it can never fill (you/your, its/it’s, their/there, then/than, to/too) — convicted on seat evidence with the one-edit repair (THE GRAMMATICALITY NET).
grammar/double-wordwarnA word repeated back-to-back, like "the the".
grammar/spacinginfoIrregular spacing around punctuation.
grammar/spinewarnThe clause spine is broken — the finite verb is missing (the car not green), uninflected (the car be green), or misplaced (the car green is); the one-edit repair restores it (THE SPINE CHECK).
grammar/standalone-iwarnLowercase "i" as a pronoun; write "I".
import/ambiguous-fileerrorAn import path several workspace files could answer by name — qualify the path so exactly one resolves.
import/cycleerrorTwo $IMPORT files reference each other in a loop.
import/missing-exporterrorAn imported section or anchor does not exist in the target file.
import/missing-fileerrorAn $IMPORT file path resolves to no file.
import/missing-sectionerrorA {file.section} reference names a section the file lacks.
import/nestederrorA problem inside an imported file (imports compose transitively), reported at the $IMPORT line that pulled it in.
import/unfilled-requirementwarnAn imported file needs a variable the import site did not fill.
import/unmet-section-requirementwarnA $REQUIRE section no file in the composed closure declares — declare it in a composing file, or keep the $REQUIRE if the platform supplies it.
import/unused-filewarnAn $IMPORT file is declared but never referenced.
logic/action-counterrorOne action is given two different counts (call five tools vs call six tools).
logic/axis-strengtherrorOne truth per axis — a second same-axis value is contained by (or contains) the first, so the looser is dead weight (fast after very fast).
logic/axis-tensionwarnA general axis claim (Be formal.) and an action-scoped one (Speak casually.) pull opposite ways — coherent (“formal overall, casual when speaking”), but worth an explicit scope.
logic/cardinalityerrorTwo counts for one set cannot both hold (there is only one X vs there are many Xs).
logic/contradictionerrorTwo rules provably conflict, like MUST X versus NEVER X.
logic/definite-ambiguouserrorA definite "the <symbol>" is bound to two or more different declared symbols.
logic/definite-identityerrorA definite reference resolves to the one object that carries its predication, and the statement denies that identity (the cool guy is NOT Xavi, when Xavi is the only declared cool guy).
logic/definite-undeclarederrorA definite "the <symbol>" names a symbol kind the file never declares.
logic/epistemic-conflicterrorTwo statements make the same claim with opposite certainty (definitely X vs cannot X) - the certainty square proves both cannot hold.
logic/exclusivityerrorAn "only" rule is exclusive, but another rule adds a member outside it.
logic/force-subsumptionerrorA weaker rule is fully guaranteed by a stronger one on the same force axis (Always X entails Sometimes X, MUST X entails SHOULD X) - it adds nothing but waver.
logic/insufficient-seterrorA directive needs more items than the declared set holds (call five tools vs there is only one tool).
logic/lead-clashwarnA lead-time floor beside a same-day grant on the same work - the booking-to-event interval cannot satisfy both. Scope one rule ("except same-day slots"), or drop one.
logic/majorityerrorTwo "most" claims about the same set cannot both hold.
logic/measureerrorTwo money values claim one slot (over $10,000 vs under $10,000) — the intervals cannot intersect (SPEC §7).
logic/measure-strengtherrorOne money value per slot — a bound restates one it already entails, or the same amount in another surface ($10 then ten dollars).
logic/modifier-contradictionerrorTwo rules share one action but sit at opposite poles, and the prohibition covers everything the obligation demands (MUST send short replies vs MUST NOT send replies) - both cannot hold.
logic/numericerrorA numeric impossibility (at most 3 vs at least 5), proven by Z3.
logic/only-gatewarnAn action is gated (X only when C / never X until C — C is necessary for X) yet mandated elsewhere without the condition: the gate is provably dropped where the two co-serve (THE PROCESS SCOPE). Add the condition to the mandate, or loosen the gate.
logic/ordererrorSteps require an impossible ordering.
logic/quantifiererrorQuantified statements provably conflict (all / some / no, or a universal vs a specific case).
logic/quantifier-strengtherrorOne quantity per fact — a quantified claim restates one it already entails (all vs some).
logic/redeclarationerrorA name is bound to two conflicting values.
logic/syllogismerrorA transitive quantifier chain is contradictory (all A are B, all B are C, no A is C).
logic/timeerrorTwo time values claim one event slot (closes at 9pm vs closes at 8pm) — the intervals cannot intersect.
logic/time-strengtherrorOne time bound per slot — a duration bound restates one it already entails (within 2 hours after within 30 minutes).
logic/window-containmentwarnA recurring slot time falls outside one operating day’s declared window while fitting the others - the slot cannot exist on that day. Scope the slot ("except Friday") or extend that day’s hours.
prompt/agentless-passiveinfoThe doer is deleted (agentless passive) or demoted to a by-phrase - name the actor or use the imperative.
prompt/ambiguous-referencewarnA definite singular (the dog) points at a slot the world proves holds 2 or more - which one? Name the one you mean, or make the reference plural.
prompt/authority-capwarnAn authority ceiling (refunds up to $200) beside an unbounded grant of the SAME action (offer a full refund) with no route past the cap — coherent only as ceiling + routed exception (the contradiction hunt, class 3). Add the approval route, or scope the entitlement.
prompt/cap-tensionwarnA bounded output (replies capped at N sentences) beside an exhaustive mandate (confirm the FULL order) — coherent only as default + exception; scope the cap (the contradiction hunt, class 2).
prompt/conjunct-capwarnA mandated ask carries more questions than the question cap allows — the count rides the coordination, one per repeated whether/wh-marker (THE CONJUNCT COUNT, THE COUNT SCOPE tier 2). Split the ask into separate turns, or scope the cap.
prompt/count-alignmentwarnOne counted thing, two count spellings (a unitless bound beside a per-unit one, or a count inside an either/or) — state one bound with one unit (THE COUNT SCOPE, the hunt’s class 1 advisory tier).
prompt/dangling-namewarnA paired %name literal% no declaration binds — declare it, or quote it ("%…%") to keep it literal prose.
prompt/dangling-referencewarnA pro-form (it, this) points at nothing the prompt has introduced - a model will guess the referent.
prompt/declared-laterinfoAn identity is declared AFTER its first use (you on line 3, used on line 1) - the model reads top-down, so declare identities before the rules that use them.
prompt/determinable-expectinfoA judge-scored expectation that has an exact deterministic form.
prompt/duplicated-declarationwarnA declaration that renders AND is @{expanded} elsewhere — the model reads the value twice.
prompt/expletive-framewarnA dummy-it frame (It is important to ...) carries no doer - state the instruction directly.
prompt/guard-prioritywarnTwo guard-led rules — one condition provably specializes the other, the actions diverge, and no priority is stated (otherwise/instead): a case serving both guards leaves the model guessing which rule wins (THE PROCESS SCOPE tier 3).
prompt/hedginginfoA hedge (try to, if possible) softens an instruction; commit to a modal.
prompt/implied-doerinfoA document of imperatives that never establishes its addressee - one declaration (You are the dispatcher.) anchors every instruction. Fires once per document.
prompt/mixed-timezonewarnTwo different timezones qualify times in one prompt — unify them, or make the zone a variable.
prompt/multiword-definitewarnA multi-word definite subject the compiler cannot bound — wrap the name in %…% to bind it as one object.
prompt/naive-timeinfoThe prompt states clock times but never fixes a timezone — the model will guess. Declare a timezone variable (default UTC) or qualify the times.
prompt/nominalized-processwarnThe action is packed into a noun (a review must take place) and nobody performs it - use the verb with a doer.
prompt/possessive-fragmentinfoA possessive fragment (The boy's father.) asserts only that the thing exists — add a predicate to bind a value, or spell the copula (The boy is …) to assert a trait.
prompt/prose-step-refinfoA prose step reference that resolves through a Step-titled section — works; the @<section> pointer is the stronger, rename-safe form.
prompt/scale-gapwarnA prose scale is defined with holes (severity one and three defined, two never) — the model must guess the middle (the contradiction hunt, class 5).
prompt/tier-overlapwarnAdjacent authority tiers double-cover a value - a shared boundary point (info) or a nested range (warn) gives one amount two handlers. Make the tiers exclusive ("over $150"), or state which rule wins.
prompt/undefined-adjectiveerrorAn adjective claims on an UNNAMED axis — define it ($CONFIG adjective <word> with an axis) or relax the dial ($CONFIG lexicon → undefined_adjectives). ERROR by default: a claim the checker holds with one hand.
prompt/unintroduced-definiteinfoA definite retrieves a card the document never introduces (Open the store. - which store?) - introduce the head on another line, or the model guesses.
prompt/unmeasurablewarnA rule with no concrete, checkable action or bound.
prompt/unowned-attributeinfoA bare attribute (The tone is …) names a slot but not its owner — own it (Your tone is …) or name the owner (The response’s tone is …). The unowned slot is judged bare-vs-bare but never paired with owned slots.
prompt/unregistered-doerinfoA bare generic doer (Users should ...) never enters the world model - the imperative or a definite party registers who acts.
prompt/untested-ruleinfoNo $TEST case exercises this rule, so its behavioral impact cannot be measured.
prompt/vagueinfoVague wording the model can read many ways.
security/injectionwarnText resembling a prompt-injection pattern.
security/leaked-secreterrorA credential literal in the prompt; secrets never live in the file.
semantic/coveredinfoEverything a line asserts is already said elsewhere (the semantic tier's entailment read) — near-total coverage escalates to warn.
spelling/typowarnA likely misspelling, with a suggested correction.
spelling/unknown-wordinfoA word the dictionary does not recognize.
structure/alias-collisionwarnA statement alias (@@ name:) already names another annotation, section, tool, or import — one name, one referent.
structure/ambiguous-section-referrorA reference (or transclusion) to a section name declared in several scopes, with no enclosing scope to pick one.
structure/ambiguous-step-referrorA step reference that several sections' steps could answer — qualify it (per <section> step 2) or use a #anchor.
structure/bad-case-exprerrorA chain arm's condition does not parse — the arm would silently never fire.
structure/bad-define-exprerrorA $DEFINE whose condition does not parse.
structure/bad-exampleerrorA malformed $EXAMPLE block field — the block cannot compile faithfully.
structure/bad-guard-exprerrorA <tag when=…> guard that is not a valid condition — the section could not resolve away soundly.
structure/bad-indentwarnIndentation does not mirror the section nesting (2 spaces per level); the nesting read is best-effort.
structure/bad-input-typeerrorA $REQUIRE variable whose name or type is malformed — the name must be one @{…} can read back, and chains and guards on a bad type would be unsound.
structure/bad-pointer-nameerrorA pointer name the grammar cannot lex (@{2fa}, @{_x}, @{customer-id}, @{}) — a pointer name begins with a LETTER. Read at the whole bracket, so both failures land here: a pointer-shaped name the emitter expands into a placeholder nothing can fill, and one it cannot read at all, which reaches the model with its compile-time @ still attached.
structure/bad-switcherrorA malformed $SWITCH or $IF chain shape (retired inline form, nested deterministic IF, dangling ELSE).
structure/bad-testerrorA malformed $TEST block field (e.g. the retired EXPECT form).
structure/bare-tool-referrorAn exact tool name in bare prose; point it with @[name], or quote it to speak the name as text.
structure/config-section-contenterrorContent inside a <$config> section that is not $IMPORT/$CONFIG rows.
structure/curly-quotewarnA curly quote or apostrophe; only ASCII quotes bind — the lookalike ships as prose, the fix is mechanical.
structure/dangling-binding-paramerrorA @{name} in a request or value that is not a declared parameter — declare it under input::, or use @{env.NAME}.
structure/dangling-section-referrorA cited <tag> that nothing declares — fix the spelling, or declare it with $REQUIRE section when a host composes it in.
structure/dangling-serviceerrorA request references a $SERVICE that is not defined — the binding has no base to compile against.
structure/dangling-step-referrorA pointer to a step ordinal this document never defines.
structure/define-bindererrorA $DEFINE using = — the binder is AS.
structure/define-cycleerror$DEFINEs that depend on themselves in a cycle — no evaluation order exists.
structure/define-in-proseerrorA $DEFINE pointed at from prose; a compile-time condition would leak as a dangling runtime placeholder.
structure/define-word-classerrorA $DEFINE word row whose - class:: is not a word class (noun, verb, adjective) — the row defines nothing.
structure/define-word-formerrorA malformed $DEFINE word header — the lemma is missing, or is not a single word.
structure/define-word-paramerrorA $DEFINE word body param outside the closed schema (class, unique) — read without it, it configured nothing.
structure/define-word-uniqueerrorA $DEFINE word - unique:: that is not a boolean, or sits on a non-noun — unique referents are a noun feature.
structure/duplicate-caseerrorAn arm matched entirely by an earlier arm — it can never run.
structure/duplicate-defineerrorOne $DEFINE name bound more than once.
structure/duplicate-define-worderrorOne $DEFINE word lemma defined more than once in a source — the first row wins.
structure/duplicate-keyerrorA field key repeated within one $TOOL / $SERVICE block — one per block.
structure/duplicate-paramerrorOne tool parameter defined more than once — the schema can carry it once.
structure/duplicate-sectionerrorTwo sections share one tag — a reference to it is ambiguous; give each a distinct name.
structure/duplicate-serviceerrorOne $SERVICE name defined more than once.
structure/duplicate-steperrorSeveral steps in one scope carry the same number — a reference to it is ambiguous.
structure/duplicate-termwarnA definition term repeats within one list.
structure/duplicate-toolerrorOne $TOOL name defined more than once.
structure/em-dashwarnAn em or en dash splices a line; the checker reads it as one statement — split it or use a comma.
structure/empty-serviceerrorA $SERVICE with no body — its fields (base::, headers::) indent beneath it.
structure/empty-toolerrorA $TOOL with no body — its fields (description::, input::, request::) indent beneath it.
structure/env-shadowwarnA declared variable named env beside a $TOOL/$SERVICE binding reading @{env.…} — inside a tool block that spelling is the AMBIENT environment, in prose it is a field of the declared variable: one spelling, two referents. Rename the variable.
structure/guard-on-headingerrorA when= guard on a # heading is inert — the content would always ship; guards live on <tag when=...> sections.
structure/guard-type-mismatcherrorA guard or $DEFINE reads an input at the wrong type — a bare read wants a bool, a comparison wants an enum member.
structure/half-quoted-literalerrorA literal-zone tag missing one of its quotes; the name is quoted whole: <"name">.
structure/header-without-bindingwarnTool headers with no request:: — headers ride an HTTP binding, so these do nothing; add the request or delete them.
structure/heading-outside-sectionwarnA # heading sits outside the XML sections the prompt uses.
structure/hoist-arminfoEvery arm repeats the same statement — shared content is branch-independent; hoist it above the chain.
structure/impossible-caseerrorA CASE pattern outside the switch domain — the arm can never fire.
structure/impossible-valueerrorA comparison against a value outside the input's declared domain.
structure/inline-markerwarnA "::" definition marker used inline; read as prose and shipped verbatim — nest it as a "- " sub-definition, or quote it as a sample.
structure/large-arminfoAn arm body large enough to extract — move it to a section and point at it.
structure/loose-contentwarnContent outside any section once XML tags are used.
structure/malformed-bindingerrorA binding placeholder written {name} — a pointer is @{name}; the rewrite is attached.
structure/malformed-headererrorA line that is not a header — a header is "- Header-Name:: value".
structure/malformed-paramerrorA line that is not a valid tool parameter — "- name:: type: description." with the type in English; the rewrite is attached.
structure/malformed-serviceerrorA line that is not a field of its $SERVICE — fields are "- key:: value" rows; the rewrite is attached.
structure/malformed-toolerrorA line that is not a field of its $TOOL — fields are "- key:: value" rows; the rewrite is attached.
structure/misplaced-annotationwarnA @@ note trailing after content instead of above it.
structure/misplaced-commanderrorA $-command below content — commands sit at the top of the file, outside any section.
structure/misplaced-paramerrorA parameter row inside description:: text — it would never reach the schema; move it under "- input::".
structure/missing-periodwarnAn unterminated statement; the checker assumes the terminator — end with . ! ? or a lead-in colon.
structure/missing-steperrorA gap in a step sequence — the numbering jumps over a step that does not exist.
structure/near-duplicate-sectionwarnTwo section names within one edit of each other — read as DISTINCT sections (refs bind by exact tag); a possible typo.
structure/needs-sigilerrorA command keyword without its $ sigil — the line would ship as prose and configure nothing.
structure/no-default-brancherrorA decision with no Otherwise — a state matching none of the branches would be unhandled.
structure/non-exhaustive-brancherrorA decision over an enum that leaves members unhandled.
structure/non-exhaustive-switcherrorA chain over open-ended conditions cannot be proven exhaustive — add an ELSE arm.
structure/one-of-colonerror"one of" took a colon; the quantifier never does.
structure/opaque-switcherrorA $SWITCH over an input with no declared domain — coverage cannot be proven; type the input.
structure/overlapping-guardwarnOne value handled by more than one branch — in a decision only one runs, and an LLM won't reliably pick the same one.
structure/phantom-columnwarnA run of two or more interior spaces doing alignment structure; collapses mechanically.
structure/retired-brace-referrorBare {braces} / [squares] are prose now: use @{name} to reference a declared name or import.
structure/retired-literal-sigilerrorThe old <=name> literal-zone spelling; the sigil is the quote pair now: <"name">.
structure/secret-literalwarnA credential-looking literal in a $SERVICE / $TOOL value — secrets never live in the file; use @{env.NAME}.
structure/service-no-baseerrorA $SERVICE without a base — every request through it needs a URL to compile against.
structure/special-characterwarnA typographic or decorative codepoint outside the ASCII plane; ships as-is, the ASCII fix is attached.
structure/split-declarationwarnOne subject declared with separate single values across statements — multiplicity must be spelled in one statement (THE ONE-STATEMENT LAW).
structure/stacked-annotationerrorA @@ note directly above another @@ note.
structure/stray-close-tagerrorA closing tag with no matching open — the section extent is undefined.
structure/switch-armerrorA malformed - member:: … arm row in a $SWITCH block.
structure/switch-shaped-chaininfoEvery arm tests one input for one member — this chain is a $SWITCH in disguise; the block form proves coverage.
structure/tabwarnA tab; the indent unit is 2 spaces — the fix is mechanical.
structure/tool-defined-and-importedwarnA tool both defined ($TOOL) and imported ($IMPORT tool) — pick one; the definition wins.
structure/tool-no-descriptionwarnA $TOOL without a description — the model has nothing to decide WHEN to call it.
structure/trailing-spacewarnTrailing whitespace at the end of a line; strips mechanically.
structure/unattached-annotationerrorA @@ note whose next line is not a statement.
structure/unclosed-tagerrorA section tag opened but never closed — the section extent is undefined.
structure/undeclared-inputerrorA guard, chain, or $DEFINE reads a variable that is not a declared input or $DEFINE.
structure/undeclared-toolerrorA tool the prose uses that no $TOOL defines and no $IMPORT tool declares.
structure/undefined-referrorAn @{name} pointer resolving to nothing declared.
structure/undefined-tool-inlineerrorA tool used inline but never imported or defined.
structure/unknown-service-keywarnA $SERVICE field key outside the schema (base, headers).
structure/unknown-tool-keywarnA $TOOL field key outside the schema (description, input, request, headers).
structure/unordered-stepwarnSteps out of numeric order within their scope.
structure/unreachable-brancherrorA branch after Otherwise — it can never run.
structure/unreachable-caseerrorAn arm after the fallback — it can never run.
structure/unreachable-otherwiseerrorEvery member already has an arm, so Otherwise can never run.
structure/unused-definewarnA $DEFINE nothing reads.
structure/unused-importwarnAn $IMPORT nothing references — the manifest over-declares.
structure/unused-servicewarnA $SERVICE no tool's request or via:: transport uses.
structure/unused-toolwarnA defined tool the prompt never mentions — the model cannot discover it.
structure/vacuous-linewarnA line that interrupts a numbered step run and says nothing the checker can read — attach it, promote it to a heading, or delete it.
structure/vague-section-namewarnA section name too short or generic to be meaningful — name it for what it contains.
structure/wrapped-definitionerrorA hard-wrapped definition continuation; one statement per line.
structure/wrapped-fragmentwarnA line that reads as a hard-wrapped continuation of the one above.
style/quoted-prosewarnA whole-line quote hides a statement from the checker.
style/wordyinfoWordy phrasing a tighter form would carry.
testfile/duplicate-caseerrorA case id is defined both inline and in the sibling .test.tg.
testfile/emptywarnA discovered .test.tg declares no $TEST or $EXAMPLE blocks.
testfile/missing-prompterrorA .test.tg has no sibling .tg prompt to test.
typeglish/if-theninfoA conditional (IF / WHEN / UNLESS / WHILE / …) opened without its THEN — an ADVISORY by the owner’s ruling (2026-08, two hunt rounds measured it at ~79% of all warns on plain-prose imports, drowning the signal; the canonical-form nudge stays, at info).