✗
Failing This test is currently failing.
Failed: output
Failure Output
[REGISTRY] Creating dispatcher for scope 'api'
[REGISTRY] Found 3 events
[REGISTRY] Generated 32833 bytes
🎯 Compiler coordination: Passes: 20 (flow-based: elaborate, analysis, emission) Code
// Pins: a bare wire value is a Koru expression, judged by the language's
// own expression parser — not by a field's declared type.
//
// `calc(expr: 2 + 3)` evaluates a bare expression to i64 5; `string`
// fields take quoted literals — `render(src: "hello world")`,
// `note(text: "thinking out loud")` — and refuse bare prose,
// `say(text: hello world)` being a parse-error: bare text is not a Koru
// expression.
import std/io
import std/bridge
import std/runtime
tor calc { expr: i64 }
proc calc|zig {
_ = @import("std").posix.write(1, "calc:") catch {};
const buf = @import("std").fmt.allocPrint(@import("std").heap.page_allocator, "{d}", .{expr}) catch unreachable;
_ = @import("std").posix.write(1, buf) catch {};
_ = @import("std").posix.write(1, "\n") catch {};
}
tor render { src: string }
proc render|zig {
_ = @import("std").posix.write(1, "render:") catch {};
_ = @import("std").posix.write(1, src) catch {};
_ = @import("std").posix.write(1, "\n") catch {};
}
tor say { text: string } -> string
proc say|zig {
return text;
}
std/runtime:register(scope: "api") {
calc(1)
render(1)
say(1)
}
tor gated { br: *std/bridge:Bridge<session>, source: string }
gated = std/bridge:run(br, source)
| partial p |> std/io:print.ln("{{ p.report:s }}")
| result r |> std/io:print.ln(" single result")
| unhandled-branch ub |> std/io:print.ln("FAIL unhandled {{ ub.branch:s }}")
| event-denied ev |> std/io:print.ln("FAIL denied {{ ev:s }}")
| residue _ |> std/io:print.ln("FAIL: residue outcome")
| parse-error p |> std/io:print.ln(" refused: {{ p.message:s }}")
| validation-error v |> std/io:print.ln("FAIL invalid {{ v:s }}")
| shape-error sh |> std/io:print.ln("FAIL shape {{ sh.message:s }}")
| dispatch-error e |> std/io:print.ln("FAIL dispatch {{ e.message:s }}")
| defined d |> std/io:print.ln("FAIL defined {{ d:s }}")
| exhausted _ |> std/io:print.ln("FAIL exhausted")
| scope-not-found s2 |> std/io:print.ln("FAIL noscope {{ s2:s }}")
[with]std/bridge:create(id: "cap", scope: "api", introspection: true): br
|> gated(br, source: "calc(expr: 2 + 3)\nrender(src: \"hello world\")\nnote(text: \"thinking out loud\")")
|> gated(br, source: "say(text: hello world)")
Actual
calc:5
render:hello world
step 1/3 result: {"branch":""} bound: r1
step 2/3 result: {"branch":""} bound: r2
step 3/3 event-denied: note
refused: the value of 'text' is not a Koru expression — write a bound name, a field path, an operation (`n * 2`), or "quote it" for literal text
Expected output
calc:5
render:hello world
step 1/3 result: {"branch":""} bound: r1
step 2/3 result: {"branch":""} bound: r2
step 3/3 result: {"branch":"","value":"ok"} bound: r3
refused: the value of 'text' is not a Koru expression — write a bound name, a field path, an operation (`n * 2`), or "quote it" for literal text
Flows
flow ~register click a branch to expand · @labels scroll to their anchor
register (scope: "api", source: calc(1)
render(1)
say(1))
subflow ~gated click a branch to expand · @labels scroll to their anchor
run (br, source)
flow ~create click a branch to expand · @labels scroll to their anchor
create (id: "cap", scope: "api", introspection: true)
Test Configuration
MUST_RUN