teardown.sh: read multi-line 404s and deleted service accounts as already gone; quiet revokes #123
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.39) × (1 − Review Confidence (0.48)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 233 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.00 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.350
Diff Size
diff_size
0.326
Real PR Conversation Timeline
2 items
Approved
LGTM
annapendleton
aditya-shantanu
Seen on a real teardown (friction #30–#32): a re-run after everything was deleted, and a run with the wrong
CLUSTER_LOCATION, ended withFAILED: delete cluster/FAILED: delete node service accountand "Resources from these steps may still exist (and bill)" when nothing did; every revoke printed the project's whole IAM policy.already_gonenow reads gcloud's whole error block from itsERROR:line on, not just that line.gcloud container clusters deleteprintsSome requests did not succeed:and puts thecode=404on the next line. This also lets the existing "cluster exists in another location" check run.Service account deletes: IAM answers an account deleted in the last 30 days with
PERMISSION_DENIED ... (or it may not exist), the same words as a denied delete of an existing account (verified read-only:describegets the same answer, so it cannot tell the cases apart;listomits deleted accounts). The step now lists the project's accounts: absent counts as deleted, present fails the step and says the delete was denied, a denied listing warns and counts it as deleted, as the cluster step already does for a deniedclusters list.remove-iam-policy-binding(project and bucket) passes--format=none(verified with gcloud 583.0.0;Updated IAM policy for project [...]still prints).Tests: the fake gcloud can return multi-line errors; new tests use the texts gcloud printed, cover the four outcomes of the service account check, a plain denial, and that every revoke passes
--format=none.go test ./tools/setup-gcp/...passes;bash -nand shellcheck show nothing new.tools/cleanup-gcpruns this repository'steardown.shdirectly, so nothing to bump there.Fixes #117