Files
clawmates/migrations/0059_mission_runtime_pairing_code.sql
T
Omar Sobh b569688e04
ci / gates (push) Successful in 10s
ci / rust (push) Failing after 23s
ci / frontend (push) Successful in 38s
ci / e2e (push) Skipped
ci / publish (push) Skipped
fix(mission_runtime): per-mission auto-pair via container log scrape (C3 auth)
The seed-mount approach didnt work: even with the shared runtimes
data dir bind-mounted, a fresh gateway instance mints a new pairing
key and requires re-pairing. The topology_worker connect returned
401 forever.

New approach — per-mission gateways self-pair:
- Provisioner tails container logs after start, extracts the
  X-Pairing-Code from the boot banner
- Persists it on missions.runtime_pairing_code (migration 0059)
- topology_worker constructs ZeroClawDriveExecutor with THAT code
  via from_env_for_gateway_with_code, which triggers the lazy
  /pair handshake on first turn and caches the returned bearer

Drops the shared-runtime data-dir mount — each per-mission gateway
now owns its own state, restoring the C3 isolation guarantee.
2026-07-22 13:06:25 -07:00

14 lines
596 B
SQL

-- Per-mission ZeroClaw pairing code.
--
-- Fresh mission runtime containers mint a new one-time pairing code
-- at startup. mission_runtime::ensure_container captures it from the
-- container's stdout and persists it here so the topology_worker's
-- ZeroClawDriveExecutor can lazy-pair with THIS gateway (instead of
-- reusing the shared runtime's env-derived ZEROCLAW_TOKEN, which the
-- fresh gateway doesn't accept).
--
-- Nullable: pre-C3-pair missions + non-mission topology runs fall
-- back to the shared-runtime env auth path.
ALTER TABLE missions ADD COLUMN runtime_pairing_code TEXT;