Data Persistence
Documentation and guides for OutcomeDev.
The Problem
OutcomeDev sandboxes are ephemeral. When the "Max Duration" timer expires, the cloud environment is terminated, and any local filesystem changes that have not been pushed to GitHub are permanently lost. Users who enable "Keep Alive" might mistakenly treat the sandbox as a persistent development server (like Codespaces) and lose hours of work.
Proposed Solutions
1. Auto-Push / Auto-Commit (Recommended)
Mechanism: The agent or a background process automatically commits and pushes changes to a temporary branch at regular intervals or upon task completion/timeout warning.
- Pros: Zero user effort; guarantees code safety.
- Cons: May create messy commit history; requires write permissions to the repo (which we already request).
- Implementation:
- Create a
backup/sandbox-idbranch when the task starts. - Run
git add . && git commit -m "Auto-save" && git pushevery 15 minutes or when the timer is < 5 minutes.
- Create a
2. "Time Is Running Out" Warning & Extension
Mechanism: Show a prominent UI modal when 5 minutes are remaining.
- Action: Allow the user to "Extend Time" (if quota allows) or "Commit & Push Now" via a single button.
- Implementation:
- Frontend polling of task duration.
- Modal triggers at
maxDuration - 5m.
3. Persistent Volumes (Infrastructure Change)
Mechanism: Mount a persistent volume (EBS/EFS) to the sandbox container.
- Pros: True persistence; feels like a real VM.
- Cons: Significantly higher infrastructure cost; complex to manage (orphaned volumes).
- Implementation:
- Attach a volume ID to the User ID.
- Mount
/workspaceto this volume.
4. Download Sandbox State
Mechanism: Allow users to download a .zip of the current workspace before termination.
- Pros: Simple fallback if GitHub push fails.
- Cons: Manual process; user might forget.
- Implementation:
- Add a "Download Workspace" button in the task header.
Immediate Action Plan (MVP)
- Implemented: Explicit UI warnings in Task Form (Done).
- Next Step: Implement Solution #2 (Warning Modal).
- Future: Investigate Solution #1 (Auto-Push) for premium users.