Proof of concept mechanical port of ircnet/ircd to Rust as part of a bit about C being insecure for network services
0

Configure Feed

Select the types of activity you want to include in your feed.

ircd.rs / docs / claude-memory / leveva-sasl-chunking-proptest-flake.md
2.3 kB

name: leveva-sasl-chunking-proptest-flake description: "RESOLVED (slice 181, 2026-06-15) — the sasl_proptest chunking_round_trips flake (a bare-+ data chunk colliding with the IRCv3 empty-payload sentinel) is closed; kept as the record of WHY the chunker can't round-trip a lone-+ payload" metadata: node_type: memory type: project originSessionId: 732facbd-591f-4e50-899c-9d8ddf8473fd#

RESOLVED in P11 slice 181 (2026-06-15). Originally discovered 2026-06-15 during slice 178 (WALLOPS): leveva/tests/sasl_proptest.rs::chunking_round_trips flaked on a payload of length ≡ 1 (mod 400) ending in + (minimal repro "A".repeat(400)+"+", also the bare "+") — the round-trip dropped the trailing +.

Root cause (the slice-178 memory's "exact-multiple" guess was wrong): exact-multiple-of-400 payloads round-trip fine. The break is narrower — chunks_for_wire emitting a data chunk equal to the bare string "+" (a length-1 final chunk that is +). That is a genuine IRCv3 wire-format ambiguity, not a chunker logic bug: AUTHENTICATE + is reserved as the empty-payload sentinel, so a non-terminator data chunk equal to + is unrepresentable, and it is unfixable in the chunker (a non-final chunk must be exactly 400 chars — that is the "more follows" signal). It is also unreachable for valid input: leveva relays only base64, whose length is always a multiple of 4 (as is 400), so a final chunk is never length 1. The old proptest generator [A-Za-z0-9+/=]{0,1200} was over-broad — it drew wire-unrepresentable payloads and asserted an impossible property.

Fix (no chunker behavior change): documented the representability contract on chunks_for_wire's rustdoc; tightened chunking_round_trips to the real base64-multiple-of-4 domain (now genuinely total); added a full-alphabet round_trip_unless_lone_plus_chunk proptest that pins the exact boundary (len % 400 == 1 && ends_with('+') → result is the payload minus the swallowed +); added a deterministic lone_plus_data_chunk_is_wire_unrepresentable unit test.

Takeaway: do NOT try to "fix" the chunker to round-trip a bare-+ payload — it is impossible within IRCv3 SASL framing; the right move was contract + fuzz-domain correctness. Related: [[leveva-s2s-notify-propagation]] (where it was flagged).