✓
Passing This code compiles and runs correctly.
Code
// Pins the item gate, flag-absent half: a gate-shaped annotation on a
// cross-module override drops the OVERRIDE, not the module. The module is
// imported unconditionally, so its flag.declare stays in the AST (see
// post.sh); only `input:calc` is gone and the default answers 42.
~import std/io
~import app/test_lib/override
~[abstract] tor calc { n: i64 } -> i64
~proc calc|zig {
return n * 2;
}
~calc(n: 21): r |> std/io:print.ln("{{ r:d }}")
Supporting Files
// Override module: declares its own flag AND carries the override gated
// on it. The unconditional import keeps the declare visible to --help;
// the gate decides only the override below.
~import std/compiler
~std/compiler:flag.declare {
"name": "my-flag",
"description": "Enable the gated calc override (item-gate pin)",
"type": "boolean"
}
~[flag(my-flag)]input:calc -> n * 10
Actual
42
Expected output
42
Flows
flow ~calc click a branch to expand · @labels scroll to their anchor
calc (n: 21)
Test Configuration
MUST_RUN
Post-validation Script:
#!/bin/bash
# The gated module is imported UNCONDITIONALLY, so its flag.declare must
# be visible to --help even though the override itself gated out. (With
# import-level gating this flag would be undiscoverable — the hole the
# item gate closes.)
set -e
HELP_OUTPUT=$(koruc input.kz --help 2>&1)
echo "$HELP_OUTPUT" | grep -q "my-flag" || {
echo "FAIL: --my-flag missing from --help although its module is imported"
exit 1
}
echo "PASS: gated module's flag.declare visible in --help"
# Gate exclusion verdicts are build diagnostics: they must never reach
# --help output, even though the help parse evaluates (and drops) the
# same gated items.
if echo "$HELP_OUTPUT" | grep -q "no gate entry true"; then
echo "FAIL: gate exclusion verdict leaked into --help output"
exit 1
fi
echo "PASS: --help carries no gate verdicts"