Files
clawmates/migrations/0054_drop_teams_zeroclaw_columns.sql
T
Omar Sobh 854a617777 task #23: retire per-team ZeroClaw container coords (Option A)
Missions never populated teams.zeroclaw_container /
teams.zeroclaw_gateway_url — those were research/loops-era columns
for long-lived per-team containers. Every mission-materialized team
runs inside the SHARED runtime as claws-as-agents provisioned via
RuntimeProvisioner. Reading zeroclaw_container on a mission row
always came up NULL, making security_scan + benchmark_runner
silently fail with "mission has no team container yet."

Changes:
  - migrations/0054_drop_teams_zeroclaw_columns.sql — DROP both
    columns.
  - cm-db/src/repo/teams.rs — delete dead helpers
    team_container_coords + set_team_container_coords.
  - cm-api/src/security_scan.rs — replace team_container_for_mission
    with exec_target(pool, mission_id): container from env
    CLAWMATES_RUNTIME_CONTAINER (default clawmates-runtime); workdir
    from env CLAWMATES_MISSIONS_ROOT + /{mission_id}/repo
    (same convention pdf_renderer uses); precondition that mission
    must have repo_id bound.
  - cm-api/src/benchmark_runner.rs — same shape.

Follow-up (not in this commit): mission_orchestrator + compose stack
still need to wire a per-mission repo checkout under
CLAWMATES_MISSIONS_ROOT before scan/bench actually produce findings.
Columns cleanup here removes the misleading silent-fail; the
missing-checkout gap is now surfaced with a clear error.

Verified: SQLX_OFFLINE=true cargo check --workspace + cargo test
-p cm-api --test mission_orchestrator both green.

Closes task #23.
2026-07-19 23:18:28 -07:00

26 lines
1019 B
PL/PgSQL

-- Task #23: retire per-team ZeroClaw container coords.
--
-- The zeroclaw_container + zeroclaw_gateway_url columns on teams were
-- a research/loops-era artifact: each team owned its own long-lived
-- ZeroClaw daemon. Missions replaced that model — every mission-
-- materialized team is a workspace-scoped ephemeral roster of claws
-- provisioned as agents inside the SHARED runtime (see
-- mission_orchestrator + runtime_provision::RuntimeProvisioner).
--
-- Missions never populated these columns; only the legacy team-wizard
-- did (via set_team_runtime_config, now pruned). Keeping them made
-- security_scan + benchmark_runner silently fail on mission runs
-- because they read a NULL container name.
--
-- The mission-era exec target is (shared runtime container) at
-- ($CLAWMATES_MISSIONS_ROOT/$mission_id/repo). See security_scan.rs
-- + benchmark_runner.rs for the resolver.
BEGIN;
ALTER TABLE teams
DROP COLUMN IF EXISTS zeroclaw_container,
DROP COLUMN IF EXISTS zeroclaw_gateway_url;
COMMIT;