The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(curator): prune-only passes stop snapshotting; ledger stores deltas; one pass per home; restore by skill name
teknium15fd334f1e32d
diff --git a/agent/curator.py b/agent/curator.pyindex a9198f980d0..8f431728f79 100644--- a/agent/curator.py+++ b/agent/curator.py@@ -14,6 +14,7 @@ import loggingimport osimport reimport threading+import timefrom collections import Counterfrom datetime import datetime, timedelta, timezonefrom pathlib import Path@@ -896,15 +897,21 @@ def run_curator_review(if dry_run: # count candidates without mutating statecounts = {"checked": len(_safe_curated_report()), "marked_stale": 0, "archived": 0, "reactivated": 0}else:- # Pre-mutation snapshot — best-effort, never blocks the run: a transient- # disk issue must not silently disable the curator forever.- try:- from agent import curator_backup- snap = curator_backup.snapshot_skills(reason="pre-curator-run")- if snap is not None:- _notify(on_summary, f"curator: snapshot created ({snap.name})")- except Exception as e:- logger.debug("Curator pre-run snapshot failed: %s", e, exc_info=True)+ from agent import curator_backup+ # The prune-only pass just renames directories into .archive/ (its own undo) and every edit is+ # ledgered; only the LLM consolidation pass rewrites content in place, so only it earns a+ # whole-tree snapshot. Retention still runs so old snapshots age out either way.+ if consolidate:+ # Best-effort, never blocks the run: a transient disk issue must not silently disable the curator forever.+ try:+ snap = curator_backup.snapshot_skills(reason="pre-curator-run")+ if snap is not None:+ _notify(on_summary, f"curator: snapshot created ({snap.name})")+ except Exception as e:+ logger.debug("Curator pre-run snapshot failed: %s", e, exc_info=True)+ else:+ with contextlib.suppress(Exception):+ curator_backup.prune_old_snapshots()counts = apply_automatic_transitions(now=start)auto_summary = ", ".join(f"{counts[key]} {label}" for key, label in (("marked_stale", "marked stale"), ("archived", "archived"), ("reactivated", "reactivated")) if counts[key]@@ -1088,13 +1095,54 @@ def _run_llm_review(prompt: str) -> Dict[str, Any]:# --- Public entrypoint for the session-start hook ---+_CLAIM_STALE_SECONDS = 3600.0+++def _run_claim_path() -> Path:+ return get_hermes_home() / "skills" / ".locks" / "curator-run"+++def _claim_run() -> bool:+ """One automatic pass per home across processes: two CLIs launched seconds apart both saw the+ weekly interval elapsed and both pruned the tree. O_EXCL create wins the claim; a claim older than+ an hour is a crashed holder and is taken over. When the lock dir cannot be created, run anyway."""+ lock = _run_claim_path()+ try:+ lock.parent.mkdir(parents=True, exist_ok=True)+ except OSError:+ return True+ try:+ fd = os.open(lock, os.O_CREAT | os.O_EXCL | os.O_WRONLY)+ except FileExistsError:+ try:+ if time.time() - lock.stat().st_mtime > _CLAIM_STALE_SECONDS:+ lock.unlink()+ return _claim_run()+ except OSError:+ pass+ return False+ with os.fdopen(fd, "w", encoding="utf-8") as fh:+ fh.write(str(os.getpid()))+ return True+++def _release_run_claim() -> None:+ with contextlib.suppress(OSError):+ _run_claim_path().unlink()++def maybe_run_curator(*, idle_for_seconds: Optional[float] = None, on_summary: Optional[Callable[[str], None]] = None) -> Optional[Dict[str, Any]]:"""Best-effort: run a curator pass if all gates pass. Returns the result dict if a pass was started, else None. Never raises."""try:# Idle gating: only enforce when the caller provided a measurement.if not should_run_now() or (idle_for_seconds is not None and idle_for_seconds < get_min_idle_hours() * 3600.0):return None- return run_curator_review(on_summary=on_summary)+ if not _claim_run():+ return None+ try:+ return run_curator_review(on_summary=on_summary)+ finally:+ _release_run_claim()except Exception as e:logger.debug("maybe_run_curator failed: %s", e, exc_info=True)return Nonediff --git a/agent/curator_backup.py b/agent/curator_backup.pyindex eca736af663..5fb2a7acd3f 100644--- a/agent/curator_backup.py+++ b/agent/curator_backup.py@@ -27,7 +27,7 @@ from hermes_cli.sizefmt import format_byteslogger = logging.getLogger(__name__)-DEFAULT_KEEP = 5+DEFAULT_KEEP = 2# Never rolled into a snapshot: .hub/ is owned by the skills hub (rolling it back breaks lockfile invariants); .curator_backups# is the backup dir itself; .git is repository metadata — rolling it back breaks git tracking, and snapshots that include it grow@@ -173,11 +173,18 @@ def snapshot_skills(reason: str = "manual", *, protect_ids: Optional[Set[str]] =shutil.rmtree(dest, ignore_errors=True) # clean up partial snapshotreturn None- _prune_old(keep=get_keep(), protect=protect_ids)+ # A same-second id reuse after a prune (`...Z` next to a surviving `...Z-02`) sorts BELOW its sibling;+ # the snapshot just written must never be its own prune victim.+ _prune_old(keep=get_keep(), protect=(protect_ids or set()) | {snap_id})logger.info("Curator snapshot created: %s (%s)", snap_id, reason)return dest+def prune_old_snapshots() -> List[str]:+ """Apply ``curator.backup.keep`` without taking a new snapshot (the prune-only curator pass)."""+ return _prune_old(keep=get_keep())++def _prune_old(keep: int, protect: Optional[Set[str]] = None) -> List[str]:"""Delete regular snapshots beyond the newest *keep*; returns deleted ids. Ids in *protect* are never deleted —rollback() uses this so the mandatory pre-rollback safety snapshot cannot evict the snapshot being restored.diff --git a/hermes_cli/config_defaults.py b/hermes_cli/config_defaults.pyindex 6bba90a2d7e..f99e23e5573 100644--- a/hermes_cli/config_defaults.py+++ b/hermes_cli/config_defaults.py@@ -1429,11 +1429,12 @@ DEFAULT_CONFIG = {# TTL purge of skills/.archive/: 0 = never; > 0 lets the explicit `hermes curator purge`# delete older archived skills (never automatic; logged in the ledger)."archive_ttl_days": 0,- # Before every real (non-dry-run) pass, snapshot ~/.hermes/skills/ to- # ~/.hermes/skills/.curator_backups/<utc-iso>/skills.tar.gz (`hermes curator rollback`).+ # Before a consolidation pass (the only one that rewrites skill content in place), snapshot+ # ~/.hermes/skills/ to ~/.hermes/skills/.curator_backups/<utc-iso>/skills.tar.gz (`hermes curator+ # rollback`). The prune-only pass just moves directories into .archive/ and takes none."backup": {"enabled": True,- "keep": 5, # retain last N regular snapshots+ "keep": 2, # retain last N regular snapshots},},# Honcho AI-native memory — ~/.honcho/config.json is the source of truth (apiKey, workspace,diff --git a/hermes_cli/curator.py b/hermes_cli/curator.pyindex fb451c1d5c5..c2f9745104c 100644--- a/hermes_cli/curator.py+++ b/hermes_cli/curator.py@@ -385,8 +385,12 @@ def _cmd_backup(args) -> int:def _cmd_ledger(args) -> int:- """List per-mutation audit ledger entries (newest first)."""+ """List per-mutation audit ledger entries (newest first), or compact the file in place."""from tools import skill_ledger+ if getattr(args, "compact", False):+ entries, before, after = skill_ledger.compact_ledger()+ print(f"curator: ledger compacted — {entries} entries, {before / 2**20:.1f} MB → {after / 2**20:.1f} MB")+ return 0rows = skill_ledger.list_entries(skill=getattr(args, "skill", None), limit=getattr(args, "limit", None) or 20)if not rows:@@ -674,7 +678,9 @@ _SUBCOMMANDS = ("ledger", "List the per-mutation skill audit ledger (all actors: curator/agent/user)",_cmd_ledger,_arg("--skill", default=None, help="Only show entries for this skill"),- _arg("--limit", type=int, default=20, help="Max entries to show (default: 20)")),+ _arg("--limit", type=int, default=20, help="Max entries to show (default: 20)"),+ _arg("--compact", **_STORE_TRUE,+ help="Rewrite the ledger dropping unchanged paths from every entry (ids and rollback preserved)")),("purge","Delete archived skills older than curator.archive_ttl_days "diff --git a/tests/agent/test_curator.py b/tests/agent/test_curator.pyindex 0d3ae9395b7..58a6c057663 100644--- a/tests/agent/test_curator.py+++ b/tests/agent/test_curator.py@@ -82,6 +82,7 @@ def test_curator_defaults(curator_env):+# ---------------------------------------------------------------------------# should_run_now# ---------------------------------------------------------------------------diff --git a/tests/agent/test_curator_backup.py b/tests/agent/test_curator_backup.pyindex d273835fc70..98100082b7f 100644--- a/tests/agent/test_curator_backup.py+++ b/tests/agent/test_curator_backup.py@@ -216,8 +216,8 @@ def test_real_run_takes_pre_snapshot(backup_env, monkeypatch):lambda now=None: {"checked": 1, "marked_stale": 0, "archived": 0, "reactivated": 0},)- curator.run_curator_review(synchronous=True)- # Pre-run snapshot should exist+ # Only the consolidation pass rewrites content in place, so only it snapshots first.+ curator.run_curator_review(synchronous=True, consolidate=True)rows = cb.list_backups()assert any(r.get("reason") == "pre-curator-run" for r in rows), (f"expected a pre-curator-run snapshot, got {[r.get('reason') for r in rows]}"diff --git a/tests/agent/test_curator_run_hygiene.py b/tests/agent/test_curator_run_hygiene.pynew file mode 100644index 00000000000..e0a801cd1b6--- /dev/null+++ b/tests/agent/test_curator_run_hygiene.py@@ -0,0 +1,81 @@+"""Curator run hygiene: what a pass costs on disk and who gets to run it.++A weekly pass on a 1.9 GB skills tree (97% curator backups + ledger) held the CLI prompt for+six minutes; two CLIs launched 12 s apart both ran it.+"""++import importlib+import threading+from pathlib import Path++import pytest+++def env(tmp_path, monkeypatch):+ home = tmp_path / ".hermes"+ (home / "skills").mkdir(parents=True)+ monkeypatch.setattr(Path, "home", lambda: tmp_path)+ monkeypatch.setenv("HERMES_HOME", str(home))+ import tools.skill_usage as usage+ import agent.curator as curator+ import agent.curator_backup as cb+ for m in (usage, cb, curator):+ importlib.reload(m)+ monkeypatch.setattr(curator, "_load_config", lambda: {})+ monkeypatch.setattr(curator, "_run_llm_review", lambda prompt: "llm-stub")+ yield {"home": home, "curator": curator, "cb": cb}+ for t in threading.enumerate():+ if t.name == "curator-review" and t.is_alive():+ t.join(timeout=10.0)+++def _snapshots(home: Path):+ d = home / "skills" / ".curator_backups"+ return sorted(p.name for p in d.iterdir() if p.is_dir()) if d.exists() else []+++def test_prune_only_pass_takes_no_snapshot_but_still_ages_old_ones_out(env, monkeypatch):+ cb, curator, home = env["cb"], env["curator"], env["home"]+ (home / "skills" / "alpha").mkdir()+ (home / "skills" / "alpha" / "SKILL.md").write_text("---\nname: alpha\n---\n", encoding="utf-8")+ monkeypatch.setattr(cb, "get_keep", lambda: 5)+ for _ in range(3):+ assert cb.snapshot_skills(reason="old") is not None+ assert len(_snapshots(home)) == 3+ monkeypatch.setattr(cb, "get_keep", lambda: 1)++ curator.run_curator_review(synchronous=True, consolidate=False)+ survivors = _snapshots(home)+ assert len(survivors) == 1, "prune-only pass must apply retention without adding a snapshot"++ curator.run_curator_review(synchronous=True, consolidate=True)+ reasons = [r.get("reason") for r in cb.list_backups()]+ assert "pre-curator-run" in reasons, "consolidation still snapshots first"+ assert len(reasons) <= 2, "and retention still applies (the new snapshot never prunes itself)"+++def test_only_one_process_claims_a_due_pass(env, monkeypatch):+ curator, home = env["curator"], env["home"]+ monkeypatch.setattr(curator, "should_run_now", lambda now=None: True)+ started, release = threading.Event(), threading.Event()+ runs = []++ def _slow_review(**kw):+ runs.append(kw)+ started.set()+ release.wait(10)+ return {}++ monkeypatch.setattr(curator, "run_curator_review", _slow_review)+ holder = threading.Thread(target=curator.maybe_run_curator, daemon=True)+ holder.start()+ assert started.wait(5)+ try:+ assert curator.maybe_run_curator() is None, "a second launch must not run the pass concurrently"+ assert len(runs) == 1+ finally:+ release.set()+ holder.join(5)+ assert not curator._run_claim_path().exists(), "claim released after the pass"+ assert curator.maybe_run_curator() is not None, "and the next due pass can claim again"diff --git a/tests/tools/test_skill_ledger_delta.py b/tests/tools/test_skill_ledger_delta.pynew file mode 100644index 00000000000..bb59ab2c49e--- /dev/null+++ b/tests/tools/test_skill_ledger_delta.py@@ -0,0 +1,72 @@+"""Ledger entries carry deltas, not whole-package manifests.++``rollback_entry`` writes every *before* path and removes *after*-only paths, so an unchanged+file in both lists is dead weight; a 4,000-file skill cost 1.5 MB of ledger per patch.+"""++import json+import os+from pathlib import Path++import pytest+++def ledger_home(tmp_path, monkeypatch):+ home = tmp_path / ".hermes"+ (home / "skills").mkdir(parents=True)+ monkeypatch.setenv("HERMES_HOME", str(home))+ monkeypatch.setattr(Path, "home", lambda: tmp_path)+ return home+++def _manifest(skills: Path, name: str, **files: str):+ from tools import skill_ledger+ return [{"path": str(skills / name / rel), "sha256": skill_ledger._store_blob(body.encode())}+ for rel, body in sorted(files.items())]+++def test_entry_stores_only_changed_paths_and_rollback_still_restores(ledger_home):+ from tools import skill_ledger+ skills = ledger_home / "skills"+ before = _manifest(skills, "big", **{"SKILL.md": "v1", "references/a.md": "same", "references/gone.md": "old"})+ after = _manifest(skills, "big", **{"SKILL.md": "v2", "references/a.md": "same", "references/new.md": "added"})+ entry_id = skill_ledger.append_entry("patch", "big", before=before, after=after, actor="agent")+ entry = skill_ledger.get_entry(entry_id)+ names = lambda items: {Path(i["path"]).name for i in items} # noqa: E731+ assert names(entry["before"]) == {"SKILL.md", "gone.md"}+ assert names(entry["after"]) == {"SKILL.md", "new.md"}++ # Lay the after-state on disk, roll back, and the before-state is exactly reproduced.+ for i in after:+ p = Path(i["path"]); p.parent.mkdir(parents=True, exist_ok=True)+ p.write_bytes(skill_ledger.read_blob(i["sha256"]))+ ok, msg = skill_ledger.rollback_entry(entry_id)+ assert ok, msg+ assert (skills / "big" / "SKILL.md").read_text() == "v1"+ assert (skills / "big" / "references" / "a.md").read_text() == "same"+ assert (skills / "big" / "references" / "gone.md").read_text() == "old"+ assert not (skills / "big" / "references" / "new.md").exists()+++def test_compact_rewrites_legacy_full_manifests_in_place(ledger_home):+ from tools import skill_ledger+ skills = ledger_home / "skills"+ full = _manifest(skills, "big", **{f"references/{n}.md": "same" for n in range(50)})+ changed_before = full + _manifest(skills, "big", **{"SKILL.md": "v1"})+ changed_after = full + _manifest(skills, "big", **{"SKILL.md": "v2"})+ legacy = {"id": "abc123", "ts": "2026-01-01T00:00:00+00:00", "actor": "agent", "action": "patch",+ "skill": "big", "evidence": {}, "before": changed_before, "after": changed_after}+ safety = {**legacy, "id": "def456", "action": "pre-rollback", "before": full, "after": full}+ path = skill_ledger.ledger_path()+ path.write_text(json.dumps(legacy) + "\n" + json.dumps(safety) + "\nnot json\n", encoding="utf-8")+ size_before = os.path.getsize(path)++ entries, raw_before, raw_after = skill_ledger.compact_ledger()+ assert (entries, raw_before) == (2, size_before)+ assert raw_after < raw_before * 0.6, "the legacy patch entry shrank to its delta (the safety entry keeps its full capture)"+ rows = skill_ledger.list_entries()+ by_id = {r["id"]: r for r in rows}+ assert {Path(i["path"]).name for i in by_id["abc123"]["before"]} == {"SKILL.md"}+ assert len(by_id["def456"]["before"]) == 50, "pre-rollback safety entries keep their full capture"+ assert "not json" in path.read_text(encoding="utf-8")diff --git a/tests/tools/test_skill_usage.py b/tests/tools/test_skill_usage.pyindex 9b65f27de75..4439a4d575f 100644--- a/tests/tools/test_skill_usage.py+++ b/tests/tools/test_skill_usage.py@@ -347,6 +347,29 @@ def test_restoring_from_archive_clears_timestamp(skills_home):assert get_record("x")["archived_at"] is None+def test_archive_and_restore_key_on_skill_name_not_directory_name(skills_home):+ """`mlops/training/accelerate` is the skill `huggingface-accelerate`: archive lands under the NAME,+ and an older archive flattened under the directory name is still found by `restore_skill`."""+ from tools.skill_usage import archive_skill, mark_agent_created, restore_skill+ skills_dir = skills_home / "skills"+ d = skills_dir / "training" / "accelerate"+ d.mkdir(parents=True)+ (d / "SKILL.md").write_text("---\nname: huggingface-accelerate\ndescription: x\n---\n", encoding="utf-8")+ mark_agent_created("huggingface-accelerate")++ ok, msg = archive_skill("huggingface-accelerate")+ assert ok, msg+ assert (skills_dir / ".archive" / "huggingface-accelerate" / "SKILL.md").exists()+ ok, msg = restore_skill("huggingface-accelerate")+ assert ok, msg++ # Legacy layout: archived under the directory name by an older build.+ (skills_dir / "huggingface-accelerate").rename(skills_dir / ".archive" / "accelerate")+ ok, msg = restore_skill("huggingface-accelerate")+ assert ok, msg+ assert (skills_dir / "huggingface-accelerate" / "SKILL.md").exists()++def test_forget_removes_record(skills_home):from tools.skill_usage import bump_view, forget, load_usagebump_view("x")diff --git a/tools/skill_ledger.py b/tools/skill_ledger.pyindex 5a2a58dc77b..9d92de39cce 100644--- a/tools/skill_ledger.py+++ b/tools/skill_ledger.py@@ -243,6 +243,18 @@ def fill_snapshot_from_curator_backup(return out+def _delta(before: List[Dict[str, str]], after: List[Dict[str, str]]) -> Tuple[List[Dict[str, str]], List[Dict[str, str]]]:+ """Drop paths whose hash is identical on both sides. ``rollback_entry`` writes every *before*+ path and removes *after*-only paths, so unchanged files are dead weight there — and a full+ package manifest per edit made a 4,000-file skill cost 1.5 MB of ledger per patch (650 MB+ over one summer). Deletions/creations are preserved: a path present on one side only stays."""+ b_sha = {str(i.get("path")): i.get("sha256") for i in before}+ a_sha = {str(i.get("path")): i.get("sha256") for i in after}+ same = {p for p, s in b_sha.items() if a_sha.get(p) == s}+ return ([i for i in before if str(i.get("path")) not in same],+ [i for i in after if str(i.get("path")) not in same])++def append_entry(action: str, skill: str, before: Optional[List[Dict[str, str]]] = None,after: Optional[List[Dict[str, str]]] = None, actor: Optional[str] = None,@@ -251,6 +263,9 @@ def append_entry(if not ledger_enabled():return Nonetry:+ # pre-rollback deliberately records before == after (the current state of every touched path).+ if action != "pre-rollback":+ before, after = _delta(before or [], after or [])entry = {"id": uuid.uuid4().hex[:12], "ts": datetime.now(timezone.utc).isoformat(),"actor": actor if actor in _VALID_ACTORS else derive_actor(),@@ -266,6 +281,36 @@ def append_entry(return None+def compact_ledger() -> Tuple[int, int, int]:+ """Rewrite the ledger with every entry's unchanged paths dropped (see ``_delta``); ids, order and+ rollback semantics are preserved. Returns ``(entries, bytes_before, bytes_after)``. Atomic: the+ new file replaces the old only once fully written. Malformed lines are kept verbatim."""+ path = ledger_path()+ try:+ raw = path.read_bytes()+ except OSError:+ return 0, 0, 0+ out, kept = [], 0+ for line in raw.decode("utf-8").splitlines():+ if not line.strip():+ continue+ try:+ row = json.loads(line)+ except json.JSONDecodeError:+ out.append(line)+ continue+ if isinstance(row, dict) and row.get("action") != "pre-rollback":+ row["before"], row["after"] = _delta(row.get("before") or [], row.get("after") or [])+ line = json.dumps(row, ensure_ascii=False)+ out.append(line)+ kept += 1+ data = ("\n".join(out) + "\n").encode("utf-8") if out else b""+ tmp = path.with_name(path.name + ".compact.tmp")+ tmp.write_bytes(data)+ os.replace(tmp, path)+ return kept, len(raw), len(data)++def record_mutation(action: str, skill: str, before_root: Optional[Path] = None,before: Optional[List[Dict[str, str]]] = None, after_root: Optional[Path] = None,diff --git a/tools/skill_usage.py b/tools/skill_usage.pyindex 1d317d386d2..4097107d149 100644--- a/tools/skill_usage.py+++ b/tools/skill_usage.py@@ -617,7 +617,9 @@ def archive_skill(skill_name: str) -> Tuple[bool, str]:return False, f"skill '{skill_name}' not found"if is_external_skill_path(skill_dir):return False, _external_read_only_message(skill_name)- dest = _archive_dir() / skill_dir.name+ # Flatten under the skill NAME, not the directory name: `mlops/training/accelerate` is the skill+ # `huggingface-accelerate`, and restore/list/purge all key on the name.+ dest = _archive_dir() / skill_nametry:dest.parent.mkdir(parents=True, exist_ok=True)except OSError as e:@@ -643,9 +645,12 @@ def restore_skill(skill_name: str) -> Tuple[bool, str]:# "<skill>-YYYYMMDDHHMMSS" counts — a bare startswith("<skill>-") would let restoring "git" steal "git-helpers".dirs = [p for p in archive_root.rglob("*") if p.is_dir()]prefix = f"{skill_name}-"+ # Older archives were flattened under the DIRECTORY name (`accelerate` for `huggingface-accelerate`),+ # so fall back to the frontmatter name before giving up.candidates = [p for p in dirs if p.name == skill_name] or sorted((p for p in dirs if p.name.startswith(prefix) and len(p.name) - len(prefix) == 14- and p.name[len(prefix):].isdigit()), reverse=True)+ and p.name[len(prefix):].isdigit()), reverse=True) or [+ p for p in dirs if (p / "SKILL.md").is_file() and _read_skill_name(p / "SKILL.md", fallback=p.name) == skill_name]if not candidates:return False, f"skill '{skill_name}' not found in archive"if (dest := _skills_dir() / skill_name).exists():diff --git a/website/docs/user-guide/features/curator.md b/website/docs/user-guide/features/curator.mdindex 3cd5050e69e..2509ea10c27 100644--- a/website/docs/user-guide/features/curator.md+++ b/website/docs/user-guide/features/curator.md@@ -124,7 +124,7 @@ hermes curator purge [--days N] [--dry-run] # delete archived skills older than## Backups and rollback-Before every real curator pass, Hermes takes a tar.gz snapshot of `~/.hermes/skills/` at `~/.hermes/skills/.curator_backups/<utc-iso>/skills.tar.gz`. The snapshot covers the live skill tree only: `.archive/`, the audit ledger, `.hub/`, and the backups themselves are never rolled in, and a rollback never rewinds them (an older copy would lose archived skills or ledger entries). If a pass archives or consolidates something you didn't want touched, you can undo the whole run with one command:+Before a consolidation pass (`consolidate: true`, the only pass that rewrites skill content in place), Hermes takes a tar.gz snapshot of `~/.hermes/skills/` at `~/.hermes/skills/.curator_backups/<utc-iso>/skills.tar.gz`. The snapshot covers the live skill tree only: `.archive/`, the audit ledger, `.hub/`, and the backups themselves are never rolled in, and a rollback never rewinds them (an older copy would lose archived skills or ledger entries). If a pass archives or consolidates something you didn't want touched, you can undo the whole run with one command:```bashhermes curator rollback # restore newest snapshot (with confirmation)@@ -136,13 +136,13 @@ The rollback itself is reversible: before replacing the skills tree, Hermes takeYou can also take manual snapshots at any time with `hermes curator backup --reason "before-refactor"`. The `--reason` string lands in the snapshot's `manifest.json` and is shown in `--list`.-Snapshots are pruned to `curator.backup.keep` (default 5) to keep disk usage bounded:+The default prune-only pass takes no snapshot: it only moves whole directories into `.archive/`, which is its own undo (`hermes curator restore`), and every mutation is in the ledger below. Snapshots are pruned to `curator.backup.keep` (default 2) on every pass to keep disk usage bounded:```yamlcurator:backup:enabled: true- keep: 5+ keep: 2```Set `curator.backup.enabled: false` to disable automatic snapshotting. The manual `hermes curator backup` command still works when backups are disabled only if you set `enabled: true` first — the flag gates both paths symmetrically so there's no way to accidentally skip the pre-run snapshot on mutating runs.