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
+5 -5
View File
@@ -67,8 +67,8 @@ export function listeningSockets(port) {
// Auth helpers (#17): sign-in, cookie/Ws clients, and a raw HTTP upgrade for status checks.
// The proto query is required from slice 3 on (DESIGN 6.2: missing or non-integer -> HTTP 400).
// proto: null omits the query entirely (the 400 test).
export function wsUrl(origin, proto = 1) {
// proto: null omits the query entirely (the 400 test). The default is the build's proto (2, #54).
export function wsUrl(origin, proto = 2) {
return origin.replace(/^http/, 'ws') + (proto === null ? '/ws' : `/ws?proto=${proto}`)
}
@@ -168,11 +168,11 @@ function wireOpen(ws, onOpen, onError) {
// Raw HTTP upgrade attempt (node:net): lets a test read the status line before the 101.
// originHeader: undefined = the server origin, null = omit the header, string = send it.
// proto: undefined = 1, null = omit the query parameter, else the value as given.
// proto: undefined = 2 (the build's proto), null = omit the query parameter, else as given.
export async function rawUpgrade(origin, opts = {}) {
const u = new URL(origin)
const key = crypto.randomBytes(16).toString('base64')
const proto = opts.proto === undefined ? 1 : opts.proto
const proto = opts.proto === undefined ? 2 : opts.proto
const path = proto === null ? '/ws' : `/ws?proto=${proto}`
const lines = [`GET ${path} HTTP/1.1`, `Host: ${u.host}`, 'Upgrade: websocket',
'Connection: Upgrade', `Sec-WebSocket-Key: ${key}`, 'Sec-WebSocket-Version: 13']
@@ -280,7 +280,7 @@ function decodeFrames(buf) {
export async function rawWs(origin, opts = {}) {
const u = new URL(origin)
const proto = opts.proto === undefined ? 1 : opts.proto
const proto = opts.proto === undefined ? 2 : opts.proto
const path = proto === null ? '/ws' : `/ws?proto=${proto}`
const key = crypto.randomBytes(16).toString('base64')
const lines = [`GET ${path} HTTP/1.1`, `Host: ${u.host}`, 'Upgrade: websocket',