feat(log): supercharge JSON output with typed envelope, error schema, sha256: ref, timing
Envelope additions (always present, no dict.get guards needed): - status: 'ok' | 'error' - error: '' on success, message on error - branch: branch that was walked - repo_id: stable identifier for cross-referencing - total: len(commits) — replaces manual len(data['commits']) - duration_ms: float wall-clock timing - exit_code: 0 on success, non-zero on error
Error payloads: - Add _LogErrorJson TypedDict {status, error, exit_code} - _emit_error() helper centralises error emission; suppresses prose in --json mode - All error paths (invalid --since, --until, bad limit) emit clean JSON, no ❌ emoji leaking
sha256: ref resolution: - _is_known_ref() now accepts sha256: prefixed commit IDs and abbreviated prefixes - run() detects commit ID refs and walks from that commit via resolve_commit_ref instead of passing the sha256: ID as a branch name (which would fail validation)
Truncation warning: - Text mode only emits the '⚠️ History truncated' warning when the DEFAULT limit was silently hit; explicit -n means the user knows they asked for N commits
TypedDicts: - Add _LogJson (9 fields) and _LogErrorJson (3 fields)
Test updates: - Fix 3 pre-existing failures: agent_id/model_id in expected keys, duration_ms excluded from format-alias equality, repo_id assertion flipped - Add 50 new tests in test_log_supercharge.py
0 comments
muse hub commit comment sha256:199343e431bf2bfa34197873ae32a481233febedafa94510dae7335cc13f5914 --body "your comment"
No comments yet. Be the first to start the discussion.