gabriel / muse public
fix patch dev
AI Agent gabriel · 127 days ago · May 8, 2026 · Diff

fix: anonymous commits — merge/revert/cherry-pick/rebase now carry author attribution

merge and revert read user.handle from config via get_config_value and pass it as author to both compute_commit_id and CommitRecord so the hash covers the same field that is stored.

cherry-pick preserves the original commit's author (target.author) rather than leaving it empty — the cherry-picker replays someone else's work, so authorship should reflect the original writer.

rebase --squash preserves the author of the first squashed commit (commits_to_replay[0].author), mirroring git squash semantics.

Fixes the wrong import path muse.core.provenance → muse.core.validation for sanitize_provenance in merge.py and revert.py.

Tests: tests/test_anon_commit_bug.py (A1–A4, all GREEN).

sha256:65dc6bd30d316b90611841bab2c4d18e2167b605e9d6700015b579c5aba099b6 sha
+30 ~4 symbols
sha256:06c5eb5b5c2fa1f14c30ede198bac9c9485ac2f30d0c5b812771d3c3dcd55126 snapshot
+30
symbols added
~4
symbols modified
0
dead code introduced
Semantic Changes 34 symbols
~ tests/test_anon_commit_bug.py .py 26 symbols added
+ _HANDLE variable variable _HANDLE L41–41
+ _HUB_URL variable variable _HUB_URL L73–73
+ _env function function _env L48–49
+ _head_commit function function _head_commit L144–147
+ _init_repo function function _init_repo L52–67
+ _make_commit function function _make_commit L97–133
+ _set_user_handle function function _set_user_handle L76–94
+ _write_object function function _write_object L136–141
+ cli variable variable cli L38–38
+ CliRunner import import CliRunner L33–33
+ annotations import import annotations L26–26
+ blob_id import import blob_id L35–35
+ datetime import import datetime L28–28
+ fake_id import import fake_id L35–35
+ heads_dir import import heads_dir L34–34
+ json import import json L29–29
+ muse_dir import import muse_dir L34–34
+ object_path import import object_path L36–36
+ pathlib import import pathlib L30–30
+ pytest import import pytest L32–32
+ ref_path import import ref_path L34–34
+ runner variable variable runner L39–39
+ test_a1_merge_commit_has_author function function test_a1_merge_commit_has_author L154–184
+ test_a2_revert_commit_has_author function function test_a2_revert_commit_has_author L191–212
+ test_a3_cherry_pick_preserves_original_author function function test_a3_cherry_pick_preserves_original_author L219–253
+ test_a4_squash_rebase_preserves_first_commit_author function function test_a4_squash_rebase_preserves_first_commit_author L260–307
~ muse/cli/commands/cherry_pick.py .py 1 symbol modified
~ run
~ muse/cli/commands/merge.py .py 2 symbols added, 1 symbol modified
+ get_config_value import import get_config_value L76–76
+ sanitize_provenance import import sanitize_provenance L77–77
~ muse/cli/commands/rebase.py .py 1 symbol modified
~ run
~ muse/cli/commands/revert.py .py 2 symbols added, 1 symbol modified
+ get_config_value import import get_config_value L82–82
+ sanitize_provenance import import sanitize_provenance L83–83
~ run
← Older Oldest on dev
All commits
Newer → Latest on dev

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