✓
Passing Passing: the compiler rejects this program as expected.
Code
// PIN (documented gap, red on purpose): a NAMED store field holding a
// CROSS-MODULE obligation loses its phantom through the `| full` rejection
// record — `f.t` reports "no live '<held!>' obligation" even though the
// full arm hands back exactly the row insert refused, obligations and all.
//
// The contrast that makes this a gap and not a rule: the SAME shape with a
// same-module obligation tracks fine — todo_tui's
// | full f |> std/string:free(s: f.label)
// compiles today (std/string's `instance`), and so does this file with
// `*std/string:String<instance!>` in place of the lib type. Only the
// cross-module phantom (`app/lib/res:held` here; koru/sse's `framing` and
// koru/curl's `open` in the wild) drops out of the record.
//
// Until fixed, the working idiom is the ANONYMOUS single-field store
// (downloads' batch): the rejection payload IS the value, and the tracker
// follows it. Found by kopium's framer store (c_chat_pane.k), which speaks
// that idiom for exactly this reason.
//
// When the tracker learns record fields, this flips to MUST_RUN.
import std/store
import app/lib/res
std/store:new(box, capacity: 2) { t: *app/lib/res:Thing<held!> }
tor arm {}
arm = app/lib/res:mk(): t |> std/store:insert(box) { t }
| row _ |> _
| full f |> app/lib/res:drop(f.t)
arm()
Supporting Files
const std = @import("std");
pub const Thing = struct {
v: i64,
};
~pub tor mk {} -> *Thing<held!>
~proc mk|zig {
const t = std.heap.page_allocator.create(Thing) catch @panic("OOM");
t.* = .{ .v = 7 };
return t;
}
~pub tor drop { t: *Thing<!held> }
~proc drop|zig {
std.heap.page_allocator.destroy(t);
}
Actual compiler output
error[KORU030]: Phantom state mismatch: 'f.t' (parameter 't') holds no live '<held!>' obligation to consume here — it was never acquired or has already been discharged. Pass a value that still holds its '<held!>' obligation.
--> tests/regression/600_STDLIB/690_STORE/690_233_full_arm_drops_cross_module_obligation/input.k:29:0
❌ Compiler coordination error: Phantom semantic validation failed
(set KORU_BACKEND_TRACE=1 for the backend return trace)Must contain:
KORU030Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (box, capacity: 2, source: t: *app/lib/res:Thing<held!>)
subflow ~arm click a branch to expand · @labels scroll to their anchor
mk
flow ~arm click a branch to expand · @labels scroll to their anchor
arm
Test Configuration
MUST_ERROR