gabriel / muse public
fix BREAKING task/fix-import-cycles #1 / 1
AI Agent gabriel · 158 days ago · Apr 17, 2026 · Diff

fix: eliminate all 7 static circular import cycles

- Extract SemVerBump to muse/core/_types.py (zero-import primitives module); update semver.py, semver_classifier.py, transport.py, domain.py, store.py - Guard store.py's StructuredDelta import with TYPE_CHECKING (annotation-only use) - Extract NoteKey, _note_content_id, _note_summary, _pitch_name to muse/plugins/midi/_midi_keys.py; update midi_diff.py and entity.py to import from the new shared module, breaking the entity <-> midi_diff cycle

All 6 runtime no-cycle tests pass. 52 midi tests pass. Core imports clean.

sha256:6603e86f5ec1a28b52f3d10e0dea28b0d02687b5b2d6b183984491a46c63f6b3 sha
+16 ~14 −7 symbols
sha256:14868ac9d621a640a0d9f40db557f8b77e2dd7c7ab3c46fdf4d35feafa984282 snapshot
+16
symbols added
~14
symbols modified
−7
symbols removed
0
dead code introduced
Semantic Changes 37 symbols
~ muse/plugins/midi/_midi_keys.py .py 8 symbols added
+ NoteKey class class NoteKey L16–30 ← moved from muse/plugins/midi/midi_diff.py
+ _PITCH_NAMES variable variable _PITCH_NAMES L13–13 ← moved from muse/plugins/midi/midi_diff.py
+ _note_content_id function function _note_content_id L40–51 ← moved from muse/plugins/midi/midi_diff.py
+ _note_summary function function _note_summary L54–63 ← moved from muse/plugins/midi/midi_diff.py
+ _pitch_name function function _pitch_name L33–37 ← moved from muse/plugins/midi/midi_diff.py
+ TypedDict import import TypedDict L11–11
+ annotations import import annotations L8–8
+ hashlib import import hashlib L10–10
~ muse/core/_types.py .py 2 symbols added
+ SemVerBump variable variable SemVerBump L15–15 ← moved from muse/domain.py
+ Literal import import Literal L9–9
~ muse/core/semver.py .py 1 symbol modified
~ muse/core/store.py .py 1 symbol added, 1 symbol removed, 4 symbols modified
StructuredDelta import import StructuredDelta L101–101
+ TYPE_CHECKING import import TYPE_CHECKING L75–75
~ muse/core/transport.py .py 1 symbol modified
~ muse/domain.py .py 1 symbol added, 1 symbol removed, 2 symbols modified
SemVerBump variable variable SemVerBump L344–344 → moved to muse/core/_types.py
+ SemVerBump import import SemVerBump L52–52
~ muse/plugins/midi/midi_diff.py .py 4 symbols added, 5 symbols removed
NoteKey class class NoteKey L70–84 → moved to muse/plugins/midi/_midi_keys.py
_PITCH_NAMES variable variable _PITCH_NAMES L62–62 → moved to muse/plugins/midi/_midi_keys.py
_note_content_id function function _note_content_id L99–110 → moved to muse/plugins/midi/_midi_keys.py
_note_summary function function _note_summary L113–122 → moved to muse/plugins/midi/_midi_keys.py
_pitch_name function function _pitch_name L92–96 → moved to muse/plugins/midi/_midi_keys.py
+ NoteKey import import NoteKey L56–56
+ _note_content_id import import _note_content_id L56–56
+ _note_summary import import _note_summary L56–56
+ _pitch_name import import _pitch_name L56–56
← Older Oldest on task/fix-import-cycles
All commits
Newer → Latest on task/fix-import-cycles

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:6603e86f5ec1a28b52f3d10e0dea28b0d02687b5b2d6b183984491a46c63f6b3 --body "your comment"