Diagnostics Reference
Every Bee diagnostic code, grouped by module. This is a compiler-builder's single
source of truth for the error surface: each code is first registered in
registry/diagnostics.json before it may appear in any /spec or /tutorial table.
The tables below are generated faithfully to that registry.
Severity legend
| Severity | Meaning |
| E | Hard error — fatal; halts the build or traps at runtime unless handled. |
| W | Soft warning — non-fatal; logged to stderr and does not change the exit status. |
Coding convention
- Block rule: module <dd> owns block E<dd>xx, where <dd> is the module's leading digit (01 → E01, 02 → E02, … 14 → E14).
- Memory block: module 00 (memory model) has no natural E00xx range (E00xx is reserved for global/deprecation codes), so memory uses the first free block E08xx.
- Collision policy: if a proposed code already exists with different semantics, the newer use is bumped to the next free slot in its module block and re-registered. A skipped slot within a block is therefore intentional.
Global codes
Cross-cutting codes shared by every module. Up-scope targets for Phase 7.2
deprecation hardening. Source: spec/00,01,02,03 + decisions D12/D14/D15.
| Code | Severity | Condition | Resolution |
| E0009 | E | Upscope target for deprecated symbols/keywords once Phase 7.2 migration completes (replaces E0010/E0011 as hard). | Rewrite using the canonical ratified form. |
| E0010 | E | Legacy form encountered: 'repeat' (use 'next', D15), '≠'/'=='/'!='/'<>' (use '¬'/'='/¬, D12), '.!'/'!.'/'!!' range glyphs (use '..<'/'>..'/'>..<', D13). | Replace with the canonical form; non-fatal until Phase 7.2 hardens to E0009. |
| E0011 | E | Legacy 'using' / 'using:' postfix on io_stmt or rule call (D6). | Use curried named-argument call form (sep: ...); non-fatal until hardened to E0009. |
| W0901 | W | Parser reached a token stream with no statements produced; soft warning attached to parser error surface. | Author statements that the rigid syntax gate recognizes. |
E00 / E08 — Memory model
Memory module spec/00-memory-model.md §5. Block moved from the overloaded E04xx range to the free E08xx on 2026-09-14 (spec/04 retains E0401–E0406). Related page: memory.html.
| Code | Severity | Condition | Resolution |
| E0801 | E | Read or write of an identifier after a 'zap' statement in the same control-flow graph. | Compile-time fatal error with source line location; runtime 'Panic: UseAfterZap' under -d. |
| E0802 | E | Pointer escapes a Region Arena into an outer scope. | Compiler automatically promotes the allocation from Region to ARC Heap. |
| E0803 | E | Unhandled cycle in an ARC structure. | Static lifetime analysis, or runtime leak warning under -d. |
| E0804 | E | Cross-thread mutation of an unshared reference. | Compile-time data-race restriction. |
E01 — Lexical structure
Lexical structure module spec/01-lexical-structure.md §6. Related page: syntax.html.
| Code | Severity | Condition | Resolution |
| E0101 | E | Unexpected UTF-8 BOM marker at source start. | Strip the BOM from the source header. |
| E0102 | E | Block comment ('+-') without a closing '-+'. | Ensure closing '-+' exists. |
| E0103 | E | Invalid escape sequence in a string literal. | Use valid \n, \t, \uXXXX escapes. |
| E0104 | E | Single-letter uppercase variable identifier. | Use a lowercase start or a multi-letter type identifier. |
| E0105 | E | Unterminated string literal or markup block. | Check closing quotes or the matching markup tag. |
E02 — Statements
Statements module spec/02-statements.md §7 (+ D14/D15). Related page: control.html.
| Code | Severity | Condition | Resolution |
| E0201 | E | Statement not aligned to the 2-space offset boundary. | Re-indent to the canonical 2-space block depth. |
| E0202 | E | Mutation of a variable without a prior 'new' declaration. | Declare the variable first. |
| E0203 | E | Missing 'done' or 'return' terminator. | Terminate the block with 'done [label];' (D14) or 'return;'. |
| E0204 | E | Using the '::' clone operator on a non-clonable primitive. | Use ':=' or restrict '::' to boxed/object targets. |
| E0205 | E | Closing label on 'done' does not match the opening header label. | Align 'done' label with the block header label. |
| E0206 | E | 'next', 'stop', or 'redo' used outside a loop body. | Move the jump inside a loop (D14/D15). |
E03 — Rules
Rules module spec/03-rules.md §7 (+ D6). Related page: rules.html.
| Code | Severity | Condition | Resolution |
| E0301 | E | Rule invoked prior to definition or forward declaration. | Define or forward-declare the rule first. |
| W0301 | W | Assertion failed in an 'assert' contract clause. | Logged to stderr; review the asserted invariant. |
| E0303 | E | Expectation failed in an 'expect' contract clause or body statement. | Fatal runtime error if unhandled. |
| E0304 | E | Multi-result rule used inside an arithmetic expression tree. | Call the rule at statement level and deconstruct its results. |
| E0305 | E | Rule block does not end with an aligned 'return;'. | Append 'return;' at the rule end. |
| E0306 | E | Forward declaration does not match the rule implementation signature. | Align the two signatures. |
| E0307 | E | Call site omits a required named-parameter slot binding with no default (D6). | Supply the named argument at the call site. |
| W0308 | W | Curried '(...)' list appended where the rule declares no named slot (D6). | Remove the extraneous named-argument list. |
| E0309 | E | Call site names an identifier not present in the rule's declared named slot (D6). | Use only declared named-slot identifiers. |
E04 — Structure
Structure module spec/04-structure.md §7. Retains the canonical E04xx block after memory was bumped to E08xx. Related page: structure.html.
| Code | Severity | Condition | Resolution |
| E0401 | E | Secondary or library module contains 'rule main'. | Remove 'rule main' from non-entry modules. |
| E0402 | E | Access to an unexported member (missing '.' prefix). | Export the member with a '.' prefix or access within module. |
| E0403 | E | Module file missing from the search path ($pro_mod, $pro_lib, $bee_lib). | Place the module in a configured search path. |
| E0404 | E | Circular dependency between imported modules. | Break the import cycle. |
| E0405 | E | Attempt to load 'main.bee' via a 'use' directive. | Do not import the entry module. |
| E0406 | E | Scope exited with pending 'begin' threads prior to a 'wait' barrier. | Add a 'wait' barrier before scope exit. (Semantic twin of E1201 in concurrency; retained here for module-level structure completeness.) |
E05 — Types
Types module spec/05-types.md §7. Related page: types.html.
| Code | Severity | Condition | Resolution |
| E0501 | E | Assigned value violates the static type boundary. | Cast or fix the value to the declared type. |
| E0502 | E | Incompatible explicit cast with the ':>' operator. | Use a lossless cast between compatible types. |
| E0503 | E | Assigned literal falls outside a constrained range/domain. | Constrain the value to the declared domain. |
| E0504 | E | Value exceeds the maximum capacity of a Q(m.n) container. | Widen the fixed-point precision. |
| E0505 | E | User type identifier uses a reserved single uppercase Latin letter. | Choose a non-reserved name or a multi-letter type. |
| E0506 | E | Approximate comparison '≈' executed with uninitialized $max_precision. | Initialize $max_precision before using '≈'. |
E06 — Objects
Objects module spec/06-objects.md §7. Related page: objects.html.
| Code | Severity | Condition | Resolution |
| E0601 | E | Concrete class fails to supply a body for an inherited abstract method. | Implement the abstract method in the concrete class. |
| E0602 | E | Access to a property without the '.' or 'self.' export prefix. | Export the property or access via 'self.'. |
| E0603 | E | Derived constructor fails to execute a 'super(...)' call. | Chain the parent constructor. |
| E0604 | E | Class hierarchy contains a circular inheritance loop. | Break the inheritance cycle. |
| E0605 | E | Accessing a dynamic key that does not exist in an object dictionary. | Guard the key with a membership check. |
| E0606 | E | Trait applied to an incompatible target type. | Apply the trait only to compatible types. |
E07 — Functions
Functions module spec/07-functions.md §7. Related page: functions.html.
| Code | Severity | Condition | Resolution |
| E0701 | E | Lambda attempts to invoke a stateful rule. | Use only pure lambdas inside a lambda; hoist the rule call out. |
| E0702 | E | Lambda contains I/O or variable mutation. | Keep lambdas side-effect-free. |
| E0703 | E | Passed lambda signature does not match the expected 'L' parameter. | Align the lambda signature with the 'L' type descriptor. |
| E0704 | E | Lambda references an outer variable not in scope inside the lambda frame. | Pass needed values as lambda parameters. |
| E0705 | E | Use of 'new', 'let', or 'alter' inside a lambda. | Move state declarations outside the lambda. |
E10 — Collections
Collections module spec/10-collections.md §5. Related page: collections.html.
| Code | Severity | Condition | Resolution |
| E1001 | E | Index less than 1 or greater than the collection length '$'. | Use 1-based indexing; '$-k' for end-relative. |
| E1002 | E | Insertion of a duplicate key/element into Set/Map. | Check membership or allow overwrite. |
| E1003 | E | Incompatible row/column dimension during assignment. | Align matrix dimensions. |
| E1004 | E | Value type does not match the declared collection element type. | Cast the value or change the element type. |
| E1005 | E | Set operator ('∩','∪') applied to a non-set type. | Use set operators only on sets. |
| E1006 | E | Use of index 0 (Bee is 1-based, Decision 1). | Rewrite the index starting from 1. |
E11 — Processing
Processing module spec/11-processing.md §7. Related page: processing.html.
| Code | Severity | Condition | Resolution |
| E1101 | E | Unboxing a reference into an incompatible scalar type. | Unbox with the correct 'Type(boxed)' target. |
| E1102 | E | Quantifier applied to a non-collection operand. | Apply quantifiers to collections only. |
| E1103 | E | Output type of a pipeline step does not match the next step's input. | Insert an adapting step into the pipeline. |
| E1104 | E | Number of targets exceeds collection elements without a '*' tail. | Add a '*' tail or reduce targets. |
| E1105 | E | Dimension wildcard '*' used on a non-matrix or invalid rank. | Use '*' only on valid matrix ranks. |
| E1106 | E | Reference assignment ':=' on an unboxed value. | Box the value first with '[x]'. |
E12 — Concurrency
Concurrency module spec/12-concurrency.md §7. Related page: concurrency.html.
| Code | Severity | Condition | Resolution |
| E1201 | E | Scope exited with pending 'begin' threads prior to a 'wait' barrier. | Add a 'wait' barrier before scope exit. (Canonical working code; twin of E0406 in structure.) |
| E1202 | E | Direct cross-thread mutation without a '+>' reduction channel. | Use the '+>' reduction channel. |
| E1203 | E | 'yield var << task' on a closed or finished coroutine. | Re-open the channel or check coroutine state. |
| E1204 | E | Unhandled exception in a worker thread surfaced at the 'wait' barrier. | Inspect the '$trial' handle and handle the re-raise. |
| E1205 | E | 'yield' used inside a non-coroutine static rule. | Declare the rule as a coroutine or remove 'yield'. |
E13 — Graphics
Graphics module spec/13-graphics.md §7. Related page: graphics.html.
| Code | Severity | Condition | Resolution |
| E1301 | E | Malformed degree/minute/second ('° ′ ″') angular syntax. | Correct the angular literal. |
| E1302 | E | 'draw' on an unattached or non-existent layer. | Attach the layer to the canvas first. |
| E1303 | E | Circle or polar point constructed with a negative radius r. | Use a non-negative radius. |
| E1304 | E | Polygon constructed with fewer than 3 vertex points. | Supply at least 3 vertices. |
| E1305 | E | Target canvas hardware context unavailable. | Retry with a valid canvas context. |
E14 — Library
Library module spec/14-library.md §7. Related page: library.html.
| Code | Severity | Condition | Resolution |
| E1401 | E | Target file path missing during an open operation. | Create the file or correct the path. |
| E1402 | E | Insufficient OS permissions to open or write a file handle. | Fix the permissions. |
| E1403 | E | Scope exited with an unclosed 'F' file handle. | Close the handle before scope exit. |
| E1404 | E | Requested '$bee.sys' submodule not available in the runtime build. | Build with the required submodule. |
| E1405 | E | File open mode is not 'r', 'w', 'a', or 'rw'. | Use one of the four accepted modes. |
Registry contract: when a diagnostic is added, register it first in
registry/diagnostics.json in the free slot of its module block. If it collides
with an existing code, bump the newer use to the next free slot and re-register
— never silently reuse an occupied code with different semantics. Keep this
page and every per-module diagnostic table in mirror agreement.