Why a program did not produce a value.
A failure is data, never an exception. A program that throws, loops forever, floods stdout, or dies with its substrate is a normal outcome of running model-authored code: the model gets told what happened and writes a better program. Raising would make the tool call an error and lose that loop.
The kinds are distinct because the model — and the operator reading a log —
can act differently on each:
:exception— the program raised. Its own bug; the message is the guest's.:timeout— the wall-clock budget expired. Possibly an infinite loop, possibly just slow; the program ran and may have had side effects.:abort— cancelled from outside (Nous.CodeRuntime.cancel/2), e.g. the agent run was cancelled. Not the program's fault.:substrate_exit— the runtime died underneath us. Ours to fix, not the model's, and the one kind that should page somebody.:invalid_output— the program returned something unrepresentable.:output_limit— it produced more output than the ledger allows. The retained prefix is still inResult.logs, because truncated evidence beats none.
Summary
Functions
Every failure kind.
Build a failure. Unknown kinds are rejected at construction, where the bug is, rather than surfacing as an unmatched clause somewhere downstream.