gabriel / musehub public
feat patch task/fetch-bundle-route #1 / 1
AI Agent gabriel · 135 days ago · May 11, 2026 · Diff

feat: POST /fetch/bundle route — single-bundle fetch endpoint (issue #47)

Add fetch_bundle route to wire.py that calls wire_fetch_bundle and returns the msgpack FetchBundleResult. Handles auth identically to fetch/presign: public repos accessible without auth, private repos return 404 to guests.

5 TDD tests (RB0–RB4): 404 for missing repo, inline bundle response, sha256 proof end-to-end, private repo auth gate, empty want.

sha256:fbed59b8e2bcec2b49343a4a5ab80ef218110dd92a93a40286e3e04131748b6a sha
+24 ~15 symbols
sha256:bb39b47c665979f9a508afedacede93e3437ec8d624e3a343c32e7f5f54e9208 snapshot
+24
symbols added
~15
symbols modified
0
dead code introduced
Semantic Changes 39 symbols
~ tests/test_fetch_bundle_route.py .py 22 symbols added
+ _make_commit function async_function _make_commit L63–103
+ _now function function _now L32–33
+ _store_object function async_function _store_object L36–60
+ AsyncClient import import AsyncClient L18–18
+ AsyncSession import import AsyncSession L20–20
+ annotations import import annotations L12–12
+ blob_id import import blob_id L25–25
+ create_repo import import create_repo L27–27
+ datetime import import datetime L23–23
+ db import import db L26–26
+ fake_id import import fake_id L25–25
+ hashlib import import hashlib L14–14
+ msgpack import import msgpack L16–16
+ pg_insert import import pg_insert L19–19
+ pytest import import pytest L17–17
+ select import import select L21–21
+ timezone import import timezone L23–23
+ test_rb0_route_404_missing_repo function async_function test_rb0_route_404_missing_repo L111–118
+ test_rb1_small_public_repo_returns_inline_bundle function async_function test_rb1_small_public_repo_returns_inline_bundle L126–151
+ test_rb2_route_preserves_content_addressing_proof function async_function test_rb2_route_preserves_content_addressing_proof L159–185
+ test_rb3_private_repo_returns_404_without_auth function async_function test_rb3_private_repo_returns_404_without_auth L193–204
+ test_rb4_empty_want_returns_zero_counts function async_function test_rb4_empty_want_returns_zero_counts L212–229
← Older Oldest on task/fetch-bundle-route
All commits
Newer → Latest on task/fetch-bundle-route

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