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

refactor(harmony): Phase 8 — extract escalations + engine into package submodules

- Add muse/core/harmony/escalations.py with _MAX_ESCALATION_BYTES, _escalation_to_dict, _dict_to_escalation, record_escalation, load_escalation, list_escalations, resolve_escalation - Add muse/core/harmony/engine.py — move harmony_engine.py into the package with relative imports; exposes EngineStatus, HarmonyPlugin, DefaultPlugin, EngineConfig, EngineResult, find_similar, resolve - Delete muse/core/harmony_engine.py (now muse.core.harmony.engine) - Update 5 call sites: cli/commands/harmony.py (3 sites), plugins/code_harmony.py, tests/test_harmony_engine.py, tests/test_code_harmony_plugin.py - Trim __init__.py: remove unused stdlib imports (datetime, json, os, tempfile, Mapping, dc_replace) and unused muse.core.types names (JsonValue, load_json_file, long_id); only logging + pathlib remain - All 707 harmony tests pass

sha256:340607e5ffa9f61ae5150b14dde6ebfa3085efe24cba3d01840a765e244f97f2 sha
+33 ~34 −17 symbols
sha256:e504c32666536eb53bc3f714086fb158b6d019827e46e8e809e3d9fafd11fe12 snapshot
+33
symbols added
~34
symbols modified
−17
symbols removed
0
dead code introduced
Semantic Changes 84 symbols
~ muse/core/harmony/escalations.py .py 26 symbols added
+ _MAX_ESCALATION_BYTES variable variable _MAX_ESCALATION_BYTES L36–36 ← moved from muse/core/harmony/__init__.py
+ _dict_to_escalation function function _dict_to_escalation L55–87 ← moved from muse/core/harmony/__init__.py
+ _escalation_to_dict function function _escalation_to_dict L42–53 ← moved from muse/core/harmony/__init__.py
+ AgentProvenance import import AgentProvenance L26–26
+ EscalationRecord import import EscalationRecord L26–26
+ EscalationStatus import import EscalationStatus L26–26
+ JsonValue import import JsonValue L19–19
+ Mapping import import Mapping L16–16 ← moved from muse/core/harmony/__init__.py
+ _EscalationDict import import _EscalationDict L26–26
+ _validate_id import import _validate_id L21–21
+ annotations import import annotations L8–8
+ datetime import import datetime L10–10 ← moved from muse/core/harmony/__init__.py
+ dc_replace import import dc_replace L17–17 ← moved from muse/core/harmony/__init__.py
+ escalation_path import import escalation_path L21–21
+ escalations_dir import import escalations_dir L21–21
+ json import import json L11–11 ← moved from muse/core/harmony/__init__.py
+ logging import import logging L12–12
+ os import import os L13–13 ← moved from muse/core/harmony/__init__.py
+ pathlib import import pathlib L14–14
+ short_id import import short_id L19–19
+ tempfile import import tempfile L15–15 ← moved from muse/core/harmony/__init__.py
+ list_escalations function function list_escalations L165–218 ← moved from muse/core/harmony/__init__.py
+ load_escalation function function load_escalation L130–163
+ logger variable variable logger L33–33
+ record_escalation function function record_escalation L93–128 ← moved from muse/core/harmony/__init__.py
+ resolve_escalation function function resolve_escalation L220–268
~ muse/core/harmony/__init__.py .py 7 symbols added, 16 symbols removed, 2 symbols modified
_MAX_ESCALATION_BYTES variable variable _MAX_ESCALATION_BYTES L212–212 → moved to muse/core/harmony/escalations.py
_dict_to_escalation function function _dict_to_escalation L235–267 → moved to muse/core/harmony/escalations.py
_escalation_to_dict function function _escalation_to_dict L222–233 → moved to muse/core/harmony/escalations.py
JsonValue import import JsonValue L100–100
Mapping import import Mapping L97–97 → moved to muse/core/harmony/escalations.py
datetime import import datetime L91–91 → moved to muse/core/harmony/escalations.py
dc_replace import import dc_replace L98–98 → moved to muse/core/harmony/escalations.py
json import import json L92–92 → moved to muse/core/harmony/escalations.py
load_json_file import import load_json_file L100–100
long_id import import long_id L100–100
os import import os L94–94 → moved to muse/core/harmony/escalations.py
tempfile import import tempfile L96–96 → moved to muse/core/harmony/escalations.py
list_escalations function function list_escalations L334–383 → moved to muse/core/harmony/escalations.py
load_escalation function function load_escalation L303–332
record_escalation function function record_escalation L269–301 → moved to muse/core/harmony/escalations.py
resolve_escalation function function resolve_escalation L385–433
+ _MAX_ESCALATION_BYTES import import _MAX_ESCALATION_BYTES L148–148
+ _dict_to_escalation import import _dict_to_escalation L148–148
+ _escalation_to_dict import import _escalation_to_dict L148–148
+ list_escalations import import list_escalations L148–148
+ load_escalation import import load_escalation L148–148
+ record_escalation import import record_escalation L148–148
+ resolve_escalation import import resolve_escalation L148–148
~ muse/core/plugins/code_harmony.py .py 1 symbol modified

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