gabriel / musehub public
feat BREAKING feat/repair-commit-endpoint #1 / 1
AI Agent gabriel · 20 hours ago · Jun 17, 2026 · Diff

feat: add repair-commit wire endpoint (API parity with repair-object/repair-snapshot)

Repairs commits whose stored row no longer reproduces its commit_id — e.g. commits the rc10 migration stamped with a signer_public_key without recomputing the id, so the serve-path hash check fails on clone and the commit (plus all descendants) is dropped. Mirrors repair-snapshot: validates hash_commit(fields)==commit_id (round- tripping committed_at through timestamp.isoformat() so the verified identity is the one re-served) before force-overwriting the row. Owner/write-only.

Validated on localhost end-to-end: push -> stamp spurious signer -> bust mpack cache -> broken clone (0/3) -> signed HTTP repair-commit -> bust cache -> clean clone (3/3).

sha256:3ff9c9863a9891bdcde71b4a43228f66d0493e38b7cc1d09fe9eb7de774046b2 sha
+35 ~46 symbols
974 changed · 974 in snapshot files
sha256:a260600d0f1e5493eaaaecfcf2fc0dcc000330ad1ceac98be224a98b444984ac snapshot
+35
symbols added
~46
symbols modified
974
files changed
974
files in snapshot
0
dead code introduced
Semantic Changes 81 symbols
~ tests/test_repair_commit_endpoint.py .py 29 symbols added
+ DB_URL variable variable DB_URL L47–47
+ HUB variable variable HUB L46–46
+ REPO_ROOT variable variable REPO_ROOT L48–48
+ SPURIOUS_SIGNER variable variable SPURIOUS_SIGNER L49–49
+ _capture_corrupt_repair function async_function _capture_corrupt_repair L96–138
+ _commit_id_by_message function function _commit_id_by_message L65–70
+ _good_commit_dict function function _good_commit_dict L78–93
+ _serve_hash function function _serve_hash L73–75
+ hub_repo function function hub_repo L142–151
+ AsyncSession import import AsyncSession L38–38
+ MusehubCommit import import MusehubCommit L42–42
+ Path import import Path L34–34
+ _commit_identity_bytes import import _commit_identity_bytes L44–44
+ _sa_text import import _sa_text L37–37
+ _time import import _time L33–33
+ _to_wire_commit import import _to_wire_commit L44–44
+ annotations import import annotations L27–27
+ asyncio import import asyncio L29–29
+ create_async_engine import import create_async_engine L38–38
+ hashlib import import hashlib L30–30
+ json import import json L31–31
+ long_id import import long_id L41–41
+ pytest import import pytest L36–36
+ sessionmaker import import sessionmaker L39–39
+ subprocess import import subprocess L32–32
+ wire_repair_commit import import wire_repair_commit L43–43
+ muse function function muse L52–55
+ muse_check function function muse_check L58–62
+ test_repair_commit_fixes_spurious_signer function function test_repair_commit_fixes_spurious_signer L154–183
~ musehub/services/musehub_wire_push.py .py 3 symbols added, 15 symbols modified
+ _commit_identity_bytes import import _commit_identity_bytes L41–41
+ long_id import import long_id L34–34
+ wire_repair_commit function async_function wire_repair_commit L232–321
~ logger
Files Changed
+974
974 in snapshot
+ .env.example .example
+ .museignore .museignore
+ CLAUDE.md .md
+ README.md .md
+ alembic.ini .ini
+ docs/ssl.md .md
+ musehub.db .db
+ musehub/py.typed .typed
+ package.json .json
+ pyproject.toml .toml
+ tsconfig.json .json
← Older Oldest on feat/repair-commit-endpoint
All commits
Newer → Latest on feat/repair-commit-endpoint

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