gabriel / muse public
refactor BREAKING bridge task/bridge-issue14-sweep #1 / 1
AI Agent gabriel · 113 days ago · May 22, 2026 · Diff

refactor(bridge): comprehensive spec sweep — close all issue #14 gaps

Fixes all spec violations found in post-completion sweep:

bridge.py — 375 → 74 lines, zero re-exports, argparse-only - Move _register_git_import, _register_git_export, _register_git_status to their canonical submodules (importer, exporter, status) - bridge.py now delegates to _register_*_parser() helpers and imports nothing from the domain layer

muse/core/bridge/__init__.py — add full public API re-export - All symbols tests might import from the package now accessible via muse.core.bridge directly (per Phase 8 spec)

git_primitives.py — fix circular import violation - FileDiffTree = dict[str, str | None] defined here, not in state.py - state.py no longer carries a type that belongs to the git layer - Upholds 'git_primitives has no Muse domain knowledge' invariant

All test imports updated: zero imports from muse.cli.commands.bridge - Every test now imports from the canonical muse.core.bridge.* path - No backward-compat shims; the old path is the thin CLI shell only

277/277 tests pass.

sha256:51116ec824246acde6abf729e6ba854c223dc5173eff31a645520208023b0652 sha
+35 ~121 −31 symbols
sha256:719041cabcaf89a76d45aea88d6c44564c1064167325c5f3af1b8abdb5524b79 snapshot
+35
symbols added
~121
symbols modified
−31
symbols removed
0
dead code introduced
Semantic Changes 187 symbols
~ muse/cli/commands/bridge.py .py 3 symbols added, 29 symbols removed, 1 symbol modified
_register_git_export function function _register_git_export L236–348
_register_git_import function function _register_git_import L88–234
_register_git_status function function _register_git_status L350–375
AttributionMapper import import AttributionMapper L42–42
BridgeHook import import BridgeHook L57–57
BridgeHooks import import BridgeHooks L57–57
BridgeState import import BridgeState L59–59
GitExporter import import GitExporter L41–41
_CatFile import import _CatFile L42–42
_batch_commit_log import import _batch_commit_log L42–42
_git import import _git L42–42
_replay_branch import import _replay_branch L58–58
_replay_commit import import _replay_commit L58–58
_should_exclude import import _should_exclude L42–42
_validate_git_branch_name import import _validate_git_branch_name L42–42
_validate_git_sha import import _validate_git_sha L42–42
_watch_loop import import _watch_loop L41–41
export_harmony_to_rerere import import export_harmony_to_rerere L51–51
export_shelves_to_stash import import export_shelves_to_stash L51–51
import_rerere_to_harmony import import import_rerere_to_harmony L51–51
import_stashes_to_shelf import import import_stashes_to_shelf L51–51 → moved to muse/core/bridge/__init__.py
load_bridge_hooks import import load_bridge_hooks L57–57
read_bridge_state import import read_bridge_state L59–59
run_git_export import import run_git_export L41–41 → moved to muse/core/bridge/__init__.py
run_git_import import import run_git_import L58–58 → moved to muse/core/bridge/__init__.py
run_git_status import import run_git_status L60–60 → moved to muse/core/bridge/__init__.py
run_hook import import run_hook L57–57
run_hooks import import run_hooks L57–57 → moved to muse/core/bridge/__init__.py
write_bridge_state import import write_bridge_state L59–59 → moved to muse/core/bridge/__init__.py
+ _register_git_export_parser import import _register_git_export_parser L50–50
+ _register_git_import_parser import import _register_git_import_parser L51–51
+ _register_git_status_parser import import _register_git_status_parser L52–52
~ muse/core/bridge/__init__.py .py 28 symbols added
+ __all__ variable variable __all__ L33–68
+ AttributionMapper import import AttributionMapper L12–12
+ BridgeHook import import BridgeHook L28–28
+ BridgeHooks import import BridgeHooks L28–28
+ BridgeState import import BridgeState L30–30
+ FileDiffTree import import FileDiffTree L12–12
+ GitExporter import import GitExporter L11–11
+ _CatFile import import _CatFile L12–12
+ _batch_commit_log import import _batch_commit_log L12–12
+ _git import import _git L12–12
+ _replay_branch import import _replay_branch L29–29
+ _replay_commit import import _replay_commit L29–29
+ _should_exclude import import _should_exclude L12–12
+ _validate_git_branch_name import import _validate_git_branch_name L12–12
+ _validate_git_sha import import _validate_git_sha L12–12
+ _watch_loop import import _watch_loop L11–11
+ export_harmony_to_rerere import import export_harmony_to_rerere L22–22
+ export_shelves_to_stash import import export_shelves_to_stash L22–22
+ import_rerere_to_harmony import import import_rerere_to_harmony L22–22
+ import_stashes_to_shelf import import import_stashes_to_shelf L22–22 ← moved from muse/cli/commands/bridge.py
+ load_bridge_hooks import import load_bridge_hooks L28–28
+ read_bridge_state import import read_bridge_state L30–30
+ run_git_export import import run_git_export L11–11 ← moved from muse/cli/commands/bridge.py
+ run_git_import import import run_git_import L29–29 ← moved from muse/cli/commands/bridge.py
+ run_git_status import import run_git_status L31–31 ← moved from muse/cli/commands/bridge.py
+ run_hook import import run_hook L28–28
+ run_hooks import import run_hooks L28–28 ← moved from muse/cli/commands/bridge.py
+ write_bridge_state import import write_bridge_state L30–30 ← moved from muse/cli/commands/bridge.py
~ muse/core/bridge/exporter.py .py 1 symbol added
+ _register_git_export_parser function function _register_git_export_parser L541–656
~ muse/core/bridge/git_primitives.py .py 1 symbol added, 1 symbol removed
FileDiffTree import import FileDiffTree L32–32
+ FileDiffTree variable variable FileDiffTree L39–39 ← moved from muse/core/bridge/state.py
~ muse/core/bridge/importer.py .py 1 symbol added
+ _register_git_import_parser function function _register_git_import_parser L587–736
~ muse/core/bridge/state.py .py 1 symbol removed
FileDiffTree variable variable FileDiffTree L27–27 → moved to muse/core/bridge/git_primitives.py
~ muse/core/bridge/status.py .py 1 symbol added
+ _register_git_status_parser function function _register_git_status_parser L236–264
← Older Oldest on task/bridge-issue14-sweep
All commits
Newer → Latest on task/bridge-issue14-sweep

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