fix(compliance): revoke badges on monitoring opt-out - #6438
Conversation
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — badge revocation on compliance opt-out plus a monotonic requalification gate.
Platform-only change (server/, registry OpenAPI, docs/building). No protocol schema surface (static/schemas/source/) touched; registry.yaml is explicitly excluded from protocol changeset scope (check-changeset-protocol-scope.cjs:92), so no changeset required. No spec drift, no oneOf regression, no released-artifact mutation.
Concurrency design verified sound: opt-out and revocation run as one serialized transaction under pg_advisory_xact_lock; the guarded upsertBadge SELECT...WHERE NOT EXISTS(compliance_opt_out=TRUE) fails closed under the shared lock; active-badge reads filter on COALESCE(compliance_opt_out,FALSE)=FALSE AND COALESCE(badge_requalification_required,FALSE)=FALSE. Migration 543 judged as production-facing (runs on startup) and is additive.
Well-covered by race, unit, and route tests. No blocking or medium findings.
Decision-table walk: no critical/high findings (row 1 n/a); gated_paths false (row 2 n/a); high_risk true but reasons are (modified)/(added) only — no deletions (row 3 n/a); no medium findings at all (rows 4/5/8 n/a); no prior escalation (row 6 n/a); no no-auto-approve team match (row 7 n/a). Falls through to row 9 — approve. high_risk is a look-closer heuristic; the (modified) files carry no medium-or-higher concern, so they are presumed safe.
Closes #6386.
Policy
Implementation
Validation
DATABASE_URLis available in CI; it is skipped locally without a test database.No changeset: this changes the website compliance service and its OpenAPI surface, not a protocol package release surface.