✓
Passing This code compiles and runs correctly.
Code
// Pins the command() narrowing head gating an import: the entry
// `command(trace)` is true exactly when the koruc invocation carries `trace`
// in command position, so the module rides along only under its command.
// This is the activation story for command-scoped tooling modules
// (std/explain is the motivating case): the module's own gate, not every
// import site's memory, decides when it exists.
//
// The imported module registers a tap, so the import is load-bearing: the
// [TAP] line in the output IS the import surviving the gate. COMPILER_FLAGS
// carries the bare word `trace`, which the harness passes in command
// position.
const std = @import("std");
~[command(trace)]import app/test_lib/tracer
~tor compute { x: i32 } -> i32
~proc compute|zig {
std.debug.print("compute({d})\n", .{x});
return x * 2;
}
~tor display { value: i32 }
~proc display|zig {
std.debug.print("Final: {d}\n", .{value});
}
~compute(x: 21): r |> display(value: r)
Actual
compute(21)
[TAP] compute
Final: 42
Expected output
compute(21)
[TAP] compute
Final: 42
Flows
flow ~compute click a branch to expand · @labels scroll to their anchor
compute (x: 21)
Imported Files
// Tap module — importing it is what wires the tap (the 310_001 mechanism).
// The pin's gated import makes that wiring conditional: this module's output
// appears exactly when the import survives the annotation gate.
const std = @import("std");
~import std/taps
~pub tor log { event_name: string }
~proc log|zig {
std.debug.print("[TAP] {s}\n", .{event_name});
}
// compute is a bare-return `-> T` event, so the tap binds the produced value
// with `: r` (call-site bind rule, Lars-ruled 2026-06-25; 310_001 is the green
// precedent) — a branch tap has no named branch to match on a bare return.
~tap(input:compute -> input:display): r |> log(event_name: "compute")
Test Configuration
MUST_RUN
Compiler Flags:
trace