houserules/packages/server
Joey Yakimowich-Payne 7cc9617f3e
fix(server): widen ModifierKindIdSchema to accept custom modifier ids
T3 audit gap 1 (BLOCKER). The server's ModifierKindIdSchema was still
z.enum([built-ins]) even after the client-side mirror was widened
during T29. Effect: any multiplayer room.create or
modifier-profile.update carrying a profile whose perType[i].kind is a
user-authored CustomModifierId (e.g. 'custom:shield') was rejected
server-side as INVALID_MESSAGE.

Symmetric fix: accept any non-empty string, defer kind validity to the
engine's registry-dispatch fallback at apply time (MODIFIER_REGISTRY
→ engine.customModifiers → warn-and-skip). The built-in id list is
preserved as a doc comment + void-referenced constant so it can't
silently drift.

Test updated: 'rejects a profile with unknown modifier kind' inverted
to 'accepts a profile with arbitrary modifier kind (T3 widening)' +
new 'rejects empty-string modifier kind' to preserve the min(1) guard.
2026-04-20 16:43:38 -06:00
..
src fix(server): widen ModifierKindIdSchema to accept custom modifier ids 2026-04-20 16:43:38 -06:00
package.json feat(server): add authoritative game session per room (P4.5) 2026-04-16 17:17:42 -06:00
PROTOCOL.md feat(server): modifier profile protocol schemas + error codes 2026-04-18 22:43:58 -06:00
README.md chore(root): scaffold monorepo — Phase 0 complete 2026-04-16 13:32:21 -06:00
tsconfig.json feat(server): add authoritative game session per room (P4.5) 2026-04-16 17:17:42 -06:00
vitest.config.ts chore(root): scaffold monorepo — Phase 0 complete 2026-04-16 13:32:21 -06:00

@paratype/chess-server — authoritative WebSocket server