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

fix(push/dry-run): remove c!=local_head filter so up-to-date dry-run reports 0 (muse#32)

When a sibling tracking ref equals local_head (e.g. local main is at the same commit as an already-pushed remote dev), the c!=local_head filter was incorrectly excluding local_head from the have set. walk_commits([D], have=[]) then walked the full history instead of pruning at D immediately.

Fix: drop the filter. walk_commits([local_head], have=[all_tracking_refs]) prunes local_head on entry when it appears in have_set, correctly reporting commits_sent=0 — matching the live path's up-to-date short-circuit.

This also covers re-push dry-runs: if staging/main already points at local_head, the result is now commits_sent=0 (correct) rather than over-counting.

Tests: RG_01 (red→green, 2 variants: local==remote, re-push), RG_02 (non-zero guard). Suite: 21/21 wire-marked tests green; 85/85 adjacent push corpus green.

sha256:6ec37c93009f7c30451ea8db62a0a1b764bb79fa93231b5506bb6855251b3e5d sha
+6 ~1 symbols
sha256:4207b465d36979b8346465b81d8957324dee989fe2ac541676780159576fb69d snapshot
+6
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 7 symbols
~ muse/cli/commands/push.py .py 1 symbol modified
~ run
+ TestRG01UpToDate class class TestRG01UpToDate L1003–1080
+ test_RG01_dry_run_zero_when_local_main_equals_remote_dev method method test_RG01_dry_run_zero_when_local_main_equals_remote_dev L1020–1053
+ test_RG01_dry_run_zero_when_main_tracking_ref_equals_local_head method method test_RG01_dry_run_zero_when_main_tracking_ref_equals_local_head L1055–1080
+ TestRG02NonZeroControl class class TestRG02NonZeroControl L1087–1150
+ test_RG02_single_new_commit_matches_DR01_result method method test_RG02_single_new_commit_matches_DR01_result L1131–1150
+ test_RG02_two_new_commits_counted_correctly method method test_RG02_two_new_commits_counted_correctly L1095–1129

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