Error Codes
DUUMBI outputs structured JSONL errors to stdout. Each error includes a code, message, node ID, and contextual details.
Validation errors (E001–E009)
Section titled “Validation errors (E001–E009)”| Code | Error | Description | How to fix |
|---|---|---|---|
| E001 | Type mismatch | Operand types don’t match (e.g., Add with i64 and f64) | Ensure both operands have the same type. Use explicit conversion if mixing i64/f64. |
| E002 | Unknown Op | Unrecognized @type in the graph | Check spelling of the @type field. See Op Types for valid ops. |
| E003 | Missing field | Required field not present on a node | Add the missing field. E.g., Add requires duumbi:left and duumbi:right. |
| E004 | Orphan reference | @id reference points to a non-existent node | Verify the @id target exists. Check for typos in the reference path. |
| E005 | Duplicate @id | Two nodes share the same @id | Rename one of the duplicate @id values to be unique. |
| E006 | No entry function | No main function found in the program | Add a function with "@id": "fn:main" to your graph. |
| E007 | Cycle | Circular dependency detected in the graph | Remove the circular reference. Functions can call each other, but data flow must be acyclic. |
| E008 | Link failed | Linker (cc) returned an error | Ensure cc (or $CC) is installed. Check runtime function signatures. |
| E009 | Schema invalid | Node doesn’t match core.schema.json | Validate your JSON-LD against the schema. Check @type and required fields. |
Example: E001 fix
Section titled “Example: E001 fix”// ❌ E001: Add with mismatched types{ "@type": "duumbi:Add", "duumbi:left": { "@type": "duumbi:Const", "value": 3 }, "duumbi:right": { "@type": "duumbi:ConstF64", "value": 2.5 }}
// ✅ Fixed: both operands are i64{ "@type": "duumbi:Add", "duumbi:left": { "@type": "duumbi:Const", "value": 3 }, "duumbi:right": { "@type": "duumbi:Const", "value": 2 }}Dependency errors (E010–E016)
Section titled “Dependency errors (E010–E016)”| Code | Error | Description | How to fix |
|---|---|---|---|
| E010 | Unresolved cross-module ref | Function call targets a missing module | Add the module as a dependency in config.toml or create it locally. |
| E011 | Dependency not found | Module not in workspace, vendor, or cache | Run duumbi deps install to download missing dependencies. |
| E012 | Module conflict | Two modules provide the same function | Rename one function or use scoped imports. |
| E013 | Registry unreachable | Cannot connect to the registry server | Check network connection. Verify registry URL in config.toml. |
| E014 | Auth failed | Invalid or missing authentication token | Run duumbi registry login <name> to refresh credentials. |
| E015 | Integrity mismatch | Downloaded module hash doesn’t match lockfile | Delete .duumbi/cache/ and re-run duumbi deps install. If persists, update lockfile. |
| E016 | Version not found | Requested version doesn’t exist in registry | Run duumbi search <name> to see available versions. Update version constraint. |
Ownership errors (E020–E029)
Section titled “Ownership errors (E020–E029)”| Code | Error | Description | How to fix |
|---|---|---|---|
| E020 | Single owner | Value has multiple owners | Use Move to transfer ownership, or Borrow for shared access. |
| E021 | Use after move | Value accessed after ownership transfer | Access the value before the Move, or clone it. |
| E022 | Borrow exclusivity | &mut T while other borrows exist | End all immutable borrows before creating a mutable borrow. |
| E023 | Lifetime exceeded | Reference outlives its borrowed value | Ensure the reference is dropped before the source value. |
| E024 | Drop incomplete | Owned value not dropped before scope exit | Add a Drop op before the function returns. |
| E025 | Double free | Value dropped more than once | Remove the duplicate Drop op. |
| E026 | Dangling reference | Reference to an already-dropped value | Drop references before dropping the source value. |
| E027 | Move while borrowed | Owner moved while borrows are active | Drop all borrows before moving ownership. |
| E028 | Lifetime param missing | Function needs lifetime annotation | Add lifetime parameters to function signature. |
| E029 | Return lifetime mismatch | Returned reference has wrong lifetime | Ensure returned reference’s lifetime matches the function’s declared lifetime. |
Example: E021 fix
Section titled “Example: E021 fix”// ❌ E021: using a value after it was moved[ { "@type": "duumbi:Alloc", "@id": "…/0", "duumbi:value": { "@type": "duumbi:ConstString", "value": "hello" } }, { "@type": "duumbi:Move", "@id": "…/1", "duumbi:source": { "@id": "…/0" }, "duumbi:target": "new_owner" }, { "@type": "duumbi:Print", "@id": "…/2", "duumbi:value": { "@id": "…/0" } } // ← E021: "…/0" was moved]
// ✅ Fixed: use Borrow instead of Move, or access before Move[ { "@type": "duumbi:Alloc", "@id": "…/0", "duumbi:value": { "@type": "duumbi:ConstString", "value": "hello" } }, { "@type": "duumbi:Borrow", "@id": "…/1", "duumbi:source": { "@id": "…/0" } }, { "@type": "duumbi:Print", "@id": "…/2", "duumbi:value": { "@id": "…/1" } }, { "@type": "duumbi:Drop", "@id": "…/3", "duumbi:value": { "@id": "…/0" } }]See the Ownership Model guide for full rules and diagrams.
Error handling errors (E030–E035)
Section titled “Error handling errors (E030–E035)”| Code | Error | Description | How to fix |
|---|---|---|---|
| E030 | Unhandled Result | result<T,E> not matched or unwrapped | Add a Match op with both ok_block and err_block. |
| E031 | Unhandled Option | option<T> not matched or unwrapped | Add a Match op with both some_block and none_block. |
| E032 | Non-exhaustive match | Match doesn’t cover all variants | Add missing match arms (e.g., both Ok and Err for Result). |
| E033 | Type param mismatch | Result/Option type parameters don’t match | Ensure the Match arms handle the correct types. |
| E034 | Unwrap without check | Unwrap without prior IsOk/IsSome | Add a check (ResultIsOk/OptionIsSome) + Branch before unwrapping, or use Match instead. |
| E035 | Wrong payload type | Unwrapped value type doesn’t match expected | Check the type parameter of the Result/Option matches what you’re extracting. |
Example: E030 fix
Section titled “Example: E030 fix”// ❌ E030: Result not handled{ "@type": "duumbi:ResultOk", "@id": "…/0", "duumbi:value": { "@type": "duumbi:Const", "value": 42 } }// ...no Match or IsOk check on "…/0"
// ✅ Fixed: use Match for exhaustive handling{ "@type": "duumbi:Match", "@id": "…/1", "duumbi:value": { "@id": "…/0" }, "duumbi:ok_block": "…/ok_arm", "duumbi:err_block": "…/err_arm" }Error output format
Section titled “Error output format”All errors are emitted as structured JSONL to stdout:
{ "level": "error", "code": "E001", "message": "Type mismatch: Add expects matching operand types", "nodeId": "duumbi:main/main/entry/2", "file": "graph/main.jsonld", "details": { "expected": "i64", "found": "f64", "field": "duumbi:left" }}Fields: level (error/warning), code (E001–E035), message (human-readable), nodeId (graph location), file (source file), details (structured context).