fix(profiles): share the runtime-tree trio with backup via hermes_constants

backup.py imports hermes_cli.profiles only lazily and profiles.py never imports backup, so
there was no cycle to justify two literals. LOCAL_RUNTIME_ROOT_DIRS now feeds both
backup._EXCLUDED_ROOT_DIRS and the clone-all root gate; one invariant test pins the identity.
This commit is contained in:
teknium1
2026-09-15 15:05:29 -07:00
committed by Teknium
parent 8bac5c2d7b
commit cf94a29319
4 changed files with 27 additions and 10 deletions
+6
View File
@@ -157,6 +157,12 @@ def get_process_hermes_home() -> Path:
return Path(val) if val else _get_platform_default_hermes_home()
# Hermes-managed runtime downloads at the root of a home (GGUF models, llama.cpp runtimes,
# managed Node): re-downloadable on demand and routinely tens to hundreds of GB. Shared by
# ``hermes backup`` (excludes them) and ``profile create --clone-all`` (skips them from the
# default profile) so the two lists cannot drift apart.
LOCAL_RUNTIME_ROOT_DIRS: frozenset[str] = frozenset({"models", "runtimes", "node"})
# get_default_hermes_root() memo keyed on (native home, HERMES_HOME) so it stays
# fresh when a test or plugin mutates HERMES_HOME; saves ~80us/call at 31+ sites.
_default_hermes_root_memo: "tuple[str, str, Path] | None" = None