gabriel / musehub public
refactor BREAKING task/phase4-load-commit-walk #1 / 1
AI Agent gabriel · 121 days ago · May 9, 2026 · Diff

refactor: extract _load_commit_walk helper, dedup intel provider BFS (issue #40 phase 4)

Extract shared DB-fetch + walk_dag BFS body from the three intel providers into a single module-level helper _load_commit_walk(session, repo_id, ref, max_walk) -> list[str]. Each provider's compute now calls the helper instead of repeating the 15-line fetch+walk block.

Update P2-1 through P2-3 structural tests to accept either walk_dag or _load_commit_walk in the provider source (Phase 4 moved the walk into the helper, so the method itself no longer contains walk_dag directly).

Add 5 TDD tests (P4-1 through P4-3): 3 structural (one per provider) + 2 behavioural (BFS order and max_walk cap on _load_commit_walk). All 33 unit tests across phases 1-4 green.

sha256:40b051e70befc99fc8e2689162b63ac1aca0bc0129c18553d5530e50e9bd2eec sha
+14 ~9 symbols
sha256:7428db0bad38daa3e9b1468b60ead0ba1d9e43503e48c9df3ce58f2c4c4f38ba snapshot
+14
symbols added
~9
symbols modified
0
dead code introduced
Semantic Changes 23 symbols
+ _make_session function function _make_session L67–71
+ _row function function _row L63–64
+ AsyncMock import import AsyncMock L11–11
+ MagicMock import import MagicMock L11–11
+ SimpleNamespace import import SimpleNamespace L10–10
+ annotations import import annotations L7–7
+ inspect import import inspect L9–9
+ pytest import import pytest L13–13
+ test_p4_1_coupling_provider_delegates_to_load_commit_walk function function test_p4_1_coupling_provider_delegates_to_load_commit_walk L20–30
+ test_p4_1_entangle_provider_delegates_to_load_commit_walk function function test_p4_1_entangle_provider_delegates_to_load_commit_walk L33–43
+ test_p4_1_velocity_provider_delegates_to_load_commit_walk function function test_p4_1_velocity_provider_delegates_to_load_commit_walk L46–56
+ test_p4_2_load_commit_walk_bfs_order function async_function test_p4_2_load_commit_walk_bfs_order L79–99
+ test_p4_3_load_commit_walk_max_walk_cap function async_function test_p4_3_load_commit_walk_max_walk_cap L107–126
~ musehub/services/musehub_intel_providers.py .py 1 symbol added, 6 symbols modified
+ _load_commit_walk function async_function _load_commit_walk L453–487
← Older Oldest on task/phase4-load-commit-walk
All commits
Newer → Latest on task/phase4-load-commit-walk

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:40b051e70befc99fc8e2689162b63ac1aca0bc0129c18553d5530e50e9bd2eec --body "your comment"