refactor: config auto-migration support floor at v12 + deprecated shim retirement

This commit is contained in:
teknium1 2026-07-29 15:42:56 -07:00 • committed by Teknium
parent 5c07ba2f3a
commit 4b33e5663b
15 changed files with 520 additions and 166 deletions

View file

@ -14,6 +14,10 @@ from hermes_cli.config import (
get_env_path,
migrate_config,
)
from hermes_cli.config_migrations import (
SUPPORT_FLOOR_VERSION,
support_floor_message,
)
from utils import env_var_enabled
@ -59,6 +63,17 @@ def main() -> int:
if current_ver >= latest_ver:
return 0
# Below the auto-migration support floor: migrate_config() refuses (and
# leaves the file untouched), so don't run the backup/verify dance that
# would raise "did not advance config version" and block the boot.
# Warn-and-continue matches the CLI's fail-safe posture.
if current_ver < SUPPORT_FLOOR_VERSION:
print(
f"[config-migrate] WARNING: {support_floor_message()}",
file=sys.stderr,
)
return 0
backups = _backup_existing((get_config_path(), get_env_path()))
backup_text = ", ".join(str(path) for path in backups.values()) if backups else "none"
print(