gabriel / musehub public
feat BREAKING bundle dev
AI Agent gabriel · 124 days ago · May 11, 2026 · Diff

feat(bundle): Phase 2 fetch readiness — content_cache on sync path for small bundles

- wire_push_unpack_bundle parses small bundles (≤ bundle_content_cache_max_bytes, default 4 MB) inline and writes musehub_objects with content_cache=raw_bytes, storage_uri='pending'. Fetch requests are served immediately from content_cache without waiting for the background job. - Large bundles (> threshold) skip inline write — sync path stays fast (pure 3-step path). - process_bundle_index_job promoted from ON CONFLICT DO NOTHING → ON CONFLICT DO UPDATE to clear content_cache and set real s3:// storage_uri when promoting pending objects. - Settings: bundle_content_cache_max_bytes (4 MB default) controls threshold. - TDD: test_bundle_fetch_readiness.py — 3 tests covering fetch-before-job, cache-cleared-after-job, large-bundle-skips-cache. Updated test_unpack_bundle_skips_msgpack.py to test the large-bundle path (threshold=0) which must remain parse-free.

sha256:34bd73ad6978c5eef464d5d61fba07ee21487fcabe986069bbcaf6c1b6f48343 sha
+41 ~4 symbols
sha256:5126aa2e2fd7168a4caf9104b876b3eee1a494fc079722c8cd5a41a327c6e9c3 snapshot
+41
symbols added
~4
symbols modified
0
dead code introduced
Semantic Changes 45 symbols
~ tests/test_bundle_fetch_readiness.py .py 41 symbols added
+ _AUTH_CTX variable variable _AUTH_CTX L47–52
+ _BLOB_SIZE variable variable _BLOB_SIZE L58–58
+ _FILES_CHANGED variable variable _FILES_CHANGED L57–57
+ _N_COMMITS variable variable _N_COMMITS L56–56
+ _N_FILES variable variable _N_FILES L55–55
+ _make_small_repo function function _make_small_repo L93–151
+ _push_bundle function async_function _push_bundle L154–200
+ client function async_function client L64–78
+ ASGITransport import import ASGITransport L23–23
+ AsyncClient import import AsyncClient L23–23
+ AsyncSession import import AsyncSession L25–25
+ CommitRecord import import CommitRecord L37–37
+ MSignContext import import MSignContext L28–28
+ SnapshotRecord import import SnapshotRecord L37–37
+ annotations import import annotations L14–14
+ app import import app L31–31
+ blob_id import import blob_id L44–44
+ build_mpack import import build_mpack L34–34
+ compute_commit_id import import compute_commit_id L36–36
+ compute_snapshot_id import import compute_snapshot_id L36–36
+ datetime import import datetime L16–16
+ db import import db L29–29
+ get_db import import get_db L30–30
+ hashlib import import hashlib L17–17
+ msgpack import import msgpack L20–20
+ muse_dir import import muse_dir L35–35
+ optional_signed_request import import optional_signed_request L28–28
+ patch import import patch L26–26
+ pathlib import import pathlib L18–18
+ pytest import import pytest L21–21
+ pytest_asyncio import import pytest_asyncio L22–22
+ require_signed_request import import require_signed_request L28–28
+ select import import select L24–24
+ write_branch_ref import import write_branch_ref L37–37
+ write_commit import import write_commit L37–37
+ write_object import import write_object L33–33
+ write_snapshot import import write_snapshot L37–37
+ repo function async_function repo L82–90
+ test_content_cache_cleared_after_job function async_function test_content_cache_cleared_after_job L247–306
+ test_fetch_object_before_worker_returns_bytes function async_function test_fetch_object_before_worker_returns_bytes L206–243
+ test_large_bundle_skips_content_cache function async_function test_large_bundle_skips_content_cache L310–347
~ musehub/config.py .py 1 symbol modified
← Older Oldest on dev
All commits
Newer → Latest on dev

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