feat: muse#53 item 1 — muse symlog hotspots and coupling
Adds two zero-scan analytics commands reading purely from the already-written symlog journal (no commit-history walk), always up to date unlike their `muse code` counterparts:
- `muse symlog hotspots [--top N] [--file path] [--json]` — ranks symbols by churn (count of symbol-modified entries; creation/ deletion/rename don't count toward ongoing-edit churn). - `muse symlog coupling [--file path] [--min N] [--top N] [--json]` — finds symbol pairs whose journals share commit IDs (a commit touched both), ranked by shared-commit count. Default --min 2 excludes the near-universal single-shared-commit case (e.g. both symbols created in the same initial commit) as noise, mirroring `muse code coupling`'s own --min default.
Core additions in muse/core/symlog.py: compute_symlog_hotspots() and compute_symlog_coupling(), both O(symbols × entries) reading read_symlog() per symbol — no AST diffing or object-store reads needed since only commit_id/operation fields matter here (unlike `symlog grep`'s body reconstruction).
Covered by tests/test_cmd_symlog_analytics.py (8 cases: hotspots ranks by modification count correctly, creation-only symbols excluded, --file scoping, --top limiting; coupling finds a pair that changed together, below---min pairs excluded, --min lowers the threshold, empty repo reports zero). Confirmed genuine RED by reverting both changed files and re-running (all 8 failed with JSONDecodeError, since neither 'hotspots' nor 'coupling' were recognized dispatch keywords), then GREEN with the fix restored plus the full symlog regression suite (249 tests, zero regressions). Live-verified via muse-dev against a disposable /tmp sandbox (hotspots correctly ranked both modified symbols; coupling correctly found their 2-shared-commit pairing).
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Semantic Changes
51 symbols
Files Changed
+1
~3
1238 in snapshot
0 comments
muse hub commit comment sha256:27434566e7da9dcad9f8462bfaaedc20c606ee91864783bbda6c28b7380f77de --body "your comment"
No comments yet. Be the first to start the discussion.