✓
Passing This code compiles and runs correctly.
Code
// Test: Subflow calling unmarked (impure) proc should be transitively impure
// Unmarked proc → Subflow calls it → Subflow should be transitively IMPURE
const std = @import("std");
// Impure operation (unmarked, so defaults to impure)
~event log { message: []const u8 }
~proc log|zig {
std.debug.print("LOG: {s}\n", .{message});
}
// Main entry using subflow
~event main {}
// Subflow that calls impure event - should be transitively IMPURE
~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: subflow calling an impure proc is locally pure but transitively impure.
#
# 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)
p = find('proc_decl', 'log')
check(p, 'log proc', 'is_pure', False)
print("✓ log proc: is_pure = false (unmarked, defaults to impure)")
check(p, 'log proc', 'is_transitively_pure', False)
print("✓ log proc: is_transitively_pure = false")
f = first_flow()
check(f, 'subflow', 'is_pure', True)
print("✓ subflow: is_pure = true (flows are always locally pure)")
check(f, 'subflow', 'is_transitively_pure', False)
print("✓ subflow: is_transitively_pure = false (calls impure log)")
print()
print("✓ Subflow correctly marked transitively impure when calling impure proc")
EOF
exit $?