gabriel / musehub public
feat patch task/phase1-commit-blobs #1 / 1
AI Agent gabriel · 126 days ago · May 10, 2026 · Diff

feat: Phase 1 — commit identity blobs stored in object store (content-addressing invariant)

Store the canonical identity payload (the bytes that produce commit_id via sha256) as a blob in MinIO for every new commit. The blob is PUT before the DB INSERT, so the content-addressing invariant holds: DB presence implies blob presence, identical to the guarantee already enforced for file blobs.

What the blob contains: - The six identity fields: sorted parent hex IDs, snapshot_id hex, message, committed_at, author, signer_public_key — null-byte separated. - Mutable annotations (agent_id, reviewed_by, test_runs, etc.) are DB-only; they cannot be part of a content-addressed blob because the commit_id is derived before they exist.

Test added: test_P1_commit_blobs_exist_in_object_store — red then green. Mock fixes: stub backends in test_wire_streaming_push / test_wire_push_plain now declare backend.put as AsyncMock. TestT5ServiceStream.stub_session now patches AsyncSessionLocal so unit tests survive the session-close/reopen that wire_push_stream performs before finalization.

sha256:9a7795bf7ea24307ab3e38adb57b5a220394e4b35fb0fa16b4cc8bd2d5a1fbbc sha
+28 ~5 symbols
sha256:68e582b01a83e3eb617501fa8dd07066c62b3276218639e25204040ce377cc9c snapshot
+28
symbols added
~5
symbols modified
0
dead code introduced
Semantic Changes 33 symbols
~ tests/test_push_commit_scale.py .py 25 symbols added
+ _collect function async_function _collect L99–103
+ _do_push function async_function _do_push L106–118
+ _fw variable variable _fw L41–41
+ _make_chain function function _make_chain L56–81
+ _pack function function _pack L48–49
+ _push_body function function _push_body L84–96
+ _wrap function function _wrap L52–53
+ AsyncIterator import import AsyncIterator L25–25
+ AsyncSession import import AsyncSession L29–29
+ MuseWireFrameWriter import import MuseWireFrameWriter L31–31
+ SFRAME_COMMIT_PACK import import SFRAME_COMMIT_PACK L33–33
+ SFRAME_END import import SFRAME_END L33–33
+ SFRAME_HEADER import import SFRAME_HEADER L33–33
+ SFRAME_OBJECT import import SFRAME_OBJECT L33–33
+ SFRAME_RESULT import import SFRAME_RESULT L33–33
+ annotations import import annotations L21–21
+ blob_id import import blob_id L32–32
+ msgpack import import msgpack L27–27
+ now_utc_iso import import now_utc_iso L32–32
+ pytest import import pytest L28–28
+ secrets import import secrets L23–23
+ time import import time L24–24
+ test_C1_500_commits_no_objects_under_5s function async_function test_C1_500_commits_no_objects_under_5s L126–156
+ test_C2_500_objects_4kb_under_5s function async_function test_C2_500_objects_4kb_under_5s L164–240
+ test_P1_commit_blobs_exist_in_object_store function async_function test_P1_commit_blobs_exist_in_object_store L248–278
~ musehub/services/musehub_wire.py .py 3 symbols added, 1 symbol modified
+ _COMMIT_ID_SEP variable variable _COMMIT_ID_SEP L131–131
+ _commit_identity_bytes function function _commit_identity_bytes L134–158
+ _compute_commit_id import import _compute_commit_id L70–70
← Older Oldest on task/phase1-commit-blobs
All commits
Newer → Latest on task/phase1-commit-blobs

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