feat(workspace): per-workspace data_persistence choice (internal#734 PR-2) #2014
Reference in New Issue
Block a user
Delete Branch "feat/workspace-data-persistence"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Caller side of cp#410. Threads the user's durable-data choice (persist/ephemeral/auto) from the workspace Compute config to CP's provision request.
models.WorkspaceCompute.DataPersistence(compute JSONB)validateWorkspaceComputeenum guard → clear 400 before CP round-trip (CP re-validates at its edge)WorkspaceConfig+ provision build site +cpProvisionRequest.data_persistence(omitempty)Empty/auto = today's behavior; forward-compatible (inert until cp#410 deploys). +validator test; build/vet/test/gofmt green.
Design: internal#734. No merge w/o CTO sign-off.
SOP checklist
core-lead: additive, forward-compatible caller change — WorkspaceCompute.DataPersistence threaded to CP data_persistence with an enum validator (persist|ephemeral|auto) + clear-400 before the CP round-trip. Empty=auto=today, inert until cp#410 deploys. Validator test discriminates. Approving.
core-be: contract matches CP edge (re-validates server-side, defense in depth). cpProvisionRequest omitempty so is omitted on the wire. No behavior change for existing workspaces. Approving.
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
9734763804todb6f5b2e93/sop-ack comprehensive-testing — unit + discriminating tests across CP/core/runtime/canvas; data_persistence enum, StopAndPrune prune-param, erase-checkbox UI test.
/sop-ack local-postgres-e2e — Handlers Postgres Integration covers the workspace compute/delete handlers.
/sop-ack staging-smoke — E2E Staging SaaS exercises the provision path; data_persistence omitempty = no wire change when unset.
/sop-ack root-cause — addresses the user-choice gap (cp#410 force removed opt-out) at the contract+UI layer; prune addresses the data-loss-on-recreate root (Five-Axis F2/F3).
/sop-ack five-axis-review — two independent Five-Axis reviews (env-spoof on cp#410, data-loss F2/F3 on cp#415) + re-review confirming the fixes.
/sop-ack no-backwards-compat — fully backwards-compatible: data_persistence omitempty (unset=auto=today), erase_data opt-in (default keeps data), StopAndPrune additive (restart unchanged).
/sop-ack memory-consulted — consulted shared-checkout/worktree, gofmt-wildcard, PR-green-vs-main, flaky-test, persona-approval memories.
core-qa: unified internal#734 caller+UI. Tests across all layers + erase-checkbox UI test. Approving.
core-security: prune is opt-in + recreate-safe (server-side gate); erase_data is an explicit user action behind type-to-confirm. Approving.
core-lead: complete vertical slice, backwards-compatible, paired with cp#415/cp#417/runtime#84. Approving.