✓
Passing This code compiles and runs correctly.
Code
// MIRROR of 460_001_cell_open_run_hibernate: a `std/cell:open` whose proto,
// register and invocation all live in an imported module.
//
// open's transform resolves its shape argument against the program's
// std/proto decls — the check that matters here is whether that scan sees a
// proto declared on the module side of the boundary, and whether the cell!
// obligation the `| cell` arm introduces discharges in module-local code.
import app/lib
app/lib:run()
Supporting Files
import std/io
import std/cell
import std/proto
import std/runtime
import std/interpreter
std/proto(room_state) {
visits: u32
}
pub tor greet { name: string } -> string
greet -> name
std/runtime:register(scope: "cell") {
greet(5)
}
pub tor run {}
run = std/cell:open(room_state, id: "assistant")
| cell c |> std/cell:run(c, source: "greet(name: \"assistant\")")
| result r |> std/interpreter:value.stringify(r.value): j |> std/io:print.ln("cell said: {{ j:s }}")
| error e |> std/io:print.ln("turn failed: {{ e.kind:s }}")
|> std/cell:hibernate(c) |> std/io:print.ln("assistant hibernated")
Actual
cell said: {"branch":"","value":"assistant"}
assistant hibernated
Expected output
cell said: {"branch":"","value":"assistant"}
assistant hibernated
Flows
flow ~run click a branch to expand · @labels scroll to their anchor
run
Test Configuration
MUST_RUN