cultmesh-py: answer an unreadable RUDP frame and end the session after 8 consecutive refusals #45

Merged
libby merged 2 commits from libby/py-refused-frames-cap into main 2026-11-08 09:54:42 +00:00
Member

Heimdall's parity ruling (2026-11-08), Python side; Rust is #43 (4828c416), TS is #44. Differs from TS: the python RUDP server dropped a frame that is no msgpack map silently, so this also adds the answer (message_invalid, details.field = "message", fixed reason) and keeps the session. Then the shared cap, MAX_CONSECUTIVE_REFUSED_FRAMES = 8 (module constant in cultmesh_py.server): the 8th consecutive unreadable frame, or 8th consecutive delete the write authority refuses (a response carrying write_not_authorized), is answered with the goodbye and ends that peer's session. A decoded map resets the unreadable run; any delete that is not refused, or any non-delete, resets the delete run.

Touches the write-authority path (refused deletes are counted from the authority's refusal response); the authority's decision and refusals are unchanged. Left unmerged for Heimdall.

Tests: two new (7 answered, reset, 7 more, 8th answered then ended; same for deletes with a granted delete and a snapshot as resets). Six hand mutants fail them under prlimit as=4GiB cpu=300 (cap 7, cap 9, unreadable never resets, delete run never resets, delete never counts, cap removed). cultmesh-py suite passes.

🤖 Generated with Claude Code

Heimdall's parity ruling (2026-11-08), Python side; Rust is #43 (4828c416), TS is #44. Differs from TS: the python RUDP server dropped a frame that is no msgpack map **silently**, so this also adds the answer (`message_invalid`, `details.field = "message"`, fixed reason) and keeps the session. Then the shared cap, `MAX_CONSECUTIVE_REFUSED_FRAMES = 8` (module constant in `cultmesh_py.server`): the 8th consecutive unreadable frame, or 8th consecutive delete the write authority refuses (a response carrying `write_not_authorized`), is answered with the goodbye and ends that peer's session. A decoded map resets the unreadable run; any delete that is not refused, or any non-delete, resets the delete run. **Touches the write-authority path** (refused deletes are counted from the authority's refusal response); the authority's decision and refusals are unchanged. Left unmerged for Heimdall. Tests: two new (7 answered, reset, 7 more, 8th answered then ended; same for deletes with a granted delete and a snapshot as resets). Six hand mutants fail them under prlimit as=4GiB cpu=300 (cap 7, cap 9, unreadable never resets, delete run never resets, delete never counts, cap removed). cultmesh-py suite passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cultmesh-py: answer an unreadable RUDP frame and end the session after 8 consecutive refusals
Some checks failed
CultMesh QUIC native / Build win32-x64 (pull_request) Has been skipped
CultMesh QUIC native / Build linux-x64 (pull_request) Has been skipped
CultMesh QUIC native / Release native binaries (pull_request) Has been skipped
CultMesh QUIC native / Verify committed binaries match SHA256SUMS (pull_request) Has been cancelled
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
b4979cb65b
Heimdall's parity ruling. A frame that is no msgpack map used to be dropped
silently; it is now answered message_invalid (field "message") and the session
kept. MAX_CONSECUTIVE_REFUSED_FRAMES (8) consecutive unreadable frames, or
consecutive deletes the write authority refuses, end the session after the
capped frame is answered. The authority's decision is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
cultmesh-py: answer the capped frame reliably and end the session once the answer is acknowledged
Some checks failed
CultMesh QUIC native / Build win32-x64 (pull_request) Has been skipped
CultMesh QUIC native / Build linux-x64 (pull_request) Has been skipped
CultMesh QUIC native / Release native binaries (pull_request) Has been skipped
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Failing after 5m17s
CultMesh QUIC native / Verify committed binaries match SHA256SUMS (pull_request) Successful in 52s
bf81695537
The 8th refusal was sent unreliable and unordered with only the first response,
then the goodbye at once, so a lost datagram left the peer without it. All answers
now go the normal reliable path; the session ends when the peer has acknowledged
them (a lost one is resent) or after a 2 s grace, and serves nothing after the
capped frame meanwhile.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
libby merged commit fe73795d89 into main 2026-11-08 09:54:42 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/CultLib!45
No description provided.