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
+1 -1
View File
@@ -116,7 +116,7 @@ type
ScenePatch* = object
## `scene.set` (DESIGN 6.1): every field is optional; an absent field keeps its value.
## `w`, `h`, `tile_size`, `cell` and `art_version` are not patch fields (import is the M6 CLI):
## `w`, `h`, `tile_size`, `cell` and `art_version` are not patch fields (import is the offline CLI, 11.1):
## they are unknown fields and ignored (6.2), so a patch with only one of them has no field at
## all and is `invalid`.
name*: Option[string]