feat(server): map import CLI, pulled forward to M4 (#79)

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.
This commit is contained in:
2026-11-21 15:59:54 +01:00
parent bacf2e1412
commit ad610abd65
12 changed files with 700 additions and 30 deletions
+15
View File
@@ -870,6 +870,21 @@ radius starts blank (scene default), on create and on edit. No wire default chan
follows the existing `'{}'` reading rather than choosing "vision on for a player-controlled token".
See current 8.
Owner also decided 2026-11-21 [FIXED (owner-delegated, 2026-11-21, #79; recorded here in the
decision log that continues the old §C)]: **the map import CLI moves from M6 to M4.** It is the
designed CLI of 11.1, not a throwaway seeder: `fff-vtt import --image=<png|webp> [--scene=1]
[--tile-size=<px>] [--state-dir=<path>]` writes `<state>/tiles/<scene>/v<art_version>/<x>_<y>.png`
(origin at the world origin) and updates the one scene row's `w`, `h`, `tile_size` and `art_version`.
A re-import for art that already exists grows `art_version`; old versions stay until M6 cleanup. It
takes the state-dir lock (a live server refuses it, exit 3) because the server reads the scene at
startup, so the operator stops the server, imports and restarts. `--tile-size` defaults to the
scene's tile size and must be a positive multiple of the explored cell (64 px fallback). Decoding
uses ImageMagick from the root devbox with disk-backed pixel-cache limits, so a 16384 px source is
memory-sane; no Nim/npm image dependency is added and the FIXED stack (2) is unchanged. This note
supersedes #63's "map import CLI (M6)" Out-of-Scope line for the CLI only; NixOS deployment, the
production vhost and tile-version cleanup stay M6. See current 3.3, 6.1, 11.1, 13 and TESTING 3.3 /
10.3.
## D. Superseded statements removed from the current spec
Each entry quotes the superseded statement (excerpt) and names the surviving rule.