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

refactor: extract bridge state layer to muse.core.bridge.state (issue #14 Phase 1)

Move BridgeState TypedDicts, read_bridge_state, write_bridge_state, and _dict_to_toml out of the 3138-line bridge.py god object and into a focused muse.core.bridge.state module. bridge.py now imports from there.

Also create muse/core/bridge/__init__.py and muse/core/bridge/state.py. All 152 bridge-related tests remain green.

sha256:0107e539d3a3e7de5a68a0e94fe4e8bcdfba52c733555b30371df331843f1d1b sha
+27 −11 symbols
sha256:7fd37ba0f6293493dcb8f3e2b73a481303583929d40e6b1343e3e7a79b9180b6 snapshot
+27
symbols added
−11
symbols removed
0
dead code introduced
Semantic Changes 38 symbols
~ muse/core/bridge/state.py .py 17 symbols added
+ BridgeState class class BridgeState L77–94 ← moved from muse/cli/commands/bridge.py
+ DriftInfo class class DriftInfo L104–108 ← moved from muse/cli/commands/bridge.py
+ FileDiffTree variable variable FileDiffTree L27–27
+ SnapshotManifest variable variable SnapshotManifest L26–26
+ _BRIDGE_STATE_LOCK variable variable _BRIDGE_STATE_LOCK L115–115 ← moved from muse/cli/commands/bridge.py
+ _LastExportState class class _LastExportState L56–74 ← moved from muse/cli/commands/bridge.py
+ _LastImportState class class _LastImportState L33–53 ← moved from muse/cli/commands/bridge.py
+ _SidecarData class class _SidecarData L97–101 ← moved from muse/cli/commands/bridge.py
+ _dict_to_toml function function _dict_to_toml L204–227 ← moved from muse/cli/commands/bridge.py
+ TypedDict import import TypedDict L16–16
+ annotations import import annotations L12–12
+ git_bridge_state_path import import git_bridge_state_path L18–18
+ pathlib import import pathlib L14–14
+ split_id import import split_id L19–19
+ threading import import threading L15–15
+ read_bridge_state function function read_bridge_state L122–155 ← moved from muse/cli/commands/bridge.py
+ write_bridge_state function function write_bridge_state L158–201 ← moved from muse/cli/commands/bridge.py
~ muse/cli/commands/bridge.py .py 10 symbols added, 11 symbols removed
BridgeState class class BridgeState L109–126 → moved to muse/core/bridge/state.py
DriftInfo class class DriftInfo L153–157 → moved to muse/core/bridge/state.py
FileDiffTree variable variable FileDiffTree L160–160
SnapshotManifest variable variable SnapshotManifest L159–159
_BRIDGE_STATE_LOCK variable variable _BRIDGE_STATE_LOCK L274–274 → moved to muse/core/bridge/state.py
_LastExportState class class _LastExportState L89–107 → moved to muse/core/bridge/state.py
_LastImportState class class _LastImportState L67–87 → moved to muse/core/bridge/state.py
_SidecarData class class _SidecarData L147–151 → moved to muse/core/bridge/state.py
_dict_to_toml function function _dict_to_toml L367–390 → moved to muse/core/bridge/state.py
read_bridge_state function function read_bridge_state L280–313 → moved to muse/core/bridge/state.py
write_bridge_state function function write_bridge_state L315–365 → moved to muse/core/bridge/state.py
+ BridgeState import import BridgeState L51–51
+ DriftInfo import import DriftInfo L51–51
+ FileDiffTree import import FileDiffTree L51–51
+ SnapshotManifest import import SnapshotManifest L51–51
+ _LastExportState import import _LastExportState L51–51
+ _LastImportState import import _LastImportState L51–51
+ _SidecarData import import _SidecarData L51–51
+ _dict_to_toml import import _dict_to_toml L51–51
+ read_bridge_state import import read_bridge_state L51–51
+ write_bridge_state import import write_bridge_state L51–51
← Older Oldest on task/bridge-decomp-phase1
All commits
Newer → Latest on task/bridge-decomp-phase1

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