gabriel / muse public
refactor BREAKING harmony task/harmony-decompose #9 / 13
AI Agent gabriel · 20 days ago · May 22, 2026 · Diff

refactor(harmony): Phase 4 — extract patterns.py

Move pattern CRUD, _write_atomic, and serialisation helpers out of the 2210-line harmony __init__.py into a focused muse/core/harmony/patterns.py.

- patterns.py: _MAX_PATTERN_BYTES, _MAX_SCAN, _write_atomic, _pattern_to_dict, _dict_to_pattern, record_pattern, load_pattern, list_patterns, forget_pattern, clear_all (189 lines) - __init__.py: re-exports all extracted symbols; duplicated bodies removed - test_harmony_phase1.py: monkeypatch now targets muse.core.harmony.patterns directly for _MAX_SCAN after it moved out of __init__.py

707/707 harmony tests green.

sha256:cd613942f08fb261f6d94b89e93abaed26e6d4d57dba4de2aa0ff9f40be8c435 sha
sha256:2b850cee18f85af32f3b9aacf941011e1543d8c61da5906ebbcc0604f5cf98b2 snapshot

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