gabriel / musehub public
feat patch commit-graph dev #91 / 100
AI Agent gabriel · 29 days ago · May 15, 2026 · Diff

feat(commit-graph): Phase 2 — MusehubCommitGraph model, migration, bulk DAG walk

- Add MusehubCommitGraph ORM model (repo_id, commit_id, parent_ids, generation, snapshot_id) with PK (repo_id, commit_id) and index (repo_id, generation) - Add alembic migration 0060_commit_graph (down_revision=0059) - process_bundle_index_job writes graph rows in topological order; generation = max(parent generations) + 1, root = 0 - _walk_commit_delta fast path: 2 queries (max_gen bounds) + 1 range scan + in-memory BFS = O(1 query per BFS level) regardless of chain length Falls back to legacy session.get() path when repo_id is absent - wire_fetch_bundle / wire_fetch_presign updated to bulk-fetch MusehubCommit rows separately for wire serialization (outside walk timing) - Add TDD tests CG-1..4 (test_commit_graph_phase2.py) — all 4 green CG-3: 1000 commits walks in 20ms (gate: 50ms)

Issue #63 Phase 2 complete.

sha256:8c5ac08973d96bb7bceb23153cd110a8ed0a0f9f6edbfb081e0dc9300b6d14ad sha
sha256:06b46b7bca812fb1d1237fcb19c63d10582ee96cc96f1276617c66e556281c2c snapshot

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