Error Reference

Error Reference

This document catalogs all error conditions in rill with descriptions, common causes, and resolution strategies. Each error has a unique ID formatted as RILL-{category}{number} (e.g., RILL-R001).

Error Categories:

  • L: Lexer errors (tokenization failures)
  • P: Parse errors (syntax violations)
  • R: Runtime errors (execution failures)
  • C: Check errors (CLI tool validation)

Navigation:


Lexer Errors

Lexer errors occur during tokenization when the source text contains invalid character sequences or malformed literals.

rill-l001

Description: Unterminated string literal

Cause: String opened with quote but never closed before end of line or file.

Resolution: Add closing quote to complete the string, or use multiline strings with triple quotes (""") for multi-line content.

Example:

# Missing closing quote on single line
"hello

# Newline inside single-quoted string
"hello
world"

rill-l002

Description: Invalid character

Cause: Character not recognized by the lexer (not part of Rill syntax).

Resolution: Remove or replace the invalid character. Common causes: unicode characters in identifiers, unsupported operators, or copy-paste artifacts.

Example:

# Unicode character in code
$x → "value"  # → is not valid, use ->

# Backtick instead of quote
`hello`  # Use "hello" instead

rill-l003

Description: Invalid number format

Cause: A number literal is followed by an exponent (1e3), a radix prefix (0x10), a digit separator (1_000), or identifier characters (12abc), or a digit follows the $ sigil ($1).

Resolution: Write numbers as plain integers (123) or decimals (1.5). Exponent, radix-prefix, and digit-separator forms are not supported, a number cannot run straight into identifier characters, and a variable name after $ must start with a letter or _.

Example:

# Digit separator underscore
1_000

# Identifier characters directly after a number
12abc

# Digit directly after the $ sigil
$1

rill-l004

Description: Unterminated multiline string

Cause: Multiline string opened with triple quotes (""") but never closed.

