SS-52 · Preview envs, sandboxes & demos

Ephemeral environments & sandboxes

A leased environment per PR — reclaimed on its own.

26operations
5sub-capabilities
3endpoint groups
4services it composes

What it does

A leased environment per PR — reclaimed on its own.

Disposable environments with a lease lifecycle: PR previews, seeded sandboxes and demo environments, each governed by teardown policies, cost guardrails and expiring-lease sweeps. Every environment carries a cost estimate and can attach evidence, so an ephemeral env is auditable rather than a leak waiting to happen.

In-mesh base http://ss-52-envs.shared-services.svc.cluster.local:8052 · auth is an SS-01 bearer token + X-Tenant-Id on every /api/v1 route.

Sub-capabilities

The real building blocks.

PR preview environments

Spin a preview per pull request, list them, and promote one to a longer-lived target when it graduates.

POST /api/v1/previews

Seeded sandboxes

Create a sandbox seeded from a dataset — a reproducible starting state for experiments and demos.

POST /api/v1/sandboxes

Lease lifecycle

Every environment holds a lease; extend it, refresh it, or let the expiring-lease sweep reclaim it. Leases never leak silently.

POST /api/v1/environments/{id}/lease/extend

Cost guardrails

Register a spend guardrail, get a per-environment cost estimate, and record breaches when an env runs hot.

POST /api/v1/guardrails

Teardown policies & evidence

Declare teardown policies and attach evidence to an environment before it is reclaimed, so nothing disappears unrecorded.

POST /api/v1/policies

Worked example

Open a PR → spin a preview → promote or reclaim

A preview environment per pull request, leased and cost-guarded, that reclaims itself when the PR closes or the lease lapses.

  1. 1
    Create the previewPOST/api/v1/previews

    One preview per PR, on a TTL lease.

  2. 2
    Estimate its costGET/api/v1/environments/{id}/cost

    A live cost estimate the guardrail is measured against.

  3. 3
    Extend if it lives onPOST/api/v1/environments/{id}/lease/extend

    Push the lease out; otherwise it is swept.

  4. 4
    Promote a graduatePOST/api/v1/previews/{id}/promote

    Promote the preview to a longer-lived target.

  5. 5
    Or reclaim itPOST/api/v1/environments/{id}/teardown

    Explicit teardown; the expiring-lease sweep is the safety net.

Endpoint catalog

26 documented endpoints of 26 operations.

Real method + path from services/envs/openapi.json. The full contract, including ops endpoints, is the 26-operation surface.

Environments

  • GET/api/v1/environmentsList the tenant's environments
  • POST/api/v1/environmentsCreate an environment
  • GET/api/v1/environments/{id}Fetch one environment
  • GET/api/v1/environments/{id}/costCost estimate for an environment
  • POST/api/v1/environments/{id}/evidenceAttach evidence to an environment
  • POST/api/v1/environments/{id}/lease/extendExtend an environment lease
  • POST/api/v1/environments/{id}/refreshRefresh an environment
  • POST/api/v1/environments/{id}/teardownTear down an environment

Previews, sandboxes & demos

  • POST/api/v1/previewsCreate a PR preview environment
  • GET/api/v1/previewsList PR previews
  • GET/api/v1/previews/{id}Get a PR preview
  • POST/api/v1/previews/{id}/promotePromote a preview to a longer-lived target
  • POST/api/v1/sandboxesCreate a seeded sandbox
  • GET/api/v1/sandboxesList seeded sandboxes
  • GET/api/v1/sandboxes/{id}Get a seeded sandbox
  • POST/api/v1/demosCreate a demo environment
  • GET/api/v1/demosList demo environments
  • POST/api/v1/datasetsRegister a seed dataset

Governance

  • POST/api/v1/guardrailsCreate a cost guardrail
  • GET/api/v1/guardrailsList cost guardrails
  • POST/api/v1/guardrails/{id}/breachRecord a cost guardrail breach
  • POST/api/v1/policiesCreate a teardown policy
  • GET/api/v1/policiesList teardown policies
  • GET/api/v1/leases/expiringList leases due to expire (sweep candidates)
  • GET/api/v1/usageTenant usage ledger + SS-10 delivery status
  • GET/api/v1/infoService info + capability envelope

Architecture placement

Where it sits in the platform.

Ephemeral environments & sandboxes does not reimplement the platform — it composes it. These are the services it leans on and the seams between them.

SS-47 SkyForge

SkyForge's own PR-preview fast path shares the same lease-and-sweep model; envs is the general environment plane.

SS-02 DBaaS

Seeded sandboxes and previews attach ephemeral DBaaS claims that are erased on teardown.

SS-10 Billing

Cost estimates and guardrail breaches feed the tenant usage ledger and SS-10 delivery.

SS-34 GRC

Attached evidence and teardown records make ephemeral environments auditable.