Commit Graph
5 Commits
Author SHA1 Message Date
SirStone 77fa2dfe4c feat(walls): proto 2 typed wall record, inert geometry, derived kind (#54)
wall.add/wall.update take thickness, position, height and the eight raw
switches; kind is output-only and the GM wall frames echo the full typed
record. Geometry is stored but inert (0/full/centre behaviour), and the
legacy kind/open wire adapter is gone. proto is bumped to 2 with the
harness default, and BannedAlways gains every wall field name with a
WALLDATA positive control.

Tests: schema-7 migrated scene vs the same walls authored via raw switches
gives byte-identical player frames, refusals and per-tile statuses.
Nim 382 / Node 113 green.
2026-11-19 22:21:47 +01:00
SirStone 8e045b0ac8 names: per-player reveal, one encountered write path, link by update (#27, #29, #30)
name.reveal wrote the subject's actual name into the encountered row of every
player who had met it: the SQL had no player predicate, so the leak was silent
live and visible only after a restart. rewriteEncountered is now the one path
that keeps a snapshot in step with its subject: it rewrites the SQLite row and
the live in-memory entry together from the name rule, takes onlyPlayer for
name.reveal (every player for reveal_all), and also runs on a rename, a link
change and an owner change, so the wire and a post-restart reload cannot
disagree (#30). The DB-only renameEncountered*/revealEncountered* helpers are
gone, which is what let the two stores drift.

token.update {character_id} now drops the token's own two names as part of the
link patch (#29): a plain token can be linked, names supplied with a link stay
invalid and unlinking still needs both names.

Tests: tcharacters covers the per-player row, the DB/memory equality, the link
handover; restart.test.mjs builds three named players, reveals to one of them
and asserts the rows directly and the whole resync over SIGTERM/SIGKILL, plus a
mid-session rename; leak.mjs/leakcheck.nim pit two players on the same subject
and pin each entry's expected name (STALE_NAME). Mutations e1-e3 and the
repointed b2 pin the three rules.
2026-11-15 14:26:07 +01:00
SirStone c4b97ec16c tools: name players through player.setname, and the character groups and four fault classes (#23) 2026-11-15 12:01:30 +01:00
SirStone e103c3ed5c tools: the details group, the leak scenario's props and three fault classes (#22)
tools/details.test.mjs is the slice's WS acceptance: the five intents and
their codes, a grow push clear of a wall, a squeeze in a corridor too narrow
for the grown token, stuck from a wall and from a GM placement cleared by a
removal and by a shrink, the GM source of a status, the caps and who reads
which bucket, and a restart that brings size, props and statuses back. Waits
use a cursor taken before the intent, so a repeated state cannot be matched
by an older frame.

The leak scenario gains a token in view with props in all three buckets, a
GM-sourced status, a resize, a wall over it and the clears; leakcheck refuses
the `gm` bucket (GM_PROP), the `owner` bucket on a non-controller
(OWNER_PROP) and any `source` on a player status entry (STATUS_SOURCE), so
`fault.test.mjs` now asserts all twelve classes. The schema-version fixtures
in smoke/persistence move to 6, and mutation.sh gains am-au plus the renames.
2026-11-15 11:02:43 +01:00
SirStone 959412ff09 tools: leak driver, checker and the fault controls (#20)
tools/leak.mjs builds a 27-group scene over the real wire (movement, a closed door,
create/remove, gm_only, a controller hand-over, another player walking in and out, a
wall added and removed, a door push) and records every frame each socket saw, one
group per mutation. tools/leakcheck.nim replays it: the GM socket is ground truth,
the subject's polygons and explored cells are recomputed from geometry.nim, and the
explored set is also probed with a clear-segment sampler. Subjects A and B both pass
with zero failures; the transcripts and logs land in results/.

tools/fault.test.mjs runs the same scenario against a -d:leakfault build for each
fault and asserts the EXACT class set (HIDDEN_TOKEN, GMONLY_TOKEN, WALLDATA,
WITHHELD, OTHER_PLAYER, NO_REMOVE, EXPLORED), plus that the shipped binary carries no
LEAK_FAULT string.

withserver can build a variant with extra -d: flags and pass an env to it; lib.mjs
can name a player out of band, the fixture the player-side tests need until slice 8
brings player.setname (the unnamed gate itself is pinned in tools/tokens.test.mjs).
2026-11-15 09:35:24 +01:00