M3 slice 3: Talking safely #18

Closed
opened 2026-11-14 20:55:46 +01:00 by SirStone · 1 comment
Owner

What

The WS protocol shell: envelope, reqId -> exactly one ack, error and close codes, intent rate limit, malformed-JSON flood closed, oversize frame rejected, per-connection n counter, proto version check, server ping. No game intents yet beyond what the tests need. See DESIGN 6.1 (envelope), 6.2, 6.4, 6.5, 4.3.

Acceptance

  • Test group protocol green: proto mismatch refused; unknown type rejected (both directions); oversized frame rejected; malformed flood closed; rate limit hit (30/s, burst 100, excess refused, no rollback); connection cap enforced.
  • Every request with a reqId gets exactly one ack; codes match 6.5.
  • n counter is per connection, no global counter on the wire.
  • Raw/malformed frames sent with node:net in the harness.
  • devbox run test green.

Decide while building

Close/error code numeric values if 6.5 leaves any open, ping interval. Record as FIXED (owner-delegated) in DESIGN.

Refs

Map #2. Decisions: #11 Message list, #15 M3 limits, #10 Library check: mummy and db_connector. DESIGN 4.3, 6.1, 6.2, 6.4, 6.5, 10.3, 13 (M3 group 4).

## What The WS protocol shell: envelope, `reqId` -> exactly one ack, error and close codes, intent rate limit, malformed-JSON flood closed, oversize frame rejected, per-connection `n` counter, proto version check, server ping. No game intents yet beyond what the tests need. See DESIGN 6.1 (envelope), 6.2, 6.4, 6.5, 4.3. ## Acceptance - Test group **protocol** green: proto mismatch refused; unknown type rejected (both directions); oversized frame rejected; malformed flood closed; rate limit hit (30/s, burst 100, excess refused, no rollback); connection cap enforced. - Every request with a `reqId` gets exactly one ack; codes match 6.5. - `n` counter is per connection, no global counter on the wire. - Raw/malformed frames sent with `node:net` in the harness. - `devbox run test` green. ## Decide while building Close/error code numeric values if 6.5 leaves any open, ping interval. Record as FIXED (owner-delegated) in DESIGN. ## Refs Map #2. Decisions: #11 Message list, #15 M3 limits, #10 Library check: mummy and db_connector. DESIGN 4.3, 6.1, 6.2, 6.4, 6.5, 10.3, 13 (M3 group 4).
SirStone added the ready-for-agent label 2026-11-14 20:55:46 +01:00
SirStone added a new dependency 2026-11-14 20:56:12 +01:00
SirStone added a new dependency 2026-11-14 20:56:13 +01:00
SirStone added a new dependency 2026-11-14 20:56:19 +01:00
Author
Owner

Slice complete and merged to main.

Commits:

  • eb48034 server: wire protocol module - envelope, frames, rate limit, flood window (#18)
  • 7e2d5b8 server: per-connection wire state and closing frames in the conn registry (#18)
  • 88dd27e server: hello, one ack per intent, proto check, rate limit, flood, ping (#18)
  • 5e43ffa tools: raw WS client and the protocol test group (#18)
  • 951f37c tools: mutations p-s for the protocol module and the n counter (#18)
  • db22b33 design: record the closing message and the protocol-shell decisions (#18)
  • 2a1e2dd results: slice 3 test and mutation logs (#18)

Gate: devbox run test + devbox run mutation green on the final tree.

Slice complete and merged to `main`. Commits: - `eb48034` server: wire protocol module - envelope, frames, rate limit, flood window (#18) - `7e2d5b8` server: per-connection wire state and closing frames in the conn registry (#18) - `88dd27e` server: hello, one ack per intent, proto check, rate limit, flood, ping (#18) - `5e43ffa` tools: raw WS client and the protocol test group (#18) - `951f37c` tools: mutations p-s for the protocol module and the n counter (#18) - `db22b33` design: record the closing message and the protocol-shell decisions (#18) - `2a1e2dd` results: slice 3 test and mutation logs (#18) Gate: `devbox run test` + `devbox run mutation` green on the final tree.
Sign in to join this conversation.