Skip to content

feat: extend uf sandbox with create/destroy lifecycle and CDE backend (Spec 029) - #97

Merged
jflowers merged 1 commit into
mainfrom
029-sandbox-cde-lifecycle
Apr 13, 2026
Merged

jflowers merged 1 commit into
mainfrom
029-sandbox-cde-lifecycle

Conversation

@jflowers

Copy link
Copy Markdown
Contributor

Summary

Extends uf sandbox (Spec 028) with persistent workspace lifecycle (create/destroy) and CDE backend (Eclipse Che / Dev Spaces). Enables the iterative demo loop without extraction.

Closes #95

Backend Interface (Strategy Pattern)

Backend interface with 7 methods (Name, Create, Start, Stop, Destroy, Status, Endpoints) and two implementations:

  • PodmanBackend: Named volumes (uf-sandbox-<project>) for persistent state, per-project container names, partial failure cleanup
  • CheBackend: chectl CLI primary path with REST API fallback, devfile-based workspace provisioning

ResolveBackend() implements resolution matrix: flag > env > config > auto-detect (CDE preferred when available).

Persistent Lifecycle

Command Before (Spec 028) After (Spec 029)
create N/A Provisions persistent workspace
start Creates ephemeral container Starts stopped workspace (or ephemeral fallback)
stop Stops + removes container Stops but preserves state
destroy N/A Permanently deletes workspace + state

New Files

  • internal/sandbox/backend.go — Backend interface, ResolveBackend(), constants
  • internal/sandbox/podman.go — PodmanBackend (named volumes, persistent lifecycle)
  • internal/sandbox/che.go — CheBackend (chectl + REST API)
  • internal/sandbox/workspace.go — WorkspaceStatus, SandboxConfig, LoadConfig, git sync, demo endpoints

Backward Compatibility

All 39 existing Spec 028 tests pass unchanged. isPersistentWorkspace() auto-detects mode — ephemeral path preserved for engineers who don't use create.

Tests

52 new test functions (91 total), covering backend resolution, PodmanBackend lifecycle, CheBackend chectl/REST paths, workspace helpers, config parsing, backward compatibility, git sync.

… (Spec 029)

- Add Backend interface (Strategy pattern per SOLID Open/Closed)
  with PodmanBackend and CheBackend implementations
- PodmanBackend: named volumes (uf-sandbox-<project>) for persistent
  state, per-project container names, partial failure cleanup
- CheBackend: chectl CLI primary path with REST API fallback,
  devfile-based workspace provisioning
- Add Create() and Destroy() dispatch functions for persistent
  workspace lifecycle
- Add WorkspaceStatus, SandboxConfig with YAML parsing, LoadConfig
  with env var overrides, bidirectional git sync helpers
- Add create subcommand (--backend, --demo-ports, --name flags)
  and destroy subcommand (--yes, --force with confirmation prompt)
- Update start with --backend flag, stop/status for persistent mode
- Add 52 new test functions (91 total) covering backend resolution,
  PodmanBackend lifecycle, CheBackend chectl/REST paths, workspace
  helpers, config parsing, backward compatibility, git sync
- All existing Spec 028 tests pass (backward compatible)
- Add spec artifacts (spec, plan, tasks, research, data-model,
  quickstart, contracts, checklists)
@jflowers
jflowers merged commit 8bbfe15 into main Apr 13, 2026
1 check passed
@jflowers
jflowers deleted the 029-sandbox-cde-lifecycle branch April 13, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

feat: extend uf sandbox with create/destroy lifecycle and CDE backend

1 participant