Repository navigation
fix(api): platform GCP orphan sweep auth (box branch, P1b) - #2750
simple-agent-manager[bot] wants to merge 5 commits into
Conversation
…ep (box branch) Port of sam/task-p1-find-out-jq3vp8 runtime + tests onto sam/selfhost-pass-2: resolveProvider builds a GCP provider (WIF or key) for a platform GCP credential, and the scheduled handler reports contained per-credential sweep errors through the durable isolate path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
Pure move, no behaviour change: claim check, final ownership re-read, delete and deletion record move from provider-orphan-reconciliation-core.ts (575 lines) to provider-orphan-destroy.ts, ahead of a change to the delete path (file size rule 18). Candidate and OwnershipScope become exported types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same change as 3f6d352 + 253e666 on sam/task-p1b-prove-platform-dyk8zb: per-call request timeouts, sweep-budget deadline, and send-and-return GCP deletion bound to the re-read instance (expectedInstance), counted as deletionRequested. Found on the box in R16: one 5 s signal for the whole pass aborted the GCP delete before it was sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the security-auditor, cloudflare-specialist, test-engineer and task-completion-validator reviews: - Claim lookup batches node ids under D1's 100 bound-parameter limit; a backlog of 100+ orphans failed every pass before. - The GCP delete is bound to the re-read's zone and ownership labels: expectedInstance.labels are re-checked on the provider's last read before the DELETE, and a known zone is read directly instead of walking every labelled zone. A re-read without a zone is refused, not bound by id alone. - Failures confined to one user/project account count as accountErrors and no longer fail the platform sweep, so one tenant's dead credential cannot mask a platform failure or page operators every hour. - Tests: delete-boundary label/id change, 105-candidate backlog against a D1 fake enforcing the bind limit, persisted audit record, hung re-read, mid-pass budget, no-zone refusal, wider INCIDENT margins with an elapsed precondition. - Deferred MEDIUM/LOW items filed in tasks/backlog/2026-11-15-provider-orphan-sweep-followups.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CodeRabbit (major): moving every failure inside a user/project account pass into accountErrors also hid D1 claim-lookup failures, so every account could fail against the shared database while the sweep reported green. Classify at the source instead: provider-attributable failures (list, re-read, delete, credential resolution) go to accountErrors for user/project accounts and to errors for the platform account; a D1 claim-lookup failure stays in errors wherever it happens. Also corrects the follow-up backlog note: the audit write runs after the delete request (CodeRabbit minor). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Closing as superseded (self-host coordinator, task 01M7FB384QHQ1TQCK95D0SX0TX). This was the box branch for the orphan sweep fix. The reviewed version of the same fix landed on main as #2757 (a886029) and reached |



Summary
Box branch for task P1b (01M7FBJF8CK4Y9KTY1PW4Y9QTR). Ports the platform-GCP orphan sweep fix from
sam/task-p1-find-out-jq3vp8(P1, task 01M7E7PHTQH57W6EPC8ZJQ3VP8) onto the self-host integration branch so it can be proven on the self-host test box, whose only cloud provider is Google Cloud through a platform credential with workload identity.provider-orphan-reconciliation-core.tsresolveProvider(): a platform GCP credential (workload identity or service-account key) now builds a GCP provider through the existingcreateGcpTokenProvider/createGcpProviderForEnvpath, acting as the credential's creator with no project scope. Before, the static provider builder rejected every GCP credential, so the sweep failed on every five-minute cron.platform-credentials.ts:getPlatformCloudCredential()also returnscreatedBy.scheduled/handler.ts: contained per-credential sweep errors are reported through the durable isolate path; partial-success counters are kept.provider-orphan-platform-gcp.test.ts(real encrypted platform credential lookup, token exchange, provider HTTP boundary, owned vs foreign/legacy) andhandler-kill-switch.test.tsadditions.Runtime/test diff is the same as P1's except for one conflict in
handler.ts, where the integration branch's reverse-tunnel lease sweep was kept next to it. Task files are not included.Draft. Do not merge. It may be made moot by the next merge of
mainintosam/selfhost-pass-2.Validation
apps/apitypecheck, eslint and prettier on the changed files pass🤖 Generated with Claude Code