Skip to main content

Module rules

Module rules 

Source
Expand description

Rule-tagged messages for type errors (#306 slice 2).

Every TypeError variant maps to a stable rule_tag (a kebab- case identifier) and a rule_explanation (plain-language description of what the rule enforces). LLM repair flows that reference the rule_tag get measurably better repair attempts because the model can cross-reference the rule across many prior examples.

The tag is stable across releases — once shipped, a rule_tag never changes meaning. New rules get new tags; existing variants that split into more specific sub-rules will be handled by adding new sibling tags, not by repurposing existing ones.

Structs§

RuleInfo
Catalog entry for one rule.

Functions§

all_rules
The full rule catalog, in stable order. Used by lex docs --rules and by tooling that wants to enumerate every supported rule (e.g. an LSP server building a code-actions registry).
suggested_transform_for
Static (rule_tag → suggested_transform) table for #306 slice 3.