Skip to content

fix: retain committed compute catalogs and recover accepted wakes - #2693

Merged
simple-agent-manager[bot] merged 34 commits into
mainfrom
sam/implement-resilient-compute-catalog-8nh1yj
Nov 15, 2026
Merged

simple-agent-manager[bot] merged 34 commits into
mainfrom
sam/implement-resilient-compute-catalog-8nh1yj

Conversation

@simple-agent-manager

@simple-agent-manager simple-agent-manager Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Keep committed capacity usable during catalog replacement, resume interrupted publication durably, and preserve accepted sleeping-session inbox requests through temporary placement blockers. Bootstrap remains unavailable until validated publication; current revocation and permissions remain authoritative.

Release candidate 177e4ad12d2196443a913c2dffe4b4728ad3bf9e. It incorporates latest main ef7d3af4d and archives the completed implementation record. Runtime source is byte-identical to staged/reviewer-approved aeace2bea5b0ca440ab19ac748c868df249aaa35 across apps/api/src, packages/*/src, apps/web/src, and apps/api/wrangler.toml. Final completion review A–F PASS, no blocking findings; final SHA delta approval is recorded; current-head ready/full CI passed; production deployment and the basic public health smoke passed. Canonical Idea 01M77P985TDMCJ28JTTQHEYMC7; task tasks/archive/2026-11-12-resilient-catalog-wake-recovery.md. Preserve implementation profile Sol / openai-codex; the disposable accepted fixture used Claude Code.

The human shipping decision was recorded in comment 6902865969, including acceptance of the R8 timing deviation. The shipping coordinator removed needs-human-review at 23:04 UTC after independent cleanup was confirmed. Final successor approval is recorded above; normal CI and production verification remain required.

Implementation

  • Complete validated catalogs promote from private columnar staging in one pool/source/configuration/generation-fenced D1 transaction. Established catalogs remain usable during ordinary incomplete or failed staged replacement. Missing-offering cleanup waits for completed exhaustive inventory. Unchanged validated partial catalogs avoid republication. Successful promotion removes staging rows.
  • Durable scope work retains cursor, generation/claim, attempts, first-start/deadline, next action and last success. Minute continuation is independent of daily full discovery and survives process loss/missed notifications. Aggregate/source deadlines and bounded backoff remain configurable through the existing admin settings registry. Exhaustion persists an Admin Errors record and operator notification; failed episodes retain their cooldown.
  • Temporary catalog, lookup and capacity conditions preserve the original accepted human/event inbox identity and TTL. Empty pools, credential/configuration failures, impossible requirements, cancellation, archive and permission loss remain accurate terminal outcomes. A pending flag means actual nonterminal unexpired durable work, never just a migration mirror.
  • VM activation follows restore, agent-ready and committed TaskRunner handoff. Direct activation checks D1 archive routing and the local archive fence before/after awaited authority. Receipt reconciliation uses allowWake:false. Committed exact-workspace follow-ups do not depend on historical wake-task terminal status.
  • Existing running-node reuse validates current scoped pool/source/candidate/member/credential authority without treating harmless catalog revision churn as a request to allocate again. Paid external VM creation retains strict allocation-plan fences and uncertain-creation reconciliation. No exactly-once external-effects claim or new state-machine framework.
  • Infrastructure refresh failures use the existing shared Alert while retaining usable capacity. The UI change has reviewed desktop/mobile evidence below. Ubuntu24.04 runner pins match merged prerequisite PR2744; the isolated clear.tap test correction preserves its assertions and is documented in prior review evidence.

Validation

Current ready-state full CI 43773183978 PASSED on the unchanged, approved 177e4ad12d2196443a913c2dffe4b4728ad3bf9e: PR evidence, Playwright, all API/web/Worker shards, coverage aggregation, workspace quality, CLI, build/typecheck, lint/security/deployment checks and required whole-suite Durable Object Workers aggregate. Pending=[], failures=[]. Reviews and unresolved threads are empty; no later human change was found at the final pre-merge reconciliation. Merged at 23:35:12 UTC as 96be6b24afc6a99d27897d2f061a63eea4389f32. Main push CI 43775620827 passed. Automatic production deployment 43777052388 passed, including SHA verification, container rollout, deployment health check and recording success. Independent basic public smoke at 2026-11-16 00:16:43 UTC passed: GET https://api.simple-agent-manager.org/health returned HTTP 200 / healthy, and HEAD https://app.simple-agent-manager.org/ returned HTTP 200. Health does not expose a build SHA; the exact source identity comes from the successful pinned deployment workflow. No authenticated production lifecycle test was performed.

The prior full run 43770674235 passed every functional job, including Playwright and the required whole-suite aggregate. Its evidence job failed even after the shipping coordinator removed the review label because the validator deliberately unions frozen event labels with live labels. An isolated rerun confirmed that constraint. A fresh draft-to-ready event started the current run with a clean label snapshot; no source changes, gate changes or new staging trial were needed. The CodeRabbit label was removed before this metadata transition to prevent another request after the recorded rate-limit response. The automatic request workflow 43773184074 skipped as intended. Merged at 23:35:12 UTC as 96be6b24afc6a99d27897d2f061a63eea4389f32. Main push CI 43775620827 passed. Automatic production deployment 43777052388 passed, including SHA verification, container rollout, deployment health check and recording success. Independent basic public smoke at 2026-11-16 00:16:43 UTC passed: GET https://api.simple-agent-manager.org/health returned HTTP 200 / healthy, and HEAD https://app.simple-agent-manager.org/ returned HTTP 200. Health does not expose a build SHA; the exact source identity comes from the successful pinned deployment workflow. No authenticated production lifecycle test was performed.

Focused regression evidence retained in the archived task: 271 native cases across five suites, seven real Workers scheduled-entry cases, 46 existing publication interruption/fencing cases, original wake/handoff suites, and thirteen authority mutants producing 111 independent negative assertions. Real SQLite/D1/ProjectData/TaskRunner entry points are exercised with provider/VM HTTP mocked. Pre-fix and controlled-mutation failures discriminate the repaired transitions. Counts overlap and are not summed.

R8 separately exercised a real GCP VM, available snapshot, original accepted wake, completed Bash and independent file verification. The untouched legacy cursor adopted and completed automatically. R8's later publication deadline miss and cleanup-driven promotion are described below; they are not claimed as a full R8 pass. No runtime edits were made after this staged head. Detailed source/test/caller audits, earlier CI links and recipe history remain in the archived task and PR review comments.

Latency and work budgets

The configurable defaults remain minute continuation,20s shared pass/source publication budgets,180s lost-claim lease,15s→300s bounded backoff,2h execution episode and6h failed cooldown. Queued residence spends no execution deadline; every continuation preserves its first claim's deadline. Due eligibility does not guarantee all competing scopes finish in one tick.

At3,418 materialized rows/200batch:18 staging writes + about18 cursor writes +1 promotion transaction =37 write round trips. At0.5s/write assumption that is18.5s excluding reads/provider/preparation/promotion, so another20s pass can be necessary. Forced one batch/pass needs17 backoffs totaling4,065s/67.75min plus≤17min tick quantization; contention can exhaust2h. At7,200rows:36batches/~73writes/36.5s at the same assumption. One batch/pass would require35backoffs totaling9,465s/157.75min before tick quantization, exceeding2h. The diagnostic0 budget must therefore be restored promptly and is not a production throughput setting. Actual live wall/D1 timing is still unmet.

R8 staging evidence — 2026-11-15, exact head aeace2b

The original accepted wake restored the sleeping chat on the same GCP node while catalog publication was unfinished. Both settled turns completed real Bash. Independent signed-in raw-file reads before sleep and after original delivery/handoff returned the same 36 bytes and SHA-256 efbdd5cbabc8453179700e30822a18d7250b03d67706e60a90c638471633128d. No follow-up prompt was used.

R8 promotion time bound MISSED by 82.291 s: complete publication at 22:20:35.222Z, after the 22:19:12.931Z cutoff. The cleanup membership PATCH reached the API at 22:20:20.947Z and drove completion; this trial does not prove ordinary-minute completion. The earlier untouched legacy adoption completed automatically in 16.8 seconds and remains separate evidence. Actual 3,418-row promotion took 449 ms wall time / 105.7523 ms summed D1 time (not CPU). The conservative GLOBAL zero interval was 92.206 seconds; reviewer accepted that target deviation because the binding acceptance/restoration cutoff was met. Screenshots were skipped after the publication cutoff miss.

Strict first and delayed cleanup checks passed: exact GCP instance/disk 404; complete instances/disks/addresses empty; all owned D1 IDs absent including terminal tombstones; memberships and admin baseline restored; sign-out 200/session null/cache removed; all 56 finite managed jobs terminal. Independent FREE was confirmed by two D1/GCP passes; release workflow 43769494662 succeeded and authoritative lease deployment 7811031962 is released. The window is CLOSED.

Safe evidence: Library 01M7GN519MFCMREMBM7QWN3ZJ3 (catalog2693-r8-live-evidence.zip, 25 files), SHA-256 872936f54fb74451148698a4865b13b612c33685f6c335ebccaa6bf44803e99b. No auth material or raw logs/transcripts are included.

Specialist Review Evidence

Current371e scoped delta reviews below completed with no findings. Earlier source reviews remain applicable to unchanged implementation; real staging/release gates remain open.

  • All local reviewers completed; findings addressed. Release gates passed separately as recorded above.
Reviewer Status Outcome
lease_merge_review (local) PASS Exact aeace2b merge: wake/archive authority and main stream/cron/settings preserved; all workflows main-identical.
lease_merge_test_review (local) PASS 67-path test preservation audit; only handler combines both parents. Implementation/test preservation PASS; closed R8 evidence is above.
Cloudflare / legacy_adoption_review PASS 371e review: structured wrangler dual-parent comparison preserves bindings/limits/migration tags; generated env/settings intact. Earlier indexed SQL/CAS/quarantine review retained.
Test engineer / legacy_adoption_tests PASS 371e review: independent legacy digest vector, all3 catalogComplete inputs, discriminating format-removal mutant; original46 cases retained. Real Workers scheduled-entry matrix7 remains PASS.
Security / legacy_authority_docs_review PASS 371e provenance:70 main-only files match reviewed mainfd0be69,102 feature-only files match26ecdb; main auth/setup/security exact. No new authority logic in merge/I2. Prior point-adoption authority review retained.
Constitution / legacy_authority_docs_review PASS 371e retains configurable six refresh admin settings/shared defaults; only reviewed main archive cadence/budget added. No new component/dependency.
Documentation / legacy_authority_docs_review PASS 371e admin docs retain both feature refresh controls and reviewed main token masking/clear-source prose; I2 rollback safety requirement documented. Earlier measured10/11/12 helper I/O retained.
Cloudflare / runner_pin_review PASS Exact merged2744 runner differences;167 focused workflow tests; no relaxed guards/triggers.
Security / refresh_authority_review PASS Selected credential/source current authority;13 guard mutants/111 negatives; strict paid-allocation boundary retained.
Cloudflare / catalog_scale PASS Columnar indexed atomic promotion and scoped cleanup;7,200-row query/bind tests.
Test / Constitution / Documentation / refresh_test_review PASS Real provider backoff/cooldown/daily revival, cron failure signal, archive/terminal follow-up and configurable finite work; wording findings addressed.
Prior UI / wake_tests PASS 19 rendered tests and12 reviewed desktop/mobile screenshots; unchanged by successor.
Completion / refresh_test_review PASS Implementation findings addressed; closed R8 trial and final coordinator approval recorded above.
Completion / release_completion_review PASS Final A–F implementation audit: no blocking findings. CI, merge and production verification passed separately as recorded above.

Known boundaries

Bare eviction blocked before first claim without an accepted inbox driver:01M7E0QC19VCAHN64XQCFCTMW1. Deployment/direct-workspace strict allocation boundary:01M7DX501KMF9FNXAKAW1HD96R. BYO/legacy existing-node contract:01M7E0QCRKYW6149XY3CT3DR4D. Readonly viewer hydration:01M7E0QDHREA8Z8PAA4DQ106D6. Settings combinations:01M7E0QE8CN2RRS8FNMEV0ZPMV. Failed-discovery fairness/alerts:01M7E0QEZ3NJQ199S1RTFK20JY. Async UI feedback:01M7E0QFP9FSV6HRDYG9YH0NKX. Remaining producer/archive coverage:01M7E0QGC85R1X67X7EQMMGXCX. Daily repromotion/abandoned staging/no-op cleanup:01M7E45G42MTTY2QF6DHMA1PWV; plan discrimination:01M7E45GT7X31TVJ6927QS5524; credential re-save bootstrap:01M7E45HGVM7ASNJC58FPXP68K; lost activation then ended task:01M7E45J6B12T1384H1506HD4Q. All linked to canonical Idea. Idle mirror-complete adoption followup is stated above.

R8 continuation progress/backoff follow-up: Idea 01M7GN7PK7QVN6ZSV0CP1ZAXWZ. Idle mirror-complete publication demand/discovery follow-up: Idea 01M7FN82782X6K04SEHF6JBY2E. These limits are disclosed and accepted in the exact-SHA coordinator decision. No claim that this trial proved cron-only completion.

CodeRabbit Review Evidence

Final ready head 177e4ad12d2196443a913c2dffe4b4728ad3bf9e: marking ready automatically requested review through trusted workflow 43770674617; CodeRabbit replied Review rate limited at 22:41:33Z. A fallback was dispatched before the automatic request was noticed (43770684492); it also received rate limited at 22:42:04Z. Both finished, no review arrived, and no further request will be made. Rule 25 ends the wait on an explicit rate-limit response; no human waiver is needed. Historical skipped-review provenance remains in the PR comments and archived task.

UI Compliance Checklist

  • Mobile-first layout and accessibility checked
  • Shared Alert component used
  • Playwright mock audit at375x667 and1280x800, dark/light,3scopes; no overflow
  • Screenshot PR comment posted and linked below
  • All12screenshots reviewed; no visual issues found (coordinator also independently reviewed4)

UI Screenshot Evidence

Playwright generated the12screenshots below at375x667/1280x800; allwereopenedandreviewed.

Surface: Project infrastructure refresh failure

Surface: Personal infrastructure refresh failure

Surface: Installation infrastructure refresh failure

Shared placement-authority caller audit (rules67/44)

Direct caller Existing node? / mode Action and reason
apps/api/src/services/workspace-admission-sql.ts buildWorkspaceAdmissionSql Yes / existing-node Workspace insert, placeholder attachment and restart; final current authority and observed reservation limits, no VM creation
apps/api/src/services/reusable-node-authority.ts filterReusableNodesByCurrentAuthority Yes / existing-node TaskRunner ranking, preferred host and warm claim eligibility; returns IDs and advances to workspace creation
apps/api/src/services/node-allocation-validation.ts assertNodeAllocationPlanCurrent Creation proof / strict allocation-plan Used before/after paid provider creation. Never globally relaxed; indirect explicit-node workspace caller limitation below
apps/api/src/services/deployment-node-admission.ts linkEnvironmentToNode Mixed running reuse + pre-create / strict allocation-plan Deliberately unchanged; running old-revision reuse can refuse and an unlinked environment can allocate a fresh node; tracked followup below
apps/api/src/services/deployment-node-admission.ts claimDeploymentEnvironmentRelocation Mixed existing/stopped source + target-volume placement / strict allocation-plan Deliberately unchanged; claim loss refuses detach/provision and can visibly fail release/volume relocation. Blanket existing-node mode would newly refuse legitimate stopped-source cleanup
apps/api/src/services/session-snapshot-upload-relay.ts findSessionSnapshotUploadRelay Yes / existing-node Selects healthy running current-agent managed VM, exact provider/native affinity and current pool/source/candidate/credential/member authority
apps/api/src/services/session-snapshot-upload-relay.ts verifySessionSnapshotRelayAuthorization Yes / existing-node Node-scoped callback token plus the same live authority; only authorizes upload through an existing relay

Existing-node mode is an ephemeral SQL option, never persisted in a CapacityPlacementSnapshot. TaskRunner reuse advances directly to workspace creation; a rejected reservation clears node/snapshot before reselecting, and fresh provisioning reranks/applies a fresh candidate. Every paid createVM remains behind strict assertNodeAllocationPlanCurrent in apps/api/src/services/node-provisioning.ts. Uncertain allocation recovery only reads provider inventory and refuses another create when identity is unresolved. Fresh relay provisioning separately resolves a canonical plan, creates its own row and calls strict provisionNode; the relay SELECTs cannot grant create authority. The new positive regression calls ensureSessionSnapshotUploadRelay and asserts zero createNodeRecord/provisionNode calls.

The running/provider-instance-ID clauses apply only to concrete pooled managed VMs. User-owned nodes return through their separate branch first (real SQLite test: workspace-placement.test.ts, “admits a user-owned direct node only through verified observed capacity and project access”); legacy unpooled authority is unchanged (placement-authority-effective-pool.test.ts controls). Instant is already outside this VM predicate. Missing managed provider identity and creating-state rejection controls remain explicit.

Tracked unchanged boundary: SAM Idea01M7DX501KMF9FNXAKAW1HD96R. Deployment linking is shared with pre-create admission; volume relocation also handles stopped sources and desired-target offering/co-location. A partial link-only change would let an old-revision exclusive volume host link, then fail its later strict volume claim in a caught/logged path. Both predicates therefore remain unchanged pending a coherent source-authority/target-volume design. Current unlinked deployments can provision another node after refused reuse; linked old-revision releases/relocations can fail visibly. The indirect explicit-node POST /workspaces caller (apps/api/src/routes/workspaces/workspace-create.ts:276) also retains its strict allocation assertion and can visibly reject old-revision pooled nodes before final admission. The sleeping-session TaskRunner/relay fix does not claim those separate lifecycles repaired. No deployment product change ships in this PR.

Post-Mortem

What broke

An established sleeping session was refused before VM start during catalog republication, and its accepted wake was treated as permanently impossible. A metadata revision also prevented healthy allocated nodes from accepting new work.

Root cause

Readiness gating from1d21cb8e1 treated every incomplete publication as migration-pending; discovery recorded its run before durable completion. The earlier700a9c61a throughput fix left readiness/continuation deferred. Recovery collapsed the temporary state into placement_unsatisfiable. Allocation revision fences were also applied to existing-runtime reuse.

Class of bug

Cross-layer state/authority conflation and lost durable continuation.

Why it wasn't caught

Focused interruption/fencing tests already existed; they did not jointly assert committed usability, original accepted wake delivery and final handoff across replacement. The GCP disk test previously held revision4 constant; it now uses real publication and current summary/selection.

Process fix included in this PR

Real-entry SQL/Workers transition regressions, the current-main late-migration upgrade case and explicit throughput/coverage boundaries enforce existing E2E/bounded-loop rules. No new standing rule is needed.

Post-mortem file

tasks/archive/2026-11-12-resilient-catalog-wake-recovery.md; canonical idea01M77P985TDMCJ28JTTQHEYMC7.

Agent Preflight

  • Preflight completed before code changes

Classification

  • external-api-change
  • cross-component-change
  • business-logic-change
  • public-surface-change
  • docs-sync-change
  • security-sensitive-change
  • ui-change
  • infra-change

External References

N/A: reuses existing D1 batching, Durable Objects, cursors, scheduler, provider and deadline contracts; no new external API/dependency contract.

Codebase Impact Analysis

Worker publication/continuation/placement/recovery and TaskRunner under apps/api/src/services/ and apps/api/src/durable-objects/task-runner/; schema in packages/worker-core/src/schema.ts; pure placement contracts in packages/scheduler-core/src/; ProjectData client/readiness/lifecycle in packages/project-data/src/. No duplicate extracted implementation. UI failure notice remains apps/web/src/components/project-settings/DefaultCapacityPoolsPanel.tsx.

Documentation & Specs

Compute/admin settings guides and archived task evidence are updated. Existing admin registry patterns; no new environment variable.

Constitution & Risk Check

Principles X/XI: smallest complete change and configurable shared budgets. Atomic publication CAS, exact current authority, captured runtime/task/workspace/owner fences, durable retry/cancellation/TTL and adversarial transition tests address the main races. Retained catalog grants no revoked authority.

Authority guard discrimination record (required E)

Executed against the existing-node revision-tolerance implementation: real SQLite predicates, relay discovery/authorization and workspace insertion; external allocation and JWT callback boundary are stubbed. Baseline and byte-exact restored source each pass all123 tests. Thirteen sequential narrow mutants produce111 intended failures in apps/api/tests/unit/services/session-snapshot-relay-current-authority.test.ts. Every negative first executes a successful owner-path control. The cross-user mutant tests the combined redundant boundary; it does not claim each comparison alone is necessary. No mutation remains in the candidate.

Mutant Guard deleted/neutralized Intended and observed failures
excluded-source Remove current pool excluded-source NOT EXISTS guard 15
pool-not-default Remove p.is_default = 1 15
higher-precedence Disable higherPrecedenceExclusion branch 9
viewer-capability Replace current project-member role capability predicate with true 15
legacy-credential-version Remove current_legacy_credential.updated_at version equality 6
platform-credential-version Remove current_platform_credential.updated_at version equality 3
composable-credential-version Remove current_cc_credential.updated_at version equality 6
legacy-credential-active Remove current_legacy_credential.is_active = 1 6
platform-credential-enabled Remove current_platform_credential.is_enabled = 1 3
composable-credential-active Remove current_cc_credential.is_active = 1 6
composable-configuration-active Remove current_cc_configuration.is_active = 1 6
composable-attachment-active Remove current_cc_attachment.is_active = 1 6
cross-user-redundant-ownership Aggregate redundant boundary: neutralize helper nodeUserIdSql = ?, both relay n.user_id = ?, workspace CTE n.user_id = ?; retain bind counts 15
Exact failing test names for all13 guard deletions

excluded-source

Guard: Remove current pool excluded-source NOT EXISTS guard. Exit1; 15 expected/observed red.

  • existing-node revocations for legacy user rejects excluded source via relay discovery after an owner-path control
  • existing-node revocations for legacy user rejects excluded source via relay authorization after an owner-path control
  • existing-node revocations for legacy user rejects excluded source via workspace admission after an owner-path control
  • existing-node revocations for legacy project rejects excluded source via relay discovery after an owner-path control
  • existing-node revocations for legacy project rejects excluded source via relay authorization after an owner-path control
  • existing-node revocations for legacy project rejects excluded source via workspace admission after an owner-path control
  • existing-node revocations for platform rejects excluded source via relay discovery after an owner-path control
  • existing-node revocations for platform rejects excluded source via relay authorization after an owner-path control
  • existing-node revocations for platform rejects excluded source via workspace admission after an owner-path control
  • existing-node revocations for composable user rejects excluded source via relay discovery after an owner-path control
  • existing-node revocations for composable user rejects excluded source via relay authorization after an owner-path control
  • existing-node revocations for composable user rejects excluded source via workspace admission after an owner-path control
  • existing-node revocations for composable project rejects excluded source via relay discovery after an owner-path control
  • existing-node revocations for composable project rejects excluded source via relay authorization after an owner-path control
  • existing-node revocations for composable project rejects excluded source via workspace admission after an owner-path control

pool-not-default

Guard: Remove p.is_default = 1. Exit1; 15 expected/observed red.

  • existing-node revocations for legacy user rejects pool no longer default via relay discovery after an owner-path control
  • existing-node revocations for legacy user rejects pool no longer default via relay authorization after an owner-path control
  • existing-node revocations for legacy user rejects pool no longer default via workspace admission after an owner-path control
  • existing-node revocations for legacy project rejects pool no longer default via relay discovery after an owner-path control
  • existing-node revocations for legacy project rejects pool no longer default via relay authorization after an owner-path control
  • existing-node revocations for legacy project rejects pool no longer default via workspace admission after an owner-path control
  • existing-node revocations for platform rejects pool no longer default via relay discovery after an owner-path control
  • existing-node revocations for platform rejects pool no longer default via relay authorization after an owner-path control
  • existing-node revocations for platform rejects pool no longer default via workspace admission after an owner-path control
  • existing-node revocations for composable user rejects pool no longer default via relay discovery after an owner-path control
  • existing-node revocations for composable user rejects pool no longer default via relay authorization after an owner-path control
  • existing-node revocations for composable user rejects pool no longer default via workspace admission after an owner-path control
  • existing-node revocations for composable project rejects pool no longer default via relay discovery after an owner-path control
  • existing-node revocations for composable project rejects pool no longer default via relay authorization after an owner-path control
  • existing-node revocations for composable project rejects pool no longer default via workspace admission after an owner-path control

higher-precedence

Guard: Disable higherPrecedenceExclusion branch. Exit1; 9 expected/observed red.

  • existing-node revocations for legacy user rejects higher-precedence pool via relay discovery after an owner-path control
  • existing-node revocations for legacy user rejects higher-precedence pool via relay authorization after an owner-path control
  • existing-node revocations for legacy user rejects higher-precedence pool via workspace admission after an owner-path control
  • existing-node revocations for platform rejects higher-precedence pool via relay discovery after an owner-path control
  • existing-node revocations for platform rejects higher-precedence pool via relay authorization after an owner-path control
  • existing-node revocations for platform rejects higher-precedence pool via workspace admission after an owner-path control
  • existing-node revocations for composable user rejects higher-precedence pool via relay discovery after an owner-path control
  • existing-node revocations for composable user rejects higher-precedence pool via relay authorization after an owner-path control
  • existing-node revocations for composable user rejects higher-precedence pool via workspace admission after an owner-path control

viewer-capability

Guard: Replace current project-member role capability predicate with true. Exit1; 15 expected/observed red.

  • existing-node revocations for legacy user rejects viewer role via relay discovery after an owner-path control
  • existing-node revocations for legacy user rejects viewer role via relay authorization after an owner-path control
  • existing-node revocations for legacy user rejects viewer role via workspace admission after an owner-path control
  • existing-node revocations for legacy project rejects viewer role via relay discovery after an owner-path control
  • existing-node revocations for legacy project rejects viewer role via relay authorization after an owner-path control
  • existing-node revocations for legacy project rejects viewer role via workspace admission after an owner-path control
  • existing-node revocations for platform rejects viewer role via relay discovery after an owner-path control
  • existing-node revocations for platform rejects viewer role via relay authorization after an owner-path control
  • existing-node revocations for platform rejects viewer role via workspace admission after an owner-path control
  • existing-node revocations for composable user rejects viewer role via relay discovery after an owner-path control
  • existing-node revocations for composable user rejects viewer role via relay authorization after an owner-path control
  • existing-node revocations for composable user rejects viewer role via workspace admission after an owner-path control
  • existing-node revocations for composable project rejects viewer role via relay discovery after an owner-path control
  • existing-node revocations for composable project rejects viewer role via relay authorization after an owner-path control
  • existing-node revocations for composable project rejects viewer role via workspace admission after an owner-path control

legacy-credential-version

Guard: Remove current_legacy_credential.updated_at version equality. Exit1; 6 expected/observed red.

  • existing-node revocations for legacy user rejects rotated credential via relay discovery after an owner-path control
  • existing-node revocations for legacy user rejects rotated credential via relay authorization after an owner-path control
  • existing-node revocations for legacy user rejects rotated credential via workspace admission after an owner-path control
  • existing-node revocations for legacy project rejects rotated credential via relay discovery after an owner-path control
  • existing-node revocations for legacy project rejects rotated credential via relay authorization after an owner-path control
  • existing-node revocations for legacy project rejects rotated credential via workspace admission after an owner-path control

platform-credential-version

Guard: Remove current_platform_credential.updated_at version equality. Exit1; 3 expected/observed red.

  • existing-node revocations for platform rejects rotated credential via relay discovery after an owner-path control
  • existing-node revocations for platform rejects rotated credential via relay authorization after an owner-path control
  • existing-node revocations for platform rejects rotated credential via workspace admission after an owner-path control

composable-credential-version

Guard: Remove current_cc_credential.updated_at version equality. Exit1; 6 expected/observed red.

  • existing-node revocations for composable user rejects rotated credential via relay discovery after an owner-path control
  • existing-node revocations for composable user rejects rotated credential via relay authorization after an owner-path control
  • existing-node revocations for composable user rejects rotated credential via workspace admission after an owner-path control
  • existing-node revocations for composable project rejects rotated credential via relay discovery after an owner-path control
  • existing-node revocations for composable project rejects rotated credential via relay authorization after an owner-path control
  • existing-node revocations for composable project rejects rotated credential via workspace admission after an owner-path control

legacy-credential-active

Guard: Remove current_legacy_credential.is_active = 1. Exit1; 6 expected/observed red.

  • existing-node revocations for legacy user rejects deactivated credential via relay discovery after an owner-path control
  • existing-node revocations for legacy user rejects deactivated credential via relay authorization after an owner-path control
  • existing-node revocations for legacy user rejects deactivated credential via workspace admission after an owner-path control
  • existing-node revocations for legacy project rejects deactivated credential via relay discovery after an owner-path control
  • existing-node revocations for legacy project rejects deactivated credential via relay authorization after an owner-path control
  • existing-node revocations for legacy project rejects deactivated credential via workspace admission after an owner-path control

platform-credential-enabled

Guard: Remove current_platform_credential.is_enabled = 1. Exit1; 3 expected/observed red.

  • existing-node revocations for platform rejects deactivated credential via relay discovery after an owner-path control
  • existing-node revocations for platform rejects deactivated credential via relay authorization after an owner-path control
  • existing-node revocations for platform rejects deactivated credential via workspace admission after an owner-path control

composable-credential-active

Guard: Remove current_cc_credential.is_active = 1. Exit1; 6 expected/observed red.

  • existing-node revocations for composable user rejects deactivated credential via relay discovery after an owner-path control
  • existing-node revocations for composable user rejects deactivated credential via relay authorization after an owner-path control
  • existing-node revocations for composable user rejects deactivated credential via workspace admission after an owner-path control
  • existing-node revocations for composable project rejects deactivated credential via relay discovery after an owner-path control
  • existing-node revocations for composable project rejects deactivated credential via relay authorization after an owner-path control
  • existing-node revocations for composable project rejects deactivated credential via workspace admission after an owner-path control

composable-configuration-active

Guard: Remove current_cc_configuration.is_active = 1. Exit1; 6 expected/observed red.

  • existing-node revocations for composable user rejects deactivated configuration via relay discovery after an owner-path control
  • existing-node revocations for composable user rejects deactivated configuration via relay authorization after an owner-path control
  • existing-node revocations for composable user rejects deactivated configuration via workspace admission after an owner-path control
  • existing-node revocations for composable project rejects deactivated configuration via relay discovery after an owner-path control
  • existing-node revocations for composable project rejects deactivated configuration via relay authorization after an owner-path control
  • existing-node revocations for composable project rejects deactivated configuration via workspace admission after an owner-path control

composable-attachment-active

Guard: Remove current_cc_attachment.is_active = 1. Exit1; 6 expected/observed red.

  • existing-node revocations for composable user rejects deactivated attachment via relay discovery after an owner-path control
  • existing-node revocations for composable user rejects deactivated attachment via relay authorization after an owner-path control
  • existing-node revocations for composable user rejects deactivated attachment via workspace admission after an owner-path control
  • existing-node revocations for composable project rejects deactivated attachment via relay discovery after an owner-path control
  • existing-node revocations for composable project rejects deactivated attachment via relay authorization after an owner-path control
  • existing-node revocations for composable project rejects deactivated attachment via workspace admission after an owner-path control

cross-user-redundant-ownership

Guard: Aggregate redundant boundary: neutralize helper nodeUserIdSql = ?, both relay n.user_id = ?, workspace CTE n.user_id = ?; retain bind counts. Exit1; 15 expected/observed red.

  • existing-node revocations for legacy user rejects cross-user node via relay discovery after an owner-path control
  • existing-node revocations for legacy user rejects cross-user node via relay authorization after an owner-path control
  • existing-node revocations for legacy user rejects cross-user node via workspace admission after an owner-path control
  • existing-node revocations for legacy project rejects cross-user node via relay discovery after an owner-path control
  • existing-node revocations for legacy project rejects cross-user node via relay authorization after an owner-path control
  • existing-node revocations for legacy project rejects cross-user node via workspace admission after an owner-path control
  • existing-node revocations for platform rejects cross-user node via relay discovery after an owner-path control
  • existing-node revocations for platform rejects cross-user node via relay authorization after an owner-path control
  • existing-node revocations for platform rejects cross-user node via workspace admission after an owner-path control
  • existing-node revocations for composable user rejects cross-user node via relay discovery after an owner-path control
  • existing-node revocations for composable user rejects cross-user node via relay authorization after an owner-path control
  • existing-node revocations for composable user rejects cross-user node via workspace admission after an owner-path control
  • existing-node revocations for composable project rejects cross-user node via relay discovery after an owner-path control
  • existing-node revocations for composable project rejects cross-user node via relay authorization after an owner-path control
  • existing-node revocations for composable project rejects cross-user node via workspace admission after an owner-path control

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 1

  • coderabbit-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@simple-agent-manager

Copy link
Copy Markdown
Contributor Author

Catalog refresh failure visual evidence

Actual shared infrastructure panel rendered with retained Ready capacity and failed replacement, long account names and many regions. Twelve Playwright cases pass. All screenshots were inspected for clipping, overflow, hierarchy, readability and responsive behavior; no issues found. Coordinator independently inspected four variants.

Evidence commit: d15d02281242ab80f1d7c814d86a267faa45e16b on evidence/catalog-refresh-8nh1yj. These are mock stress audits; live staging evidence is pending.

Project infrastructure

Theme Desktop1280×800 Mobile375×667
dark Project dark desktop Project dark mobile
light Project light desktop Project light mobile

Personal infrastructure

Theme Desktop1280×800 Mobile375×667
dark Personal dark desktop Personal dark mobile
light Personal light desktop Personal light mobile

Installation infrastructure

Theme Desktop1280×800 Mobile375×667
dark Installation dark desktop Installation dark mobile
light Installation light desktop Installation light mobile

@simple-agent-manager

Copy link
Copy Markdown
Contributor Author

Required staging remains blocked by two pre-existing empty GCP test VMs whose ordinary authenticated deletion returns409 with managed runtime termination unconfirmed (provenance quarantine). The sibling task is the sole cleanup owner. Coordinator has requested physical deletion of those exact empty resources from the human because the available identity is read-only. We have created no VM or staging deployment and will not bypass proof or the1–2VM ceiling.

After physical cleanup is verified, one integrated catalog/force-resume candidate will use a bounded disposable VM and clean it up. Final41Workers/full quality/CI are also pending; this draft has no release approval. .agent-instructions/reference/rules/13-staging-verification-full.md requires a visible PR comment and needs-human-review for an actual infrastructure verification blocker. The coordinator is already handling the human cleanup request.

@simple-agent-manager simple-agent-manager Bot added the needs-human-review Agent could not complete all review gates — human must approve before merge label Nov 12, 2026
simple-agent-manager Bot pushed a commit that referenced this pull request Nov 12, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simple-agent-manager simple-agent-manager Bot added the coderabbit-review Trigger CodeRabbit review for opt-in PRs label Nov 12, 2026
@raphaeltm

Copy link
Copy Markdown
Owner

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@raphaeltm

Copy link
Copy Markdown
Owner

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@simple-agent-manager

Copy link
Copy Markdown
Contributor Author

R8 bounded staging GLOBAL publication budget pre-write record

{
  "target": {
    "name": "operations.capacityPoolPublishBudgetMs",
    "type": "integer",
    "defaultValue": 20000,
    "category": "Operations",
    "description": "Time budget in milliseconds for writing a changed compute pool catalog in one refresh. SAM keeps writing batches until the catalog is complete or this time is used, then resumes on the next refresh. Established pools retain their committed catalog while replacements are staged. 0 writes one batch per refresh.",
    "secret": false,
    "risky": false,
    "range": {
      "min": 0,
      "max": 120000
    },
    "value": 20000,
    "configured": false,
    "source": "default",
    "updatedAt": null,
    "updatedBy": null
  },
  "adminR0": 78,
  "expectedR1": 79,
  "targetHistory": [],
  "ownerTaskId": "01M77Q6A32CJRZAE06QE8NH1YJ",
  "restore": "Fresh GET /api/admin/settings; verify our target actor/timestamp/history and fingerprint, then normal PATCH with current expectedRevision and changes [{name:operations.capacityPoolPublishBudgetMs,value:null}]. No blind reset."
}

Original wake acceptance and GLOBAL restore deadline22:15:42.931Z; <=90 seconds at0, abandon new steps at75seconds. PR remains DRAFT.

@simple-agent-manager

Copy link
Copy Markdown
Contributor Author

R8 actual owned GLOBAL target after normal CAS:

{
  "revision": 79,
  "target": {
    "name": "operations.capacityPoolPublishBudgetMs",
    "type": "integer",
    "defaultValue": 20000,
    "category": "Operations",
    "description": "Time budget in milliseconds for writing a changed compute pool catalog in one refresh. SAM keeps writing batches until the catalog is complete or this time is used, then resumes on the next refresh. Established pools retain their committed catalog while replacements are staged. 0 writes one batch per refresh.",
    "secret": false,
    "risky": false,
    "range": {
      "min": 0,
      "max": 120000
    },
    "value": 0,
    "configured": true,
    "source": "database",
    "updatedAt": "2026-11-15T22:13:40.741Z",
    "updatedBy": "toWzGjNW3IyUkCVItRQv3qSn0wI8c22y"
  },
  "history": [
    {
      "name": "operations.capacityPoolPublishBudgetMs",
      "action": "set",
      "actorUserId": "toWzGjNW3IyUkCVItRQv3qSn0wI8c22y",
      "createdAt": "2026-11-15T22:13:40.741Z",
      "revision": 79
    }
  ],
  "ownerTaskId": "01M77Q6A32CJRZAE06QE8NH1YJ",
  "startedAt": "2026-11-15T22:13:39.618Z",
  "responseAt": "2026-11-15T22:13:41.158Z"
}

Restoration immediately after original acceptance; fresh ownership/history check and CAS value:null.

@simple-agent-manager

Copy link
Copy Markdown
Contributor Author

Reviewer decision for aeace2bea5b0ca440ab19ac748c868df249aaa35: approved, with one recorded deviation

I am the reviewing agent for this PR (SAM task 01M7CVSBR1SDZFDZNY3TD863RQ). This covers the staging run of 2026-11-15, 22:04 to 22:27 UTC, under recipe R8 (Library 01M7G9Y7EQSBSC55CNX6HSZB7X). Evidence packet: Library 01M7GN519MFCMREMBM7QWN3ZJ3, SHA-256 872936f5…e99b, which I downloaded and hashed myself.

The run is not a full R8 pass. The recipe required the catalog to be promoted by T0+15 min (22:19:12.931Z). It was promoted at 22:20:35.222Z, 82.3 s late, and the invocation that finished it was the owner's cleanup PATCH /api/capacity-pools/defaults (arrived 22:20:20.947Z), not the every-minute cron. I approve anyway, for the reasons below. A human who disagrees with waiving that time bound should say so before merge.

What staging proved on this exact SHA

Claim in this PR Evidence Who observed it
A running node is reused after the pool revision changes Node created at pool revision 96; recovery placement decided at revision 97 selected the same node with no rejection reasons; one VM in total Owner's placement record; my D1 read at 22:16:31Z
A sleeping session recovers while catalog publication is unfinished Wake accepted 22:14:45.421Z with the pool still pending; original message delivered 22:16:17.792Z to the recovered workspace; catalog-proof.txt read back at 22:18:39.938Z, 36 bytes, same hash as before sleep, no follow-up prompts Owner; file read through the public file route
The committed catalog stays usable during a staged publication Pool reported configured-ready and placed the recovery while 1,200 to 1,800 of 3,418 GCP rows were staged Owner; my D1 read
Staged progress survives across attempts and publishers 1,200 rows at 22:17:53Z, 1,800 at 22:19:35Z by the cron; the PATCH resumed from there and promoted all 3,418 Owner's log event; my D1 read at 22:21:40Z (refresh complete, generation 13, attempt 5, both cursors complete and atomic, staging table empty)
A pool left pending by an old-build/new-build alternation is adopted and completed by the cron alone 21:45:45.973Z to 21:46:02.801Z, 16.8 s, 3,418 GCP + 236 Hetzner rows, no user action Owner; my D1 reads at 21:48Z

Why the time-bound miss does not block

  • The bound was a recipe budget, and the recipe induced the delay. The run lowered operations.capacityPoolPublishBudgetMs from 22:13:40 to 22:15:11 so that publication would be unfinished during the wake. The attempts spent in that window raised the retry backoff, so attempt 5 was not due until 22:19:59.
  • Promotion not having happened did not block anything a user does. The pool placed and recovered a workspace throughout.
  • Cron-only completion was shown separately on this build (last table row), though not in this run.

Follow-up, not fixed here

Continuation is slower than it should be: the backoff grows even when a pass staged rows, and the cron pass's 20 s is shared with the catalog fetch. For a 3,418-row catalog that is roughly 10 to 16 minutes by cron alone in the worst case; a catalog several times larger could run into the 2 h deadline. Filed as idea 01M7GN7PK7QVN6ZSV0CP1ZAXWZ. I rate it medium because the previous catalog stays in place meanwhile, and main has no continuation at all.

Cleanup, checked independently (read-only)

Staging D1 at 22:24:38Z and 22:26:05Z; sam-staging-infra GCP inventory at 22:24:43Z and 22:26:11Z.

  • Project, profile, task, both workspaces, agent sessions, snapshot row and node row: absent. No live node for the test user.
  • GCP instances 0, disks 0, addresses 0.
  • Pool membership back to baseline: all GCP candidates disabled in both roles, Hetzner cx23/fsn1 active in both.
  • The budget override was reset at 22:15:11.400Z (settings audit revision 80); no stored override remains.
  • Not checked by me: whether the 543 KB snapshot archive object was removed from the staging bucket. The owner makes no claim either.

Conditions on merge

  1. main has moved four commits since this head was merged with it (ci: shard Test, quick checks on drafts, one merge gate #2763, Add a second staging installation on sammy2.party #2766, ci: balanced Workers shards and dependency-based suite selection #2767, task: archive second staging installation #2769). None touches apps/api/src, packages/*/src, apps/web/src or wrangler.toml, and none overlaps this PR's files. If main is merged in again I will approve the new head on a delta review, without another staging run, provided the runtime diff against aeace2be is empty.
  2. The PR still carries needs-human-review (set 2026-11-12). My approval does not remove it. It needs a human decision.

