✓
Passing This code compiles and runs correctly.
Code
// Pins: a bare STEM on the CLI (`koruc input hello`) dispatches a frontend
// command exactly as the explicit facet (`koruc input.kz hello`) does. The
// stem is the real unit of compilation — `.k`/`.kz`/`.kjs` are facets — so
// command dispatch must key off the raw arg the user typed, not the
// extension-resolved path.
~import std/build
~std/build:command.sh(name: "hello") {
echo "Hello from Koru!"
}
~std/build:command.sh(name: "args") {
echo "Args: $@"
}
Flows
flow ~command.sh click a branch to expand · @labels scroll to their anchor
command.sh (name: "hello", source: echo "Hello from Koru!")
flow ~command.sh click a branch to expand · @labels scroll to their anchor
command.sh (name: "args", source: echo "Args: $@")
Test Configuration
Post-validation Script:
#!/bin/bash
# Bare-stem command dispatch must match explicit-facet dispatch byte-for-byte.
set -e
# 1. Bare stem dispatches the shell command (no full build, no fall-through).
stem_hello="$(koruc input hello)"
facet_hello="$(koruc input.kz hello)"
if [ "$stem_hello" != "$facet_hello" ]; then
echo "FAIL: 'koruc input hello' != 'koruc input.kz hello'"
echo " stem : $stem_hello"
echo " facet: $facet_hello"
exit 1
fi
if [ "$stem_hello" != "Hello from Koru!" ]; then
echo "FAIL: expected 'Hello from Koru!', got: $stem_hello"
exit 1
fi
# 2. Trailing args pass through the bare-stem form identically.
stem_args="$(koruc input args one two three)"
facet_args="$(koruc input.kz args one two three)"
if [ "$stem_args" != "$facet_args" ]; then
echo "FAIL: trailing args differ between stem and facet"
echo " stem : $stem_args"
echo " facet: $facet_args"
exit 1
fi
if [ "$stem_args" != "Args: one two three" ]; then
echo "FAIL: expected 'Args: one two three', got: $stem_args"
exit 1
fi
echo "OK: bare-stem command dispatch matches explicit facet"