✓
Passing This code compiles and runs correctly.
Code
// ASPIRATIONAL (RED by design until std/store rung 2 lands — see DESIGN.md).
// UPDATE WHERE — the query-row addressing head (O2 ruling 2026-07-04: one
// lvalue path grammar, four heads). Inside a query branch the bound row IS
// an addressing head: a `stored` block writing through it updates THAT
// row. The query system is thereby SQL's whole write surface — no second
// API. Watch fires for the damage sweep re-checking nothing: the guard
// selected the rows, the body addressed them.
//
// Three rows; the sweep halves hp where kind == 1; the field watch
// (unguarded, fires per hp write) reports each halving.
// ASSUMES row INSERT fires the `inserted` lifecycle (and query enter),
// NOT per-field watches — a field watch observes CHANGE to an existing
// row's field; birth arrives whole (sibling of O9's birth-is-not-a-write;
// recorded as O9b in DESIGN.md, lean pending ratification). Hence no
// "hp now 40/60/80" lines from the inserts.
// NOTE (gauntlet 2): this pin carries the QUERY-TEMPORALITY ambiguity —
// when does a post-insert-declared query apply to pre-existing rows?
// Candidate resolution: the stripe ruling (DESIGN.md O13). Reframe this
// pin when (l) is ruled.
~import std/io
~import std/store
~std/store:create(game) { hp: i64, kind: i64 }
~std/store:watch(game)
! hp h |> std/io:print.ln("hp now {{ h:d }}")
~std/store:insert(game) { hp: 40, kind: 1 }
~std/store:insert(game) { hp: 60, kind: 2 }
~std/store:insert(game) { hp: 80, kind: 1 }
// (@divTrunc, not `/`: integer-division LOWERING is the expression-layer
// gap pinned at 010_063 — this pin tests the addressing head, not division.)
~std/store:query(game)
! query { entity.hp, entity.kind } when kind == 1 |> std/store:stored { entity.hp: @divTrunc(entity.hp, 2) }
Actual
hp now 20
hp now 40
Expected output
hp now 20
hp now 40
Flows
flow ~create click a branch to expand · @labels scroll to their anchor
create (expr: game, source: hp: i64, kind: i64)
flow ~watch click a branch to expand · @labels scroll to their anchor
watch (expr: game)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: game, source: hp: 40, kind: 1)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: game, source: hp: 60, kind: 2)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: game, source: hp: 80, kind: 1)
flow ~query click a branch to expand · @labels scroll to their anchor
query (expr: game)
Test Configuration
MUST_RUN