You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ErrorPattern{pattern:"arr_get: bound check",category:"runtime",explanation:"`arr_get` triggered a bounds check.",typical_cause:"Index/range outside valid bounds.",fix:"Guard with length/key check before access."},
1239
1239
ErrorPattern{pattern:"str_slice: bound check",category:"runtime",explanation:"`str_slice` triggered a bounds check.",typical_cause:"Index/range outside valid bounds.",fix:"Guard with length/key check before access."},
1240
1240
ErrorPattern{pattern:"arr_slice: bound check",category:"runtime",explanation:"`arr_slice` triggered a bounds check.",typical_cause:"Index/range outside valid bounds.",fix:"Guard with length/key check before access."},
1241
+
ErrorPattern{pattern:"Unknown flag:",category:"cli",explanation:"Command-line flag not recognised.",typical_cause:"Typo or feature removed.",fix:"Run `omc --help` for valid flags."},
1242
+
ErrorPattern{pattern:"--test requires",category:"cli",explanation:"--test mode needs a file argument.",typical_cause:"Forgot the path.",fix:"Run as `omc --test path/to/file.omc`."},
1243
+
ErrorPattern{pattern:"--check requires",category:"cli",explanation:"--check mode needs a file argument.",typical_cause:"Forgot the path.",fix:"Run as `omc --check path/to/file.omc`."},
1244
+
ErrorPattern{pattern:"--bench requires",category:"cli",explanation:"--bench mode needs a file argument.",typical_cause:"Forgot the path.",fix:"Run as `omc --bench path/to/file.omc`."},
1245
+
ErrorPattern{pattern:"--fmt requires",category:"cli",explanation:"--fmt mode needs a file argument.",typical_cause:"Forgot the path.",fix:"Run as `omc --fmt path/to/file.omc`."},
1246
+
ErrorPattern{pattern:"Failed to read file",category:"io",explanation:"Couldn't open / read the source file.",typical_cause:"Path wrong or perms.",fix:"Check the path and read permissions."},
1247
+
ErrorPattern{pattern:"install: unknown package",category:"cli",explanation:"Package not found in any registry.",typical_cause:"Typo or removed.",fix:"Run `omc --list` to see installed packages."},
1248
+
ErrorPattern{pattern:"Match: no arm matched",category:"runtime",explanation:"No match arm fired and no default.",typical_cause:"Missing wildcard.",fix:"Add `_ => ...` last."},
1249
+
ErrorPattern{pattern:"Match: type tag",category:"types",explanation:"Type-tag pattern doesn't match value's runtime type.",typical_cause:"Wrong tag in arm.",fix:"Check type_of(value); valid tags: int, float, string, bool, array, dict, function, null."},
1250
+
ErrorPattern{pattern:"Pattern: invalid range",category:"parser",explanation:"Range pattern lo..hi with lo > hi.",typical_cause:"Swapped bounds.",fix:"Ensure lo <= hi."},
1251
+
ErrorPattern{pattern:"heal_pass: ",category:"runtime",explanation:"Self-healing pass made a rewrite.",typical_cause:"Source had a fixable issue.",fix:"Inspect what was healed; if undesirable, add @no_heal pragma."},
1252
+
ErrorPattern{pattern:"heal budget exceeded",category:"runtime",explanation:"Too many heal-pass rewrites in one program.",typical_cause:"Source is significantly malformed.",fix:"Fix manually; budget is a safety cap."},
1253
+
ErrorPattern{pattern:"VM: unknown opcode",category:"runtime",explanation:"Bytecode contains an opcode the VM doesn't recognise.",typical_cause:"Stale bytecode after VM update.",fix:"Recompile from source."},
1254
+
ErrorPattern{pattern:"VM: stack underflow",category:"runtime",explanation:"Pop on empty stack.",typical_cause:"Bytecode bug.",fix:"Recompile from source; file issue if persists."},
1255
+
ErrorPattern{pattern:"VM: stack overflow",category:"runtime",explanation:"Operand stack exceeded budget.",typical_cause:"Pathological code.",fix:"Refactor to use fewer intermediates."},
1256
+
ErrorPattern{pattern:"JIT: lowering failed",category:"runtime",explanation:"Codegen couldn't lower this function.",typical_cause:"Unsupported op or shape.",fix:"Fall back to tree-walk; file issue with the failing fn."},
1257
+
ErrorPattern{pattern:"JIT: dispatch boundary",category:"runtime",explanation:"Crossing tree-walk ↔ JIT boundary with incompatible type.",typical_cause:"Array-from-JIT not bridged yet (L1.6 pending).",fix:"Stay tree-walk for now, or restructure to scalar-only ops."},
1258
+
ErrorPattern{pattern:"Tokenizer: ID 0",category:"tokenizer",explanation:"Stream contains an unescaped ID 0 — encoder bug.",typical_cause:"Manual ID array.",fix:"Use omc_token_encode to produce streams."},
1259
+
ErrorPattern{pattern:"Tokenizer: malformed escape",category:"tokenizer",explanation:"Escape byte missing after ID 0.",typical_cause:"Truncated stream.",fix:"Verify the encoded array is intact."},
1260
+
ErrorPattern{pattern:"Substrate: out of range",category:"substrate",explanation:"Value past supported attractor table extent.",typical_cause:"n > 6.3e7.",fix:"Mod-reduce or use HInt::new which extends supported range."},
1261
+
ErrorPattern{pattern:"Resonance: invalid input",category:"substrate",explanation:"Resonance call expected numeric.",typical_cause:"Passed array/string.",fix:"Use arr_resonance_vec for arrays."},
1262
+
ErrorPattern{pattern:"HBit: malformed dual",category:"substrate",explanation:"Dual-band representation has wrong arity.",typical_cause:"Manual construction.",fix:"Use hbit_dual to build."},
1263
+
ErrorPattern{pattern:"safe_divide",category:"runtime",explanation:"Safe-divide produced Singularity result.",typical_cause:"Division by zero in `safe` context.",fix:"is_singularity check on result."},
1264
+
ErrorPattern{pattern:"safe_arr_get",category:"runtime",explanation:"Safe array-get returned a Singularity.",typical_cause:"Out-of-bounds index in `safe` context.",fix:"is_singularity check on result."},
1265
+
ErrorPattern{pattern:"safe_arr_set",category:"runtime",explanation:"Safe array-set was a no-op.",typical_cause:"Out-of-bounds index in `safe` context.",fix:"is_singularity check or pre-grow."},
1266
+
ErrorPattern{pattern:"Lambda capture missing",category:"runtime",explanation:"Lambda referenced an unbound name from outer scope.",typical_cause:"Variable doesn't exist when lambda is defined.",fix:"Define the variable first."},
1267
+
ErrorPattern{pattern:"Closure shared state",category:"runtime",explanation:"Two sibling lambdas mutating shared state observe each other.",typical_cause:"Capture-by-reference semantics.",fix:"Use distinct closures or use immutable values."},
1268
+
ErrorPattern{pattern:"Recursive type",category:"runtime",explanation:"Self-referential structure detected.",typical_cause:"Class field references its own class.",fix:"Avoid cycles or use dict-based representation."},
1269
+
ErrorPattern{pattern:"Stack frame leak",category:"runtime",explanation:"Frame not released across calls.",typical_cause:"Wrong scope management.",fix:"File an issue; should be impossible from user code."},
1270
+
ErrorPattern{pattern:"Symbol redefinition",category:"runtime",explanation:"Same name registered twice as host_builtin.",typical_cause:"Embedder called register_builtin twice.",fix:"De-register first or use a different name."},
1271
+
ErrorPattern{pattern:"Reverse-FFI not initialized",category:"runtime",explanation:"Calling a name that's neither user-defined nor a builtin.",typical_cause:"Expected a host_builtin registration.",fix:"Register the function before calling it from OMC."},
1272
+
ErrorPattern{pattern:"Module export shadowed",category:"imports",explanation:"Module exports a name that shadows a builtin.",typical_cause:"Module author chose conflicting name.",fix:"Rename in the module or use a prefix import."},
1273
+
ErrorPattern{pattern:"Test runner state",category:"test_runner",explanation:"Test runner can't record failure outside a test function.",typical_cause:"Called assert outside test_*.",fix:"Wrap in fn test_xxx() {}."},
1274
+
ErrorPattern{pattern:"Reentrancy",category:"runtime",explanation:"Builtin re-entered itself.",typical_cause:"Cycle through host or callback.",fix:"Break the cycle."},
1275
+
ErrorPattern{pattern:"Reentrancy: dict",category:"runtime",explanation:"Dict mutation during iteration.",typical_cause:"Inserting into dict you're iterating.",fix:"Collect keys first, then mutate."},
1276
+
ErrorPattern{pattern:"Reentrancy: array",category:"runtime",explanation:"Array mutation during iteration.",typical_cause:"Inserting into array you're iterating.",fix:"Use slice/copy first."},
1277
+
ErrorPattern{pattern:"expected",category:"test_runner",explanation:"Test assertion failed — actual didn't match expected.",typical_cause:"Bug in code under test or in test.",fix:"Re-read the assertion's labeled message; print actual/expected for inspection."},
1278
+
ErrorPattern{pattern:"test_record_failure called outside test",category:"test_runner",explanation:"Manual failure recording without test context.",typical_cause:"Forgot test_set_current().",fix:"Call inside a test_* function, or set name first."},
1279
+
ErrorPattern{pattern:"str_",category:"core",explanation:"Error originating from str_* family.",typical_cause:"Refer to specific message for context.",fix:"Filter omc_search_builtins(\"str_\") for related operations."},
1280
+
ErrorPattern{pattern:"arr_",category:"core",explanation:"Error originating from arr_* family.",typical_cause:"Refer to specific message for context.",fix:"Filter omc_search_builtins(\"arr_\") for related operations."},
1281
+
ErrorPattern{pattern:"dict_",category:"core",explanation:"Error originating from dict_* family.",typical_cause:"Refer to specific message for context.",fix:"Filter omc_search_builtins(\"dict_\") for related operations."},
1282
+
ErrorPattern{pattern:"tape_",category:"core",explanation:"Error originating from tape_* family.",typical_cause:"Refer to specific message for context.",fix:"Filter omc_search_builtins(\"tape_\") for related operations."},
1283
+
ErrorPattern{pattern:"dual_",category:"core",explanation:"Error originating from dual_* family.",typical_cause:"Refer to specific message for context.",fix:"Filter omc_search_builtins(\"dual_\") for related operations."},
1284
+
ErrorPattern{pattern:"gen_",category:"core",explanation:"Error originating from gen_* family.",typical_cause:"Refer to specific message for context.",fix:"Filter omc_search_builtins(\"gen_\") for related operations."},
1285
+
ErrorPattern{pattern:"py_",category:"core",explanation:"Error originating from py_* family.",typical_cause:"Refer to specific message for context.",fix:"Filter omc_search_builtins(\"py_\") for related operations."},
1286
+
ErrorPattern{pattern:"omc_",category:"core",explanation:"Error originating from omc_* family.",typical_cause:"Refer to specific message for context.",fix:"Filter omc_search_builtins(\"omc_\") for related operations."},
1287
+
ErrorPattern{pattern:"is_",category:"core",explanation:"Error originating from is_* family.",typical_cause:"Refer to specific message for context.",fix:"Filter omc_search_builtins(\"is_\") for related operations."},
1288
+
ErrorPattern{pattern:"hbit_",category:"core",explanation:"Error originating from hbit_* family.",typical_cause:"Refer to specific message for context.",fix:"Filter omc_search_builtins(\"hbit_\") for related operations."},
1289
+
ErrorPattern{pattern:"harmonic_",category:"core",explanation:"Error originating from harmonic_* family.",typical_cause:"Refer to specific message for context.",fix:"Filter omc_search_builtins(\"harmonic_\") for related operations."},
1241
1290
];
1242
1291
1243
1292
/// Best-matching pattern for an error message. Returns None if no
0 commit comments