✓
Passing This code compiles and runs correctly.
Code
// WALL: plural `! updated` binds the write contract — the written field's
// { old, new } images — never row fields. Destructuring a row field here
// confuses the lifecycle grammar (`inserted`/`removed` project ROW fields
// by pun; `updated` carries the DELTA) and must be rejected with a message
// that teaches the contract, at the koru level.
import std/io
import std/store
std/store:new(reserve) { pool: 0[i64] }
std/store:new(squad) { hp: i64 }
! updated { hp } |> std/store:stored { reserve.pool: reserve.pool + hp }
std/store:insert(squad) { hp: 10 }
Output must match:
MUST_FAIL
BACKEND_COMPILE_ERROR
CONTAINS updated
CONTAINS old
CONTAINS newError Verification
Actual Compiler Output
🎯 Compiler coordination: Passes: 17 (flow-based: frontend, analysis, emission)
Error: output_emitted.zig:31:16: error: std/store:new(squad): `! updated` binds the written field's images — destructure exactly { old, new } (row fields ride `inserted`/`removed`)
comptime { @compileError("std/store:new(squad): `! updated` binds the written field's images — destructure exactly { old, new } (row fields ride `inserted`/`removed`)"); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
main_module: output_emitted.zig:29:25
main: output_emitted.zig:896:5
4 reference(s) hidden; use '-freference-trace=6' to see all references
output_emitted.zig:32:16: error: std/store:insert: unknown store 'squad' - no std/store:new(squad) found
comptime { @compileError("std/store:insert: unknown store 'squad' - no std/store:new(squad) found"); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: reserve, source: pool: 0[i64])
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: squad, source: hp: i64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: squad, source: hp: 10)
Test Configuration
MUST_FAIL
Expected Error:
std/store:new(squad): `! updated` binds the written field's images — destructure exactly { old, new } (row fields ride `inserted`/`removed`)