Resolution: Add closing triple quotes (""") to complete the multiline string.

Example:

# Missing closing triple quotes
"""hello
world

# Only two closing quotes instead of three
"""content""

rill-l005

Description: Invalid escape sequence

Cause: Backslash followed by unsupported character in string literal.

Resolution: Use valid escape sequences: \n (newline), \t (tab), \ (backslash), " (quote), { (brace). For literal backslash, use \.

Example:

# Invalid escape character
"hello\xworld"  # \x not supported

# Incomplete escape at end
"path\

Parse Errors

Parse errors occur when token sequences violate rill syntax rules during AST construction.

rill-p001

Description: Unexpected token

Cause: Token appears in invalid position according to grammar rules.

Resolution: Check syntax at the indicated position. Common causes: missing operators, mismatched delimiters, or keywords in wrong context.

Example:

# Doubled pipe operator
"hello" -> -> "world"

# Statement starting with operator
-> "value"  # Missing left side

# Unexpected closing brace
{ "value" }}  # Extra closing brace

rill-p002

Description: Unexpected end of input

Cause: File or block ended while parser expected more tokens (incomplete expression or statement).

Resolution: Complete the incomplete construct. Common causes: unclosed blocks, incomplete pipe chains, or missing expression after operator.

Example:

# error statement with no message inside a block
{ error }

# error statement with no message in a function body
fn { error }

# Error statement with no message
error

rill-p003

Description: Invalid type annotation

Cause: Type name not recognized. Rill supports: string, number, bool, fn, list, dict, tuple.

Resolution: Use valid type name from supported set. Check spelling and casing (types are lowercase).

Example:

# Uppercase type name
"a" => $x:String  # Use "string" not "String"

# Invalid type name
"a" => $x:int  # Use "number" for all numeric types

# Bare union without members
"a" -> :union  # Write union(string, number)

rill-p004

Description: Invalid expression

Cause: Expression structure violates grammar rules or contains unsupported constructs.

Resolution: Check expression syntax. Common causes: invalid operator combinations, malformed literals, or unsupported language features.

Example:

# Negation with no operand
$x -> !

# Post-loop body without a trailing while
0 -> do { $ + 1 }

rill-p005

Description: Missing delimiter

Cause: Expected closing delimiter (parenthesis, bracket, brace) not found.

Resolution: Add the missing delimiter. Check for proper nesting and matching pairs.

Example:

# Missing closing parenthesis
func($a, $b

# Missing closing bracket in a list
list[1, 2, 3

# Mismatched delimiters
list[1, 2}  # Opened with [ but closed with }

rill-p006

Description: Invalid syntax in context

Cause: A syntactic construct was used in a context where it is not allowed.

Resolution: Check that the construct is used in the correct context.

Example:

# Spread in unsupported position
$x.method(...$args)  # spread not supported in method calls

# yield outside stream function
fn(x) { yield }  # yield requires :stream() return type

rill-p007

Description: Keyword not adjacent to opener, or extra spread

Cause: The angle-opener keywords use<, destruct< and slice< must be written with ‘<’ immediately following, no whitespace allowed. A second spread argument (…) in one argument list also raises this error.

Resolution: Remove the whitespace between the keyword and ‘<’. Write ‘useext:app’ not ‘use ext:app’. Pass at most one spread argument per call.

Example:

# use with whitespace before <
use <ext:app> => $app  # Error: use use<ext:app>

# destruct with whitespace before <
destruct <a, b>  # Error: use destruct<a, b>

# slice with whitespace before <
slice <0:2>  # Error: use slice<0:2>

rill-p008

Description: Retired: bare bracket at expression start

Cause: This error was raised when a bare [ token appeared at expression start, because the parser could not tell a list literal from a dict literal.

Resolution: This error code is no longer thrown. A bare bracket literal is now equivalent to list[…] or dict[key: val, …].

Example:

# Bare list literal (no longer thrown; same as list[...])
[1, 2, 3]  # now equivalent to list[1, 2, 3]

# Bare dict literal (no longer thrown; same as dict[...])
[a: 1, b: 2]  # now equivalent to dict[a: 1, b: 2]

rill-p009

Description: Removed sigil syntax

Cause: Code uses a removed sigil-prefixed collection or extraction form that was replaced by keyword-prefixed syntax.

Resolution: Replace the sigil form with the keyword-prefixed equivalent. See examples for specific replacements.

Example:

# Removed tuple sigil
*[1, 2]  # Error: use tuple[1, 2]

# Removed destructure sigil
*<$a, $b>  # Error: use destruct<$a, $b>

# Removed slice sigil
/<1:3>  # Error: use slice<1:3>

rill-p010

Description: Invalid AT expression syntax

Cause: The ‘@’ token at expression start is only valid as a do-while loop terminator inside a loop body. ‘@[…]’ and ‘@$fn’ are not supported expression forms.

Resolution: Use chain(…) to chain collection operations, or restructure the expression to use a valid operator.

Example:

# Invalid @[ at expression start
@[1, 2, 3]  # Error: use chain(...) instead

# Invalid @$fn at expression start
@$transform  # Error: use chain(...) instead

rill-p011

Description: Removed union separator

Cause: A ‘|’ followed a type in a type position. Unions are written with the union(…) constructor.

Resolution: Replace ‘A|B’ with ‘union(A, B)’. Members are types or string, number, bool, or atom literals.

Example:

# Pipe-separated union
1 -> :string|number  # Error: write union(string, number)

rill-p012

Description: Removed syntax used

Cause: Code uses a syntax form that was removed in a previous version, such as a closure literal, a namespaced host call, or the uniform dict(V) and ordered(V) types.

Resolution: Migrate to the replacement syntax shown in the error message.

Example:

# Namespaced host-call syntax removed
math::add(1, 2)  # Error: use use<ext:math> => $math, then $math.add(1, 2)

# -> export pipe syntax removed
"value" -> export  # Error: use last-expression result instead

# Computed-selector dot forms removed
dict[a: 1] => $d
$d.("a")  # Error: use $d["a"], or $d.?["a"] to probe

# |params| closure literal removed
|x| ($x * 2)  # Error: use fn(x) { $x * 2 }

# |x: T|:R closure type literal removed
$f -> :|x: number|:string  # Error: use :fn(x: number):string

# dict(V) uniform value type removed
dict(number)  # Error: use map(string, number), or name the fields as in dict(a: number)

rill-p014

Description: Malformed type argument list

Cause: A type argument list has a syntax error: missing comma, closing paren, or invalid argument.

Resolution: Check the type argument list for missing commas or closing parentheses.

Example:

# Missing comma between type arguments
list(string number)  # Error: expected , or )

# Missing closing paren
dict(key: string  # Error: expected )

rill-p015

Description: Maximum nesting depth exceeded

Cause: An expression nests primary expressions (e.g. parentheses) deeper than the parser supports.

Resolution: Reduce the nesting depth of the expression, e.g. by extracting sub-expressions into variables.

Example:

# Parentheses nested beyond the depth limit
(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((1)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

rill-p020

Description: Missing ‘:’ in use<> static form

Cause: The static form of use<> requires a ‘:’ separating the scheme from the resource path (e.g., usescheme:path).

Resolution: Add ‘:’ after the scheme identifier. Example: usemodule:path.to.resource

Example:

# Missing colon in use<>
use<module>  # Error: expected scheme:resource

rill-p021

Description: Empty resource after colon in use<>

Cause: The static form of use<> requires at least one resource segment after ‘:’.

Resolution: Provide a resource path after ‘:’. Example: usemodule:resource

Example:

# Empty resource in use<>
use<module:>  # Error: missing resource after colon

rill-p022

Description: Missing ‘>’ to close use<>

Cause: The use<> expression was not closed with a matching ‘>’.

Resolution: Add ‘>’ to close the use<> expression.

Example:

# Unclosed use<>
use<module:resource  # Error: missing >

rill-p023

Description: Malformed frontmatter closing delimiter

Cause: The frontmatter block’s closing delimiter has more than three dashes.

Resolution: Write the closing delimiter as exactly three dashes: ‘—’.

Example:

# Closing delimiter with an extra dash
---
model: opus
----
log(1)

rill-p024

Description: Comment needs a space after ‘#’

Cause: A ‘#’ followed directly by a letter or underscore starts an atom literal, not a comment. Text such as ‘#note’ after an expression reads as an atom where a comment was meant.

Resolution: Put a space after ‘#’ to write a comment, as in ‘# note’. Use an atom only where a value is expected.

Example:

# Comment missing the space after '#'
1 #note

# Comment text read as an atom followed by a word
#TODO fix this later

rill-p025

Description: Control statement options in angle brackets

Cause: A control statement (guard, retry, timeout, pass, or the loop ‘do’) has its options written between ‘<’ and ‘>’. These keywords take their options as a dict in parentheses after the keyword. Angle brackets are reserved for ‘slice<…>’, ‘destruct<…>’, and ‘use<…>’.

Resolution: Write the options in parentheses: ‘retry(attempts: 3)’, ‘guard(on: #TIMEOUT)’, ’timeout(total: $d)’, ‘pass(async: true)’, ‘do(limit: 100)’. The retry bound ’limit’ is now ‘attempts’. The pass option that took #IGNORE is now ‘ignore_halts: true’.

Example:

# Retry options in angle brackets
retry<limit: 3> { 1 }

# Pass option in angle brackets
pass<async: true> { 1 }

# Loop options in angle brackets
do<limit: 10> { $ + 1 } while ($ < 3)

rill-p026

Description: Destructure mixes positional and keyed elements

Cause: A destructure pattern lists both positional elements (’$a’, ‘_’, or a nested destruct) and keyed elements (‘key: $b’). A pattern matches either a list or tuple by position, or a dict or ordered by key, not both.

Resolution: Use only positional elements to destructure a list or tuple, or only keyed elements to destructure a dict or ordered.

Example:

# Positional and keyed elements in one pattern
list[1, 2] -> destruct<$a, b: $c>

# Keyed element followed by a skip
dict[a: 1] -> destruct<a: $x, _>

rill-p027

Description: Duplicate key in a dict, ordered, or map

Cause: A dict, ordered, or map literal, or a dict or ordered type, spells the same key twice. Dict and ordered keys are compared as strings, so 1 and “1” are the same key. A map key is a value, so two literal map keys collide only when equal by value: 1 and 1.0 collide, 1 and “1” do not.

Resolution: Remove the repeated key, or give each entry a distinct key.

Example:

# Identifier key repeated
dict[a: 1, a: 2]

# Number key and string key spell the same key
dict[1: "x", "1": "y"]

# Type fields spell the same key twice
dict(a: number, "a": string)

# Map literal repeats a key
map[#a: 1, #a: 2]

rill-p028

Description: Invalid unnamed fn parameters

Cause: An fn parameter list declares a third unnamed param, mixes named and unnamed params, or gives an unnamed param a default. Unnamed params bind ‘$’ and ‘$@’, so at most two are allowed, and they take no name or default.

Resolution: Declare at most two unnamed params, keep a parameter list all named or all unnamed, and move any default onto a named param.

Example:

# Three unnamed params
fn(number, number, number) { $ }

# Named and unnamed params mixed
fn(x: number, string) { $x }

# Default on an unnamed param
fn(number = 1) { $ }

rill-p029

Description: fn() or named-param fn body reads ‘$’ or ‘$@’

Cause: A function written fn() or fn(x) declares a parameter list, so nothing binds ‘$’ or ‘$@’ in its body; a named param is read as ‘$x’.

Resolution: Declare the params the body reads, as in ‘fn(number) { $ }’, or drop the read.

Example:

# Empty fn() reading '$'
fn() { $ + 1 }

# Empty fn() reading '$@'
fn() { $@ }

# Named param fn reading '$'
fn(x) { $ }

rill-p030

Description: List or dict literal pipe target reads ‘$’

Cause: A list or dict literal used as a pipe target builds a new value and is not handed the piped value, so a ‘$’ at its top level has nothing to read.

Resolution: Wrap the literal in a block so ‘$’ reads the piped value, as in ‘3 -> { list[$, $] }’.

Example:

# List literal target reading '$'
3 -> list[$, $]

# Dict literal target reading '$'
"a" -> dict[a: $]

rill-p031

Description: Block or string target ignores the piped value

Cause: A block or string used as a pipe target discards the piped value when its body never reads ‘$’, so the pipe has no effect on the result.

Resolution: Reference ‘$’ in the block or string, as in ‘5 -> “x{$}”’, or drop the pipe and write the value directly.

Example:

# String target that ignores the piped value
5 -> "x"

# Block target that ignores the piped value
3 -> { 5 }

Runtime Errors

Runtime errors occur during script execution when operations fail due to type mismatches, undefined references, or violated constraints.

rill-r001

Description: Argument or binding mismatch

Cause: An argument does not match the declared parameter type, the call has the wrong arity or a spread binding error, a type-locked variable or a typed destructure element receives a value of another type, a script reassigns an outer variable, or the call target is not callable.

Resolution: Pass a value of the correct type, or convert it before passing. Check the function signature for expected types and arity, keep variable types stable after first assignment, capture to a new name instead of reassigning an outer variable, and call only callable values.

Example:

# String passed to number parameter
fn(x: number) { $x * 2 } => $double
"5" -> $double()

# Number assigned to string-locked variable
"a" => $x
5 => $x  # Error: $x is locked to string

rill-r002

Description: Operation not valid for its operands or context

Cause: An operation received an operand, key, or receiver of the wrong type or shape. Rill does not perform implicit type coercion. Families: an operator applied to incompatible operand types, including division or modulo by zero and logical or negation operators on non-bool values; ordering two durations whose calendar and clock components disagree; a list[…] dispatch with a non-number index, a missing index, or a spread that is not a list or tuple; a non-bool condition in a conditional, while, do-while, or assert; a non-string message in an error statement; an index or key of the wrong type, or a receiver that cannot be indexed (for example “Cannot index string” or “Cannot index iterator”); a destructure pattern that does not match the shape of the value; a call or dispatch on a non-callable target, or property access on a non-dict value; a spread of the wrong type in a list, dict, or annotation literal; a collection operator applied to a source that is not a list, tuple, string, dict, ordered, map, iterator, or stream; and an iterator or stream protocol violation, such as a .next that is not a function or does not return the expected step. The same code is raised when a script uses a reserved brand key (such as __type or __rill_atom) as a dict or ordered field name or as an annotation key, because such a key would let user data masquerade as a branded runtime value.

Resolution: Ensure both operands are compatible types. Convert values explicitly if needed using type-specific methods. Rename any field or annotation key that collides with a reserved brand key.

Example:

# Adding string and number
"5" + 1  # Error: no implicit coercion

# Indexing a string
"abc" => $s
$s[0]  # Error: Cannot index string

rill-r003

Description: Method receiver type mismatch

Cause: Method called on value of wrong type. String methods require strings, list methods require lists, etc. Also raised when a type value is asked for a property its kind does not define, such as inner on a leaf type.

Resolution: Call method on correct type, or convert value before calling. Check method documentation for receiver type. For a type value, probe with .?inner or recover with ??.

Example:

# String method on number
123 -> .upper()  # upper() is a string method

# String method on list
list[1, 2] -> .trim()  # trim() is a string method

# Property a type value does not define
string => $t
$t.inner  # Error: a leaf type has no inner

rill-r005

Description: Undefined variable

Cause: Variable referenced before assignment, or variable name misspelled.

Resolution: Assign value to variable before use (value => $var), or check spelling. Variables must be captured before reference.

Example:

# Variable used before assignment
$count + 1  # $count never assigned

# Typo in variable name
"hi" => $mesage
$message  # Typo: mesage vs message

# Variable out of scope
{ "local" => $x }
$x  # $x only exists inside block

rill-r006

Description: Undefined function

Cause: Function name not found in runtime context (not a built-in or host-provided function).

Resolution: Check function name spelling, ensure function is provided by host application, or verify module imports.

Example:

# Misspelled function name
leng("hello")  # Should be length()

# Missing host function
fetch($url)  # Host must register fetch

rill-r007

Description: Undefined method

Cause: Method name not supported for the given type, or method name misspelled.

Resolution: Check method documentation for the type. Verify method name spelling and that it exists for this type.

Example:

# Method not defined for the type
list[1, 2] -> .push(3)  # lists have no push method

# Misspelled method name
"hello" -> .upcase()  # Should be .upper()

rill-r008

Description: Undefined annotation

Cause: Annotation key accessed but not set on statement or parameter.

Resolution: Set annotation before accessing (^(key: value)), or check annotation key spelling.

Example:

# Accessing undefined annotation
fn(x: number) { $x } => $f
$f.^timeout  # No ^(timeout: ...) set

rill-r009

Description: Key or index not found

Cause: A dict, ordered, or map key, or a list, tuple or ordered index, does not exist in the value. Index access through [], .at, or list[…] dispatch raises it when the index is outside the valid range.

Resolution: Check property name spelling, verify the property exists, or use null-coalescing (??) to provide default. For safe access, use .? operator.

Example:

# Missing dict key
dict[name: "x"] -> .age  # age key not in dict

# Index out of bounds (also .at, list dispatch)
list[1, 2, 3] => $items
$items[5]  # Only 3 elements (0-2)

# Out-of-range index through .at
list[1, 2] -> .at(9)  # Only 2 elements (0-1)

rill-r010

Description: Iteration limit exceeded

Cause: Loop or collection operation exceeded configured iteration limit (prevents infinite loops). The output caps of take, batch, window, start_when and stop_when raise the same code.

Resolution: Reduce data size, adjust iteration limit via RuntimeOptions, or check for infinite loop conditions. Loops, recursion, iterate and materializing consumers halt fatally and cannot be recovered. Bounded slicing operators (take, batch, window, start_when, stop_when) halt catchably, so guard or ?? can recover.

Example:

# Infinite loop without termination
while (true) do { "looping" }  # Never terminates

# Large collection with default limit
range(0, 20000) -> seq({ $ })  # May exceed default limit

rill-r011

Description: Invalid regex pattern

Cause: Regular expression pattern has invalid syntax or unsupported features.

Resolution: Fix regex syntax errors. Check for unescaped special characters, unclosed groups, or invalid quantifiers.

Example:

# Unclosed group in an autoExceptions pattern
# createRuntimeContext({ autoExceptions: ["(abc"] })  # Missing closing )

# Unclosed character class in an autoExceptions pattern
# createRuntimeContext({ autoExceptions: ["[a"] })  # Missing closing ]

rill-r012

Description: Operation timeout

Cause: Function execution exceeded configured timeout duration.

Resolution: Increase timeout via RuntimeOptions, optimize slow operations, or add ^(timeout: ms) annotation to specific calls.

Example:

# Slow host function exceeds the host timeout
slow_api()  # Times out if the host timeout elapses first

rill-r013

Description: Retired: execution aborted

Cause: This error was raised when the host application cancelled execution via AbortSignal.

Resolution: This error code is no longer thrown. Cancellation now raises the uncatchable #DISPOSED halt.

Example:

# User cancellation in UI (now halts with #DISPOSED)
# Long-running script cancelled by user

rill-r014

Description: Retired: auto-exception triggered

Cause: This error was raised when a value matched an auto-exception pattern configured by the host.

Resolution: This error code is no longer thrown. A string pipe value that matches an autoExceptions pattern now halts with the non-catchable #R999 atom. Handle the condition that produced the matched pattern, or adjust the autoExceptions configuration.

Example:

# Output matching an autoExceptions pattern (no longer raised; now a #R999 halt)
"ERROR: upstream failed"  # Host configured autoExceptions: ["^ERROR:"]

rill-r015

Description: Assertion failed

Cause: Assertion statement evaluated to false.

Resolution: Fix the condition causing assertion failure, or remove/adjust assertion if condition is incorrect.

Example:

# Basic assertion
0 => $count
assert $count > 0  # Fails because $count is 0

# Assertion with message
17 => $age
assert $age >= 18 "Must be adult"

rill-r016

Description: Error statement executed

Cause: Error statement executed explicitly in code.

Resolution: This is intentional error raising. Fix the condition that triggers the error statement, or handle the error case differently.

Example:

# Explicit error
error "Invalid configuration"

# Conditional error
"failed" => $status
($status == "failed") ? { error "Process failed" } ! "ok"

rill-r017

Description: fs extension: unknown mount

Cause: Script references mount name that does not exist in fs extension configuration, or mount path is invalid.

Resolution: Verify mount name is correct, ensure mount is configured in createFsExtension() call, and check mount path exists.

Example:

# Unknown mount
use<ext:fs> => $fs
$fs.read("unknown", "file.txt")  # Mount "unknown" not in config

rill-r018

Description: fs extension: path escapes mount boundary

Cause: Path traversal attempt (using .. or symlinks) escapes configured mount boundary.

Resolution: Remove path traversal attempts, use paths relative to mount root, or reconfigure mount boundaries.

Example:

# Path traversal with ..
use<ext:fs> => $fs
$fs.read("data", "../../etc/passwd")  # Attempts escape

# Symlink escape
use<ext:fs> => $fs
$fs.read("data", "symlink_to_root")  # Symlink points outside mount

rill-r019

Description: fs extension: file type not permitted in mount

Cause: Filename does not match mount glob pattern (e.g., trying to read .exe when only *.csv allowed).

Resolution: Use file with allowed extension, or reconfigure mount glob pattern to permit file type.

Example:

# Glob mismatch
use<ext:fs> => $fs
$fs.read("csv_only", "data.json")  # Mount configured with glob: "*.csv"

# Multiple extensions
use<ext:fs> => $fs
$fs.read("configs", "app.ini")  # Mount glob: "*.{json,yaml}"

rill-r020

Description: fs extension: mount does not permit operation

Cause: Operation (read or write) not permitted by mount mode (e.g., write to read-only mount).

Resolution: Use mount with appropriate mode, or reconfigure mount to allow operation.

Example:

# Write to read-only mount
use<ext:fs> => $fs
$fs.write("readonly", "file.txt", "data")  # Mount mode: "read"

# Read from write-only mount
use<ext:fs> => $fs
$fs.read("writeonly", "file.txt")  # Mount mode: "write"

rill-r021

Description: fs extension: permission denied or file not found

Cause: Operating system denied access to file (EACCES/EPERM), or file does not exist (ENOENT).

Resolution: Check file permissions, verify file exists, ensure user has appropriate access rights.

Example:

# Permission denied
use<ext:fs> => $fs
$fs.read("data", "protected.txt")  # File exists but no read permission

# File not found
use<ext:fs> => $fs
$fs.read("data", "missing.txt")  # File does not exist

rill-r022

Description: fetch extension: HTTP 4xx client error

Cause: HTTP request returned a 4xx client error status code.

Resolution: Check request parameters, verify authentication, or adjust request payload.

Example:

# HTTP 404 Not Found
use<ext:fetch> => $fetch
$fetch.get("api", "/nonexistent")  # Returns 404

# HTTP 400 Bad Request
use<ext:fetch> => $fetch
$fetch.post("api", "/users", dict[invalid: "data"])  # Returns 400

rill-r023

Description: fetch extension: HTTP 5xx after retries

Cause: HTTP request returned a 5xx server error after all retry attempts.

Resolution: Check server status, reduce request frequency, or increase retry limit.

Example:

# HTTP 503 Service Unavailable
use<ext:fetch> => $fetch
$fetch.get("api", "/resource")  # Server returns 503

rill-r024

Description: fetch extension: request timeout

Cause: HTTP request exceeded configured timeout duration.

Resolution: Increase timeout via extension configuration, or optimize server response time.

Example:

# Slow API endpoint
use<ext:fetch> => $fetch
$fetch.get("api", "/slow")  # Times out if exceeds limit

rill-r025

Description: fetch extension: network error

Cause: Network request failed (DNS resolution, connection refused, or other network issue).

Resolution: Check network connectivity, verify server is reachable, or check firewall settings.

Example:

# Connection refused
use<ext:fetch> => $fetch
$fetch.get("api", "/down")  # Server not running

rill-r026

Description: fetch extension: invalid JSON response

Cause: Response body could not be parsed as JSON.

Resolution: Check response Content-Type header, verify server returns valid JSON, or use raw response parsing.

Example:

# HTML error page returned as JSON
use<ext:fetch> => $fetch
$fetch.get("api", "/html")  # Server returns HTML instead of JSON

rill-r027

Description: ahi extension: validation failed (HTTP 400)

Cause: Downstream agent rejected the request with HTTP 400.

Resolution: Check request parameters match the downstream agent schema.

Example:

# Missing required parameter
use<ext:ahi> => $ahi
$ahi.parser(dict[])  # Agent expects a non-empty params dict

rill-r028

Description: ahi extension: agent unreachable (HTTP 404)

Cause: Downstream agent endpoint returned HTTP 404.

Resolution: Verify the agent URL is correct and the agent is deployed.

Example:

# Wrong agent path
use<ext:ahi> => $ahi
$ahi.removed(dict[input: "x"])  # Agent URL points at a removed route

rill-r029

Description: ahi extension: downstream exec failed

Cause: Downstream agent returned HTTP 500.

Resolution: Check downstream agent logs for the root cause.

Example:

# Unhandled error in downstream agent
use<ext:ahi> => $ahi
$ahi.crashing(dict[input: "x"])  # Downstream agent crashes

rill-r030

Description: ahi extension: timeout exceeded

Cause: HTTP request to downstream agent exceeded configured timeout.

Resolution: Increase the AHI extension timeout or reduce downstream latency.

Example:

# Slow downstream agent
use<ext:ahi> => $ahi
$ahi.slow(dict[input: "x"])  # Agent exceeds the configured timeout

rill-r031

Description: ahi extension: connection refused

Cause: Network error contacting downstream agent (DNS failure, connection refused).

Resolution: Verify the agent URL, ensure the agent is running, and check network access.

Example:

# Agent not running
use<ext:ahi> => $ahi
$ahi.offline(dict[input: "x"])  # Agent service is down

rill-r032

Description: ahi extension: rate limited (HTTP 429)

Cause: Downstream agent returned HTTP 429 (rate limited).

Resolution: Reduce request frequency or increase rate limits on the downstream agent.

Example:

# Too many concurrent requests
use<ext:ahi> => $ahi
$ahi.busy(dict[input: "x"])  # Agent enforces per-second request quota

rill-r033

Description: ahi extension: extension disposed

Cause: AHI extension has been disposed; no further calls are permitted.

Resolution: Do not call AHI functions after the extension has been disposed.

Example:

# Call after dispose
use<ext:ahi> => $ahi
$ahi.disposed(dict[input: "x"])  # Host disposed the extension before this call

rill-r034

Description: ahi extension: downstream HTTP error

Cause: Downstream agent returned an unexpected HTTP error status code.

Resolution: Check the downstream agent for details about the error status.

Example:

# HTTP 503 Service Unavailable
use<ext:ahi> => $ahi
$ahi.flaky(dict[input: "x"])  # Downstream returns 503

rill-r035

Description: ahi extension: agent unresolvable

Cause: Registry could not resolve the symbolic agent name at boot or on first call.

Resolution: Verify the agent is registered in the registry and the registry URL is correct.

Example:

# Agent not registered
use<ext:ahi> => $ahi
$ahi.unregistered(dict[input: "x"])  # Registry has no entry for the agent

rill-r036

Description: Incompatible convert source/target

Cause: The -> type form does not support conversion between the given source and target types. -> string has no route from a function, an iterator, or a vector, or from a list, dict, tuple, ordered, or map that holds one at any depth, and interpolating or joining one halts the same way. -> string has no route from a datetime, or from a collection that holds a datetime or a duration, though interpolation prints them; a duration alone converts to its printed form. -> number accepts only string (must be numeric) and bool (produces 0 or 1). Other targets (-> bool, -> list, -> dict, -> tuple, -> ordered, -> map) have their own accepted sources. A map converts to a dict only when every key is a string, so a map keyed by atoms or numbers halts; a list has no route to a map, so list -> map halts.

Resolution: Check the target type. A function, an iterator, or a vector, or a collection that holds one, has no string form; read its type with .^type instead. Interpolate a datetime or duration instead of converting it. For -> number, only string and bool sources are accepted. Verify the source type matches the accepted sources for the target type.

Example:

# String to list conversion
"hello" -> list  # Not allowed

rill-r037

Description: dict -> ordered without structural signature

Cause: Converting a dict to ordered with -> ordered requires an explicit ordered(field: type, …) type signature to determine field order.

Resolution: Provide a structural type signature: $dict -> ordered(name: string, age: number)

Example:

# Missing structural signature
dict[a: 1] -> ordered  # Ambiguous field order

rill-r038

Description: Non-parseable string to number

Cause: The string does not represent a valid number.

Resolution: Ensure the string contains a valid numeric format before converting with -> number.

Example:

# Non-numeric string
"hello" -> number  # Not a number

rill-r039

Description: Retired: type-value variable dispatch (:> form)

Cause: This error was raised by the legacy :>$var conversion form when the variable did not hold a type value. The :> operator has been removed; variable dispatch now falls through to RILL-R002 when the target variable does not hold a dispatchable value.

Resolution: This error code is no longer thrown. If a variable pipe target produces an unexpected dispatch error, see RILL-R002.

Example:

# Legacy: `:>$var` where $var held a string (no longer thrown; produces RILL-R002)
# "list" => $t
# "hello" :> $t  # was: expected type value, got string

rill-r040

Description: Non-callable chain, start_when, stop_when arg

Cause: The chain() built-in received a value that is neither a function nor a list of functions, or a list element was not a function. The start_when and stop_when built-ins received a predicate that is not callable. The halt is catchable for chain(), start_when, and stop_when.

Resolution: Pass a single function or a list of functions to chain(), and a function predicate to start_when and stop_when.

Example:

# Passing a number to chain()
5 -> chain(42)  # 42 is not a function

# Passing a non-function predicate to start_when
list[1, 2, 3] -> start_when(42)  # 42 is not a function

rill-r041

Description: Retired: list dispatch non-integer index

Cause: This error was raised when the index piped to a list[…] dispatch was not an integer.

Resolution: This error code is no longer thrown. A non-number index now raises RILL-R002, and a non-integer number halts with #INVALID_INPUT (" index must be an integer, got ").

Example:

# Floating-point index (no longer raised; now #INVALID_INPUT)
1.5 -> list["a", "b"]  # Not an integer

rill-r042

Description: Retired: list dispatch index out of range

Cause: This error was raised when the index piped to a list[…] dispatch was outside the valid range.

Resolution: This error code is no longer thrown. An out-of-range index now raises RILL-R009 (" index out of bounds: "). Use an index within [0, length-1] or add a fallback with ??.

Example:

# Index beyond end (no longer raised; now RILL-R009)
5 -> list["a", "b"]  # Only 2 elements (indices 0-1)

rill-r043

Description: Non-producing function body or script

Cause: A function body or script contains no statements that produce a value.

Resolution: Ensure the function body or script ends with an expression that produces a value.

Example:

# Empty function body
fn(x: number) { } => $f
$f(1)  # No value produced

# Script with only comments
# just a comment  # No value produced

rill-r044

Description: Missing required member or missing argument

Cause: The -> type form requires all fields/elements without defaults to be present in the source value. A call also raises this code with the message “Missing argument for parameter ‘’” when a required parameter receives no argument.

Resolution: Supply the missing field or element in the source value, or add a default to the type annotation. For a call, pass the missing argument or give the parameter a default.

Example:

# Dict missing a required field
[name: "Alice"] -> dict(name: string, age: number)  # age is missing

# Tuple missing a required element
tuple["a"] -> tuple(string, number)  # element at position 1 is missing

rill-r045

Description: Too many arguments passed to callable

Cause: The number of arguments passed to a callable exceeds the number of declared parameters.

Resolution: Remove the excess arguments or add more parameters to the callable definition.

Example:

# Too many arguments to a two-param function
fn(x: number, y: number) { $x + $y } => $add
$add(1, 2, 3)  # 3 args, 2 params

rill-r050

Description: Module not found in resolver config

Cause: The module ID is absent from the moduleResolver config map. Under use<…> the failure surfaces wrapped as RILL-R056.

Resolution: Add an entry for the module ID to the moduleResolver config object.

Example:

# Module absent from the resolver config
# moduleResolver("greetings", {})  # "greetings" is not a key of the config

rill-r051

Description: Module file read failure

Cause: The file path mapped to the module ID could not be read. Under use<…> the failure surfaces wrapped as RILL-R056.

Resolution: Verify the file path exists and the process has read permission.

Example:

# Module file does not exist
# moduleResolver("greetings", { greetings: "/nonexistent/greetings.rill" })  # Path is missing

rill-r052

Description: Extension not found in resolver config

Cause: The extension name is absent from the extResolver config map. Under use<…> the failure surfaces wrapped as RILL-R056.

Resolution: Add an entry for the extension name to the extResolver config object.

Example:

# Extension absent from the resolver config
# extResolver("missing", {})  # "missing" is not a key of the config

rill-r053

Description: Member path not found in extension

Cause: The dot-path member does not exist in the extension value, or the path descends into a value that is not a plain dict (a callable, tuple, ordered, vector, or stream), which is never traversed. Under use<…> the failure surfaces wrapped as RILL-R056.

Resolution: Verify the member path matches the structure of the extension dict, and that every segment before the last names a dict.

Example:

# Nonexistent member
# extResolver("app.missing", { app: { ... } })  # "missing" key not in the app extension

rill-r054

Description: No resolver registered for scheme

Cause: A use<> expression referenced a scheme with no registered resolver. The halt is catchable by guard and retry.

Resolution: Register a resolver for the scheme via RuntimeOptions.resolvers. Example: resolvers: { myScheme: myResolver }.

Example:

# Unregistered scheme
use<db:users>  # no resolver registered for "db"

rill-r055

Description: Circular resolution detected

Cause: A use<> resolver returned source that re-entered the same scheme:resource key. The halt is not catchable by guard or retry.

Resolution: Remove the circular dependency from module sources. Ensure module A does not directly or indirectly usemodule:A.

Example:

# Self-referencing module
use<module:a>  # module:a source contains use<module:a>

rill-r056

Description: Resolver threw, or returned a malformed result

Cause: The registered resolver function for the given scheme either threw an exception, or returned a result that is not a valid resolver result (e.g. missing or unrecognized kind, a value/text field that is absent or the wrong type, or a value that is a function, symbol, bigint, or contains such a non-rill value nested in a dict or list), or the returned source failed to parse. The halt is catchable by guard and retry.

Resolution: Inspect the original error message in the RILL-R056 detail and fix the resolver implementation.

Example:

# Network error in resolver
use<module:remote>  # resolver throws "connection refused"

rill-r057

Description: use<> identifier must resolve to string

Cause: Variable or computed form of use<> evaluated to a non-string value. The halt is catchable by guard and retry.

Resolution: Ensure the variable or expression inside use<> evaluates to a string of the form “scheme:resource”.

Example:

# Variable holds a number
42 => $id
use<$id>  # $id must be a string

rill-r058

Description: use<> identifier must contain ‘:’ scheme separator

Cause: The dynamic use<> string did not contain a colon separating scheme from resource. The halt is catchable by guard and retry.

Resolution: Ensure the string has the format “scheme:resource”. Example: “module:greetings”.

Example:

# Missing colon
"nocolon" => $id
use<$id>  # missing : separator

rill-r059

Description: moduleResolver config is not a plain object

Cause: The config passed to moduleResolver is not a plain object. Under use<…> the failure surfaces wrapped as RILL-R056.

Resolution: Pass a plain object as the moduleResolver config (e.g., { myModule: “/app/mod.rill” }). Paths must be absolute; resolve them before passing in.

Example:

# Non-object config
# moduleResolver("greetings", null)  # Config is null, not a plain object

rill-r060

Description: Removed frontmatter key used

Cause: Script uses a frontmatter key that was removed in a previous version.

Resolution: Migrate to the replacement shown in the error message.

Example:

# use: frontmatter key removed
---
use:
  - myMod: ./mod.rill
---
# Error: use use<module:...> expression instead

# export: frontmatter key removed
---
export:
  - $result
---
# Error: use last-expression result instead

rill-r061

Description: parseSource not configured in RuntimeContext

Cause: A resolver returned { kind: “source” } but RuntimeOptions.parseSource was not provided.

Resolution: Pass parseSource in RuntimeOptions when constructing the runtime context. parseSource is required for resolvers that return source text.

Example:

# Missing parseSource option
use<module:greetings>  # resolver returns { kind: "source", text: "..." } but host did not pass parseSource

rill-r062

Description: Context key not found

Cause: The requested dot-path key does not exist in the context config. Under use<…> the failure surfaces wrapped as RILL-R056.

Resolution: Ensure the key is present in the context configuration passed to contextResolver.

Example:

# Missing top-level key
# contextResolver("timeout", {})  # "timeout" is not in the context config

rill-r063

Description: Context path segment is not a dict

Cause: A dot-path segment resolves to a non-dict value, so traversal cannot continue. Under use<…> the failure surfaces wrapped as RILL-R056.

Resolution: Ensure each intermediate segment in the dot-path is a nested dict in the context config.

Example:

# Non-dict intermediate segment
# contextResolver("limits.max_tokens", { limits: "text" })  # "limits" is a string, not a dict

rill-r064

Description: Retired: cannot convert string to number

Cause: This error was raised when a string that is not a valid number was converted with number.

Resolution: This error code is no longer thrown. Converting a non-numeric string with number now raises RILL-R038. Ensure the string holds a valid number before converting.

Example:

# Non-numeric string conversion (no longer raised; now RILL-R038)
"hello" -> number  # Not a valid number

rill-r065

Description: Retired: cannot convert string to bool

Cause: This error was raised when a string other than “true” or “false” was converted with bool.

Resolution: This error code is no longer thrown. Converting such a string with bool now raises RILL-R036. Use the exact strings “true” or “false”.

Example:

# Invalid bool string (no longer raised; now RILL-R036)
"yes" -> bool  # Only "true"/"false" convert

rill-r066

Description: Retired: cannot convert number to bool

Cause: This error was raised when a number other than 0 or 1 was converted with bool.

Resolution: This error code is no longer thrown. Converting such a number with bool now raises RILL-R036. Use 0 (false) or 1 (true).

Example:

# Non-binary number conversion (no longer raised; now RILL-R036)
42 -> bool  # Only 0 and 1 convert

rill-r067

Description: Retired: value is not JSON-serializable

Cause: This error was raised when a value that cannot be represented in JSON, such as a function, was serialized.

Resolution: This error code is no longer thrown. Serializing such a value now halts with #INVALID_INPUT. Convert the value to a serializable type (string, number, bool, list, or dict) before serializing; extract data from functions or iterators first.

Example:

# Function in JSON context (no longer raised; now #INVALID_INPUT)
fn(x) { $x + 1 } => $f
$f -> json  # Functions are not serializable

rill-r068

Description: Type registration is frozen

Cause: The type registration object was deep-frozen, preventing method assignment.

Resolution: Ensure type registrations are not deep-frozen before calling populateBuiltinMethods.

Example:

# Frozen registration object
# Object.freeze(registration) prevents method population

rill-r069

Description: Function missing required description

Cause: The requireDescriptions option is enabled but the function has no description.

Resolution: Add a description field to the function definition, or disable requireDescriptions.

Example:

# Missing function description
# registerFunction("greet", { fn: ... }) with requireDescriptions: true

rill-r070

Description: Parameter missing required description

Cause: The requireDescriptions option is enabled but a parameter has no description annotation.

Resolution: Add a description annotation to each parameter, or disable requireDescriptions.

Example:

# Missing parameter description
# param { name: "x", annotations: {} } with requireDescriptions: true

rill-r071

Description: Duplicate type registration

Cause: Two type registrations share the same name. Each type name must be unique.

Resolution: Remove or rename the duplicate type registration.

Example:

# Duplicate type name
# Two registrations both named "string"

rill-r072

Description: Type missing format protocol

Cause: Every type registration must include a format function in its protocol.

Resolution: Add a format function to the type registration protocol.

Example:

# Missing format in protocol
# TypeRegistration { name: "custom", protocol: {} } missing format

rill-r073

Description: Duplicate method on type

Cause: A method with the same name is registered twice on the same type.

Resolution: Remove the duplicate method registration or rename one of them.

Example:

# Method registered twice
# Type "string" has two methods both named "split"

rill-r074

Description: Vector requires at least one dimension

Cause: An empty Float32Array was passed to createVector. Vectors must have at least one element.

Resolution: Provide a non-empty Float32Array when creating vectors.

Example:

# Zero-dimension vector
# createVector(new Float32Array([]), "model")  # No dimensions

rill-r075

Description: Event missing event field

Cause: The event object passed to emitExtensionEvent has no event field or the field is empty.

Resolution: Include a non-empty string event field in the event object.

Example:

# Empty event field
# emitExtensionEvent(ctx, { event: "" })  # Empty event name

rill-r076

Description: Unknown module resource

Cause: The module resolver received a resource identifier it does not recognize. Under use<…> the failure surfaces wrapped as RILL-R056.

Resolution: Use a valid module resource. The ext module resolver only handles the “ext” resource.

Example:

# Invalid module resource
# The resolver of a createTestContext() context receives "unknown"  # Only "ext" is served

rill-r077

Description: Invalid parameter default value

Cause: The default value type does not match the declared parameter type. Explicit host registration checks nested field defaults and return-type defaults too; a nested mismatch reads “Default value for field ‘a’ must be X, got Y”.

Resolution: Ensure every defaultValue, including nested field defaults and return-type defaults, matches its declared type in the function definition.

Example:

# Type mismatch in default
# param { name: "x", type: "number", defaultValue: "hello" }  # String default for a number

rill-r078

Description: Legacy :> conversion syntax

Cause: The parser encountered the legacy ‘:>type’ conversion operator. The ‘->’ pipe operator is now the unified syntax for both function dispatch and type conversion dispatch.

Resolution: Replace ‘:>type’ with ‘-> type’. The target type keyword follows the pipe directly: ‘-> :>string’ becomes ‘-> string’, ‘-> :>ordered(…)’ becomes ‘-> ordered(…)’.

Example:

# Legacy conversion syntax
42 -> :>string
"3.14" -> :>number
list[1, 2] -> :>tuple

rill-r079

Description: Legacy pre-loop @ syntax

Cause: The parser encountered the legacy pre-loop ‘@’ operator. The ‘while (cond) do { body }’ syntax is now the canonical while-loop form.

Resolution: Replace ‘(cond) @ { body }’ with ‘while (cond) do { body }’. For bounded loops, use ‘do(limit: N) { body } while (cond)’.

Example:

# Legacy pre-loop syntax
0 -> ($ < 3) @ { $ + 1 }

rill-r080

Description: Legacy post-loop @ syntax

Cause: The parser encountered the legacy post-loop ‘@’ operator. The ‘do { body } while (cond)’ syntax is now the canonical do-while form.

Resolution: Replace ‘@ { body } ? (cond)’ with ‘do { body } while (cond)’. For seeded loops, pipe the seed: ‘seed -> do { body } while (cond)’.

Example:

# Legacy post-loop syntax
0 -> @ { $ + 1 } ? ($ < 3)

rill-r081

Description: Legacy ^(limit:) loop annotation syntax

Cause: The parser encountered the legacy ‘^(limit: N)’ annotation form for loop limits. The ‘do(limit: N)’ construct option is now the canonical syntax.

Resolution: Replace ‘^(limit: N) @ { body }’ with ‘do(limit: N) { body } while (cond)’ or ‘while (cond) do(limit: N) { body }’.

Example:

# Legacy limit annotation in expression position
(^(limit: 10) 0)

rill-r082

Description: Total wall-time timeout exceeded

Cause: The timeout(total: duration) block body did not complete within the wall-time bound.

Resolution: Recover via guard { timeout(total: d) { body } } ?? fallback. Increase duration or optimize body.

Example:

# Total timeout expires
use<ext:app> => $app
timeout(total: duration("500ms")) { $app.slow() }

rill-r083

Description: Idle inactivity timeout exceeded

Cause: The timeout(idle: duration) block saw no stream chunk and no host call return within the idle bound.

Resolution: Recover via guard { timeout(idle: d) { body } } ?? fallback. Increase the idle duration, or make the body read stream chunks or call the host more often.

Example:

# Idle timeout expires
use<ext:app> => $app
timeout(idle: duration("200ms")) { $app.hang() }

rill-r084

Description: Invalidation code outside the core error set

Cause: invalidate() (or an equivalent host-boundary call) was given a code outside the closed core error set. “ok” is reserved for the valid-value sentinel, and a host cannot add codes of its own.

Resolution: Use a core error code such as #INVALID_INPUT or #UNAVAILABLE, and carry the specifics in message or provider. To return a valid value, do not invalidate it.

Example:

# Host attempts to invalidate with the reserved "ok" code
# Host code: ctx.invalidate(error, { code: "ok", provider: "host" })  # rejected

# Host attempts to invalidate with a code it invented
# Host code: ctx.invalidate(error, { code: "PAYMENT_FAILED", provider: "host" })  # rejected

rill-r085

Description: Host function broke the host contract

Cause: Two causes share the message template, each supplying its own {detail}. First, a host callable has no usable parameter declaration (missing, not an array, or holding a non-object entry) because it was built by hand instead of with callable() or toCallable; the detail reads “has no parameter declaration; build callables with toCallable or callable()” or “declares a malformed parameter at index N; …”. Second, a host function returned a JavaScript value that has no representation in the rill value model, such as undefined, null, a symbol, a bigint, a plain function, a Date, a Set, or a non-plain class instance. The value may have been nested inside a returned array or plain object.

Resolution: Build every callable with callable() or toCallable, or register it with the { signature, fn } shorthand, so it carries a parameter declaration. For an invalid return value, convert the returned value to a rill-representable shape (primitive, dict, list, tuple, atom, datetime, duration, or callable) before returning it from the host function.

Example:

# Host function returns an unsupported JavaScript value
returns_date()  # The host function returned a Date

# Hand-built callable without a parameter declaration
$hand_built()  # Built by hand instead of with callable()

rill-r086

Description: Wildcard policy rule declares transforms

Cause: A “*” policy rule carried in or out entries. Wildcard rules are access-control only, because one transform signature cannot fit every method it would wrap.

Resolution: Drop the in/out entries from the “*” rule and declare transforms on the specific methods that need them.

Example:

# Wildcard rule declares an out transform
# policy: { "kb": { "*": { "access": "deny", "out": ["filter.redact"] } } }

rill-r087

Description: Transform reference cannot be resolved

Cause: A policy in/out entry named a transform that is missing from the mounted extensions, is not written as “extension.method”, or does not name a callable.

Resolution: Write the reference as “extension.method”, mount the extension that provides it, and confirm the named member is a callable.

Example:

# Transform reference naming an unmounted extension
# policy: { "kb": { "search": { "access": "allow", "out": ["filter.redact"] } } }  # No "filter" extension mounted

rill-r088

Description: Call denied by policy

Cause: The dispatch-boundary filter matched a rule whose access is “deny”, or matched a policed extension whose method could not be identified.

Resolution: Recover via guard { … } or a ?? fallback, or grant the method an “access”: “allow” rule in the host policy.

Example:

# Denied call
use<ext:kb> => $kb
$kb.delete()  # Policy denies kb.delete

rill-r089

Description: Policy transform cycle detected

Cause: A policy transform re-entered itself, directly or through another policed method whose own transforms call back into it.

Resolution: Break the cycle so a transform does not call a method whose in/out chain reaches that same transform.

Example:

# Transform that must not call back into its own method
use<ext:kb> => $kb
$kb.search()  # The out transform filter.redact calls kb.search again

rill-r090

Description: Extension too large to brand for policy

Cause: A usescheme:resource resolver returned a value with more members than the policy walk will visit. Branding every callable is what makes policy rules match, so a partial walk would leave the remainder silently unpoliced.

Resolution: Return a smaller extension value from the resolver, or split the extension across several resources that are resolved separately.

Example:

# Extension with more members than the policy walk visits
use<ext:kb> => $kb  # The kb extension has 10001 members and kb is policed

rill-r091

Description: Invalid host function signature

Cause: A host function definition carries a signature that cannot be registered. The signature string fails to lex, parse, or convert to a type structure (a $name type reference, a default or annotation value that is not a constant literal, and an interpolated string are all rejected); the definition supplies signature together with params or returnType; the signature is not a string; the description is not a string; the annotations field is not an object; or one annotation key is declared by more than one source, such as the signature and the annotations field.

Resolution: Fix the signature string so it reads fn(param: type, …):return_type with parentheses and named params (an unnamed param is rejected), supply either signature or params and returnType but not both, write defaults and annotation values as constant literals, pass strings for signature and description, pass an object for annotations, and declare each annotation key in one place only.

Example:

# Signature string with an unclosed parameter list
# Host code: { signature: "fn(x: string", fn }  # rejected

# Signature combined with an explicit params list
# Host code: { signature: "fn(x: string)", params: [], fn }  # rejected

Check Errors

Check errors occur in the rill-check CLI tool during file validation and configuration processing.

rill-c001

Description: File not found

Cause: Specified file path does not exist in filesystem.

Resolution: Verify file path is correct, check file exists, or create the file if it should exist.

Example:

# Nonexistent file
rill-check missing.rill

# Wrong file extension
rill-check script.txt  # Should be script.rill

rill-c002

Description: File unreadable

Cause: File exists but cannot be read (permission denied or IO error).

Resolution: Check file permissions, ensure read access, or verify file is not locked by another process.

Example:

# Permission denied
rill-check protected.rill  # File exists but no read permission

rill-c003

Description: Invalid configuration

Cause: Configuration file or options contain invalid values or structure.

Resolution: Fix configuration syntax, ensure all required fields are present, and values are of correct type.

Example:

# Invalid JSON in config
# .rillrc.json contains malformed JSON

# Unknown config option
# Config contains unsupported option key

rill-c004

Description: Fix collision detected

Cause: Multiple auto-fix rules attempt to modify the same source location.

Resolution: Apply fixes one at a time, or disable conflicting lint rules. Some fixes may need manual resolution.

Example:

# Overlapping fix ranges
# Two rules try to fix same code section

Error Handling Patterns

Defensive Checks

Prevent runtime errors with existence and type checks:

# Check variable existence before use
[apiKey: "secret123"] => $secrets
$secrets.?apiKey ? $secrets.apiKey ! "default-key"

# Check type before method call
"test" => $value
$value :? string ? ($value -> .upper) ! $value

# Validate before conversion
"42" => $input
$input -> .is_match("^-?[0-9]+(\\.[0-9]+)?$") ? ($input -> number) ! 0

Default Values

Provide fallbacks for missing properties:

# Field with default
dict[name: "Alice", age: 30] => $user
$user.email ?? "no-email@example.com"

# Annotation with default
fn(x) { $x } => $fn
$fn.^timeout ?? 30

# Dict dispatch with default
dict[a: 1, b: 2, c: 3] => $lookup
"b" -> $lookup ?? "not found"

Type Assertions

Explicitly verify and convert types:

# Assert type before operation
"  hello  " => $input
$input:string -> .trim

# Check type before calling method
[1, 2, 3] => $numbers
$numbers :? list ? ($numbers -> .len) ! 0

# Convert with validation
"42" => $value
$value -> .is_match("^-?[0-9]+(\\.[0-9]+)?$") ? ($value -> number) ! 0

Getting Help

Each error message includes a help URL linking to this documentation:

Error: Variable foo is not defined
Help: https://github.com/rcrsr/rill/blob/v0.5.0/docs/ref-errors.md#rill-r005

The URL format is:

https://github.com/rcrsr/rill/blob/v{version}/docs/ref-errors.md#{error-id}

Where:

  • {version} is the rill package version (e.g., v0.5.0)
  • {error-id} is the lowercase error ID (e.g., rill-r005)

Contributing

Found an error not documented here? Submit an issue with:

  1. Error ID and message
  2. Code that triggers the error
  3. Expected vs actual behavior
  4. rill version

We maintain this documentation to help users resolve issues quickly and understand error conditions.


See Also