Commit Graph
12 Commits
Author SHA1 Message Date
SirStone 7e2d5b8dc0 server: per-connection wire state and closing frames in the conn registry (#18)
Conn now carries what DESIGN 6/6.4/6.5 need per connection, all under the one
registry lock: the outgoing n counter (starts at 1, server frames only), the intent
token bucket, the malformed-flood window, the player's named flag and the last Pong.
None of it is shared, so the n counter is not a global side channel (H25).

activate/revokePlayer now hand back the doomed Conn values instead of raw sockets:
the caller still has the frame count, so the final closing frame carries the right n
before the close. Tests cover per-connection counters, the bucket and the flood
window in isolation, and that a snapshot survives the lock.
2026-11-15 08:33:07 +01:00
SirStone eb48034eba server: wire protocol module - envelope, frames, rate limit, flood window (#18)
Pure, mummy-free module for the protocol shell: the envelope rules of DESIGN 6.5
step 2 (UTF-8 text, JSON object, string t, integer reqId in 0..2^31-1), the frame
builders of 6.1 including closal/closing, the per-connection intent token bucket
(30/s, burst 100) and the malformed-flood window (10 in any 10 s), plus the FIXED
constants: proto 1, 64 KB inbound, close codes 4001/4002/4003/1008 and their reason
strings. The 29-intent catalogue and the GM-only set live here so 'unknown type'
and role checks have one definition.

Found while testing: std/json parseJson("") returns nil instead of raising, and
node{"t"} is nil for a missing key, so both are guarded (a bare {} would have
crashed the handler).
2026-11-15 08:33:01 +01:00
SirStone e612db5826 server: auth schema, keys, sessions, connection registry (#17) 2026-11-14 22:13:04 +01:00
SirStone f376efdc39 server: config, migrations, redacted logging, /healthz entrypoint (#16) 2026-11-14 21:40:39 +01:00
SirStoneandClaude Sonnet 5.5 8d3b77add4 mutation: parallel jobs in temp copies, per-mutation test files, FFF_MUTATION reduced iterations, trap cleanup, sleep inhibit
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 19:19:58 +01:00
SirStoneandClaude Sonnet 5.5 a29bb0bb46 moverules: door close pushes overlapped tokens aside (valid-side check, blocked only if no side valid); Push list; tests; mutations m-o
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 18:56:06 +01:00
SirStoneandClaude Sonnet 5.5 388e901541 moverules: blocked policy set/keep/clear (GM moves and placements set/clear, KEEP while any wall overlaps); tests; mutations k, l
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 18:47:39 +01:00
SirStoneandClaude Sonnet 5.5 e0705a8533 bench: harness with synthetic 5k-wall scenes (devbox run bench), scenegen + tests
Targets met without a spatial grid: polygon+cells 0.048 ms (<= 0.451) on the prototype scene, polygon 0.083 ms
(< 1 ms) on 5k sparse. 5k dense stress layout reported (1.28 ms). Logs: results/bench.log, nimble-test.log.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:15:31 +01:00
SirStoneandClaude Sonnet 5.5 afe84f2add moverules: swept-circle move check, token-on-wall escape, blocked flag, step cap, GM bypass
Pure in-process module (server/moverules.nim, plain data, no IO) per DESIGN 5.5. Replaces moveBlocked tests
(ported at r=0), the KNOWN LIMITATION pin and the Q14 pin with positive escape/capsule assertions and
blocked-policy tests. tests/tprobing.nim: in-process T8 probing test with a concrete bound (stepCap + r).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:11:49 +01:00
SirStoneandClaude Sonnet 5.5 67fa96e23d geometry: scanline cellsTouched, differential + independent oracle tests, prototype corpus
cellsTouched is now a scanline over cell rows (prototype per-cell version kept test-only in
tests/refold.nim). Differential tests (random polygons, concave, grid-aligned) and a brute-force
explored oracle (0.5 px tolerance) cover it; regression corpus = prototype leak-run polygons.
moveBlocked leaves geometry.nim (replaced by server/moverules.nim next); geometry primitives exported.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:08:21 +01:00
SirStoneandClaude Sonnet 5.5 b8d68cdb3a tests: shared-vertex both-arms test, door-closed-on-token pin (Q14), KNOWN LIMITATION token-on-wall pin
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 10:08:26 +01:00
SirStoneandClaude Sonnet 5.5 547458c37e m1: devbox, nimble, layout; port geometry.nim and 33 tgeometry tests (98 checks)
Fixture tests/fixtures/scene.json copied from prototype data/; seed test no longer skips if missing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 10:06:58 +01:00