✓
Passing This code compiles and runs correctly.
Code
// Pins `glance`: `koruc input.k glance` prints the declaration surface of the
// whole program — every module's events with full signatures, annotations, and
// file:line. glance is a built-in FRONTEND AST mode (no import, no backend): it
// walks the fully-resolved post-import AST and exits, like --help. `--app` drops
// std/koru. This file imports std/store, so glance must surface its CRUD events.
import std/store
std/store:new(counter) { clicks: 0[i64] }
std/store:watch(counter)
! clicks c |> std/store:stored { counter.clicks: counter.clicks + 1 }
Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: counter, source: clicks: 0[i64])
flow ~watch click a branch to expand · @labels scroll to their anchor
watch (expr: counter)
Test Configuration
Post-validation Script:
#!/bin/bash
# glance prints the program's declaration surface — no `import std/glance` needed
# (implicit injection). It must show std/store's CRUD events with signatures;
# --app must drop std modules.
set -e
echo "=== koruc input.k glance ==="
OUT=$(koruc input.k glance 2>&1)
echo "$OUT"
echo "$OUT" | grep -q "std.store" || { echo "FAIL: std.store module not glanced"; exit 1; }
echo "$OUT" | grep -qE "new\(.*Program.*\) -> SiteResult" || { echo "FAIL: new signature not shown"; exit 1; }
echo "$OUT" | grep -qE "insert\(" || { echo "FAIL: insert event not surfaced"; exit 1; }
echo "$OUT" | grep -qE "take\(" || { echo "FAIL: take event not surfaced"; exit 1; }
echo "=== koruc input.k glance --app (drops std) ==="
APP=$(koruc input.k glance --app 2>&1)
echo "$APP"
echo "$APP" | grep -q "std.store" && { echo "FAIL: --app should have dropped std.store"; exit 1; } || true
echo "=== PASS: glance surfaces the store CRUD events; --app filters std ==="