This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 9/16/2026.
Runtime.parsewire
~import std/runtime.parsewireKoru Standard Library: the `parsewire` part of runtime.kz.
runtime.parsewire.kz · 1 tors
Koru Standard Library: the `parsewire` part of runtime.kz. · 28 more lines
Koru Standard Library: the `parsewire` part of runtime.kz.
Joined via `~part parsewire` in runtime.kz; merged into the runtime
module at load.
PARSE.WIRE - the wire grammar: one flow, arms included
A model's turn is `verb(field: "value", ...)` with `|` arms chaining the
fresh outcomes (`| ok h |> verb(handle: h)` binds what the call just
issued — the composition partial programs are). Quoted string values;
prose and trailing text are refused at PARSE time, with a diagnostic
written to be fed back to the model that emitted it.
Two things are deliberately NOT checked here:
- **Vocabulary membership.** An in-shape call naming a verb outside the
scope is `event-denied` at dispatch — "a real verb that is not yours",
a different and load-bearing meaning from "that was not Koru" (430_055
pins the confusion this split exists to prevent).
- **Field membership.** An unknown field on a known verb is
`validation-error` at dispatch, for the same reason.
Validation only shapes the line; the AST is still built by the
interpreter's own parser, so the wire can never accept a shape that eval
would execute differently.
The wire's shape rules, as prompt bytes. These are the sentences
`wireValidate` below enforces — the two must move together or the prompt
starts lying about the parser (the drift this rung exists to kill).
`scope-grammar` renders this text above the scope's own verb lines.
~[retain] pub tor parse.wire { source: string }
| parsed *const ast.Flow
| parse-error { message: string, line: u32, column: u32 }