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>.
| Code | Severity | What it proves |
|---|---|---|
clarity/dead-rule | warn | A rule whose condition can never hold, so it never fires. |
clarity/duplicate | warn | Two rules say the same thing; one is redundant. |
config/bad-number | warn | A numeric config param (max_tokens, temperature) is not a number. |
config/dangling-service | error | A config param's via names a $SERVICE that is not defined. |
config/missing-conditional | warn | A glish cross-field rule ($REQUIRE X when Y is Z) is unmet: the condition holds but the required kind is absent. |
config/missing-param | warn | A config kind is missing a required param (e.g. model's via) — a nudge, not a block. |
config/out-of-range | warn | A config param value violates its declared refinement (a numeric range, character length, or pattern). |
config/unknown-model | warn | The $CONFIG model is not a recognized model id. |
config/unknown-param | info | A config param is not in the kind's schema. |
grammar/double-word | warn | A word repeated back-to-back, like "the the". |
grammar/spacing | info | Irregular spacing around punctuation. |
grammar/standalone-i | warn | Lowercase "i" as a pronoun; write "I". |
import/cycle | error | Two $IMPORT files reference each other in a loop. |
import/missing-export | error | An imported section or anchor does not exist in the target file. |
import/missing-file | error | An $IMPORT file path resolves to no file. |
import/missing-section | error | A {file.section} reference names a section the file lacks. |
import/nested | error | An imported file itself imports another; nesting is not allowed. |
import/unfilled-requirement | warn | An imported file needs a variable the import site did not fill. |
import/unused-file | warn | An $IMPORT file is declared but never referenced. |
logic/action-count | error | One action is given two different counts (call five tools vs call six tools). |
logic/cardinality | error | Two counts for one set cannot both hold (there is only one X vs there are many Xs). |
logic/contradiction | error | Two rules provably conflict, like MUST X versus NEVER X. |
logic/definite-ambiguous | error | A definite "the <symbol>" is bound to two or more different declared symbols. |
logic/definite-identity | error | A 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-undeclared | error | A definite "the <symbol>" names a symbol kind the file never declares. |
logic/exclusivity | error | An "only" rule is exclusive, but another rule adds a member outside it. |
logic/insufficient-set | error | A directive needs more items than the declared set holds (call five tools vs there is only one tool). |
logic/majority | error | Two "most" claims about the same set cannot both hold. |
logic/numeric | error | A numeric impossibility (at most 3 vs at least 5), proven by Z3. |
logic/order | error | Steps require an impossible ordering. |
logic/quantifier | error | Quantified statements provably conflict (all / some / no, or a universal vs a specific case). |
logic/quantifier-strength | error | One quantity per fact — a quantified claim restates one it already entails (all vs some). |
logic/redeclaration | error | A name is bound to two conflicting values. |
logic/syllogism | error | A transitive quantifier chain is contradictory (all A are B, all B are C, no A is C). |
prompt/dangling-name | warn | A paired %name literal% no declaration binds — declare it, or quote it ("%…%") to keep it literal prose. |
prompt/determinable-expect | info | A judge-scored expectation that has an exact deterministic form. |
prompt/duplicated-declaration | warn | A declaration that renders AND is @{expanded} elsewhere — the model reads the value twice. |
prompt/hedging | info | A hedge (try to, if possible) softens an instruction; commit to a modal. |
prompt/multiword-definite | warn | A multi-word definite subject the compiler cannot bound — wrap the name in %…% to bind it as one object. |
prompt/possessive-fragment | info | A 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/unmeasurable | warn | A rule with no concrete, checkable action or bound. |
prompt/untested-rule | info | No $TEST case exercises this rule, so its behavioral impact cannot be measured. |
prompt/vague | info | Vague wording the model can read many ways. |
security/injection | warn | Text resembling a prompt-injection pattern. |
security/leaked-secret | error | A credential literal in the prompt; secrets never live in the file. |
semantic/covered | info | Everything a line asserts is already said elsewhere (the semantic tier's entailment read) — near-total coverage escalates to warn. |
spelling/typo | warn | A likely misspelling, with a suggested correction. |
spelling/unknown-word | info | A word the dictionary does not recognize. |
structure/bad-indent | error | Indentation does not mirror the section nesting (2 spaces per level). |
structure/bare-tool-ref | error | An exact tool name in bare prose; point it with @[name], or quote it to speak the name as text. |
structure/curly-quote | error | A curly quote or apostrophe; only ASCII quotes bind. |
structure/define-in-prose | error | A $DEFINE pointed at from prose; a compile-time condition would leak as a dangling runtime placeholder. |
structure/duplicate-term | warn | A definition term repeats within one list. |
structure/em-dash | error | An em or en dash splices a line; split it or use a comma. |
structure/guard-on-heading | error | A when= guard on a # heading is inert — the content would always ship; guards live on <tag when=...> sections. |
structure/half-quoted-literal | error | A literal-zone tag missing one of its quotes; the name is quoted whole: <"name">. |
structure/heading-outside-section | warn | A # heading sits outside the XML sections the prompt uses. |
structure/inline-marker | error | A "::" 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-content | warn | Content outside any section once XML tags are used. |
structure/misplaced-annotation | warn | A @@ note trailing after content instead of above it. |
structure/missing-period | error | An unterminated statement; end with . ! ? or a lead-in colon. |
structure/one-of-colon | error | "one of" took a colon; the quantifier never does. |
structure/phantom-column | error | A run of two or more interior spaces doing alignment structure. |
structure/retired-brace-ref | error | Bare {braces} / [squares] are prose now: use @{name} to reference a declared name or import. |
structure/retired-literal-sigil | error | The old <=name> literal-zone spelling; the sigil is the quote pair now: <"name">. |
structure/special-character | error | A typographic or decorative codepoint outside the ASCII plane. |
structure/stacked-annotation | error | A @@ note directly above another @@ note. |
structure/tab | error | A tab; the indent unit is 2 spaces. |
structure/trailing-space | error | Trailing whitespace at the end of a line. |
structure/unattached-annotation | error | A @@ note whose next line is not a statement. |
structure/undefined-ref | error | An @{name} pointer resolving to nothing declared. |
structure/undefined-tool-inline | error | A tool used inline but never imported or defined. |
structure/wrapped-definition | error | A hard-wrapped definition continuation; one statement per line. |
structure/wrapped-fragment | warn | A line that reads as a hard-wrapped continuation of the one above. |
style/quoted-prose | warn | A whole-line quote hides a statement from the checker. |
style/wordy | info | Wordy phrasing a tighter form would carry. |
testfile/duplicate-case | error | A case id is defined both inline and in the sibling .test.tg. |
testfile/empty | warn | A discovered .test.tg declares no $TEST or $EXAMPLE blocks. |
testfile/missing-prompt | error | A .test.tg has no sibling .tg prompt to test. |
typeglish/if-then | warn | A conditional (IF / WHEN / UNLESS / WHILE / …) opened without its THEN. |