✓
Passing This code compiles and runs correctly.
Code
// A guarded standing reactive rule on a PLURAL store: the `std/store(name)`
// reference face carries a `when` guard, exactly as it does on a singleton
// (690_026). The guard fuses into the write path — checked at each hp write,
// not by a runtime filter — so only rows that cross the threshold announce.
//
// Three rows are damaged by an AoE query (-20 each); the guarded rule fires
// only for the two that drop to <= 0 (15→-5, 18→-2). The survivor (50→30) is
// written too, but the guard filters it out — proving the fuse, not a filter.
import std/io
import std/store
std/store:new(arena) { hp: i64 }
std/store(arena)
! hp h when h <= 0 |> std/io:print.ln("an enemy has fallen (hp {{ h:d }})")
std/store:insert(arena) { hp: 15 }
| row _ |> _
| full |> _
std/store:insert(arena) { hp: 18 }
| row _ |> _
| full |> _
std/store:insert(arena) { hp: 50 }
| row _ |> _
| full |> _
std/store:query(arena)
! query { entity.hp } when hp > 0 |> std/store:stored { entity.hp: entity.hp - 20 }
Actual
an enemy has fallen (hp -5)
an enemy has fallen (hp -2)
Expected output
an enemy has fallen (hp -5)
an enemy has fallen (hp -2)
Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: arena, source: hp: i64)
flow ~std/store click a branch to expand · @labels scroll to their anchor
std/store (arena)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: arena, source: hp: 15)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: arena, source: hp: 18)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: arena, source: hp: 50)
flow ~query click a branch to expand · @labels scroll to their anchor
query (expr: arena)
Test Configuration
MUST_RUN