Commit Graph
160 Commits
Author SHA1 Message Date
SirStone 8aaf03be04 docs: add ADRs for the durable design decisions
22 ADRs: server-authoritative sight and single egress, per-recipient views/diffs, uniform
nack, opaque ids, 32 px tile unit, wall switches/presets, see-over, thick walls, open-door
gap, typed wall columns, proto 2, build order, zoom clamp, accepted status leak, player
marker, chunked explored, slow-client policy, session/key split, closing message, character
records, global lock, synchronous choice. Each links its tickets and its spec section.
2026-11-17 23:12:04 +01:00
SirStone 7a69779c5a docs: extract DESIGN history (change log, decision log, superseded text)
The v0.4-v0.30 change log, the old §12 HANDOFF table and the whole §14 owner-decision log
(Q1-Q24) move here verbatim, with the superseded statements removed from the spec quoted
with their surviving rule. Non-normative.
2026-11-17 23:12:04 +01:00
SirStone 7b804f4e5e docs: analysis review and decisions 2026-11-17 22:45:58 +01:00
SirStone 287859d890 design: wall wire format, schema and migration (#49) 2026-11-17 22:31:16 +01:00
SirStone 2a160fb274 design: door geometry, thick doors and door push (#50) 2026-11-17 22:17:16 +01:00
SirStone 409d2c8621 docs: tag #42 preset list superseded by #48 2026-11-16 22:42:56 +01:00
SirStone 7ac915ae6c design: terrain dropped, presets, window markers (#48) 2026-11-16 22:39:20 +01:00
SirStone b8f04c2faf design: windows and one-way walls (#47) 2026-11-16 22:08:14 +01:00
SirStone 5c3a123d41 design: thick walls sight and movement (#45) 2026-11-15 21:53:55 +01:00
SirStone afe19ac258 design: secret and locked doors (#46) 2026-11-15 19:27:15 +01:00
SirStone 4c968b78d8 design: low walls sight and see-over (#44) 2026-11-15 19:21:10 +01:00
SirStone 7511daa3c5 design: wall switches, presets and one-way sight (#42) 2026-11-15 18:23:26 +01:00
SirStone a7f302ec26 design: height model for tokens, eyes and walls (#41) 2026-11-15 16:47:40 +01:00
SirStone b4720779d4 research: sight with thick and low walls (#39) 2026-11-15 16:12:15 +01:00
SirStone d5147ec4db research: how tabletops model wall kinds (#40) 2026-11-15 15:54:46 +01:00
SirStone b6c006d08b agents: add bug and enhancement category labels 2026-11-15 15:30:23 +01:00
SirStone c78ed7969b glossary: wall term from #26 triage 2026-11-15 15:25:24 +01:00
SirStone e13fa905a4 results: rerun the gates on the fixed tree (#27-#31)
devbox run test: nimble suites and 107 node tests pass (was 103: +1 characters,
+2 tiles, +1 restart). devbox run mutation: control and every mutation pass,
including the new e1-e3 and the repointed b2.
2026-11-15 14:26:23 +01:00
SirStone b4bddf1d52 design: record the #27-#31 rules and the measured egress numbers (#27-#31)
6.1: a link patch hands the token's names over; the encountered snapshot is
written by one path in both stores, and a reveal is scoped to its player. 4.3:
egress borrows (never copies) under the lock, and the scene is a value swapped
under the lock that each request reads once. 10.3: STALE_NAME is a leakcheck
class. 14: the five fixes, their tests and mutations, with the before/after
egress measurements (context build 4.87 ms -> 0.008 us at 262144 cells; GM
egress 142.8 ms -> 0.80 ms). Doc bumped to v0.20.
2026-11-15 14:26:23 +01:00
SirStone f963e8f4d6 main: read the scene once per request, under the lock (#31)
scene.set reassigns app.scene under dbLock while the HTTP handlers read it with
no lock and no stable snapshot: tileGate read it three times (twice outside the
lock) and checkScene read the id unlocked, so a swap could hand a request two
records, or race ORC freeing the old walls seq. tileGate now takes one snapshot
under the lock and uses it for the URL parse, the explored check and the
X-Accel-Redirect; checkScene and scene.set read under the lock; the wall/door
handlers capture sceneId inside their lock for the post-lock log and effect
frame.

Tests: ttiles pins that one record gives one whole answer after a swap;
tiles.test.mjs pins the handler shape (one code read, after the lock) and
interleaves 20 scene.set plus wall edits with 200 tile fetches -- only whole
tiles, no crash.
2026-11-15 14:26:15 +01:00
SirStone e9d5f6815a views: borrow the world in egress instead of copying it (#28)
views.Context held copies of scene, tokens, characters, reveals, encountered
and visions, so every mutation deep-copied each player's explored HashSet under
the global lock; playerView then copied its own PlayerVision again and greyFor
copied one per encountered entry. Context now holds six pointers
(contextOf/borrow), playerView/gmView read a ptr PlayerVision and a view builds
each player's visible-id set once per frame, so grey is a set test.

Measured on this build's types (debug, 6 players, 40 encountered entries, 40
world tokens, 16384 / 262144 explored cells): context construction 0.227 ms /
4.87 ms -> 0.008 us; one getOrDefault of a PlayerVision 28.8 us / 591 us -> gone;
GM egress pass 8.0 ms / 142.8 ms -> 0.79 ms / 0.80 ms; player pass 1.45 ms /
25.7 ms -> 0.32 ms. Behaviour is unchanged (leak/fault suites and tviews green);
tviews pins the borrow by identity, the six-pointer size and both sizes inside
the M5 7.5 ms budget.
2026-11-15 14:26:11 +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 e68c6eefbf design: owner confirms prop registry fallback (#22)
Mark the 6.1 property-schema registry as an owner decision (2026-11-15):
keep the empty registry with the permissive fallback in v1, strict mode
with the FFF seam post-v1. Record it in 14 and bump the doc to v0.19.
2026-11-15 13:06:58 +01:00
SirStone 76ec6f4b3d results: rerun the M3 gates on the final tree (#25) 2026-11-15 13:03:54 +01:00
SirStone 2c0ce47134 design: record the measured M3 gate results (#25) 2026-11-15 13:03:51 +01:00
SirStone e713e05931 tools: define the scene.set mutation after the dispatcher (#25) 2026-11-15 12:55:58 +01:00
SirStone 14939afd81 design: record the finish line, the scene rules and the M3 acceptance checklist (#25) 2026-11-15 12:52:23 +01:00
SirStone cedb80aa96 tests: the restart and logs groups, the nine-group checklist and the fixture clean-up (#25) 2026-11-15 12:52:20 +01:00
SirStone 70a984c55a server: scene.set closes the 29-intent catalogue, plus a log-leak fault hook (#25) 2026-11-15 12:52:17 +01:00
SirStone df2b186267 results: rerun the slice 9 gates on the final tree (#24) 2026-11-15 12:30:53 +01:00
SirStone 7ef5cc433a design: record the map-tile gate and test nginx decisions (#24) 2026-11-15 12:30:53 +01:00
SirStone 30512127b0 tools: test nginx, generated tile fixtures and the tile group (#24) 2026-11-15 12:30:51 +01:00
SirStone 669e47e1ba server: the map-tile gate and the internal X-Accel path (#24) 2026-11-15 12:30:48 +01:00
SirStone 5ff15c4b36 results: rerun the slice 8 gates on the final tree (#23) 2026-11-15 12:11:42 +01:00
SirStone ea6d92bf76 server: refresh a player's sight when a connection starts receiving state (#23) 2026-11-15 12:11:42 +01:00
SirStone 1ad9f724f2 tests: drop the two unused imports (#23) 2026-11-15 12:02:52 +01:00
SirStone 74272c1e70 results: rerun the slice 8 gates on the final tree (#23) 2026-11-15 12:01:40 +01:00
SirStone dab7c77675 design: record the characters and names decisions (#23) 2026-11-15 12:01:33 +01:00
SirStone 54ecf7bf6a tools: nine mutations for the name rule, the snapshots and the character link (#23) 2026-11-15 12:01:30 +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 f134534c6c tests: characters, names, the encountered list and migration step 7 (#23) 2026-11-15 12:01:30 +01:00
SirStone 20dcb87afb server: the character and name intents, player names and the roster (#23) 2026-11-15 12:01:26 +01:00
SirStone 5977d45a5a server: characters, names and the encountered list in the one egress (#23) 2026-11-15 12:01:26 +01:00
SirStone 75c3e046f8 server: the character, reveal and encountered records and migration step 7 (#23) 2026-11-15 12:01:21 +01:00
SirStone 34a33b5ead results: rerun the slice 7 gates on the final tree (#22)
devbox run test green: 317 Nim [OK] blocks and 77/77 Node harness tests
(migration step 6, the details group, the twelve fault classes).
devbox run mutation green: control plus a..au, no survivors, no no-ops.
2026-11-15 11:09:15 +01:00
SirStone 3c6e926122 design: record the token details decisions (#22)
Migration step 6, the status/source payload rules, the prop caps and the
property-schema registry (empty at start with a permissive fallback, because
8 says v1 never interprets props), and the grow-push search that 5.6 left
PROPOSED are all FIXED owner-delegated in 5.6/6.1 and summarised in 14. The
token payload rules now say `radius`/`props` are accepted on create from
slice 7 and refused nowhere else. 10.3 lists the three new fault classes,
and the glossary gains property, bucket and registry.
2026-11-15 11:02:43 +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 20575f2147 tests: props, statuses, the resize rules and migration step 6 (#22)
tests/tprops.nim is new: the caps (per bucket, keys, values), the key rules,
the registry (empty fallback, a registered key's kind and bucket), set/unset
and the clone that keeps an edit away from the original bucket.

ttokens covers radius, the three buckets, the status set (round trip, sorted,
replaced rather than appended, removed by the FK cascade). tmoverules covers
per-token radius, shrink/grow/squeeze, the no-crossing rule, the corner
relaxation and the independence of the two sources; the old `blocked` tests
became `stuckWalls`. tviews covers the bucket and source filtering, one
`token` frame per change and the effective radius. tdb/tdb's fixtures move to
step 6, and tprobing follows the rename.
2026-11-15 11:02:43 +01:00
SirStone 81898ab69c server: resize, status and prop intents in the mutation pipeline (#22)
`token.resize`, `status.set`, `status.clear`, `prop.set` and `prop.unset`
answer the 6.1 acks and codes; `token.create` now accepts `radius` and
`props` and computes the placement status before writing the row, so a token
dropped on a wall is born `stuck`. `token.update` keeps refusing the
character link and ignores `radius`/`props` (their intents own them).

Wall add/update/remove and door.set now run the pure rules on a snapshot
taken before the write and apply the outcome after it committed
(`applyRuleOutcome`: positions and walls-sourced statuses in one NORMAL
transaction, memory after COMMIT), which replaces the door-push-only helpers
and adds the 5.5 SET/KEEP/CLEAR rules and the squeeze of a failed push. A
value over the bucket cap is refused without touching the token (the clone
makes the cap check side-effect free). Prop keys are never logged.
2026-11-15 11:02:35 +01:00
SirStone dcc813225f server: per-recipient props and statuses in the one egress (#22)
The typed views carry the bucket filter: `PlayerTokenView` has `propsPublic`
always and `propsOwner` only when the recipient controls the token, and no
field for the `gm` bucket at all, so a later change to the frame builder
cannot leak one. Statuses are `StatusKind` values for a player (no `source`,
5.5/6.1 note 6) and full `(status, source)` entries for the GM.

Both negative controls for the new rules live behind `-d:leakfault` and in
the type, so the shipped binary has neither the fields nor the branches:
`gmProp` (the gm bucket reaches a player), `ownerProp` (the owner bucket
reaches a non-controller) and `statusSource` (a viewer learns the cause).
The `otherOwner` fault now carries the owner bucket too, so it stays one
class (the `mine` claim) instead of also tripping the bucket check.
2026-11-15 11:02:35 +01:00