Toolnexus.Status (toolnexus v0.20.0)

Copy Markdown View Source

The TWO status vocabularies, as first-class values (ADR 0027 / D5).

They share a field name and they are NOT the same closed set. Reading the §7D set while holding a §8 %RunResult{} is what issue #92 did, and it is the defect this module exists to remove.

  • run/0 — §8 Client.RunResult.status
  • task/0 — §7D TaskResult.status (the agent runtime)

"timeout" belongs EXCLUSIVELY to §7D: it is a wait/2 deadline, where the child KEEPS RUNNING. A client run that hits :timeout_ms raises Toolnexus.TimeoutError; it never reports a "timeout" status.

Summary

Functions

§7D: the handle was closed.

§8 + §7D: the turn produced a final answer.

§7D: the run failed; failures cross a handle boundary as results.

§8 + §7D: a limit stopped the run, and limit NAMES it.

§7D: the turn was aborted; the handle is idle and alive.

True when s is a canonical limit value.

The closed limit vocabulary: ["maxTurns", "maxTokens", "maxToolCalls", "maxWallMs", "maxChildren", "maxConcurrent", "maxDepth", "completion", "timeout"].

§8 + §7D: a §10 durable suspension; resume with Runtime.resume/2.

§8 RunResult.status: ["done", "pending", "incomplete"].

True when s is a §8 run status.

§7D TaskResult.status: ["done", "pending", "incomplete", "interrupted", "closed", "timeout", "error"].

True when s is a §7D task status.

§7D: a wait deadline expired — the child KEEPS RUNNING.

Functions

closed()

§7D: the handle was closed.

done()

§8 + §7D: the turn produced a final answer.

error()

§7D: the run failed; failures cross a handle boundary as results.

incomplete()

§8 + §7D: a limit stopped the run, and limit NAMES it.

interrupted()

§7D: the turn was aborted; the handle is idle and alive.

limit?(s)

@spec limit?(String.t()) :: boolean()

True when s is a canonical limit value.

limits()

@spec limits() :: [String.t()]

The closed limit vocabulary: ["maxTurns", "maxTokens", "maxToolCalls", "maxWallMs", "maxChildren", "maxConcurrent", "maxDepth", "completion", "timeout"].

pending()

§8 + §7D: a §10 durable suspension; resume with Runtime.resume/2.

run()

@spec run() :: [String.t()]

§8 RunResult.status: ["done", "pending", "incomplete"].

run?(s)

@spec run?(String.t()) :: boolean()

True when s is a §8 run status.

task()

@spec task() :: [String.t()]

§7D TaskResult.status: ["done", "pending", "incomplete", "interrupted", "closed", "timeout", "error"].

task?(s)

@spec task?(String.t()) :: boolean()

True when s is a §7D task status.

timeout()

§7D: a wait deadline expired — the child KEEPS RUNNING.