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

refactor(harmony): Phase 6 — extract audit.py

Move append-only audit log logic out of the harmony god-object into muse/core/harmony/audit.py.

- audit.py: _MAX_AUDIT_BYTES, _MAX_AUDIT_ENTRIES, append_audit, list_audit - __init__.py: re-exports extracted symbols; content_hash import removed (no longer used after append_audit moved out)

707/707 harmony tests green.

sha256:f85ef10979de86932a635d67bc0363742979e3d858f64b84f225f9a3368f5b01 sha
+21 ~5 −5 symbols
sha256:29692eb5d369b60336cd82dc60ead00fefddf37484df2a4f36d9d232868ef0a7 snapshot
+21
symbols added
~5
symbols modified
−5
symbols removed
0
dead code introduced
Semantic Changes 31 symbols
~ muse/core/harmony/audit.py .py 17 symbols added
+ _MAX_AUDIT_BYTES variable variable _MAX_AUDIT_BYTES L27–27 ← moved from muse/core/harmony/__init__.py
+ _MAX_AUDIT_ENTRIES variable variable _MAX_AUDIT_ENTRIES L30–30 ← moved from muse/core/harmony/__init__.py
+ append_audit function function append_audit L36–76 ← moved from muse/core/harmony/__init__.py
+ AgentProvenance import import AgentProvenance L18–18
+ AuditEvent import import AuditEvent L18–18
+ _AuditMetadata import import _AuditMetadata L18–18
+ _now_utc import import _now_utc L15–15
+ _write_atomic import import _write_atomic L17–17
+ annotations import import annotations L7–7
+ audit_dir import import audit_dir L16–16
+ content_hash import import content_hash L13–13
+ json import import json L9–9
+ load_json_file import import load_json_file L13–13
+ logging import import logging L10–10
+ pathlib import import pathlib L11–11
+ list_audit function function list_audit L78–121 ← moved from muse/core/harmony/__init__.py
+ logger variable variable logger L24–24
~ muse/core/harmony/__init__.py .py 4 symbols added, 5 symbols removed, 5 symbols modified
_MAX_AUDIT_BYTES variable variable _MAX_AUDIT_BYTES L197–197 → moved to muse/core/harmony/audit.py
_MAX_AUDIT_ENTRIES variable variable _MAX_AUDIT_ENTRIES L206–206 → moved to muse/core/harmony/audit.py
append_audit function function append_audit L264–304 → moved to muse/core/harmony/audit.py
content_hash import import content_hash L101–101
list_audit function function list_audit L306–349 → moved to muse/core/harmony/audit.py
+ _MAX_AUDIT_BYTES import import _MAX_AUDIT_BYTES L136–136
+ _MAX_AUDIT_ENTRIES import import _MAX_AUDIT_ENTRIES L136–136
+ append_audit import import append_audit L136–136
+ list_audit import import list_audit L136–136

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