Preserve and resume file workspaces
Keep a file workspace for a later process.
Keep a file workspace for a later process. A checkpoint saves workflow progress; a snapshot saves files.
Choose what to retain
Section titled “Choose what to retain”run: clean up owned files after success.local: keep them on this machine.portable: also save verified snapshots through an explicit transport and namespace.
Use this factory in place of openEmptyWorkspace() from the file-workspace example.
The next worker must be able to read ./conserved. For another host, use shared storage and keep the explicit documents namespace; a name derived from a local path is insufficient.
Resume completed work
Section titled “Resume completed work”After a command or agent turn finishes, Outpost synchronizes and verifies its files before recording completion or a pause. Local resume refuses missing, replaced or changed files. Portable resume restores a verified snapshot into a new owned directory. Mounted sources must remain accessible and unchanged: a snapshot does not turn a mount into a copy.
Interactive tasks also retain the conversation and close the sandbox before asking a question. Resuming them does not repeat completed turns.
Save these scripts beside portable-workspace.ts. This example writes directly into the workspace and needs no agent or sandbox.
Run node save-files.ts, then node restore-files.ts from the same directory. The second process prints the new path and Ready for review. Keep workspace-record.json and conserved/ together: the former references the snapshot in the latter.
Recover interrupted ownership
Section titled “Recover interrupted ownership”- Stop the previous owner’s processes and confirm any remote allocation has been released. A file snapshot does not prove that a remote sandbox stopped.
- Inspect the workspace with inspectFileWorkspace and keep its revision.
- Pass the inspected record and explicit stopped-process authorization to recoverFileWorkspace. A changed revision is refused.
- Recover checkpoint ownership and authorize interrupted-task replay separately when required.
Interrupted preparation retains its record and partial files. Ordinary restoration refuses them; after stopping the processes, adoptInterruptedFiles explicitly accepts those files without rerunning preparation. Changing a mounted source needs its own explicit adoption. Neither action authorizes workflow replay.
For a failed publication, follow publication recovery.

