Files
prime-core/docs/PRIME_BOOTSTRAP.md
T

2.5 KiB

Prime Bootstrap v0

1) Environment

source /srv/prime-core/scripts/prime-env.sh
export PRIME_VAULT_KEY='set-a-strong-random-value'

2) Validate

prime status
prime dispatch planning "design backup policy"
prime dispatch coding "implement hello endpoint"

3) Backup/Restore

prime backup-now
prime restore <commit-id>

4) OAuth broker stubs

Current prime_core/oauth.py is a stub interface (start/callback) and encrypted token vault. Replace auth.example URLs and token exchange with provider-specific OAuth implementations.

5) Queue worker + approvals

prime queue add planning "design X"
prime queue run-once
prime queue list
prime queue approve <task-id>
prime queue deny <task-id> --reason "optional reason"

Worker service:

sudo systemctl status prime-worker.service

6) Telegram notifications

Set in local runtime secrets (.secrets/runtime.env):

  • TELEGRAM_BOT_TOKEN
  • TELEGRAM_CHAT_ID

Worker sends alerts for:

  • blocked approval tasks
  • failed tasks

7) Telegram control plane (beyond request/response)

Prime now includes:

  • prime-telegram-control.service (inbound command channel)
  • prime-autonomy-loop.service (goal-driven autonomous queue seeding)

Telegram commands:

  • status
  • queue list
  • queue add <task_type> <task>
  • queue approve <id>
  • queue deny <id> [reason]
  • run once
  • mode autonomous on|off
  • goals show
  • goals add <text>

8) Stability Sprint v1

Added:

  • Risk classification tiers (prime_core/risk.py)
  • Audit trail (logs/audit.jsonl)
  • Safer restore:
    • prime restore --dry-run <commit>
    • preflight + rollback on failure
  • Telegram control guardrails for high-risk direct commands

9) Backup classes + verification (Stability Sprint v2)

Prime now separates backups into classes:

  • scripts/backup/code-backup.sh -> git code/config backup
  • scripts/backup/state-backup.sh -> encrypted state snapshot (task-queue.json, tokens.enc)
  • scripts/backup/secrets-backup.sh -> encrypted secret escrow (optional, requires PRIME_SECRET_BACKUP_PASSPHRASE)

Timers:

  • prime-state-backup.timer (15m)
  • prime-restore-test.timer (nightly dry-run restore)
  • prime-audit-watch.timer (15m anomaly check)

11) Telegram allowlist controls

Prime responds only to allowlisted Telegram users. Owner (configured TELEGRAM_CHAT_ID) can manage list:

  • allowlist show
  • allowlist add <telegram_user_id>
  • allowlist remove <telegram_user_id>

Owner cannot be removed from allowlist.