gabriel / muse public
chore harmony task/harmony-decompose #13 / 13
AI Agent gabriel · 24 days ago · May 22, 2026 · Diff

chore(harmony): baseline audit — Phase 0 of issue #16

BASELINE METRICS (2026-05-21) ============================== Test suite (scoped): 707 passed / 0 failed / 0 errors Structural breakage: 0 violations — healthy Lines of code: 2210 (muse/core/harmony.py)

SYMBOL INVENTORY ================ Top-level classes (19): L169-190 ConflictType L192-204 ResolutionStrategy L206-220 PolicyAction L222-235 PolicyScope L237-253 AuditEventType L255-263 EscalationStatus L270-310 AgentProvenance L313-328 PolicyCondition L331-365 ConflictPattern L368-390 Resolution L393-418 Policy L421-443 ResolutionProposal L446-472 EscalationRecord L478-489 _PatternDict L491-502 _ResolutionDict L504-508 _PolicyConditionDict L510-520 _PolicyDict L522-532 AuditEvent L534-543 _EscalationDict

Top-level functions (53): Path helpers (8): L549-551 patterns_dir L553-555 policies_dir L557-559 audit_dir L561-563 escalations_dir L565-575 escalation_path L577-594 pattern_dir L599-601 _resolutions_dir L603-621 resolution_path

Validation (3): L630-647 _validate_id L649-676 _validate_fingerprint L678-695 _validate_policy_id

Fingerprinting (3): L701-715 blob_fingerprint L717-750 compute_pattern_id L752-781 compute_resolution_id

I/O helpers (3): L787-789 _now_utc L791-803 _parse_dt L805-824 _write_atomic

Serialisation/deserialisation (8): L830-843 _pattern_to_dict L845-863 _dict_to_pattern L865-878 _resolution_to_dict L880-898 _dict_to_resolution L900-906 _policy_condition_to_dict L908-920 _policy_to_dict L922-946 _dict_to_policy

Patterns persistence (5): L952-986 record_pattern L988-1029 load_pattern L1031-1076 list_patterns L1078-1131 forget_pattern L1133-1160 clear_all

Resolutions persistence (5): L1166-1211 save_resolution L1213-1260 load_resolution L1262-1303 list_resolutions L1305-1333 increment_applied_count L1335-1348 best_resolution

GC (1): L1354-1394 gc_stale

Audit log (2): L1400-1440 append_audit L1442-1485 list_audit

Policies persistence (5): L1491-1513 save_policy L1515-1551 load_policy L1553-1594 list_policies L1596-1620 remove_policy L1626-1648 _condition_matches L1650-1670 match_policy

Escalations persistence (5): L1676-1690 compute_escalation_id L1696-1707 _escalation_to_dict L1709-1741 _dict_to_escalation L1743-1775 record_escalation L1777-1806 load_escalation L1808-1857 list_escalations L1859-1907 resolve_escalation

Semantic fingerprinting (1): L1913-1954 compute_semantic_fingerprint

Engine (2): L1956-2069 auto_apply L2071-2210 record_resolutions

DEPENDENCIES (muse/core/harmony.py outbound) ============================================ stdlib: collections.abc, dataclasses, datetime, fnmatch, hashlib, json, logging, os, pathlib, re, tempfile, typing muse deps: muse.core.paths (harmony_dir) muse.core.types (JsonValue, Manifest, content_hash, load_json_file, long_id, short_id, split_id) muse.core.validation (validate_object_id)

EXTERNAL IMPORT SITES (inbound callers) ======================================== muse/cli/commands/commit.py:L51 from muse.core.harmony import record_resolutions as harmony_record_resolutions → called at L667

muse/cli/commands/merge.py:L79 from muse.core.harmony import auto_apply as harmony_auto_apply → called at L679

muse/cli/commands/harmony.py:L153,L1781,L2072,L2108,L2233 from muse.core.harmony import (...) — bulk import of types + functions → used throughout the 2493-line CLI handler

muse/core/bridge/harmony_shelf.py:L54,L172 from muse.core.harmony import (...) → ConflictPattern, Resolution, best_resolution, list_patterns etc.

muse/core/harmony_engine.py (495 lines) → already-split wrapper; will be merged into harmony/engine.py in Phase 8

COMPANION FILES =============== muse/core/harmony_engine.py 495 lines (engine wrapper — Phase 8 merge target) muse/cli/commands/harmony.py 2493 lines (CLI — Phase 9 thin target ≤200 lines) muse/core/bridge/harmony_shelf.py ~200 lines

NO CODE CHANGES IN THIS COMMIT — pure audit baseline.

sha256:596a4963c21debb14d9ef51e23c2ca9f825b602ab8585f69caca35eb81bcac77 sha
sha256:5e19db9644f43623b4eab4ee0abd68134f21c641063d3c6a6ef3a58005aa5872 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:596a4963c21debb14d9ef51e23c2ca9f825b602ab8585f69caca35eb81bcac77 --body "your comment"