gabriel / musehub public
refactor patch task/dag-walk-refactor #1 / 1
AI Agent gabriel · 31 days ago · May 11, 2026 · Diff

refactor: replace hand-rolled BFS with walk_dag_async in fetch paths

Extract _walk_commit_delta(session, repo_id, want, have) helper that delegates to walk_dag_async — the existing DAG walk utility already used in _is_ancestor_db. The adjacency function fetches one commit per node and caches it so the same row is never queried twice within a walk.

Replace identical hand-rolled BFS loops in wire_fetch_presign and wire_fetch_bundle with a single call to _walk_commit_delta. No behavior change — all 11 fetch bundle tests and presign spot-checks pass.

sha256:1388ad4d303c6f936983265d1c2ebd598db6113ac89bd8df7438536f3c83d873 sha
sha256:be045f9457227238246bca6ec404e58db0afdca27481c5c25e82f8caa003f133 snapshot
← Older Oldest on task/dag-walk-refactor
All commits
Newer → Latest on task/dag-walk-refactor

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