gabriel / muse public
fix patch push/dry-run task/mwp-7-sibling-negotiation #3 / 5
AI Agent gabriel · 21 days ago · Jun 29, 2026 · Diff

fix(push/dry-run): align --dry-run commit walk to live have-negotiation (muse#32)

Use _all_known_have_anchors for the commit walk boundary in dry-run mode, matching the live path which reads ALL remote branch heads after GET /refs. Previously, dry-run used only get_remote_head(remote, push_branch) — a single-branch tip that ignored sibling refs, causing over-counting when a sibling branch had already been pushed.

After this change, both dry_commits and dry_objects derive from the same `have` set. Dry-run counts equal the live push when tracking refs are fresh (after muse fetch).

Tests: DR_01 (red→green, 2 variants), DR_02 (object parity, 2 variants). Adjacent corpus: 85 passed, 0 regressions.

sha256:dce546e01303125e7a80339e86a843aa90c41117ba84bcb7c6c99fac9d92729e sha
+11 ~2 symbols
sha256:8cbb263328b17f90b42eb0666d255f181d325b8fb1452e46b193ff34e80b1cac snapshot
+11
symbols added
~2
symbols modified
0
dead code introduced
Semantic Changes 13 symbols
~ muse/cli/commands/push.py .py 1 symbol modified
~ run
~ tests/test_mwp7_sibling_negotiation.py .py 11 symbols added, 1 symbol modified
+ TestDR01DryRunCommitCount class class TestDR01DryRunCommitCount L852–929
+ test_DR01_dry_run_overcounts_when_main_not_yet_pushed method method test_DR01_dry_run_overcounts_when_main_not_yet_pushed L867–900
+ test_DR01_large_chain_mirrors_incident_report method method test_DR01_large_chain_mirrors_incident_report L902–929
+ TestDR02ObjectsSent class class TestDR02ObjectsSent L936–996
+ test_DR02_objects_sent_matches_live_merge_with_one_blob method method test_DR02_objects_sent_matches_live_merge_with_one_blob L947–972
+ test_DR02_objects_sent_zero_for_pure_merge method method test_DR02_objects_sent_zero_for_pure_merge L974–996
+ _run_dry_push function function _run_dry_push L332–353
+ _write_tracking_ref function function _write_tracking_ref L320–329
+ io import import io L39–39
+ json import import json L40–40
+ redirect_stdout import import redirect_stdout L42–42

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