gabriel / musehub public
test patch mwp-2 task/mwp-2-walk-fallback #3 / 6
AI Agent gabriel · 27 days ago · Jun 29, 2026 · Diff

test(mwp-2): phase 3 bounded fallback + 5k stress (MWP2_10, MWP2_11)

- Switch Kahn's topo-sort queue from list.pop(0) to collections.deque.popleft() so O(n) holds for all graph shapes, not just linear chains. - MWP2_10: verify max_nodes=100_000 kwarg reaches walk_dag_async (patch.object capture); verify WARNING fires when reachable hits the cap (mock yields 100k). - MWP2_11: 5,000-commit linear chain, no graph rows, forces full DAG fallback; asserts all 5,000 returned in parents-first topo order; flush (no commit) keeps SQLAlchemy identity map warm for O(1) adjacency calls. 21 tests GREEN (8 MWP2 + 13 MWP1), no regressions.

sha256:1280ec7c64fed820c8a862f23e64707df980b19e5a63ca0fee14acf7ee1b86d9 sha
+26 ~1 symbols
sha256:2527dd0d10427ade85990a409e7adf6450dfacd3a42c1a4230b6180f54829a94 snapshot
+26
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 27 symbols
~ docs/issues/mwp-2-walk-fallback.md .md 23 symbols added
+ MWP-2 — Correctness fallback for _walk_commit_delta (fixes RC-2) section MWP-2 — Correctness fallback for _walk_commit_delta (fixes RC-2) L1–308
+ Acceptance criteria section Acceptance criteria L265–279
+ Anchors section Anchors L298–308
+ Background section Background L8–79
+ The bug (RC-2) section The bug (RC-2) L24–57
+ Why MWP-1 is necessary but not sufficient section Why MWP-1 is necessary but not sufficient L57–79
+ Design section Design L94–178
+ Detection — free in the common case section Detection — free in the common case L96–124
+ code[python] variable variable code[python] L101–114
+ Fallback — authoritative DAG walk section Fallback — authoritative DAG walk L124–158
+ code[python] variable variable code[python] L129–137
+ Interaction with MWP-1's [MWP1_13] guard section Interaction with MWP-1's [MWP1_13] guard L166–178
+ Why detection lives inside _walk_commit_delta, not in wire_fetch_mpack section Why detection lives inside _walk_commit_delta, not in wire_fetch_mpack L158–166
+ Goal section Goal L79–94
+ Out of scope section Out of scope L289–298
+ Phases (load-bearing; each green before the next) section Phases (load-bearing; each green before the next) L178–265
+ Phase 0 — Reproduce (red) ✅ COMPLETE section Phase 0 — Reproduce (red) ✅ COMPLETE L180–196
+ Phase 1 — Promote the DAG walk to a tested helper ✅ COMPLETE section Phase 1 — Promote the DAG walk to a tested helper ✅ COMPLETE L196–213
+ Phase 2 — Wire detection + automatic fallback ✅ COMPLETE section Phase 2 — Wire detection + automatic fallback ✅ COMPLETE L213–231
+ Phase 3 — Bounded fallback + stress ✅ COMPLETE section Phase 3 — Bounded fallback + stress ✅ COMPLETE L231–253
+ Phase 4 — End-to-end regression (the acceptance gate) section Phase 4 — End-to-end regression (the acceptance gate) L253–265
+ Testing tiers section Testing tiers L279–289
+ table section table L281–288
~ musehub/services/musehub_wire_fetch.py .py 1 symbol added, 1 symbol modified
+ deque import import deque L8–8
~ tests/test_mwp2_walk_fallback.py .py 2 symbols added
+ test_mwp2_10_max_nodes_bound_is_wired function async_function test_mwp2_10_max_nodes_bound_is_wired L455–524
+ test_mwp2_11_stress_5000_commit_linear_chain function async_function test_mwp2_11_stress_5000_commit_linear_chain L533–594

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:1280ec7c64fed820c8a862f23e64707df980b19e5a63ca0fee14acf7ee1b86d9 --body "your comment"