feat(memory): add hot/cold startup protocol with boot-pack generator and startup show

This commit is contained in:
Prime Backup Bot
2026-03-12 00:06:01 +00:00
parent 89cf3cd3e3
commit 02a9460bfd
6 changed files with 119 additions and 0 deletions
+15
View File
@@ -172,6 +172,21 @@ def parse_and_handle(chat_id: int, msg_id: int, text: str) -> str:
if not parts:
return help_text()
if parts[:2] == ['startup','show']:
try:
import json
from pathlib import Path
bp = Path('/srv/prime-core/state/boot-pack.json')
if not bp.exists():
return 'Boot pack not generated yet.'
data = json.loads(bp.read_text())
s = data.get('summary', {})
return (f"Boot pack @ {data.get('generated_at_utc')}\n"
f"goals={s.get('goal_count')} queued={s.get('queued_count')} blocked={s.get('blocked_count')}\n"
f"chat={s.get('chat_enabled')} strict={s.get('strict_mode')} autonomous={s.get('autonomous_enabled')}")
except Exception as e:
return f"startup show error: {e}"
if parts[:2] == ['allowlist','show']:
if str(chat_id) != owner_id():
return 'Not authorized.'