gabriel / muse public
feat BREAKING reflog task/reflog-phase1 #5 / 8
AI Agent gabriel · 23 days ago · Jun 28, 2026 · Diff

feat(reflog): Phase 4 — GC integration (RL_18–RL_20)

- Add reflog_expired field to GcResult dataclass - Add _DEFAULT_REFLOG_EXPIRE_DAYS = 90 constant to gc.py - run_gc() and _run_gc_inner() accept reflog_expire_days parameter - _expire_all_reflogs() helper prunes HEAD log + all branch logs during GC - muse gc --json gains reflog_expired integer field (RL_18) - muse gc --dry-run --json reports count without writing (RL_19) - CLI reads reflog.expire-days from config; falls back to 90 (RL_18) - Human-readable output prints expired count when > 0 - Integration tests verify entries gone from disk after gc (RL_20) - 15 new tests; 100/100 across all reflog+GC test files

sha256:6b79ec131a5ad528addc784d77fe632e6abc3cd1f9be179d2861b14190180724 sha
+43 ~8 symbols
sha256:b4a8e2148f8b5dd27b99f44bdc9cacf746e419d91a79b13a1ea935fcbcf53b34 snapshot
+43
symbols added
~8
symbols modified
0
dead code introduced
Semantic Changes 51 symbols
~ tests/test_cmd_gc_reflog.py .py 38 symbols added
+ TestGcReflogDryRun class class TestGcReflogDryRun L177–238
+ test_dry_run_branch_log_untouched method method test_dry_run_branch_log_untouched L226–238
+ test_dry_run_does_not_delete_log_entries method method test_dry_run_does_not_delete_log_entries L198–211
+ test_dry_run_does_not_remove_log_file method method test_dry_run_does_not_remove_log_file L213–224
+ test_dry_run_reports_reflog_expired method method test_dry_run_reports_reflog_expired L180–196
+ TestGcReflogExpired class class TestGcReflogExpired L87–170
+ test_gc_expires_branch_logs_too method method test_gc_expires_branch_logs_too L133–144
+ test_json_output_has_reflog_expired_field method method test_json_output_has_reflog_expired_field L90–101
+ test_old_entries_counted_in_reflog_expired method method test_old_entries_counted_in_reflog_expired L103–119
+ test_recent_entries_not_expired method method test_recent_entries_not_expired L121–131
+ test_reflog_expire_days_config_respected method method test_reflog_expire_days_config_respected L156–170
+ test_reflog_expired_zero_when_no_log_files method method test_reflog_expired_zero_when_no_log_files L146–154
+ TestGcReflogIntegration class class TestGcReflogIntegration L245–316
+ test_all_old_entries_removed_file_deleted method method test_all_old_entries_removed_file_deleted L265–272
+ test_branch_old_entries_removed_after_gc method method test_branch_old_entries_removed_after_gc L274–288
+ test_exact_counts_from_100_entry_log method method test_exact_counts_from_100_entry_log L290–304
+ test_gc_output_without_json_flag_mentions_reflog method method test_gc_output_without_json_flag_mentions_reflog L306–316
+ test_old_head_entries_removed_after_gc method method test_old_head_entries_removed_after_gc L248–263
+ _DAY variable variable _DAY L26–26
+ _branch_log function function _branch_log L58–59
+ _env function function _env L32–33
+ _head_log function function _head_log L54–55
+ _make_repo function function _make_repo L36–51
+ _now function function _now L71–72
+ _old_ts function function _old_ts L75–76
+ _recent_ts function function _recent_ts L79–80
+ _write_entries function function _write_entries L62–68
+ cli variable variable cli L24–24
+ CliRunner import import CliRunner L21–21
+ annotations import import annotations L11–11
+ fake_id import import fake_id L20–20
+ json import import json L13–13
+ logs_dir import import logs_dir L19–19
+ muse_dir import import muse_dir L19–19
+ pathlib import import pathlib L14–14
+ pytest import import pytest L17–17
+ time import import time L15–15
+ runner variable variable runner L23–23
~ muse/cli/commands/gc.py .py 1 symbol added, 5 symbols modified
+ _DEFAULT_REFLOG_EXPIRE_DAYS import import _DEFAULT_REFLOG_EXPIRE_DAYS L37–37
~ run_gc
~ run
~ muse/core/gc.py .py 4 symbols added, 3 symbols modified
+ _DEFAULT_REFLOG_EXPIRE_DAYS variable variable _DEFAULT_REFLOG_EXPIRE_DAYS L457–457
+ _expire_all_reflogs function function _expire_all_reflogs L647–672
+ expire_reflog import import expire_reflog L83–83
+ list_reflog_refs import import list_reflog_refs L83–83
~ run_gc

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