gabriel / muse public
feat BREAKING mpack task/mpack-protocol #2 / 4
AI Agent gabriel · 59 days ago · Apr 17, 2026 · Diff

feat(mpack): true chunked HTTP/1.1 streaming for push_stream — eliminate b''.join bottleneck

- Add _open_chunked_connection() module-level function as the testable seam for http.client.HTTPConnection/HTTPSConnection (mirrors _open_url pattern) - Add _send_chunked_frame() and _send_terminal_chunk() helpers that encode each frame as '{size_hex}\r\n{data}\r\n' and '0\r\n\r\n' respectively - Refactor HttpTransport.push_stream to stream frames incrementally: · H frame built first; Authorization signed over H frame bytes only · O frames compressed and sent one at a time (peak memory O(1 object)) · Transfer-Encoding: chunked, no Content-Length, no b''.join · Server can validate auth + start writing objects while later frames arrive · Error handling via http.client.HTTPException / OSError (not urllib) · Connection always closed in finally block - MSign signing upgrade: Authorization covers H frame bytes (not full body) · H frame carries embedded Ed25519 over canonical intent · Content-addressed objects self-verify (sha256: prefix) · E frame counts cross-validate stream integrity - tests/test_mpack_chunked_push.py: 30 TDD tests covering Transfer-Encoding, no Content-Length, H-frame signing, per-frame send(), memory boundedness, HTTP vs HTTPS connection selection, connection lifecycle, R/X/P/4xx response - tests/test_mpack_transport.py: updated _capture_push_request helper to use _open_chunked_connection seam instead of _open_url

sha256:262a0a1858ebb8abcff6171d534916c898feb05d265ff3504681581f6eb6fe89 sha
sha256:54a3535088e54b87f0037440aa7a9327a1398975986dfaab373f7fc35313e527 snapshot

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:262a0a1858ebb8abcff6171d534916c898feb05d265ff3504681581f6eb6fe89 --body "your comment"