✗
Failing This test is currently failing.
Failed: wrong-error
Failure Output
Showing last 10 of 13 lines
--> auto_discharge:37:0
❌ Compiler coordination error: Auto-discharge failed (multiple disposal options or no disposal event)
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/310_COMPTIME/310_102_comptime_obligation_leak/backend.zig:95:13: 0x1029fb9d3 in emit (backend)
return error.CompilerCoordinationFailed;
^
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/310_COMPTIME/310_102_comptime_obligation_leak/backend.zig:202:28: 0x1029fcb63 in main (backend)
const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
^ Code
// NEGATIVE TEST (designed rejection ORDERING — comptime obligation
// checking, ruled 2026-07-06). The gap is sharper than "comptime is
// unchecked": the analysis-time checker DOES see comptime flows and
// DOES reject this leak (KORU030) — but only AFTER evaluate-comptime
// has already RUN the flow. Observed 2026-07-06: the sink printed
// "comptime input" (twice — fold + evaluate both walk it) BEFORE the
// rejection. Taint reached the sink during compilation; the build
// failed after the exfiltration. Checked-but-too-late.
//
// The ruled fix: run the SAME phantom checker as a frontend segment
// scoped to [comptime]-marked items, BEFORE process-template-procs
// (compiler.kz:828), with a comptime-scoped auto-discharge run ahead
// of it. One implementation of obligation semantics, two executions
// disciplined — and comptime side effects can never precede their own
// rejection.
//
// This is 330_069's taint shape, comptime-marked. The NOT_CONTAINS
// assertion is the pin's point: rejection must fire before the sink
// can produce output. Also wanted from the fix: the diagnostic names
// the comptime context and the real source location (today it points
// at auto_discharge:33:0). Double-evaluation is a separate observation
// to investigate.
const std = @import("std");
~[comptime] pub event get-input {}
| line []const u8<unsanitized!>
~[comptime] get-input => line "comptime input"
~[comptime] pub event sink { s: []const u8 }
~proc sink|zig {
std.debug.print("{s}\n", .{s});
}
~[comptime] get-input()
| line s |> sink(s)
Backend must reject with:
CONTAINS obligation
CONTAINS unsanitized
NOT_CONTAINS comptime inputError Verification
Actual Compiler Output
comptime input
comptime input
error[KORU030]: Resource 's' obligation <unsanitized!> was not discharged. No event accepts <!unsanitized>.
--> auto_discharge:37:0
❌ Compiler coordination error: Auto-discharge failed (multiple disposal options or no disposal event)
error: CompilerCoordinationFailed
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/310_COMPTIME/310_102_comptime_obligation_leak/backend.zig:95:13: 0x1029fb9d3 in emit (backend)
return error.CompilerCoordinationFailed;
^
/Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/310_COMPTIME/310_102_comptime_obligation_leak/backend.zig:202:28: 0x1029fcb63 in main (backend)
const generated_code = try RuntimeEmitter.emit(compile_allocator, final_ast);
^Flows
flow ~get-input click a branch to expand · @labels scroll to their anchor
get-input
Test Configuration
MUST_FAIL
Expected Error:
obligation <unsanitized!> on the line payload is never discharged in comptime code — this flow runs during compilation; route it through a consumer of <!unsanitized> before evaluation ends