gabriel / muse public
feat patch feat/53-symlog-stat #1 / 1
AI Agent gabriel · 16 hours ago · Oct 22, 2026 · Diff

feat: muse#53 item 10 — muse symlog stat

Adds `muse symlog stat [FILE::SYMBOL] [--file path] [--json]`: reads a symbol's full journal (or aggregates every symbol's journal in a file) and reports total entry count, a breakdown by operation category (symbol-created/modified/deleted/renamed-to/born-from), the most active author, and the first/last commit IDs + timestamps.

Wired in as a new positional-dispatch subcommand in symlog.py's run(), matching this file's existing convention (resolve/diff/expire/delete/ exists dispatch on positional[0], not argparse subparsers like reflog.py uses) — picked the established pattern of the file being touched over importing reflog.py's different convention.

Covered by tests/test_cmd_symlog_stat.py (7 cases: empty symlog, created+modified counting with author attribution, missing symbol/ --file error, both-given error, invalid symbol address error, file-mode aggregation across multiple symbols, file with no symlogs). Confirmed genuine RED by reverting the fix file and re-running (5 of 7 failed with KeyError, since 'stat' fell through to the existing --file/ single-symbol read paths without dispatch; 2 passed incidentally via pre-existing exit-1 paths), then GREEN with the fix restored plus the full symlog regression suite (216 tests across read/lifecycle/refs/ core/commit-integration, zero regressions). Live-verified via muse-dev against a disposable /tmp sandbox (single-symbol and --file modes).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

sha256:86bb35ad76c8e6bc00af734f65e80e74d92f1e974a156977aa356875fbd7d09a sha
+25 ~4 symbols
3 changed · 1232 in snapshot files
sha256:53881e343774bab9c5dd853625c7131874c9ef2c01eea2042de8864a1241512a snapshot
+25
symbols added
~4
symbols modified
3
files changed
1232
files in snapshot
0
dead code introduced
Semantic Changes 29 symbols
~ tests/test_cmd_symlog_stat.py .py 22 symbols added
+ TestSymlogStatFileMode class class TestSymlogStatFileMode L104–124
+ test_aggregates_across_symbols_in_file method method test_aggregates_across_symbols_in_file L105–118
+ test_file_with_no_symlogs_reports_zero method method test_file_with_no_symlogs_reports_zero L120–124
+ TestSymlogStatSingleSymbol class class TestSymlogStatSingleSymbol L60–101
+ test_counts_created_and_modified method method test_counts_created_and_ L72–86
+ test_empty_symlog_reports_zero method method test_empty_symlog_reports_zero L61–70
+ test_invalid_symbol_address_errors method method test_invalid_symbol_address_errors L98–101
+ test_missing_symbol_and_file_errors method method test_missing_symbol_and_file_errors L88–91
+ test_symbol_and_file_both_given_errors method method test_symbol_and_file_both_given_errors L93–96
+ _commit function function _commit L38–48
+ _init_repo function function _init_repo L27–29
+ _invoke function function _invoke L18–24
+ _make_repo function function _make_repo L51–53
+ _symlog function function _symlog L56–57
+ _write_file function function _write_file L32–35
+ CliRunner import import CliRunner L13–13
+ annotations import import annotations L6–6
+ json import import json L8–8
+ os import import os L9–9
+ pathlib import import pathlib L10–10
+ textwrap import import textwrap L11–11
+ runner variable variable runner L15–15
~ muse/cli/commands/symlog.py .py 3 symbols added, 1 symbol modified
+ _SymlogStatJson class class _SymlogStatJson L144–155
+ _categorize_symlog_operation function function _categorize_symlog_operation L596–598
+ run_stat function function run_stat L601–713
~ run
Files Changed
+1 ~2
1232 in snapshot
← Older Oldest on feat/53-symlog-stat
All commits
Newer → Latest on feat/53-symlog-stat

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