@@ -196,14 +196,15 @@ failed cleanup instead of silently leaking storage. Filesystem operations with a
196196path remain concurrent across unrelated projects, but arbitrary code, shell execution, and process
197197launch always take a non-exclusive global lease because path parsing cannot prove their runtime
198198filesystem scope. Project cleanup fences and drains that lease, terminates every managed and
199- same-user untracked sandbox process, and only then removes the folder. Account deletion destroys shared
200- sandbox state once and removes run Durable Objects in bounded pages. The account cleanup
201- RPC synchronously fences new sandbox work, drains operations that already started, records
202- final sandbox usage, clears the user's Daytona volume subpath, and deletes every validated
203- sandbox. A temporary durable tombstone makes an interrupted cleanup resume behind the same
204- fence. Once external cleanup succeeds, the configured 2026-07-15 Workers compatibility contract
205- lets one atomic ` deleteAll() ` remove that tombstone, owner keys, workspace SQLite schema, and
206- alarm so the object ceases to occupy storage.
199+ same-user untracked sandbox process, and only then removes the folder. Account
200+ deletion destroys shared sandbox state once and removes run Durable Objects in
201+ bounded pages. The account cleanup RPC synchronously fences new sandbox work,
202+ drains operations that already started, records final sandbox usage, clears the
203+ user's Daytona volume subpath, and deletes every validated sandbox. A temporary
204+ durable tombstone makes an interrupted cleanup resume behind the same fence.
205+ Once external cleanup succeeds, one atomic ` deleteAll() ` removes the tombstone,
206+ owner keys, workspace SQLite schema, and alarm so the object ceases to occupy
207+ storage.
207208
208209Constructors inspect existing identity and SQLite metadata without materializing an empty store.
209210An object with no registered owner absorbs late lease/alarm cleanup and rejects every other
@@ -221,38 +222,20 @@ project/thread soft-delete generation and verifies that every requested run belo
221222scope. The 30-second signature window is therefore safe to retry and cannot authorize stale or
222223cross-tenant destruction; no shared key or legacy signature fallback exists.
223224
224- Workspace and sandbox releases use a separate signed internal RPC. For one exact
225- release SHA, the closed release gate and an in-memory mutation lease reject concurrent
226- workspace operations. Preparation stops affected processes, collision-checks and renames
227- Daytona folders, reconciles process and port state, and records only temporary KV evidence for
228- the canonical folders that existed. Finalization reloads the already-canonical Postgres
229- inventory and requires the same physical evidence before snapshot work begins. The release
230- workflow drains all AgentRuns before this phase, so no stale run can recreate a replaced path.
231- Generic Durable Object reconciliation deliberately runs first: it contracts the permanent
232- SQLite schema to the project tombstone table and removes the one-time transition and retired-slug
233- tables; prepare and finalize do not depend on either table. An owner with no materialized sandbox
234- state uses only the in-memory maintenance lease plus the temporary evidence key, so successful
235- reconciliation does not leave an empty SQLite store behind.
236-
237- Finalization also reconciles the user's existing Daytona sandbox to the exact configured
238- snapshot. Volume-backed replacements mount the same isolated subpath and compare complete tree
239- digests. The one-time adoption of a local-disk sandbox creates a deterministic archive and copies
240- it through durable 8 MiB chunks; there is no total workspace-size cap. A candidate never carries
241- the canonical label while the source does. After digest verification the source is retired, the
242- candidate receives the full canonical label set, the Durable Object atomically adopts its exact
243- ID, and only then is the old sandbox deleted. Every boundary is retryable by the temporary
244- upgrade phase and deterministic candidate identity. Once final verification succeeds, both the
245- workspace-transition evidence and snapshot-upgrade state are deleted; an ambiguous response can
246- therefore retry against the canonical physical state without leaving cutover residue. Account
247- deletion clears the user's shared-volume subpath before deleting all exact owned sandboxes, so
248- persistent volume data does not outlive the account.
225+ Every ProjectSandbox uses the one configured immutable Daytona snapshot and the
226+ one configured shared workspace volume. Existing sandbox identity is accepted
227+ only when its owner, canonical labels, snapshot, volume, and mount contract all
228+ match. Mismatches fail closed instead of running a hidden migration. New
229+ sandboxes mount the user's isolated volume subpath directly at ` /workspace ` .
230+ Account deletion clears that subpath before deleting all exactly owned
231+ sandboxes, so persistent volume data does not outlive the account.
249232
250233Production binds ` CHEATCODE_RELEASE_GATE ` explicitly. ` draining ` rejects public
251234run, sandbox, preview, download, and deletion admission while allowing already
252235admitted AgentRun Workflow/DO callbacks, sandbox operations, and persistence to
253236finish. ` closed ` additionally fences those continuation paths and serves only
254- ` /health ` plus the exact signed canonical-workspace reconciliation RPC. Stable
255- drain proofs run at both gates before DDL.
237+ ` /health ` plus the signed database-readiness RPC. Stable drain proofs run at
238+ both gates before DDL.
256239
257240Project ZIP generation and streaming share the exact
258241` PROJECT_ARCHIVE_MAX_OUTPUT_BYTES ` contract from ` @cheatcode/types ` (640 MiB). The
@@ -276,7 +259,7 @@ pnpm --filter @cheatcode/agent-worker typecheck
276259
277260- ` CHEATCODE_ENVIRONMENT ` (` production ` in committed Wrangler config; local generated config overrides it)
278261- ` CHEATCODE_RELEASE_SHA ` (required for production deployments)
279- - ` CHEATCODE_RELEASE_GATE ` (` open ` in source; coordinated releases inject ` draining ` and then ` closed ` until migration/reconciliation complete)
262+ - ` CHEATCODE_RELEASE_GATE ` (` open ` in source; coordinated releases inject ` draining ` and then ` closed ` until migration and database-readiness checks complete)
280263- ` CF_VERSION_METADATA `
281264- ` AGENT_RUN `
282265- ` AGENT_RUN_WORKFLOW `
0 commit comments