✓
Passing This code compiles and runs correctly.
Code
// Layer 3 demonstration: annotations are open metadata at the frontend.
// `[pure]` on an event is redundant (events derive purity from impls,
// not from annotations) but it is NOT an error. The frontend accepts it.
//
// This test passes if the program compiles cleanly. The purity pass
// either ignores the annotation or computes a redundantly-correct
// result. Neither rejection nor error.
const std = @import("std");
// [pure] on an event — redundant but legal
~[pure] event noop {}
~proc noop|zig {}
~event main {}
~noop()
Flows
flow ~noop click a branch to expand · @labels scroll to their anchor
noop
Test Configuration
MUST_RUN
Post-validation Script:
#!/bin/bash
# Verify: [pure] on an event is legal (annotations are open metadata) and the program compiles.
#
# 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', 'noop')
if e is None:
print("✗ FAIL: noop event not found in program.ast.json")
sys.exit(1)
print("✓ program with [pure] on event compiled cleanly (annotations are open metadata)")
EOF
exit $?