gabriel / musehub public
feat patch task/wire-fetch-step1 #1 / 1
AI Agent gabriel · 118 days ago · May 16, 2026 · Diff

feat: POST /{owner}/{slug}/fetch — wire fetch protocol step 1 (issue #68)

- Add wire_fetch() service function: DAG walk, object delta, presigned mpack URL - Add POST /{owner}/{slug}/fetch route: 200/422/404/503 per protocol pseudocode - Add FetchResult TypedDict, FetchCommitNotFound, FetchNotReady exceptions - Fix WireCommit serialization: .model_dump() before msgpack.packb - Add test_wire_fetch_step1.py: 10 TDD tests all green (F01–F10)

sha256:c763733e98504ba53ad394dcce33375795ae9e254f0e2de0e00a49ec3d171aea sha
+46 ~9 symbols
sha256:379bc2cb7133a0821a83d4ea7d024674d6e767b52cb8b30f8dbea2e4a4009993 snapshot
+46
symbols added
~9
symbols modified
0
dead code introduced
Semantic Changes 55 symbols
~ tests/test_wire_fetch_step1.py .py 37 symbols added
+ _fetch function function _fetch L177–190
+ _make_commit function async_function _make_commit L114–174
+ _now function function _now L53–54
+ _store_object function async_function _store_object L84–111
+ _stub_backend function function _stub_backend L57–81
+ AsyncClient import import AsyncClient L32–32
+ AsyncMock import import AsyncMock L28–28
+ AsyncSession import import AsyncSession L34–34
+ MusehubBranch import import MusehubBranch L37–37
+ MusehubCommit import import MusehubCommit L37–37
+ MusehubCommitGraph import import MusehubCommitGraph L37–37
+ MusehubCommitRef import import MusehubCommitRef L37–37
+ MusehubMPackIndex import import MusehubMPackIndex L37–37
+ MusehubObject import import MusehubObject L37–37
+ MusehubObjectRef import import MusehubObjectRef L37–37
+ MusehubSnapshot import import MusehubSnapshot L37–37
+ MusehubSnapshotRef import import MusehubSnapshotRef L37–37
+ annotations import import annotations L24–24
+ blob_id import import blob_id L36–36
+ create_repo import import create_repo L48–48
+ datetime import import datetime L27–27
+ fake_id import import fake_id L36–36
+ hashlib import import hashlib L26–26
+ msgpack import import msgpack L30–30
+ pg_insert import import pg_insert L33–33
+ pytest import import pytest L31–31
+ timezone import import timezone L27–27
+ test_f01_happy_path_returns_presigned_url function async_function test_f01_happy_path_returns_presigned_url L198–217
+ test_f02_up_to_date_returns_zero_counts function async_function test_f02_up_to_date_returns_zero_counts L225–244
+ test_f03_delta_excludes_have_side_objects function async_function test_f03_delta_excludes_have_side_objects L252–288
+ test_f04_missing_repo_returns_404 function async_function test_f04_missing_repo_returns_404 L296–302
+ test_f05_empty_want_returns_422 function async_function test_f05_empty_want_returns_422 L310–316
+ test_f06_malformed_want_entry_returns_422 function async_function test_f06_malformed_want_entry_returns_422 L324–330
+ test_f07_unknown_want_commit_returns_404 function async_function test_f07_unknown_want_commit_returns_404 L338–345
+ test_f08_unindexed_objects_returns_503 function async_function test_f08_unindexed_objects_returns_503 L353–378
+ test_f09_private_repo_without_auth_returns_404 function async_function test_f09_private_repo_without_auth_returns_404 L386–393
+ test_f10_mpack_id_equals_sha256_of_stored_bytes function async_function test_f10_mpack_id_equals_sha256_of_stored_bytes L401–428
~ musehub/api/routes/wire.py .py 5 symbols added, 9 symbols modified
+ fetch function async_function fetch L530–575
+ FetchCommitNotFound import import FetchCommitNotFound L42–42
+ FetchNotReady import import FetchNotReady L42–42
+ MPackValidationError import import MPackValidationError L42–42
+ wire_fetch import import wire_fetch L42–42
~ musehub/services/musehub_wire.py .py 4 symbols added
+ FetchCommitNotFound class class FetchCommitNotFound L2302–2303
+ FetchNotReady class class FetchNotReady L2306–2307
+ FetchResult class class FetchResult L2150–2154
+ wire_fetch function async_function wire_fetch L2157–2299
← Older Oldest on task/wire-fetch-step1
All commits
Newer → Latest on task/wire-fetch-step1

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