The snapshot is {t:'walls', scene, walls:[{id, a, b, ...}]} per DESIGN 6.1:
scene lives on the frame, entries carry only the wall record. The client
required scene on each entry and dropped every snapshot wall, so a GM
reload/reconnect showed canvas.dataset.walls==='0' while the server still
blocked player sight.
Pass the enclosing frame's scene into wallViewFromFrame and keep an entry's
own scene as the tolerant fallback. The server already matched DESIGN, so
no wall wire shape changed.
Tests: client reducer from a real snapshot frame, WS pin that a snapshot
entry equals a wall delta record, and e2e reload plus server-restart.
The old e2e missed it because every wall test built walls in-session.
The owner fixed the map cap at 1920 px on the long side and 1080 px on the
short side (either orientation). fff-vtt import now shrinks a larger source
with ImageMagick Lanczos before tiling (alpha kept, proportions preserved,
no upscaling), prints `scaled WxH -> WxH`, and records the shrunk w/h; a
source at or below the cap is untouched, so the pixel-identity tests still
hold. A scene row already above the cap is not rewritten: the server logs
`map_above_cap` at startup and serve prints the re-import advice.
Docs: ADR-0023, DESIGN 3.3/5.3/8/11.1/13/14, TESTING 5.3/13, README,
HANDOFF-M4, client README. The M4 phone gate and the fogbench measurement
now use the Full HD maximum; the 16384 px / 262144-cell bench and test rows
stay as labelled server stress references. import-scale now proves a 16384²
input is shrunk to 1080x1080 (289 tiles at 64 px) quickly and bounded.
Part of #63, #85. #77 is blocked by this issue.
The GM survey view asked row-major, at most 8 at a time, rebuilt the whole
wanted window on every settle, and paid two requests for every failed tile
(image error, then a fetch to learn the status). A 404/5xx was stored as
permanent `denied`, so a tile imported after page load stayed black until a
page reload, and `viewport.setScene` swallowed a same-id art_version change
so the old textures were never dropped.
- TILE_CONCURRENCY 8 -> 32, the measured knee on a Full HD scene (min-of-3
headless: GM fit + player 0.5, tile 32/64; 64 is inside the noise).
- orderTilesCentreOut: nearest the viewport centre first.
- Settle path is incremental (one settle = one tile sprite/flag update);
the window is rebuilt only on camera/scene changes.
- fetch + createImageBitmap: status from the same response, decode off the
main thread, so a failure costs one request.
- 403 stays permanent (retried only on fog.fresh); 404/5xx/network retry
with 250/500 ms backoff up to 3 loads, and `hello`/reconnect or a
scene/art_version change resets the budget. A failure that lands after a
reconnect is a fresh first attempt; a failure that leaves the window does
not spend the budget.
- setScene emits for a same-id scene; a new art_version drops the texture
cache and reschedules. Tiles are `Cache-Control: private, max-age=1y,
immutable` (still gated), so a reload reuses them; DESIGN 3.3/11.1 and
client/README updated.
Tests: vitest for ordering, incremental invariants, retry budget/backoff,
reconnect epoch and art_version invalidation; e2e for a GM survey fill (one
request per succeeded tile) and a 404 tile recovering after the file appears
and a real reconnect. Before -> after (min-of-3, saturated host, Full HD):
GM fit 32px 910->843 ms, player 0.5 32px 972->862 ms, GM fit 64px
320->249 ms, player 0.5 64px 332->368 ms (noise).
Part of #63. Blocks #77.
The mobile map gate compared the cumulative request counter to the wanted
window, but the #70 rule re-asks a tile whose 403 became allowed when the
explored frame lands after the first window, so a correct load can be 481
attempts for a 480-tile window (seen once on a loaded host). Expose
data-tile-distinct and assert that no tile URL is fetched twice; the no-retry
proof stays the 403 test's per-URL count. The console collector now ignores the
browser's network-level resource line, like the fog suites: a transient tile
error is explicitly tolerated by the tile contract, and the page wait already
reflects it.
Under the fan-out a test that greps server.log right after an ack can lose:
the logger writes the line after the ack. waitForLog polls to a deadline and
the assertions are unchanged (the line must still appear; absence checks still
run on the same snapshot). Fixes the one observed assertion failure
(fault.test.mjs's intent_failed line) and the same latent race in the
opaque_refused and startup-line checks.
Adds the warmed/cold table for test/client-test/e2e, the pre-push total,
mutation and bench, the machine/commit note and the FFF_TEST_JOBS /
FFF_E2E_JOBS overrides. TESTING explains what makes the fan-out safe (per-file
isolation, shared build cache, worktree-local nimcache, tmpfs state dirs) and
why the wall-clock gate files still run alone.
Every Nim test file and every Node test file is already isolated (own temp state
dir, free ports, own server/nginx), so run them FFF_TEST_JOBS at a time (default
half the cores, capped at 8) instead of one at a time. The real server (clean,
leakfault, dispfault) and the leak checker are built once per source+flags and
shared across the parallel files; nimcaches are worktree-local so two checkouts
cannot race on them. The 22 independent fault cases are sharded across
processes. The wall-clock gate files (persistence, tiles; e2e map/fog/fogbench/
perf) still run alone first so their budgets are not measured under the suite's
own load. No test or assertion changes.
devbox 0.17.2 runs .devbox/gen/scripts/<name>.sh with the args as positional
parameters but does not append "$@", so tools/serve.sh (and seed, bench,
mutation, import-scale, fogbench) saw an empty argv and a documented
`serve -- --image=...` silently served the default 4096 scene. End every
argument-taking script body with "$@".
serve: --dry-run parses and prints the options without building; unknown
options, non-numeric ports/tile sizes and --tile-size without --image fail
loudly; a no-image start prints the current map read from state.db; NixOS
gets security.pki.certificateFiles instead of the Debian trust steps.
Guard the faults import in worldmap/vision/markers with
`when defined(leakfault)` (it is only used inside those blocks), removing
the three UnusedImport warnings; leakfault builds still compile.
tools/devboxargs.test.mjs goes through `devbox run <script> -- <args>` for
serve (dry-run, unknown flag, tile-size without image) and seed (--help,
unknown flag), the seam the direct-tool tests missed.
The one-shot `magick -crop 64x64 +adjoin` built an image list of all 65,536 tiles; ImageMagick's
memory/map limits are per image, so the attempt held 4.3 GB of source cache plus every tile cache and
died after minutes with "Too many open files" at 1023 fds, having published nothing.
Slice by streaming instead: one disk-cache-backed decode of the source to raw samples, the CLI reads
it one tile row at a time, and a pool of 8 magick children cuts one row band each. Live caches and
fds are bounded by the worker count, never by the tile count. Progress goes to stderr ("rows 37/256,
tiles 9472/65536") and failures quote the image, row band and magick's own message. Atomicity is
unchanged: temp dir then rename, scene row only on success, same lock and exit codes.
Measured on the owner's 16384x16384 map at 64 px: 19 s, 391 MB peak RSS, 10 fds, 65,536 tiles (was
~5 min then failure). The tile pixels are identical to the old crop (proven tile by tile in
tools/import.test.mjs); PNG bytes can differ because the encoder now sees raw samples.
New gate: devbox run import-scale (16384/64 under ulimit -n 256) writes results/import-scale.log;
devbox run test keeps the fast fixtures and skips it.
A transient tile load error is terminal for the current window (retried only on
a new window or a reconnect), but data-tiles treated it as never settled, so one
host hiccup left it at 'loading' forever and every e2e readiness wait hung
(audit.test.mjs timed out under a parallel lane). TileScheduler.isPending() now
reports loading only for queued/in-flight tiles; ready means the pass is done.
Proven by aborting one tile request: the wait timed out before, passes after.
Unit-tested at the scheduler seam.
Map gate (a): measure the fastest of 4 fresh page loads after a warm-up (min-of-N,
TESTING 5.3) against 2x the 1 s DESIGN budget (the documented saturated-host
tolerance), and print every sample; a planted 50 ms/tile decode delay fails it.
Wall editor: an ack dispatch re-renders with the previous server record, and the
panel repopulated every control on every render, so a just-toggled checkbox was
reverted until the wall frame landed (Playwright saw 'did not change its state').
Repopulate only when the record changed (src/panels/wallSync.ts, unit-tested) and
restore the controls when the server refuses an edit.
Opt-in ?perf=1 overlay (fps, frame p50/p95, JS p50/p95, tokens, zoom; no node or ticker work when off). fff-vtt import creates and migrates a fresh/empty state dir through the shared server startup path; devbox run serve gains --image. devbox run seed creates deterministic labelled NPC tokens over the real WS (idempotent rerun, --replace), and the GM token form defaults X/Y to the viewport centre.
One command builds the client dist and server binary, then starts the
loopback server behind the DESIGN 11.1 TLS/HTTP2 nginx on the detected
LAN address. State, GM key and certificate persist under run/lan so a
table and a phone's trust survive Ctrl-C/restart; the certificate is
regenerated when the address changes. Prints the URL, GM key and
Android/laptop trust steps. tools/nginx.mjs and tools/tlsdev.mjs gained
the bind/SAN knobs the LAN needs (test defaults unchanged).
tools/serve.test.mjs proves h2 + verified TLS on /healthz and /, POST
/join, a /ws upgrade on the LAN address, loopback-only server binding,
and identical key/cert after a restart.
Slice a PNG/WebP map into the gate's <x>_<y>.png tree under
<state>/tiles/<scene>/v<art_version>/ and update the one scene row
(w, h, tile_size, art_version); a re-import grows art_version so
clients never serve stale tiles. The state-dir lock keeps a running
server out (it loads the scene at startup), so stop/import/restart.
Decoding is ImageMagick from the root devbox with a disk-backed
pixel cache (-limit memory/map), keeping a 16384 px source
memory-sane; no Nim/npm image dependency and the FIXED stack is
unchanged. The black-box harness covers the tile geometry, scene
row, restart pickup through the gate, re-import bump and every
refused-import case.
Records the M6 -> M4 move in DESIGN 3.3/11.1/13 and DESIGN-history,
and documents the CLI plus the 16384 px/50-token recipe in README.
Token create and edit now carry flags.vision and vision_radius; edits merge
only the vision key into the stored flags. A new token keeps DESIGN 8's
flags '{}' default (vision off, radius = scene default). The fog e2e authors
its sighted token through the GM panel, and the admin e2e proves the panel
round-trip plus an explored 200 / unexplored 403 tile probe.
Refs #78
- client/e2e/audit.test.mjs: independent player-browser traffic audit (own
frame catalogue and banned-key list, never leakcheck.nim), with a
-d:leakfault/otherVision negative control.
- client/e2e/fogbench.test.mjs + tools/fogbench.nim: 50 tokens on a
16384 px map (server move path and headless SwiftShader cadence);
results/m4-fog-bench.md records both honestly (SW is not the phone gate).
- Archive prototype-* under docs/archive/prototypes (Q24); DESIGN 13 M4
done, TESTING 13 M4 accept result, HANDOFF-M4 close-out.
- mutation.sh c1/c2 patch the post-#65 tile-gate line again (they had
silently become sed no-ops).
Draw, select, edit and delete walls through the GM panel: the four 5.8
presets, raw switches (preset XOR raw, open excluded from wall.update), a
private label, the one-way arrow + flip (sight_dir names the blind side),
the player-marker switch, door open/close through door.set, secret/locked
with the locked hint and one-click unlock, delete and single-step undo.
No thickness, height or position-flip control (ADR-0012).
The pure rules and payload builders live in src/wallEditor.ts; the GM wall
slice (src/slices/walls.ts) owns the server records, selection and undo;
the render module draws on the gm layer and defines the input precedence:
token drag (#72) > armed wall draw > camera pan (#69), with a click (no
movement) selecting the nearest wall.
Shared core edits: client/src/reducer.ts gains the wall-select and
wall-record-undo events (the only new core events); style.css and the
client README document the panel and rules. Unit tests cover the slice,
presets, derived kind, arrow side, snapping, payload XOR, door intent and
undo builders; the e2e draws every preset, edits the fields, flips the
one-way wall, opens/closes a door, deletes and undoes, proves a token drag
still wins over draw mode, and probes the player's fog pixels, with the
player WS leaking no wall data.
Ref #73
The fog layer (DESIGN 7.1 layer 4, spec #63 decision 9) keeps the explored
grid in one cell-resolution RGBA canvas: never-seen cells opaque black,
explored cells black at 0.6 alpha. A second canvas is the sprite texture:
the explored canvas is copied into it and the union of the server's vision
polygons is cut out with `destination-out`. A full explored snapshot
repaints; a cell diff mutates only the new bytes and uploads the dirty
rectangle. Player markers from the marker set/del frames are sprites above
the fog; the GM layer hides the fog.
The cut-out is baked instead of using a Graphics stencil mask: on the e2e's
software renderer the stencil state cost ~350 ms of the phone-class viewport
fill budget (412x869 dpr 2.625), while baking keeps the fill at the pre-fog
baseline. The cut-out is rasterized at cell resolution, the same grid the
server sends.
Integration fix in the tile layer: a tile denied with 403 because it was
unexplored is asked once more when the fog says its cells became explored;
unexplored denials still never retry (the map 403 test is unchanged).
Proven at the reducer seam (fog slice) and by screenshot pixel probes in the
browser e2e: black/dim/visible, window see-through, one-way blind side,
secret door, marker anchor and retraction, a drag that moves the fog with no
reload, and a reconnect resync. Fog update cost recorded under the 412x869
dpr 2.625 / 4x CPU emulation.
Rebase #72 onto the map/pan-zoom lane. Drag e2e now converts world points to
page points with the camera transform, drags at zoom 0.5 and 4, and proves a
token drag leaves the camera alone while an empty-canvas gesture still pans.
The camera publishes its x/y in `data-camera` for that (UI fact, like zoom).
Also folds #69's duplicate viewport import in tiles.ts into one.
Drag a controlled token (GM: any token) at <=20 Hz plus a final send on release;
the sprite follows the pointer while authoritative frames are ignored for drawing.
Uniform move nacks roll back with a short tween (on release if still dragging),
rate-limited acks drop quietly, and pending reqIds die with the connection.
- slices/move.ts: pure drag/pending/ack state machine at the reducer seam
- render/modules/drag.ts: canvas pointer input, capture-phase so token drag wins
over pan/pinch (#69); sends via the new intents bridge
- tokens renderer draws the optimistic/confirmed position and tweens the rollback
- intents.ts + ws.send onReqId: one reqId-keyed sender for render modules
- e2e: drag persists after reload, wall refusal tween, GM move mid-drag,
reconnect mid-drag dropping the pending map
T6 of spec #63. Tiles are requested only for the viewport plus one tile of
margin, in viewport order, at most 8 at a time (TileScheduler); decoded
textures are cached by URL so a reconnect refetches nothing; a 403/404 is
remembered as denied and never retried. The browser image loader is the hot
path, with one status fetch only to classify an error.
Camera: drag to pan, wheel/pinch to zoom around the pointer/midpoint; players
clamp at 0.5 (ADR-0013) and the GM has no player floor; both stop at 4.0.
Grid is one TilingSprite toggled by #grid-toggle. Camera is local UI state,
not a reducer slice, so hello/reconnect does not move the view.
Tests: viewport/tile unit tests (clamps, margin window, 8-wide queue, denial,
cache) and client/e2e/map.test.mjs (mobile viewport fill gate (a), grid,
pinch, cache across reconnect, GM zoom, 403 no-retry) against the real
server through TLS/h2. Tile-size gate (a) documented in client/README.md.
Server: GM token frames gain the additive, GM-only seen_by:[player ids],
computed from each player's existing sight (PlayerVision.visibleTo) with
no extra polygon pass. Leakcheck BannedAlways bans seen_by; a seenBy
fault build is caught as exactly WALLDATA. proto stays 2 (6.2 additive).
Client: new cast slice parses character/character_gone/encountered frames
and seen_by; gmcast panel adds character create/rename/assign/remove,
reveal to one/all, encountered forget (grey entries only) and the
who-sees-it list (0/100 in M4). Mounted beside the #74 admin panel.
Docs: DESIGN 5.9/6.1/6.2/7.4 record the round-1 shape and the no-bump
call. Gates: devbox run test, client-test, e2e green; bench recorded.
- slices/tokens.ts: token upsert, token_gone, hello reset; status names only.
- slices/characters.ts + slices/encountered.ts: own characters, encountered
list with grey entries; the GM's per-player copies are ignored.
- render/tokenBoard.ts (pure): event -> entered/updated/left patches, so one
changed token costs one container; seeds from the reducer on mount.
- render/modules/tokens.ts: pooled world-coordinate nodes on the tokens layer,
one shared unit-circle context per kind, BitmapText from one pre-installed
BitmapFont assigned only on a name change, stuck/squeezed badges, canvas
dataset instrumentation for the "only changed entities" criterion.
- panels/lists.ts + render/modules/lists.ts: #lists under #panels, textContent
only, greyed encountered rows; mounted by a render module so no shared
bootstrap file changed.
T5 of the M4 client (spec #63). All of it at the existing seams: the pure
reducer slice, the WS client and the browser e2e.
- First sign-in: a live player with `me.name === null` gets a name prompt
instead of the HUD and no Pixi stage (the server sends no scene until named).
`player.setname` is acked before the second `hello` (#33); `name-taken`,
`invalid` and `not-allowed` become visible text and the prompt stays put.
Acceptance is followed by `hello` + the 6.3 resync, so the prompt is keyed on
state and is asked once.
- Badge (`#badge[data-state]`): connected / reconnecting / offline. Offline is
driven by `navigator.onLine` (a phone with no network) and by terminal close
outcomes; reconnecting keeps the stale map on screen.
- Reconnect: a transport close after a live connection retries with
1/2/4/8/10 s base delays +/-20% jitter, then the cap. `revoked` and
`proto-mismatch` stay terminal; pending `reqId`s die with the socket; the
browser `online` event skips the rest of the wait. A drop does not clear the
view: `hello` resets every slice and the resync rebuilds tokens, fog,
explored, markers and lists.
- Two devices on one player key both stay live and receive the same frames.
Proof: new unit tests for the schedule/retry machine (`test/ws.test.ts`) and the
badge/reconnect/name transitions (`test/reducer.test.ts`); new
`client/e2e/session.test.mjs` runs the real server and TLS/HTTP2 vhost, kills
and restarts the server under a live page, drops the browser network with
`context.setOffline`, and asserts the full resync frames (roster, encountered,
vision, explored, marker, token) plus two pages on one key.
Refs #68
The tile gate no longer takes dbLock or runs a SQL session JOIN per tile: a published
in-memory view (server/sessions.nim) holds token hashes -> player/role and one explored
bitmap per player. Sessions load from the DB at startup and are updated by join, key
replacement and player removal in the same lock as the write; refreshed cells publish
before the ack. The gate is one snapshot read (parse + session + bit test + redirect)
over scalar data only, so a tile burst is answered while a mutation holds dbLock.
Evidence: tests/tsessions.nim pins the cache/bitmap lifecycle and gate rule; tiles.test
adds the lock-held burst and the revocation/restart seam; auth.test adds the
LEAK_FAULT=sessioncache negative control (a stale entry makes the auth group fail);
mutation c5 keeps the cache drop load-bearing. Explored wire and persistence untouched.
Bench (devbox run bench, in-process): tile gate old 0.006 ms -> new 0.001 ms per
request; incremental explored mark 0.001 ms; snapshot build 2.0 ms at 262144 cells
(startup only).
New `client/` package (Vite + TypeScript + PixiJS v8, plain DOM overlay):
the pure reducer seam (no Pixi import), an append-only slice registry
build-time glob, the `proto` 2 WS client with envelope/ack/closing mapping,
the sign-in door (`POST /join`, one "Key not recognised." for wrong and
unknown), the DOM shell/HUD and a minimal Pixi stage created only after a
live `hello`. `hello` resets every slice so a reconnect cannot show stale
state; `proto-mismatch` shows reload; `revoked` returns to the sign-in page
and stops.
The browser e2e moves into the client package (`client/e2e/`, owning
playwright-core) and runs the real Vite build through the TLS/HTTP2 test
nginx: join -> canvas -> hello/roster for GM and player, no data before
join, identical wrong/unknown key refusal, proto mismatch, revoked.
`devbox run client-test` adds the Vitest seam; `devbox run e2e` builds the
client first. The #66 stub dist stays local to `tools/vhost.test.mjs`, so
`devbox run test` still needs no npm install.
Refs #67
Rebased on origin/main (1dff520). devbox run test green (Nim suite + 149
node tests + group evidence); devbox run mutation green including a2 (a ray
tests the next sector's chord) failing 5 bit-identical tests. bench.log is
the rebased run: prototype polygon 0.009 ms, 5k sparse 0.035 ms, 5k dense
0.737 ms.
Refs #64.
Each fan ray now tests the one circle-segment chord of its angular sector
instead of all 64. A sector-boundary ray tests both meeting chords, so the
rayHit set and the picked minimum are unchanged: the polygon is bit-identical
to the all-segments fan. tests/tgeometry.nim keeps the old fan as an oracle
and asserts exact float equality over the prototype corpus, the seed scene
(all switch shapes), the 5k sparse/dense scenegen layouts, the #26
collinear/radial cases and random walls. tools/mutation.sh gains a2 (a ray
tests the next sector's chord), which fails 5 of those tests.
Bench on this host, before -> after (3-run median):
1 poly, prototype 0.028 -> 0.008 ms (3.5x)
1 poly, 5k sparse 0.062 -> 0.033 ms (1.9x)
1 poly, 5k dense 1.085 -> 0.708 ms (1.5x)
Refs #64.
The test nginx is now the production shape of DESIGN 11.1 and the browser
gate's real path (#66, spec #63 decision 6): TLS-only listener with
http2 on, a self-signed certificate generated per run (tools/tlsdev.mjs,
added to the process's default CA list so verification stays on), the
client dist at / with SPA fallback, index no-cache and a year-immutable
/assets/ cache, and the tile gate's internal /_tiles/ still unreachable.
Existing tile/doors/oneway/wallbehaviour harnesses point their server's
public origin at the https vhost, so they prove the same listener the
browser uses. tools/vhost.test.mjs is the independent node:http2 client
(cert SANs, ALPN h2, cache headers, SPA fallback, direct /_tiles/ 404);
e2e/h2.test.mjs drives devbox chromium via playwright-core and asserts
the page reports h2 (`devbox run e2e`, npm deps outside tools/).
Root devbox gains chromium + openssl. Harness builds use a worktree-local
nimcache so parallel worktrees stop corrupting each other's objects.
Refs #66
visibilityPolygon casts one ray per 64-gon vertex and ang, ang+-RayEps per wall
endpoint. A wall radial to the viewer is collinear with the ray that crosses it,
and rayHit rejected the collinear case; its own +-RayEps rays meet the wall's
line at the viewer (t = 0, rejected by t > Eps). So the wall got no ray, no
vertex and no shadow, and a token on the line beyond it stayed inside the
polygon: a player-view fog leak (DESIGN 3.1).
Fix: rayHit returns the nearest point of the overlap when the wall lies on the
ray's line (and Inf only for a parallel wall on another line). {.inline.} keeps
the fan's inner loop at its previous cost (CPU-time cross-check on 20k dense
polygons: 25.8s before, 32.5s without the pragma, 24.9s with it).
Proof: tgeometry visibility tests (horizontal k=0, vertical k=16, both wall
directions, a 32 px grid translation, 10 degrees, plus the non-radial and
0.5 px-off negative controls); the leak world gains a wall on the subject's own
column with a hidden token beyond it, and leakcheck's HIDDEN_TOKEN class now
asserts the token-level over-approximation (token centre + viewer->token
segment, 5.4 tolerance), which the GEOMETRY class structurally cannot see.
devbox run test: Nim suites and 149 node tests pass (the 16 registered group
evidence tests included). devbox run mutation: control and all 78 mutations pass,
including s1-s7 and the new e4/e5/f1-f3 from #32/#33/#35.
Refs #36.
- tools/groups.mjs evidence entries now name the exact test, a minimum assertion
count and the calls its body must keep; groups.test.mjs checks all three.
- tools/evidence.mjs parses the spec reporter log and fails the gate unless every
registered evidence test ran and passed; test.sh runs it after the Node suite.
- restart.test.mjs snapshots the live as-built world on the first server, then
compares it to the post-SIGTERM/SIGKILL state (players connect before the GM, so
the GM's derived encountered grey is computed on both sides).
- Negative controls: a hollowed auth test fails the new evidence check; a planted
first-load drop of a token's gm prop bucket fails the new restart baseline while
the old restart-to-restart test passed.
- Refresh the gate evidence (control + 73 mutations incl. s1-s7, 142 node tests).
One shared validator next to the property caps: 8 KB serialized, 64 keys
per object, depth 8 (top-level object = 1). At a cap is accepted; over
is invalid and applies nothing. Both call sites use it, and a refusal is
logged once with the field and limit, never the value. Token flags and
props keep their existing rules; stored over-cap rows still load as
stored.
The durable write and registry update stay put; the ack is enqueued
between the commit and the first effect, then hello, the full resync and
roster follow in their existing order. The failure paths are unchanged.
Frame-order test pins ack first on the renaming connection.
A readable intent that fails in handling now always gets exactly one ack:
the new static internal code, unless the handler's own ack was already
enqueued. Both transaction helpers roll back on every unwind path,
Defect included, so the shared SQLite connection never keeps an open
transaction. Test-only dispfault build covers catchable/defect/after-ack;
DESIGN 6.5 records internal as an owner decision and 6.2 names refusal
codes as additive.
The Walls r1 scenario had grown appendages: a marked window bolted on in the
room, a one-way wall tacked onto the southern walk, and no secret or locked
door at all. #61 makes it one coherent world and proves the world itself.
The world now holds a room entered through an opening door, a far wall with a
solid stretch, a secret door and a locked door (a token behind each, so their
absence from the transcript is the leak proof), a one-way screen the subject
sees across, a marked window in the room, the same window's switch cleared and
restored (retraction and re-earn end to end), a marked solid wall, and a marked
window the subject never sees.
- tools/leak.mjs: declarative WORLD with role handles (no wallIds[1] indexing),
narrative groups, and a scenarioCoverage() reading the GM's wall frames and
the subject's marker frames.
- tools/leak.test.mjs: asserts the coverage on subject A: one-way wall, secret
door, locked door, a marked window on each side of the sight gate and a
marked non-window.
- tools/groups.mjs: the leak+fault group lists doors.test.mjs (#56) and
markers.test.mjs (#59/#60) with their proving tests.
- docs/TESTING.md: the scenario, the coverage gate and the marker retraction
exercise are recorded as built.
Fault matrix: all 21 fault classes still caught as exactly their own class
(oneWay, markerEarly/Extra/Off included); 22 tests with the clean-build gate.
That build passes and its bytes carry no LEAK_FAULT. nimble test and the
136-test node suite green.
Ref #61
A wall cause change (endpoint move, thickness/position, player_marker off,
no longer window) committed the wall row in the FULL transaction while its
marker_seen deletes rode the later NORMAL derived-memory transaction. A crash
between them left the stale row, and restart restored the marker with the
anchor recomputed from the NEW geometry, revealing a position the player never
saw (DESIGN 5.8).
updateWall now deletes the affected rows in the same FULL transaction as the
replaced row, exactly as the composite FK cascade already does for wall.remove.
The live del frames are unchanged and marker inserts stay in the derived
transaction: wall+deletes commit, derived inserts, then ack.
The marker cause signature moves to world.markerSig so the write-time delete
and the online retraction cannot drift.
Proof: a leakfault-only markerCrash hook quits between the wall commit and
the derived write; tools/markers.test.mjs covers all four causes and restarts
on a clean build, asserting no marker for the changed wall (no new anchor) and
restoring the untouched window's marker as the positive control.
Ref #60
Retract a player marker when the GM removes the wall, clears
player_marker, makes the wall stop deriving window, or moves its
geometry (a/b, thickness, position). Retraction emits del only and
never the new anchor; a re-earned marker gets a fresh id. The
marker_seen deletes ride the same derived-memory NORMAL transaction as
the explored chunks, after the wall row commits and before the ack.
Replace the leak checker's aggregate MARKER class with MARKER_EARLY,
MARKER_EXTRA and MARKER_OFF, add their leakfault hooks and exact-class
fault tests, and extend the leak scenario with an unseen marked window
and a marked solid wall as the negative controls. WS black-box tests
cover all four causes, fresh re-earns, no untouched re-send, no
set/del for one id in a frame, no explored write from a retraction,
and delete/cascade durability across a restart.