Skip to the content.

RFC 0023: Staging CVM for Autonomous Daemon Development

Summary

Stand up a second, always-on CVM on pha-prod as the deploy target for autonomous (Paseo) daemon development, separate from the load-bearing hermes-staging CVM. The Paseo loop builds and deploys candidate daemon images to staging; a human tests against it; promotion to the production CVM stays a laptop-only gated step (merge the PR to origin/main, then ship-fix.sh prod). The capability to break production is held only by the laptop.

Problem

There is no environment where an autonomous loop can deploy and exercise a candidate daemon build without risking production.

Files / infra to modify

Implementation

  1. Provision the staging CVM on pha-prod (same cluster as today) with its own cvm-id (e.g. webhost-staging), its own owner token, and its own external named volumes. It hosts only test projects the loop deploys — no co-hosted production apps.
  2. Parameterize ship-fix.sh by target. staging → the staging cvm-id/compose/env/token; prod → the existing hermes-staging wiring. The prod target is absent from the loop’s environment, so the loop cannot deploy to prod even by mistake.
  3. Autonomous deploy to staging. After the local suite passes, the loop builds → pushes a staging-tagged image to ghcr → phala deploy --cvm-id webhost-staging --wait. This is the step the loop owns end to end.
  4. Human test step. The operator exercises the candidate against the staging URL — the real CVM behaviors local docker can’t show (recover, gateway ingress, and the attestation surface to the extent pha-prod exposes it; see Out of Scope on chain_id 0).
  5. Promote (laptop-gated). Merge the PR to origin/main (existing path), then from the laptop run ship-fix.sh prod, which upgrades the production CVM. This is the only step that touches production, and it requires a human plus the laptop-held token.
  6. Hygiene for an always-on box (accepted drift). The loop periodically redeploys staging from origin/main HEAD so the running image tracks origin, and tears down stale test-* projects between cycles. This is the lightweight anti-drift habit; full reproducible-from-pin restore is RFC 0017’s job, not a prerequisite here.

Testing & Validation Requirements

Out of Scope