gabriel / muse public
refactor BREAKING task/bridge-decomp-phase3 #1 / 1
AI Agent gabriel · 116 days ago · May 22, 2026 · Diff

refactor: extract git primitives to muse.core.bridge.git_primitives (issue #14 Phase 3)

Move GitCommitInfo/GitTagInfo TypedDicts, AttributionMapper, _CatFile, _git, _batch_commit_log, _batch_diff_tree, _is_lfs_pointer, ANSI helpers, _list_git_branches/_tags, and security validators out of bridge.py into a focused muse.core.bridge.git_primitives module. bridge.py drops from 3138 → 2355 lines. All 193 bridge tests green.

sha256:19ad48d4f3082eeede0e06028fa808440665df2899d4bcd3cc79b8221b2b8ca0 sha
+57 −28 symbols
sha256:44833369ee8d726de72c2e8172fc87e826acd7ba3416b93d3ba72ea90bcbafaa snapshot
+57
symbols added
−28
symbols removed
0
dead code introduced
Semantic Changes 85 symbols
~ muse/core/bridge/git_primitives.py .py 36 symbols added
+ AttributionMapper class class AttributionMapper L172–222 ← moved from muse/cli/commands/bridge.py
+ __init__ method method __init__ L188–202 ← moved from muse/cli/commands/bridge.py
+ get_handle method method get_handle L204–222 ← moved from muse/cli/commands/bridge.py
+ GitCommitInfo class class GitCommitInfo L40–50 ← moved from muse/cli/commands/bridge.py
+ GitTagInfo class class GitTagInfo L53–58 ← moved from muse/cli/commands/bridge.py
+ _ANSI_ESCAPE_RE variable variable _ANSI_ESCAPE_RE L500–500 ← moved from muse/cli/commands/bridge.py
+ _BRANCH_SAFE_RE variable variable _BRANCH_SAFE_RE L129–129 ← moved from muse/cli/commands/bridge.py
+ _BRANCH_UNSAFE_CHARS_RE variable variable _BRANCH_UNSAFE_CHARS_RE L135–135 ← moved from muse/cli/commands/bridge.py
+ _CatFile class class _CatFile L229–309 ← moved from muse/cli/commands/bridge.py
+ __enter__ method method __enter__ L305–306 ← moved from muse/cli/commands/bridge.py
+ __exit__ method method __exit__ L308–309 ← moved from muse/cli/commands/bridge.py
+ __init__ method method __init__ L248–254 ← moved from muse/cli/commands/bridge.py
+ close method method close L296–303 ← moved from muse/cli/commands/bridge.py
+ read method method read L256–294 ← moved from muse/cli/commands/bridge.py
+ _DEFAULT_EXCLUDE_PREFIXES variable variable _DEFAULT_EXCLUDE_PREFIXES L65–77 ← moved from muse/cli/commands/bridge.py
+ _DEFAULT_EXCLUDE_SUFFIXES variable variable _DEFAULT_EXCLUDE_SUFFIXES L79–94 ← moved from muse/cli/commands/bridge.py
+ _GIT_SHA_RE variable variable _GIT_SHA_RE L132–132 ← moved from muse/cli/commands/bridge.py
+ _batch_commit_log function function _batch_commit_log L335–392 ← moved from muse/cli/commands/bridge.py
+ _batch_diff_tree function function _batch_diff_tree L395–478 ← moved from muse/cli/commands/bridge.py
+ _git function function _git L316–332 ← moved from muse/cli/commands/bridge.py
+ _is_lfs_pointer function function _is_lfs_pointer L485–497 ← moved from muse/cli/commands/bridge.py
+ _list_git_branches function function _list_git_branches L538–551 ← moved from muse/cli/commands/bridge.py
+ _list_git_tags function function _list_git_tags L554–584 ← moved from muse/cli/commands/bridge.py
+ _parse_sem_ver_bump function function _parse_sem_ver_bump L508–531
+ _should_exclude function function _should_exclude L97–122 ← moved from muse/cli/commands/bridge.py
+ _strip_ansi function function _strip_ansi L503–505 ← moved from muse/cli/commands/bridge.py
+ _validate_git_branch_name function function _validate_git_branch_name L150–165 ← moved from muse/cli/commands/bridge.py
+ _validate_git_sha function function _validate_git_sha L138–147 ← moved from muse/cli/commands/bridge.py
+ FileDiffTree import import FileDiffTree L32–32
+ TypedDict import import TypedDict L30–30
+ annotations import import annotations L24–24
+ hashlib import import hashlib L26–26
+ load_json_file import import load_json_file L33–33
+ pathlib import import pathlib L27–27
+ re import import re L28–28
+ subprocess import import subprocess L29–29
~ muse/cli/commands/bridge.py .py 21 symbols added, 28 symbols removed
AttributionMapper class class AttributionMapper L169–220 → moved to muse/core/bridge/git_primitives.py
__init__ method method __init__ L185–200 → moved to muse/core/bridge/git_primitives.py
get_handle method method get_handle L202–220 → moved to muse/core/bridge/git_primitives.py
GitCommitInfo class class GitCommitInfo L86–96 → moved to muse/core/bridge/git_primitives.py
GitTagInfo class class GitTagInfo L99–104 → moved to muse/core/bridge/git_primitives.py
_ANSI_ESCAPE_RE variable variable _ANSI_ESCAPE_RE L486–486 → moved to muse/core/bridge/git_primitives.py
_BRANCH_SAFE_RE variable variable _BRANCH_SAFE_RE L1635–1635 → moved to muse/core/bridge/git_primitives.py
_BRANCH_UNSAFE_CHARS_RE variable variable _BRANCH_UNSAFE_CHARS_RE L1641–1641 → moved to muse/core/bridge/git_primitives.py
_CatFile class class _CatFile L222–302 → moved to muse/core/bridge/git_primitives.py
__enter__ method method __enter__ L298–299 → moved to muse/core/bridge/git_primitives.py
__exit__ method method __exit__ L301–302 → moved to muse/core/bridge/git_primitives.py
__init__ method method __init__ L241–247 → moved to muse/core/bridge/git_primitives.py
close method method close L289–296 → moved to muse/core/bridge/git_primitives.py
read method method read L249–287 → moved to muse/core/bridge/git_primitives.py
_DEFAULT_EXCLUDE_PREFIXES variable variable _DEFAULT_EXCLUDE_PREFIXES L111–123 → moved to muse/core/bridge/git_primitives.py
_DEFAULT_EXCLUDE_SUFFIXES variable variable _DEFAULT_EXCLUDE_SUFFIXES L125–140 → moved to muse/core/bridge/git_primitives.py
_GIT_SHA_RE variable variable _GIT_SHA_RE L1638–1638 → moved to muse/core/bridge/git_primitives.py
_batch_commit_log function function _batch_commit_log L322–380 → moved to muse/core/bridge/git_primitives.py
_batch_diff_tree function function _batch_diff_tree L382–470 → moved to muse/core/bridge/git_primitives.py
_git function function _git L304–320 → moved to muse/core/bridge/git_primitives.py
_is_lfs_pointer function function _is_lfs_pointer L472–484 → moved to muse/core/bridge/git_primitives.py
_list_git_branches function function _list_git_branches L848–861 → moved to muse/core/bridge/git_primitives.py
_list_git_tags function function _list_git_tags L863–893 → moved to muse/core/bridge/git_primitives.py
_parse_sem_ver_bump function function _parse_sem_ver_bump L492–516
_should_exclude function function _should_exclude L142–167 → moved to muse/core/bridge/git_primitives.py
_strip_ansi function function _strip_ansi L488–490 → moved to muse/core/bridge/git_primitives.py
_validate_git_branch_name function function _validate_git_branch_name L1654–1670 → moved to muse/core/bridge/git_primitives.py
_validate_git_sha function function _validate_git_sha L1643–1652 → moved to muse/core/bridge/git_primitives.py
+ AttributionMapper import import AttributionMapper L51–51
+ GitCommitInfo import import GitCommitInfo L51–51
+ GitTagInfo import import GitTagInfo L51–51
+ _ANSI_ESCAPE_RE import import _ANSI_ESCAPE_RE L51–51
+ _BRANCH_SAFE_RE import import _BRANCH_SAFE_RE L51–51
+ _BRANCH_UNSAFE_CHARS_RE import import _BRANCH_UNSAFE_CHARS_RE L51–51
+ _CatFile import import _CatFile L51–51
+ _DEFAULT_EXCLUDE_PREFIXES import import _DEFAULT_EXCLUDE_PREFIXES L51–51
+ _DEFAULT_EXCLUDE_SUFFIXES import import _DEFAULT_EXCLUDE_SUFFIXES L51–51
+ _GIT_SHA_RE import import _GIT_SHA_RE L51–51
+ _batch_commit_log import import _batch_commit_log L51–51
+ _batch_diff_tree import import _batch_diff_tree L51–51
+ _git import import _git L51–51
+ _is_lfs_pointer import import _is_lfs_pointer L51–51
+ _list_git_branches import import _list_git_branches L51–51
+ _list_git_tags import import _list_git_tags L51–51
+ _parse_sem_ver_bump import import _parse_sem_ver_bump L51–51
+ _should_exclude import import _should_exclude L51–51
+ _strip_ansi import import _strip_ansi L51–51
+ _validate_git_branch_name import import _validate_git_branch_name L51–51
+ _validate_git_sha import import _validate_git_sha L51–51
← Older Oldest on task/bridge-decomp-phase3
All commits
Newer → Latest on task/bridge-decomp-phase3

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