✓
Passing This code compiles and runs correctly.
Code
// Layer 2 demonstration (event derivation, negative case):
// an event with an unannotated proc impl derives is_pure=false on
// the event itself. The proc is structurally impure (Layer 1) and
// the event inherits that.
const std = @import("std");
~event log { message: []const u8 }
~proc log|zig {
std.debug.print("LOG: {s}\n", .{message});
}
~event main {}
~log(message: "hello")
Actual
LOG: hello
Flows
flow ~log click a branch to expand · @labels scroll to their anchor
log (message: "hello")
Test Configuration
MUST_RUN
Post-validation Script:
#!/bin/bash
# Verify: event derives is_pure=false from its unannotated (impure) proc impl.
#
# Re-pointed 2026-07-03: the serialized-AST Zig literal (backend.zig /
# program_ast.zig) is RETIRED — the backend loads program.ast.json at
# runtime, so that JSON is the serialized AST and the artifact to assert
# against. The old grep-the-Zig-literal form passed on stale artifacts
# only (the harness never cleaned program_ast.zig).
if [ ! -f "program.ast.json" ]; then
echo "✗ program.ast.json not found"
exit 1
fi
python3 - <<'EOF'
import json, sys
d = json.load(open('program.ast.json'))
def find(kind, name):
for it in d['items']:
if kind in it:
v = it[kind]
segs = (v.get('path') or {}).get('segments') or []
if segs and segs[-1] == name:
return v
return None
def first_flow():
for it in d['items']:
if 'flow' in it:
return it['flow']
return None
def check(entity, label, field, want):
if entity is None:
print(f"✗ Could not find {label}")
sys.exit(1)
got = entity.get(field)
if got is not want:
print(f"✗ FAIL: {label} should have {field} = {str(want).lower()}, got {str(got).lower()}")
sys.exit(1)
e = find('event_decl', 'log')
check(e, 'log event', 'is_pure', False)
print("✓ log event: is_pure = false (derived from unannotated proc impl)")
check(e, 'log event', 'is_transitively_pure', False)
print("✓ log event: is_transitively_pure = false (derived)")
print()
print("✓ Event correctly derives is_pure=false from its impure proc impl")
EOF
exit $?