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.
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-modelwarnThe $CONFIG model is not a recognized model id.
config/unknown-paraminfoA config param is not in the kind's schema.
grammar/double-wordwarnA word repeated back-to-back, like "the the".
grammar/spacinginfoIrregular spacing around punctuation.
grammar/standalone-iwarnLowercase "i" as a pronoun; write "I".
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/nestederrorAn imported file itself imports another; nesting is not allowed.
import/unfilled-requirementwarnAn imported file needs a variable the import site did not fill.
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/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/exclusivityerrorAn "only" rule is exclusive, but another rule adds a member outside it.
logic/insufficient-seterrorA directive needs more items than the declared set holds (call five tools vs there is only one tool).
logic/majorityerrorTwo "most" claims about the same set cannot both hold.
logic/numericerrorA numeric impossibility (at most 3 vs at least 5), proven by Z3.
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).
prompt/dangling-namewarnA paired %name literal% no declaration binds — declare it, or quote it ("%…%") to keep it literal prose.
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/hedginginfoA hedge (try to, if possible) softens an instruction; commit to a modal.
prompt/multiword-definitewarnA multi-word definite subject the compiler cannot bound — wrap the name in %…% to bind it as one object.
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/unmeasurablewarnA rule with no concrete, checkable action or bound.
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/bad-indenterrorIndentation does not mirror the section nesting (2 spaces per level).
structure/bare-tool-referrorAn exact tool name in bare prose; point it with @[name], or quote it to speak the name as text.
structure/curly-quoteerrorA curly quote or apostrophe; only ASCII quotes bind.
structure/define-in-proseerrorA $DEFINE pointed at from prose; a compile-time condition would leak as a dangling runtime placeholder.
structure/duplicate-termwarnA definition term repeats within one list.
structure/em-dasherrorAn em or en dash splices a line; split it or use a comma.
structure/guard-on-headingerrorA when= guard on a # heading is inert — the content would always ship; guards live on <tag when=...> sections.
structure/half-quoted-literalerrorA literal-zone tag missing one of its quotes; the name is quoted whole: <"name">.
structure/heading-outside-sectionwarnA # heading sits outside the XML sections the prompt uses.
structure/inline-markererrorA "::" definition marker used inline; it opens an entry at a line head — nest it as a "- " sub-definition, or quote it as a sample.
structure/loose-contentwarnContent outside any section once XML tags are used.
structure/misplaced-annotationwarnA @@ note trailing after content instead of above it.
structure/missing-perioderrorAn unterminated statement; end with . ! ? or a lead-in colon.
structure/one-of-colonerror"one of" took a colon; the quantifier never does.
structure/phantom-columnerrorA run of two or more interior spaces doing alignment structure.
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/special-charactererrorA typographic or decorative codepoint outside the ASCII plane.
structure/stacked-annotationerrorA @@ note directly above another @@ note.
structure/taberrorA tab; the indent unit is 2 spaces.
structure/trailing-spaceerrorTrailing whitespace at the end of a line.
structure/unattached-annotationerrorA @@ note whose next line is not a statement.
structure/undefined-referrorAn @{name} pointer resolving to nothing declared.
structure/undefined-tool-inlineerrorA tool used inline but never imported or defined.
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-thenwarnA conditional (IF / WHEN / UNLESS / WHILE / …) opened without its THEN.