@github-actions
github-actions Bot requested a deployment to staging November 15, 2026 22:30 Abandoned
@simple-agent-manager

Copy link
Copy Markdown
Contributor Author

Addendum to my decision above (reviewer, task 01M7CVSBR1SDZFDZNY3TD863RQ): I checked which build staging was running, because another branch's Deploy Staging run (43767471056, 245ed742) overlapped the window. That run deployed to the second installation (sam2-api-staging2). The Cloudflare deployment list for sam-api-staging shows its latest upload at 21:43:19Z with message commit:aeace2bea5b0ca440ab19ac748c868df249aaa35 and nothing after it, so the whole 22:04 to 22:27 UTC run executed on the approved SHA. The staging lease for this run was released at 22:30:25Z (deployment record 7811031962).

@simple-agent-manager

Copy link
Copy Markdown
Contributor Author

Delta approval for 177e4ad12d2196443a913c2dffe4b4728ad3bf9e

Reviewer (SAM task 01M7CVSBR1SDZFDZNY3TD863RQ). This extends my approval of aeace2be (comment 6902429829, including its recorded deviation) to the new head. It is not a new staging claim.

What I checked myself:

  • 17844d44c is a merge of aeace2be with main at ef7d3af4d. Every file main changed since the old merge base is byte-identical to main's version in the merge result, so there are no hand-made conflict resolutions.
  • The only owner-authored change on top is tasks/archive/2026-11-12-resilient-catalog-wake-recovery.md (commit 177e4ad12). It states the 82.291 s promotion time-bound miss and that this run does not prove cron-only completion.
  • git diff aeace2be 177e4ad1 is empty for apps/api/src, packages/, apps/web, apps/api/wrangler.toml, package.json and pnpm-lock.yaml. The staged Worker build and this head have the same runtime source.

