✓
Passing This code compiles and runs correctly.
Code
// Pins: an event that is declared, wired, and never implemented ANYWHERE must
// announce itself and die when reached — it may not fabricate an answer.
//
// A program carrying `test` blocks stands the invoked-but-unimplemented wall
// (KORU047) down wholesale, because an implementation may be sitting in an
// unparsed test body that no walk of this AST can see. That stand-down covers
// application flows too, so the emitter's no-implementation path synthesizes
// its silent stub — first branch, zero-defaults — and `fetch` below hands back
// `found 0` without a word. The application believes it and takes the success
// arm.
//
// This is the scaffold shape the swarm workflow depends on: the whole program
// as high-level flow, boxes left empty, running before anything is filled in.
// Running is right; running silently is not.
~import std/testing
~import std/io
~tor fetch { id: u32 }
| found u32
| missing
~tor run-it { id: u32 }
| ok u32
| gone
~run-it = fetch(id)
| found f => ok f
| missing => gone
// A test block exists — this alone stands the wall down — and it mocks nothing.
~test(a test block exists, and mocks nothing) {
~assert.ok()
}
~run-it(id: 1)
| ok v |> std/io:print.ln("value = {{ v:d }}")
| gone |> std/io:print.ln("nothing there")
Flows
subflow ~run-it click a branch to expand · @labels scroll to their anchor
fetch (id)
flow ~test click a branch to expand · @labels scroll to their anchor
test (a test block exists, and mocks nothing, source: ~assert.ok())
flow ~run-it click a branch to expand · @labels scroll to their anchor
run-it (id: 1)
Test Configuration
Post-validation Script:
#!/bin/bash
# The program must DIE at the unfilled event, naming it. It must never print a
# value it invented. Passing here means an empty box is loud, not silent.
cd "$(dirname "$0")"
bin=""
for candidate in ./output ./a.out; do
[ -x "$candidate" ] && bin="$candidate" && break
done
if [ -z "$bin" ]; then
echo "FAIL: no executable was produced"
exit 1
fi
out=$("$bin" 2>&1)
rc=$?
if printf '%s' "$out" | grep -q 'value = '; then
echo "FAIL: the unfilled event 'fetch' fabricated an answer instead of dying"
echo " program printed: $out"
exit 1
fi
if [ $rc -eq 0 ]; then
echo "FAIL: reaching an unfilled event exited 0"
echo " program printed: $out"
exit 1
fi
if ! printf '%s' "$out" | grep -q 'fetch'; then
echo "FAIL: the program died but did not name the event it died on"
echo " program printed: $out"
exit 1
fi
echo "PASS: reaching unfilled event 'fetch' died loudly and named itself"
exit 0