✓
Passing Passing: the compiler rejects this program as expected.
Code
// NEGATIVE (under --auto-discharge=disable): `std/io:read-file`'s buffer
// carries `allocated!` and MUST reach `std/io:free`.
//
// RULED 2026-07-31 (this file used to be the open question): one label —
// `allocated` — for every allocator-owned buffer an io tor hands back
// (read-file here, read-stdin in 335_043), and one disposer, `std/io:free`.
// The phantom machinery was never missing (335_047 tracked `tainted` on a
// bare string); this was the spelling landing on the IO surface.
//
// Under DEFAULT settings auto-discharge inserts the free (the same
// convenience curl/yyjson/sse lean on) and this file compiles and runs
// clean — proven the day of the ruling by koru-examples/kopium's leak
// check going green. With the net disabled, the leak is a loud refusal:
// error[KORU030]: Resource 'content' carries obligation <allocated!>
// was not discharged. Call: std.io:free
~import std/io
~std/io:read-file(path: "data.txt")
| ok content |> std/io:print.ln("{{ content:s }}")
| not-found |> _
| failed _ |> _
Actual compiler output
error[KORU030]: Resource 'content' carries obligation <allocated!> was not discharged. Call one of: std.io:free
--> tests/regression/300_ADVANCED_FEATURES/335_OBLIGATION_STRESS/335_042_read_file_no_free/input.kz:20:0
❌ Compiler coordination error: Phantom semantic validation failed
(set KORU_BACKEND_TRACE=1 for the backend return trace)Must contain:
KORU030Flows
flow ~read-file click a branch to expand · @labels scroll to their anchor
read-file (path: "data.txt")
Test Configuration
MUST_ERROR
Compiler Flags:
--auto-discharge=disable