✓
Passing This code compiles and runs correctly.
Code
// `invariants` takes no arguments — its listing is the whole surface, and a
// consumer (a git gate, a review pass) is a script over that listing, never a
// subcommand. A caller holding a retired or misspelled spelling must be
// refused with a non-zero exit: the alternative is a hook that greens while
// checking nothing.
//
// Run: koruc input.kz invariants gate (must refuse)
~import std/invariants
~std/invariants:inferred {
"name": "comment-language",
"tags": ["git-gate"],
"rule": "Comments are written in English, not Norwegian."
}
~tor main {}
~proc main|zig {
}
~main()
Flows
flow ~inferred click a branch to expand · @labels scroll to their anchor
inferred (source: "name": "comment-language",
"tags": ["git-gate"],
"rule": "Comments are written in English, not Norwegian.")
flow ~main click a branch to expand · @labels scroll to their anchor
main
Test Configuration
Post-validation Script:
#!/bin/bash
# An argument to `invariants` is refused: non-zero exit, the argument named,
# and the real surface taught — never the listing with exit 0.
set -e
OUT=$(koruc "$KORU_INPUT" invariants gate 2>&1) && RC=0 || RC=$?
[ "$RC" -ne 0 ] \
|| { echo "FAIL: unknown argument exited 0"; echo "$OUT"; exit 1; }
echo "$OUT" | grep -q 'got `gate`' \
|| { echo "FAIL: refused argument not named"; echo "$OUT"; exit 1; }
echo "$OUT" | grep -q "koruc <file> invariants" \
|| { echo "FAIL: real surface not taught"; echo "$OUT"; exit 1; }
if echo "$OUT" | grep -q "1 inferred"; then
echo "FAIL: listing printed despite the refusal"; echo "$OUT"; exit 1
fi
echo "=== Test passed: retired spelling refused loudly ==="