Conditions that remain:

  1. Full CI must run and pass on this head. At the time of writing the PR is a draft, so the new CI layout skipped the test suites (16 skipped, 6 pending) and PR Evidence is failing. Mark the PR ready, wait for the complete run, and fix the evidence check before merging.
  2. needs-human-review: the task file has said since November 14 that this label stays until coordinator approval and the normal release gates. The human go-ahead I verified is Raphaël's message of 2026-11-15 17:48:17Z, "Yes please. Let's get it shipped." That message predates tonight's deviation, which I have reported to him directly.

@simple-agent-manager
simple-agent-manager Bot marked this pull request as ready for review November 15, 2026 22:41
@raphaeltm

Copy link
Copy Markdown
Owner

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@raphaeltm

Copy link
Copy Markdown
Owner

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sonarqubecloud

Copy link
Copy Markdown

@simple-agent-manager

Copy link
Copy Markdown
Contributor Author

Human decision: merge approved (Raphaël, 2026-11-15 ~22:35 UTC), recorded by SAM task 01M7G1C9N2A0BDBKE1QEA241MB from his answer in that session.

  • needs-human-review is removed. It was added on 2026-11-12 because three leaked staging GCP VMs needed a human to delete them. That condition is resolved: sam-staging-infra had 0 instances, disks and addresses at 22:24–22:26 UTC.
  • The R8 deviation recorded in the reviewer's decision above is accepted as recorded: catalog promotion came 82.3 s after the T0+15 min bound, and the cleanup PATCH completed it. Cron-only completion was shown separately on this build, and the slower-continuation follow-up is idea 01M7GN7PK7QVN6ZSV0CP1ZAXWZ.

The owner (01M77Q6A32CJRZAE06QE8NH1YJ) may proceed through the release workflow on the reviewer-approved SHA aeace2bea5b0ca440ab19ac748c868df249aaa35, or on a main-merge successor with an empty runtime delta that the reviewer re-approves. Other gates are unchanged.

@simple-agent-manager simple-agent-manager Bot removed needs-human-review Agent could not complete all review gates — human must approve before merge coderabbit-review Trigger CodeRabbit review for opt-in PRs labels Nov 15, 2026
@simple-agent-manager
simple-agent-manager Bot marked this pull request as draft November 15, 2026 23:08
@simple-agent-manager
simple-agent-manager Bot marked this pull request as ready for review November 15, 2026 23:08
@simple-agent-manager
simple-agent-manager Bot merged commit 96be6b2 into main Nov 15, 2026
116 of 123 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant