gabriel / musehub public
refactor BREAKING task/grpc-only-wire #2 / 2
AI Agent gabriel · 155 days ago · Apr 23, 2026 · Diff

refactor: enforce gRPC framing on all MWP wire traffic

- Delete STREAM_MIME_TYPE from models/wire.py — application/grpc+muse is the single wire Content-Type for all push and fetch endpoints - musehub_wire.py: import grpc_frame; _sp() and wire_fetch_stream local _pack() now wrap every response frame in grpc_frame() before yielding - routes/wire.py: push response Content-Type → GRPC_CONTENT_TYPE; fetch route strips 5-byte gRPC prefix before msgpack decode; response media_type → GRPC_CONTENT_TYPE - Tests: STREAM_MIME_TYPE → GRPC_CONTENT_TYPE throughout; _unpack_all rewritten to handle gRPC-wrapped msgpack response frames; test_wire_ streaming_push _wrap() adds grpc_frame(); test_background_jobs adds _wrap() helper; GrpcFrameReader used where raw msgpack.Unpacker was

sha256:9590cee1e0ccd6c76528f005b95d634d80f5019f0dcb7c371e149adc31d1fb65 sha
+10 ~41 −4 symbols
580 changed · 580 in snapshot files
sha256:6cbdb8779a5861879d5eb9b76df31485534a1d8ed16dcd80706b7fc3b3500cb5 snapshot
+10
symbols added
~41
symbols modified
−4
symbols removed
580
files changed
580
files in snapshot
0
dead code introduced
Semantic Changes 55 symbols
~ musehub/api/routes/wire.py .py 1 symbol added, 1 symbol removed, 4 symbols modified
− STREAM_MIME_TYPE import import STREAM_MIME_TYPE L39–39
+ GRPC_CONTENT_TYPE import import GRPC_CONTENT_TYPE L39–39
~ musehub/models/wire.py .py 1 symbol removed
− STREAM_MIME_TYPE variable variable STREAM_MIME_TYPE L375–375
~ musehub/services/musehub_wire.py .py 1 symbol added, 3 symbols modified
+ _grpc_frame import import _grpc_frame L1354–1354
~ _sp
~ tests/test_background_jobs.py .py 4 symbols added, 1 symbol modified
+ _fw variable variable _fw L32–32
+ _wrap function function _wrap L43–44
+ MuseWireFrameWriter import import MuseWireFrameWriter L21–21
+ grpc_frame import import grpc_frame L21–21
~ tests/test_wire_streaming_push.py .py 3 symbols added, 1 symbol removed, 8 symbols modified
− STREAM_MIME_TYPE import import STREAM_MIME_TYPE L28–28
+ GRPC_CONTENT_TYPE import import GRPC_CONTENT_TYPE L34–34
+ GrpcFrameReader import import GrpcFrameReader L34–34
+ grpc_frame import import grpc_frame L34–34
~ _wrap
Files Changed
+580
580 in snapshot
+ .env.example .example
+ .museignore .museignore
+ CLAUDE.md .md
+ README.md .md
+ alembic.ini .ini
+ musehub.db .db
+ musehub/py.typed .typed
+ package.json .json
+ pyproject.toml .toml
+ tsconfig.json .json

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:9590cee1e0ccd6c76528f005b95d634d80f5019f0dcb7c371e149adc31d1fb65 --body "your comment"