fix: cap wall flags and scene extra as opaque objects (#35)

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.
This commit is contained in:
2026-11-20 21:46:53 +01:00
parent 41c2fe695b
commit b0e1633aa9
9 changed files with 264 additions and 8 deletions
+9
View File
@@ -77,6 +77,8 @@ same numbering.
- v0.31 records #32 (the dispatch guard: the `internal` refusal code and unconditional rollback on
every unwind path) in 4.2, 6.2, 6.5, 14
- v0.32 records #35 (the opaque-object caps on wall `flags` and scene `extra`: 8 KB, 64 keys per
object, depth 8) in 6.1, 14
All of Q1-Q24 are RESOLVED or DEFERRED; none OPEN.
@@ -855,6 +857,13 @@ helpers roll back on every unwind path (`Defect` included) so the shared connect
the handler's own ack was already enqueued, it stands and no second ack is appended. `internal` is
additive in proto 2. A `Defect` is bounded damage, not a restart policy. See current 4.2, 6.2, 6.5.
Owner also decided 2026-11-20 [FIXED (owner-delegated, 2026-11-20, #35)]: wall `flags` and scene
`extra` are opaque but capped uniformly, on the same measure as a prop value: serialized JSON at
most 8 KB, at most 64 keys per object (per object, not summed) and nesting depth at most 8 (a
top-level object is depth 1). At a cap is accepted; over is `invalid` and applies nothing. The caps
live next to the property caps and are read from one shared validator; token `flags`, props and
stored values above a cap are out of scope. See current 6.1.
## D. Superseded statements removed from the current spec
Each entry quotes the superseded statement (excerpt) and names the surviving rule.
+10 -2
View File
@@ -1431,7 +1431,13 @@ switches, never `thickness`, `position` or `height` (#50).
no sight, movement or status rule; a marker is emitted only for a wall that is both
`player_marker:true` and derives `window` (5.8).
- `flags` is a JSON object or absent (absent = `{}`); anything else is `invalid`. It is stored
verbatim and never interpreted — the switches are fields, not flags (5.8).
verbatim and never interpreted — the switches are fields, not flags (5.8). The object is opaque
but bounded [FIXED (owner-delegated), 2026-11-20, #35], on the same measure as a prop value:
serialized JSON is at most 8 KB, at most 64 keys per object, and nesting depth at most 8 (a
top-level object is depth 1, nested objects and arrays each add one). A value at every cap is
accepted; one byte, key or level over is `invalid` and nothing is stored. A refused value is
logged once with the field and the limit it broke, never its contents. A row already stored above
a cap is loaded and echoed as stored: the cap is an input rule, not a migration.
- `wall.update` patches `a`, `b`, `thickness`, `position`, `height`, the switches except `open` (or
one `preset`), `label` and `flags`; at least one of them is required, otherwise `invalid`. A patch
is absolute, not additive: everything named is set to the value given (`null` clears `height` and
@@ -1486,7 +1492,9 @@ switches, never `thickness`, `position` or `height` (#50).
- `name`: the 6.5 text rule, 1..64 code points, already trimmed, no control characters.
- `grid_size`: a finite number `>= 0` (0 = no grid; `classify` rejects NaN/Inf).
- `vision_radius_default`, `token_radius_default`: a finite number `> 0`, no upper cap (#4).
- `extra`: a JSON object, stored verbatim and never interpreted; the GM sees it in `hello`.
- `extra`: a JSON object, stored verbatim and never interpreted; the GM sees it in `hello`. It
carries the same opaque caps as wall `flags` [FIXED (owner-delegated), 2026-11-20, #35]: 8 KB
serialized, 64 keys per object, depth 8; over a cap is `invalid` and applies none of the patch.
- `w`, `h`, `tile_size`, `cell` and `art_version` are **not** patch fields (import is the M6 CLI):
they are unknown fields and ignored (6.2), so a patch carrying only one of them has no field at
all and is `invalid`.