✓
Passing This code compiles and runs correctly.
Code
// Test: std/runtime:scope-manifest serves a scope's vocabulary as a JSON data
// contract — the register block minted as a data structure at scope creation,
// not a hand-written doc. Same bytes as enforcement: the possession arcs and
// argument types rendered here are the ones the interpreter checks before
// dispatch, from the same EventEntry records the dispatch tables are emitted
// from. Feeds the Orisha .json endpoint and the `explain` host downstream.
//
// Pure-surface form (.k): the tilde does not exist here — a pure-Koru file
// rejects it outright (PARSE003), which is exactly the point of the spelling.
import std/runtime
import std/io
pub tor open { path: string } -> string<open!>
open -> { "note_0" }
pub tor append { handle: string<!open>, text: string } -> string<open!>
append -> { handle }
pub tor close { handle: string<!open> }
close -> {}
pub tor say { text: string }
say -> {}
std/runtime:register(scope: "notes") {
open(10)
append(1)
close(1)
say(1)
}
std/runtime:scope-manifest(name: "notes")
| ok json |> std/io:print.ln("{{ json:s }}")
| not-found |> std/io:print.ln("NOT FOUND")
std/runtime:scope-manifest(name: "no-such-scope")
| ok json |> std/io:print.ln("UNEXPECTED: {{ json:s }}")
| not-found |> std/io:print.ln("NOT FOUND")Actual
{"kind":"koru/scope-manifest","version":1,"scope":"notes","events":[{"name":"open","cost":10,"home":null,"args":[{"name":"path","type":"string","optional":false,"phantom":null}],"creates":[{"obligation":"open","module":"main","field":"__type_ref","resource_type":"string"}],"discharges":[],"branches":[]},{"name":"append","cost":1,"home":null,"args":[{"name":"handle","type":"string","optional":false,"phantom":"!open"},{"name":"text","type":"string","optional":false,"phantom":null}],"creates":[{"obligation":"open","module":"main","field":"__type_ref","resource_type":"string"}],"discharges":[{"obligation":"open","module":"main","arg":"handle"}],"branches":[]},{"name":"close","cost":1,"home":null,"args":[{"name":"handle","type":"string","optional":false,"phantom":"!open"}],"creates":[],"discharges":[{"obligation":"open","module":"main","arg":"handle"}],"branches":[]},{"name":"say","cost":1,"home":null,"args":[{"name":"text","type":"string","optional":false,"phantom":null}],"creates":[],"discharges":[],"branches":[]}],"includes":[]}
NOT FOUND
Expected output
{"kind":"koru/scope-manifest","version":1,"scope":"notes","events":[{"name":"open","cost":10,"home":null,"args":[{"name":"path","type":"string","optional":false,"phantom":null}],"creates":[{"obligation":"open","module":"main","field":"__type_ref","resource_type":"string"}],"discharges":[],"branches":[]},{"name":"append","cost":1,"home":null,"args":[{"name":"handle","type":"string","optional":false,"phantom":"!open"},{"name":"text","type":"string","optional":false,"phantom":null}],"creates":[{"obligation":"open","module":"main","field":"__type_ref","resource_type":"string"}],"discharges":[{"obligation":"open","module":"main","arg":"handle"}],"branches":[]},{"name":"close","cost":1,"home":null,"args":[{"name":"handle","type":"string","optional":false,"phantom":"!open"}],"creates":[],"discharges":[{"obligation":"open","module":"main","arg":"handle"}],"branches":[]},{"name":"say","cost":1,"home":null,"args":[{"name":"text","type":"string","optional":false,"phantom":null}],"creates":[],"discharges":[],"branches":[]}],"includes":[]}
NOT FOUNDFlows
flow ~register click a branch to expand · @labels scroll to their anchor
register (scope: "notes", source: open(10)
append(1)
close(1)
say(1))
flow ~scope-manifest click a branch to expand · @labels scroll to their anchor
scope-manifest (name: "notes")
flow ~scope-manifest click a branch to expand · @labels scroll to their anchor
scope-manifest (name: "no-such-scope")
Test Configuration
MUST_RUN