feat(walls): proto 2 typed wall record, inert geometry, derived kind (#54)

wall.add/wall.update take thickness, position, height and the eight raw
switches; kind is output-only and the GM wall frames echo the full typed
record. Geometry is stored but inert (0/full/centre behaviour), and the
legacy kind/open wire adapter is gone. proto is bumped to 2 with the
harness default, and BannedAlways gains every wall field name with a
WALLDATA positive control.

Tests: schema-7 migrated scene vs the same walls authored via raw switches
gives byte-identical player frames, refusals and per-tile statuses.
Nim 382 / Node 113 green.
This commit is contained in:
2026-11-19 22:21:47 +01:00
parent c1b1e9cf91
commit 77fa2dfe4c
23 changed files with 852 additions and 318 deletions
+3 -3
View File
@@ -24,7 +24,7 @@ test('hello is the first frame; n counts server frames per connection, never glo
const hello = await gm.ws.waitText('hello')
assert.deepEqual(gm.ws.messages[0], hello, 'hello is the first frame')
assert.equal(hello.n, 1) // starts at 1 on the connection's first frame
assert.equal(hello.proto, 1) // M3 ships proto 1 (DESIGN 6.2)
assert.equal(hello.proto, 2) // proto 2 is the wall-model build (DESIGN 6.2)
assert.equal(hello.role, 'gm')
assert.deepEqual(hello.me, { id: 1, name: 'GM' })
// 6.3: the roster, then the GM wall snapshot (slice 4, DESIGN 6.1 `walls`)
@@ -78,9 +78,9 @@ test('proto: absent or non-integer is HTTP 400; a different proto is 101 + closi
assert.equal((await rawUpgrade(s.origin, { cookie, proto: null })).status, 400)
assert.equal((await rawUpgrade(s.origin, { cookie, proto: 'x' })).status, 400)
assert.equal((await rawUpgrade(s.origin, { cookie, proto: '1.0' })).status, 400)
assert.equal((await rawUpgrade(s.origin, { cookie, proto: 1 })).status, 101)
assert.equal((await rawUpgrade(s.origin, { cookie, proto: 2 })).status, 101)
const raw = await rawWs(s.origin, { cookie, proto: 2 })
const raw = await rawWs(s.origin, { cookie, proto: 1 })
const closing = await raw.waitText('closing')
assert.equal(closing.reason, 'proto-mismatch')
assert.equal(closing.code, 4003)