You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
relay: the message limiter keys one bucket per address, dropping the capture's per-message-type window #1301
Found by job 045's code lens (row 5 of #868), reviewing nostream-relay at 8488bf13.
The message limiter keys one bucket per address and loses the message type:
crates/nostream-relay/src/limits.rs:543
let key = format!("{address}:message:{}", config.period_ms);
The capture buckets by a closed set of message types and keys ${client}:message:${type}:${period} (src/adapters/web-socket-adapter.ts:59-71, :354), so an EVENT burst spends the REQ budget and vice versa. Mixed traffic is therefore refused where the capture allowed it — a false positive that scales with a client's use of both.
message_backoff (limits.rs:520) takes no type, so it cannot express the capture's key, and tests/limits.rs:694-724 can only ever call it by address, which is why the test suite pins the type-free shape. ADR 0004:173 records the one-key-per-address shape as measured, not as a decision against the capture.
Acceptance
The key carries the message type, derived from the raw frame prefix against the capture's closed set with an other fallback, and message_backoff's signature can express it.
A case where an EVENT burst leaves the REQ window intact fails on the old key.
ADR 0004 records the decision (and the closed set) rather than the old shape.
Closed by d8c57439c3b2405d9119ed0d99d909a672f61a57 (#1381).
The message limiter now derives the capture's closed set (REQ, EVENT, COUNT, CLOSE, AUTH, NEG-OPEN, NEG-MSG, NEG-CLOSE, with OTHER) from the raw frame prefix and keys {address}:message:{CLASS}:{period_ms}, so an EVENT burst no longer spends the REQ window. NEG-CLOSE's nine characters exceed the capture's own eight-character bound, so that frame lands in OTHER — parity with the capture, proved by the_nine_character_neg_close_falls_to_other.
Evidence: the socket oracle an_event_burst_leaves_the_req_window_intact fails at 7019957a (CLOSED s1 where EOSE s1 is expected) and passes at head; ADR 0004 records the decision and the closed set rather than the old shape; the security lens bounded the eight-fold bucket multiplication (8 reachable classes, 65,536-key store cap, admit fail-closed).
Follow-ups filed: #1382 (a 20 ms liveness test that fails on a loaded runner), #1385 (from_frame allocates a String per frame). The irreversibility gate's expectation-removed finding was measured as a signature reformat with the same expectation and discharged by the operator (2026-12-04).
Activity
chappie-daemon commentedon Dec 4, 2026
Factory job started (row from the 2026-12-04 plan): recon in progress, branch
factory/050-*' fromrewrite/mainat7019957`.fix(relay): key the message limiter by the frame type (#1301)
chappie-daemon commentedon Dec 4, 2026
Closed by
d8c57439c3b2405d9119ed0d99d909a672f61a57(#1381).The message limiter now derives the capture's closed set (
REQ, EVENT, COUNT, CLOSE, AUTH, NEG-OPEN, NEG-MSG, NEG-CLOSE, withOTHER) from the raw frame prefix and keys{address}:message:{CLASS}:{period_ms}, so an EVENT burst no longer spends the REQ window.NEG-CLOSE's nine characters exceed the capture's own eight-character bound, so that frame lands inOTHER— parity with the capture, proved bythe_nine_character_neg_close_falls_to_other.Evidence: the socket oracle
an_event_burst_leaves_the_req_window_intactfails at7019957a(CLOSED s1whereEOSE s1is expected) and passes at head; ADR 0004 records the decision and the closed set rather than the old shape; the security lens bounded the eight-fold bucket multiplication (8 reachable classes, 65,536-key store cap,admitfail-closed).Follow-ups filed: #1382 (a 20 ms liveness test that fails on a loaded runner), #1385 (
from_frameallocates a String per frame). The irreversibility gate'sexpectation-removedfinding was measured as a signature reformat with the same expectation and discharged by the operator (2026-12-04).