Beacon Diagnostic Codes
Beacon’s Diagnostic provider combines parser feedback, Hindley–Milner type errors, annotation coverage checks, control/data-flow analysis, and workspace import resolution into a single stream of LSP diagnostics.
This guide lists every diagnostic code emitted by that pipeline so you can interpret squiggles quickly and trace them back to the subsystem described in Type Checking, Static Analyzer, and Type Checking Modes.
LSP severity for imports (circular vs. unresolved) remains configurable under [diagnostics] as documented in Configuration.
To temporarily suppress any diagnostic, use the mechanisms described in Suppressions.
Legend:
- ⚠ = Warning
- ✕ = Error
- ⓘ = Info/Hints
Note that per-mode rows show the icon used in strict / balanced / relaxed order
| Code | Name | Level | Category | Description |
|---|---|---|---|---|
| ANY001 | UnsafeAnyUsage | ⚠ | Type Safety | Deep inference found an Any value, reducing type safety. |
| ANN001 | AnnotationMismatch | ✕ ⚠ ⓘ | Annotations | Declared annotation disagrees with the inferred type. |
| ANN002 | MissingVariableAnnotation | ✕ ⚠ | Annotations | Assignment lacks an annotation in strict/balanced modes. |
| ANN003 | ParameterAnnotationMismatch | ✕ ⚠ ⓘ | Annotations | Parameter annotation conflicts with inferred usage. |
| ANN004 | MissingParameterAnnotation | ✕ ⚠ | Annotations | Parameter missing annotation when inference is precise. |
| ANN005 | ReturnAnnotationMismatch | ✕ ⚠ ⓘ | Annotations | Function return annotation disagrees with inference. |
| ANN006 | MissingReturnAnnotation | ✕ ⚠ | Annotations | Function lacks return annotation when inference is concrete. |
| ANN007 | ImplicitAnyParameter | ✕ | Annotations | Strict mode forbids implicit Any on parameters. |
| ANN008 | ImplicitAnyReturn | ✕ | Annotations | Strict mode forbids implicit Any return types. |
| ANN009 | MissingClassAttributeAnnotation | ✕ | Annotations | Strict mode requires explicit annotations on class attributes. |
| ANN010 | BareExceptClause | ✕ | Annotations | Strict mode forbids bare except: clauses without exception types. |
| ANN011 | ParameterImplicitAny | ⚠ | Annotations | Balanced mode warns when parameter type resolves to implicit Any. |
| ANN012 | ReturnImplicitAny | ⚠ | Annotations | Balanced mode warns when return type resolves to implicit Any. |
| DUNDER_INFO | EntryPointGuard | ⓘ | Dunder Patterns | Highlights if __name__ == "__main__": guard blocks. |
| DUNDER001 | MagicMethodOutOfScope | ⚠ | Dunder Patterns | Magic methods defined outside a class. |
| HM001 | TypeMismatch | ✕ | Type System | Hindley–Milner could not unify two types. |
| HM002 | OccursCheckFailed | ✕ | Type System | Recursive type variable detected (infinite type). |
| HM003 | UndefinedTypeVar | ✕ | Type System | Referenced type variable was never declared. |
| HM004 | KindMismatch | ✕ | Type System | Wrong number of type arguments supplied to a generic. |
| HM005 | InfiniteType | ✕ | Type System | Inference produced a non-terminating type (self-referential). |
| HM006 | ProtocolNotSatisfied | ✕ | Type System | Value fails to implement the required protocol methods. |
| HM007 | AttributeNotFound | ✕ | Attributes | Attribute or method does not exist on the receiver type. |
| HM008 | ArgumentCountMismatch | ✕ | Type System | Call site passes too many or too few arguments. |
| HM009 | ArgumentTypeMismatch | ✕ | Type System | Argument type incompatible with the parameter type. |
| HM010 | PatternTypeMismatch | ✕ | Pattern Typing | Match/case pattern cannot match the subject type. |
| HM011 | KeywordArgumentError | ✕ | Type System | Unknown or duplicate keyword arguments in a call. |
| HM012 | GenericTypeError | ✕ | Type System | Catch-all Hindley–Milner error (value restriction, etc.). |
| HM013 | PatternStructureMismatch | ✕ | Pattern Typing | Pattern shape (mapping, class, sequence) differs from subject. |
| HM014 | VarianceError | ✕ | Variance | Invariant/covariant/contravariant constraint violated. |
| MODE_INFO | TypeCheckingMode | ⓘ | Mode | Reminder showing which type-checking mode produced diagnostics. |
| PM001 | PatternNonExhaustive | ✕ | Patterns | Match statement fails to cover every possible case. |
| PM002 | PatternUnreachable | ✕ | Patterns | Later pattern is shadowed by an earlier one. |
| circular-import | CircularImport | ✕ ⚠ ⓘ | Imports | Module participates in an import cycle (severity comes from config). |
| missing-module | MissingModule | ✕ | Imports | Referenced module is absent from the workspace/stubs. |
| shadowed-variable | ShadowedVariable | ⚠ | Scope | Inner scope reuses a name that already exists in an outer scope. |
| undefined-variable | UndefinedVariable | ✕ | Name Resolution | Name used before being defined anywhere. |
| unresolved-import | UnresolvedImport | ✕ ⚠ ⓘ | Imports | Import target cannot be resolved (severity configurable). |
| unreachable-code | UnreachableCode | ⚠ | Data Flow | Code after return, raise, or break never executes. |
| unused-variable | UnusedVariable | ⓘ | Data Flow | Variable assigned but never read. |
| use-before-def | UseBeforeDef | ✕ | Data Flow | Variable read before it is assigned in the current scope. |