✓
Passing This code compiles and runs correctly.
Code
// ASPIRATIONAL PIN (2026-06-13): CHAINING auto-discharge — the end-goal.
//
// `acquire` issues a Widget in state `raw!`. The only way to discharge `raw!`
// is to WALK: `cure` (a single-branch, no-extra-param FORWARD transition
// raw!→cured!) and then `discard` (a VOID terminal that consumes cured!). The
// flow below leaves `w<raw!>` undischarged; the aspiration is that the
// auto-discharger walks `cure` → `discard` and cleans it up — so this would
// print "acquired 7" and exit 0. When the depth-N walk lands, flip this back to
// MUST_RUN + expected.txt "acquired 7".
//
// PINNED MUST_FAIL, BY DESIGN — NOT A BUG. Our auto-discharger accepts ONLY void
// events as dischargers (src/auto_discharge_inserter.zig: `branches.len > 0`
// → skip), so the non-void `cure` is never auto-inserted, `raw!` is left
// undischarged, and this is correctly rejected with KORU030. The void-only rule
// is the deliberate depth-1 BASE CASE. The depth-N walk (cycle-guarded against
// self-loops, `[!]` only to break ties) is the roadmap — see
// memory/project_obligation_stress_work_order.md "DISCHARGE MODEL".
//
// NOTE (2026-06-26): this was briefly GREEN as a MUST_RUN — the bare-return head
// migration (`acquire(): w`) hit a gap where the flow-head bare-return
// obligation was not tracked by auto-discharge, silently tolerating the leak
// (the NAMED-BRANCH head form `| acquired w` always rejected it). Closing that
// gap restored the intended rejection; the marker now matches the comment.
~import std/io
const std = @import("std");
pub const Widget = struct { id: u32 };
~pub event acquire {} -> *Widget<raw!>
~proc acquire|zig {
const w = std.heap.page_allocator.create(Widget) catch unreachable;
w.* = .{ .id = 7 };
return w;
}
// Single-branch FORWARD transition raw! → cured!, takes only the resource.
~pub event cure { w: *Widget<!raw> } -> *Widget<cured!>
~proc cure|zig {
return w;
}
// VOID terminal — consumes cured!, issues nothing.
~pub event discard { w: *Widget<!cured> }
~proc discard|zig {
std.heap.page_allocator.destroy(w);
}
~acquire(): w |> std/io:print.ln("acquired {{ w.id:d }}")
Backend must reject with:
CONTAINS error[KORU030]
CONTAINS was not dischargedError Verification
Actual Compiler Output
error[KORU030]: Resource 'w' obligation <raw!> was not discharged. Call: cure
--> auto_discharge:53:0
❌ Compiler coordination error: Auto-discharge failed (multiple disposal options or no disposal event)
error: CompilerCoordinationFailed
???:?:?: 0x10029b9d3 in _backend.RuntimeEmitter.emit (???)
???:?:?: 0x10029cb63 in _backend.main (???)Flows
flow ~acquire click a branch to expand · @labels scroll to their anchor
acquire
Test Configuration
MUST_FAIL