-- Roll back T16 rollout verifier read grant seed.

SELECT set_config('app.project_id', 'awoooi', FALSE);

UPDATE awooop_mcp_grants
SET
    is_revoked = TRUE,
    revoked_at = NOW(),
    revoked_by = 'migration:t16_rollout_verifier_seed_down'
WHERE project_id = 'awoooi'
  AND agent_id IN ('pre_decision_investigator', 'post_execution_verifier')
  AND tool_id IN (
      SELECT tool_id
      FROM awooop_mcp_tool_registry
      WHERE project_id = 'awoooi'
        AND tool_name = 'k8s_watch_rollout'
  );

UPDATE awooop_mcp_tool_registry
SET
    is_active = FALSE,
    updated_at = NOW()
WHERE project_id = 'awoooi'
  AND tool_name = 'k8s_watch_rollout';
