docs: Q4 resolved (32 px tiles), outbox lock invariant, cleanups — all §14 questions answered

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-08 11:49:21 +01:00
co-authored by Claude Haiku 5.5
parent eb1b128668
commit 2cd0b1cd19
+16 -14
View File
@@ -1,6 +1,6 @@
# FFF_vtt design
Status: draft v0.3, 2026-11-08 (owner decisions recorded in section 14; v0.3 records Q13, Q20 and the mummy tag pin). Audience: the owner and coding agents.
Status: draft v0.4, 2026-11-08 (owner decisions recorded in section 14; v0.4 records Q4 (tile_size 32 px), the outbox lock invariant (4.2, 4.3), and the follow-ups in 3.4, 8, 11.1, 12, 13. All of Q1-Q24 are RESOLVED or DEFERRED; none OPEN). Audience: the owner and coding agents.
Legend:
- **[FIXED]** owner decision, not up for debate here.
@@ -11,6 +11,7 @@ Legend:
Evidence roots (relative to repo root):
- `prototype-pixi-perf/` (client perf; README holds all tables)
- `prototype-server-vision/` (server + vision; `README.md`, `HANDOFF.md`, `NOTES.md`, `results/`, `results/spike/investigation.md`)
- `prototype-tile-leak/` (tile size vs leak; `README.md` holds desktop tables and the 2026-11-08 phone run; `results/phone-20261108T113701.jsonl`)
- `docs/prototype.md` is only the original brief for the perf prototype.
- No FFF engine notes exist in the repo. `GLOSSARY.md` and `docs/adr/` do not exist yet; AGENTS.md requires them (Q24, FIXED). `prototype-*` dirs stay in-tree until the M4 client port, then are archived (Q24, FIXED). Nothing here is FFF-specific beyond the seam in section 9.
@@ -124,7 +125,7 @@ Notes:
- Browser asks `GET /tiles/<scene>/<x>_<y>.png` (Nim path). Nim parses strictly (digits only, length-bounded, range-checked against scene size), checks the session's explored grid, and answers `200` with `X-Accel-Redirect: /_tiles/...` or `403`. nginx serves the bytes from an `internal` location; direct hits on `/_tiles/` give 404 [MEASURED: `prototype-server-vision/results/smoke.log`, README "Phase 2a"].
- GM is always allowed.
- Rule: a tile is allowed iff at least one explored cell of that player overlaps it [MEASURED semantics: leak test (d), 9984 + 7424 requests, 0 failures, `results/leak-A.log`, `results/leak-B.log`].
- **Known tile-edge leak (accepted for v1, documented) [MEASURED design limit]:** a tile is the unit of disclosure. With 256 px tiles and 32 px explored cells, up to one tile (256 px) around any explored cell is revealed, including art outside the explored cells. Once revealed it is never revoked. Static art only: door state is never in tiles. Consequences for map authors: do not paint secrets (secret doors, hidden traps, notes) in map art within ~256 px of areas players can reach; keep secrets as GM-only entities. Mitigations and their cost: Q4, still open. Prototyping server-masked tiles vs cell-size tiles in `prototype-tile-leak/`.
- **Residual tile-edge leak (accepted for v1, documented) [FIXED, Q4]:** a tile is the unit of disclosure. v1 sets `tile_size` = explored cell = 32 px (section 8), tile grid origin = world origin, so a tile is allowed iff its one cell is explored. The residual is the whole 32 px cell that a vision polygon grazed, including art the LOS did not actually see. Once revealed it is never revoked. No server-side masking is built [FIXED, Q4]. Static art only: door state is never in tiles. Consequences for map authors: do not paint secrets (secret doors, hidden traps, notes) in map art within ~32 px of areas players can reach; keep secrets as GM-only entities. Evidence: `prototype-tile-leak/README.md` (desktop numbers; phone run 2026-11-08). Fallback if the M4 gates fail: `tile_size` 64 px (per-scene config, no code change; leak <= 3 cells per allowed tile, 4x fewer files).
- A second consequence: map art itself may depict walls/doors. Art is "what players see once there", walls data is "what physics/vision uses". Authoring must keep them consistent; mismatch is GM error, not a leak.
- Tile URLs include a scene version so that re-imported art does not hit stale caches [PROPOSED]; response `Cache-Control: private`.
@@ -136,12 +137,12 @@ Notes:
| T2 | Player reads wall/door data | walls only in GM view | fault `walls` [MEASURED caught] |
| T3 | Player reads other player's vision/explored/ownership | per-player view only | faults `other-*` [MEASURED caught] |
| T4 | Player fetches unexplored tiles | Nim gate + internal nginx location | leak (d), smoke steal check |
| T5 | Tile-edge over-disclosure (up to 1 tile) | accepted v1; authoring rule; Q4 | documented, not testable as a leak |
| T5 | Tile-edge over-disclosure: one 32 px cell grazed by vision, never revoked | tile_size = explored cell = 32 px, no server masking, authoring rule ~32 px (Q4 FIXED) | documented, not testable as a leak; M4 timing gates (13) |
| T6 | Invite/session theft via logs, referrer, history | session != invite, log redaction, no-referrer, HTTPS only | config test (grep logs for secret) [new] |
| T7 | Cross-site WS hijack | Origin check + SameSite=Strict | new test |
| T8 | **Wall-probing oracle via move validation** [INFERRED, not in prototype tests]: `moveBlocked` answers `ok:false` for any chosen segment, with unlimited length; binary searching lets a player map walls beyond LOS and tell open from closed doors | cap step length per intent (= token vision radius, Q18 FIXED), rate limit intents per connection, uniform nack that carries only the old position | new probing test: count wall/door facts recoverable from nacks beyond LOS |
| T9 | Info via error replies (`not yours` echoing a position) | errors are static strings, never state; move of non-owned token gives `error` without position [MEASURED rule, README Findings] | leak test (e) |
| T10 | Message-size or rate DoS, slow client memory growth | max frame size, per-connection rate limit, connection cap; mummy queue is unbounded [MEASURED finding, README mummy caveats] | new tests |
| T10 | Message-size or rate DoS, slow client memory growth | max frame size, per-connection rate limit, connection cap; **bounded per-connection outbox** (byte/message caps, state coalescing), lagging clients stopped and resynced (4.3, Q13); mummy queue is unbounded [MEASURED finding, README mummy caveats] | new tests (10.3 slow client, protocol) |
| T11 | Timing/size side channels (message bytes reveal hidden activity) | accepted; only deliver messages when state visible to that recipient changes | not tested |
| T12 | Path tricks on static/tile routes | strict parsing; webby rejected `%2f`/`%00` [MEASURED, NOTES Phase 2a] | smoke |
| T13 | Player-controlled strings (token names, props) as XSS in DOM overlay | render with `textContent`, never `innerHTML`; CSP | new test |
@@ -176,7 +177,7 @@ Under the single global lock (as prototype, order proven correct by 3 x 60 s run
8. Clear `fresh`.
Invariants (carry from prototype):
- Send order per connection == mutation order, because sends happen inside the lock and mummy keeps per-socket order. No separate broadcaster.
- Enqueue order per connection == mutation order: messages are appended to the connection's outbox **while holding the lock**; network sends happen **outside** the lock, at flush. Non-state messages are FIFO. State messages are coalesced per key (latest wins, 4.3), so their position relative to other messages is flush order, not mutation order.
- Ack after COMMIT (a client never sees a state that a crash can undo, except under `synchronous=NORMAL` power loss, 4.4).
- A failed validation mutates nothing, bumps nothing, persists nothing.
- Non-owned/malformed requests get `error`, never an ack (an ack would echo an unseen position).
@@ -187,7 +188,7 @@ Second limitation [INFERRED]: a fast drag sampled at ~50 ms can produce a straig
### 4.3 Locking and threading
- mummy: `WebSocket.send` appends the encoded frame to one server-wide deque under `sendQueueLock` and wakes the IO thread; worker threads handle events; per-socket events are serialized [MEASURED reading, `prototype-server-vision/README.md` "mummy suitability", mummy.nim ~L262-311].
- **One global lock** around intent handling and send. [MEASURED] 13748 mutations / ~36k messages in 60 s with 3 clients (~223 intents/s): no crash, no reorder, no loss, consistent final views (`results/concurrency-final{1,2,3}.log`); intent->ack avg 1.40 ms, p99 4.58 ms, worst 20.31 ms.
- **One global lock** around intent handling and outbox enqueue; network sends happen outside it (flush, see 4.2). [MEASURED] 13748 mutations / ~36k messages in 60 s with 3 clients (~223 intents/s): no crash, no reorder, no loss, consistent final views (`results/concurrency-final{1,2,3}.log`); intent->ack avg 1.40 ms, p99 4.58 ms, worst 20.31 ms.
- Decision [PROPOSED]: keep the global lock in v1. A table of <= ~10 clients is 2 orders of magnitude below the single-core limit (server total per mutation avg 0.70 ms [MEASURED]). Revisit only if a measured p99 > 50 ms appears in production logs.
- Worker threads: prototype uses 8; one table needs 2-4 [INFERRED].
- **Slow client [FIXED (owner decision), 2026-11-08, Q13 option A]**. mummy's send queue is one unbounded deque and per-socket backlog is invisible to app code (no forced close, no depth API at this pin). No mummy patch. Research: `docs/research/q13-mummy-slow-clients.md`.
@@ -197,7 +198,7 @@ Second limitation [INFERRED]: a fast drag sampled at ~50 ms can produce a straig
- **Dead or stuck peers**: closed by nginx proxy timeouts [PROPOSED mechanism; verify in M5 that `/ws` goes through nginx and which directive fires, `send_timeout` is the candidate]. `close(ws)` cannot force-close at this pin (it queues behind the backlog).
- Connection cap 8 (6 players + GM + headroom) [PROPOSED, derived from FIXED max 6, Q1]. Inbound message rate limit in `websocketHandler` (mummy's inbound queue is unbounded).
- Forking mummy (per-socket depth, forced close) is fallback only, not planned.
- `WebSocket` has no `==`/hash; prototype keys connections by the raw bytes of the ref (`key(ws)`), flagged as shortcut. Real build: assign a connection id at upgrade and keep it in a table indexed by the ws via a documented wrapper; add a test that fails if mummy's layout changes (pinned commit makes this stable but the test makes it explicit) [PROPOSED].
- `WebSocket` **does** have generic field-wise `==` and `hash` at the pin (fields `server`, `clientSocket`, `clientId`; Nim 2.2 stdlib) [MEASURED reading, `docs/research/q13-mummy-slow-clients.md`, Corrections]. The earlier "no `==`/hash, keyed by raw bytes" note is stale. Prototype keys connections by the raw bytes of the ref (`key(ws)`), flagged as shortcut. Real build: assign an app `connId` at upgrade and key the outbox table by `connId`, not by `WebSocket` [PROPOSED, per Q13 research]; add a test that fails if mummy's `WebSocket` fields change (the pin makes this stable, the test makes it explicit) [PROPOSED].
- Handler discipline: no blocking I/O under the lock except the one SQLite COMMIT; no logging formatting of large structures under the lock; metrics are O(1) updates (section 11).
- SQLite tail: server worst ~20 ms is the COMMIT (WAL autocheckpoint / OS scheduling [INFERRED]) and every other mutation queues behind it as `lock_wait` (`results/spike/investigation.md`). Accepted for v1. Moving persist out of the lock breaks ack-after-commit and order; not done.
- 583 ms intent->ack outlier: **not reproduced**, cause undetermined (host stall or node harness pause; not proven either way, `results/spike/investigation.md`). Production logging (section 11) must make a recurrence diagnosable (SLOW lines with breakdown).
@@ -380,7 +381,7 @@ Prototype `client/src/main.ts`: explored rects appended to a `Graphics` mask for
All ids are server-assigned, opaque, non-guessable where they are exposed to players (entities); walls use dense integers GM-side only.
- **Scene** (exactly one in v1, Q3): `id, name, w, h` (px), `tile_size` (256 default), `explored_cell` (32 default; `tile_size % cell == 0` required, prototype assumes it silently), `grid_size`, `vision_radius_default`, `art_version`, `active`, free-form `extra`.
- **Scene** (exactly one in v1, Q3): `id, name, w, h` (px), `tile_size` (32 default = `explored_cell` [FIXED, Q4]; 64 is the per-scene fallback), `explored_cell` (32 default; `tile_size % cell == 0` required, prototype assumes it silently), `grid_size`, `vision_radius_default`, `art_version`, `active`, free-form `extra`.
- **Wall/Door**: `id, scene, a:[x,y], b:[x,y], kind ('wall'|'door'), open:bool, flags`. `blocks = not (door and open)`. GM-only everywhere. Later kinds (window, one-way, secret door) are extra `kind`/`flags` values; v1 geometry treats any non-open blocker identically.
- **Entity (token and anything else) [PROPOSED, FFF seam]**:
- `id, scene, kind` (free string: `pc`, `npc`, `item`...), `name`, `pos`, `radius`, `owner` (player id or null = GM-controlled), `gm_only`, `flags` (`vision`, `blocks_move`...), `vision_radius` (optional; per-entity numeric with scene default, Q7 FIXED), `status` (e.g. `blocked`, Q14).
@@ -452,7 +453,7 @@ Principles carried from the prototype: the checker must be independent of the co
### 11.1 Deployment on NixOS [PROPOSED]
- **Service** [FIXED, Q20; research: `docs/research/q20-nix-packaging.md`]: NixOS module `services.fffVtt` in `nix/module.nix`, defining: package from `nix/package.nix` (`buildNimPackage`; dependencies from committed `nix/lock.json` generated by `nim_lk`; mummy tag `0.4.8`; nixpkgs input pinned to match devbox Nim 2.2.12; fallback: vendored deps via `nimFlags --path:`), a systemd unit, state dir, options for `publicOrigin`, `port`. Imported from the owner's server NixOS config, like `foundryvtt.nix`.
- Unit hardening: `DynamicUser` or dedicated user, `StateDirectory=fff-vtt`, `ProtectSystem=strict`, `ProtectHome`, `NoNewPrivileges`, `PrivateTmp`, `RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6`, `MemoryMax`. Listen on `127.0.0.1:<port>` only [MEASURED prototype binds 127.0.0.1].
- Unit hardening: `DynamicUser` or dedicated user, `StateDirectory=fff-vtt`, `ProtectSystem=strict`, `ProtectHome`, `NoNewPrivileges`, `PrivateTmp`, `RestrictAddressFamilies=AF_INET AF_INET6`, `MemoryMax`. Add `AF_UNIX` only if the FFF sidecar (section 9, option b) is chosen; revisit at Q19. Listen on `127.0.0.1:<port>` only [MEASURED prototype binds 127.0.0.1].
- `Restart=on-failure`; `TimeoutStopSec` short; SIGTERM handler flushes (4.4).
- **Client build**: Vite `dist/` produced by Nix (or CI), served by nginx from the store path. Hashed assets, long cache; `index.html` no-cache.
- **nginx** (shape of the vhost, adapt to the existing server config; reference only, I did not read the owner's NixOS repo for this doc):
@@ -495,7 +496,7 @@ Source: `prototype-server-vision/HANDOFF.md` (and README/NOTES worries).
| H5 | Shared-endpoint test gap | Decision: port with a test that fails if either arm is removed; new mutation (d) | M1 |
| H6 | Single machine, loopback, power-save timings | Decision: keep as baseline only; real-network run required | M7 |
| H7 | Boundary epsilon ambiguity | Decision: keep `RayEps`, 0.5 px tolerance in checkers; documented | M1 |
| H8 | Tile leak: whole 256 px tile | Decision: accept for v1 + authoring rule; Open Q4 for mitigations | M3 (documented), later |
| H8 | Tile leak: whole 256 px tile | Decision [FIXED, Q4]: `tile_size` = explored cell = 32 px; residual leak <= one cell, never revoked; no server masking; M4 gates (headless mobile-emulation + phone run); fallback 64 px per-scene config | M4 |
| H9 | Invite = cookie = permanent bearer, no expiry, binds 0.0.0.0, needs HTTPS | Decision: session != invite, revoke/regenerate, log redaction, bind 127.0.0.1, HTTPS via nginx. Sessions never expire; one invite reusable across devices (Q10 FIXED); invite secrets plaintext (Q11 FIXED) | M3 |
| H10 | Move collision: centre path + dest circle, not swept circle | Decision: add swept-circle check; add step cap (T8) | M2 |
| H11 | Leak test explored/tile checks self-consistent | Decision: add independent explored oracle | M2 |
@@ -506,7 +507,7 @@ Source: `prototype-server-vision/HANDOFF.md` (and README/NOTES worries).
| H16 | Timing instrumentation unbounded and under lock | Decision: do not port; ring buffer/histogram, snapshot outside lock | M5 |
| H17 | 583 ms spike unexplained | Open: not reproduced; production SLOW logging to catch recurrence | M5/M7 |
| H18 | mummy: unbounded send queue, no backpressure | Decision [FIXED (owner decision), Q13]: app-level bounded per-client outbox, coalescing, WS Ping(seq)/Pong lag tracking, stop feeding + full resync; no mummy patch; fork is fallback only (4.3) | M5 |
| H19 | `WebSocket` keyed by raw bytes | Decision: documented wrapper + test | M3 |
| H19 | `WebSocket` keyed by raw bytes | Decision: app `connId` table (not raw bytes; `WebSocket` has field-wise `==`/hash at pin, Q13 research) + layout test | M3 |
| H20 | Fog masks Graphics grow unbounded | Decision: fixed-size baked fog texture (7.3) | M4 |
| H21 | Pixi `Text` per token heavy | Decision: BitmapText; glyph set Latin incl. accents + Nerd Font icons (Q17 FIXED) | M4 |
| H22 | Browser rendering never verified | Decision: headless browser e2e | M4 |
@@ -534,11 +535,12 @@ Each is small, ends with a green gate, and no milestone depends on browser UI be
- **M4 - Client v1.**
- Scope: new `client/` dir (first real client build): Vite + TS + Pixi v8 client: layers, tiles, grid, tokens (BitmapText), fog textures, wall/door editor, token drag with prediction/rollback, DOM overlay, reconnect backoff, reducer tests; after the client port, archive `prototype-*` dirs (Q24).
- Accept: headless e2e: fog pixel checks, player traffic audit clean, reconnect restores; manual run on laptop and Note 10 at 60 fps with 50 tokens, 16384 px map (tiled; PROPOSED test target, Q2), fog active.
- Tile-size gates [FIXED, Q4]: (a) automated headless-Chromium test with mobile emulation (viewport, dpr, CPU + network throttle) against the real server path (nginx HTTP/2 + caching): viewport fills in < 1 s at zoom 1; (b) one manual run on the owner's 5-year-old Android phone (worst-case reference). If either fails: `tile_size` 64 px (per-scene config, no code change). The 2026-11-08 prototype phone run (`prototype-tile-leak/README.md`) is evidence, not the gate: HTTP/1.1, no-store, zoom 0.5 only, first cold load up to 3.3 s.
- **M5 - Robustness and observability.**
- Scope: SIGTERM handler, bounded metrics + SLOW lines, connection cap, frame/rate limits, per-client bounded outbox with coalescing and Ping(seq)/Pong lag tracking (Q13, 4.3), verify `/ws` goes through nginx and its timeouts, healthz.
- Accept: concurrency 60 s x3 pass with p99 <= prototype (4.98 ms) +50%; slow-client test: client that stops reading -> outbox stays under cap, RSS flat, no further state queued to it, full resync on recovery equals a fresh connection; nginx closes a dead `/ws` within its configured timeout (measured); stats computation shown outside the lock (lock hold time unchanged with metrics on, measured).
- **M6 - NixOS deployment.**
- Scope: `nix/` dir per Q20: un-ignore `nix/` in `.gitignore`; `lock.json` (nim_lk), `package.nix` (buildNimPackage, nixpkgs pinned to devbox Nim 2.2.12, mummy tag 0.4.8), `module.nix` (`services.fffVtt`); declare a nimble `bin` in `fff_vtt.nimble` (nim_builder builds only `bin` entries, so the package is empty without it); client build; nginx vhost; systemd hardening; backups timer (Q21), restore drill, import CLI for maps.
- Scope: `nix/` dir per Q20: un-ignore `nix/` in `.gitignore`; `lock.json` (nim_lk), `package.nix` (buildNimPackage, nixpkgs pinned to devbox Nim 2.2.12, mummy tag 0.4.8), `module.nix` (`services.fffVtt`); declare a nimble `bin` in `fff_vtt.nimble` (nim_builder builds only `bin` entries, so the package is empty without it); client build; nginx vhost; systemd hardening; backups timer (Q21), restore drill, import CLI for maps (slices at `tile_size`, Q4).
- Accept: deployed behind HTTPS on the owner's server; `/_tiles/` 404 directly; WS upgrade works; invite join works from phone; access log has no secret; backup + restore drill passes.
- **M7 - Real-world pass.**
- Scope: real-network latency/throughput run, iOS/Safari check (if available), one real session with the owner's table, collect SLOW lines.
@@ -552,7 +554,7 @@ Each is small, ends with a green gate, and no milestone depends on browser UI be
1. Q1 - Table size and device mix: how many players max, and which devices (phones, tablets, iOS)? Drives iOS testing priority and token/message budgets. **RESOLVED [FIXED (owner decision), 2026-11-08]:** devices are phones, tablets and laptops. Max players: 6 [FIXED, owner decision 2026-11-08] (section 1). Connection cap 8 (6 players + GM + headroom) stays [PROPOSED] (sections 4.3, 13).
2. Q2 - Largest map you plan to use (px), and typical wall count per scene? Drives tile size, spatial grid priority and explored chunking. **DEFERRED [FIXED (owner decision), 2026-11-08]:** owner does not know yet. 16384 px map and 5k walls stay [PROPOSED] test targets; revisit with real maps.
3. Q3 - Multiple scenes in v1 (GM switches the active scene, per-scene explored grids), or exactly one scene per table to start? **RESOLVED [FIXED (owner decision), 2026-11-08]:** exactly one scene in v1; schema may stay `scene_id`-keyed.
4. Q4 - Tile-edge leak: accept as documented, or reduce it (smaller tiles = more requests; gate tiles only when explored cells cover a minimum fraction; or server-side masked tiles at the cost of image processing in Nim)? What detail do you paint in map art that must stay secret? **OPEN (owner, 2026-11-08):** still open. Prototyping server-masked tiles vs cell-size tiles in `prototype-tile-leak/`.
4. Q4 - Tile-edge leak: accept as documented, or reduce it (smaller tiles = more requests; gate tiles only when explored cells cover a minimum fraction; or server-side masked tiles at the cost of image processing in Nim)? What detail do you paint in map art that must stay secret? **RESOLVED [FIXED (owner decision), 2026-11-08]:** `tile_size` = explored cell size = 32 px. Residual leak is at most one cell, never revoked; no server-side masking. Authoring rule shrinks from ~256 px to ~32 px. M4 acceptance: (a) headless mobile-emulation test on the real server path, (b) one manual phone run; fallback 64 px (per-scene config). Evidence: `prototype-tile-leak/README.md`. Applied in 3.3, 3.4 (T5), 8, 12 (H8), 13 (M4, M6).
5. Q5 - Map import: CLI-only for v1, or upload + tiling from the browser (GM) from the start? **RESOLVED [FIXED (owner decision), 2026-11-08]:** map import is CLI-only in v1; browser upload is post-v1.
6. Q6 - Wall/door authoring: is an in-browser GM wall editor required in v1 (no generator feeds in), or is hand-edited/imported wall data acceptable at first? What other wall kinds are needed soon (windows, one-way, secret doors, locked doors)? **RESOLVED [FIXED (owner decision), 2026-11-08]:** in-browser GM wall editor in v1; wall kinds `wall` and `door` only.
7. Q7 - Vision model: single radius per token or per-token property from day one? Is any "darkvision/light" concept needed before FFF? **RESOLVED [FIXED (owner decision), 2026-11-08]:** per-entity numeric `vision_radius` plus scene default; no light sources or darkvision.
@@ -567,7 +569,7 @@ Each is small, ends with a green gate, and no milestone depends on browser UI be
16. Q16 - Vision payload: OK with full polygon per move (~3.4-3.7 KB per mover delivery, measured on loopback) for v1, or do you want deltas/binary earlier (e.g. for mobile data plans)? **RESOLVED [FIXED (owner decision), 2026-11-08]:** full vision polygon, integer px, sent only on change; deltas post-v1.
17. Q17 - Names/labels: which character sets must labels support (Latin only, accents, non-Latin, emoji)? Affects BitmapText glyph atlas vs Text/HTMLText. **RESOLVED [FIXED (owner decision), 2026-11-08]:** labels in Latin incl. accented characters plus Nerd Font icon glyphs.
18. Q18 - Grid and movement: snap to grid on drop? Any server-side speed/distance limit per move, given there are no rules yet? **RESOLVED [FIXED (owner decision), 2026-11-08]:** grid snap off by default (client option); server step cap = token vision radius.
19. Q19 - FFF engine: implementation language/runtime, current maturity, and whether it should run inside the VTT server process, as a sidecar, or in the browser for display only? Does it need hidden/secret state beyond the three property buckets (public / owner / GM)? **PARTLY RESOLVED [FIXED (owner decision), 2026-11-08]:** no hidden state beyond the `public`/`owner`/`gm` buckets and `gm_only` flag in v1; revisit when FFF starts (schema change accepted then). Engine language, runtime and location: not answered, still open.
19. Q19 - FFF engine: implementation language/runtime, current maturity, and whether it should run inside the VTT server process, as a sidecar, or in the browser for display only? Does it need hidden/secret state beyond the three property buckets (public / owner / GM)? **RESOLVED for hidden state [FIXED (owner decision), 2026-11-08]:** no hidden state beyond the `public`/`owner`/`gm` buckets and `gm_only` flag in v1; revisit when FFF starts (schema change accepted then). Engine language, runtime and location: **DEFERRED** to FFF start (section 9 options a/b/c; no decision now).
20. Q20 - Nix packaging: how do you want the Nim server built (nimble lock + `buildNimPackage` or a vendored deps approach), and which repo hosts the NixOS module (this repo or your nixos-configuration repo)? **RESOLVED [FIXED (owner decision), 2026-11-08]:** `buildNimPackage` with a committed `nix/lock.json` (`nim_lk` JSON lock). `nix/package.nix` and `nix/module.nix` (`services.fffVtt`) live in this repo and are imported from the owner's server NixOS config, like `foundryvtt.nix`. nixpkgs input pinned to match devbox Nim (2.2.12). Fallback: vendored deps if `nim_lk` cannot resolve the mummy pin. `nix/` un-ignored in `.gitignore` when M6 starts, not now. mummy pinned to tag `0.4.8` (same `src/` as `01deb1ff`). Research: `docs/research/q20-nix-packaging.md`; detail in 11.1.
21. Q21 - Backups: where should off-box backups go (existing mechanism on the server?), and how many dated copies to keep? **RESOLVED [FIXED (owner decision), 2026-11-08]:** v1 backups go to a backup folder the server creates under its data root; off-box backups out of v1 scope.
22. Q22 - Observability: journald lines only, or also an internal metrics endpoint scraped by something you run? **RESOLVED [FIXED (owner decision), 2026-11-08]:** journald lines only; `/healthz` stays.