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/previewsSS-52 · Preview envs, sandboxes & demos
A leased environment per PR — reclaimed on its own.
What it does
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
Spin a preview per pull request, list them, and promote one to a longer-lived target when it graduates.
POST /api/v1/previewsCreate a sandbox seeded from a dataset — a reproducible starting state for experiments and demos.
POST /api/v1/sandboxesEvery 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/extendRegister a spend guardrail, get a per-environment cost estimate, and record breaches when an env runs hot.
POST /api/v1/guardrailsDeclare teardown policies and attach evidence to an environment before it is reclaimed, so nothing disappears unrecorded.
POST /api/v1/policiesWorked example
A preview environment per pull request, leased and cost-guarded, that reclaims itself when the PR closes or the lease lapses.
/api/v1/previewsOne preview per PR, on a TTL lease.
/api/v1/environments/{id}/costA live cost estimate the guardrail is measured against.
/api/v1/environments/{id}/lease/extendPush the lease out; otherwise it is swept.
/api/v1/previews/{id}/promotePromote the preview to a longer-lived target.
/api/v1/environments/{id}/teardownExplicit teardown; the expiring-lease sweep is the safety net.
Endpoint catalog
Real method + path from services/envs/openapi.json. The full contract, including ops endpoints, is the 26-operation surface.
/api/v1/environmentsList the tenant's environments/api/v1/environmentsCreate an environment/api/v1/environments/{id}Fetch one environment/api/v1/environments/{id}/costCost estimate for an environment/api/v1/environments/{id}/evidenceAttach evidence to an environment/api/v1/environments/{id}/lease/extendExtend an environment lease/api/v1/environments/{id}/refreshRefresh an environment/api/v1/environments/{id}/teardownTear down an environment/api/v1/previewsCreate a PR preview environment/api/v1/previewsList PR previews/api/v1/previews/{id}Get a PR preview/api/v1/previews/{id}/promotePromote a preview to a longer-lived target/api/v1/sandboxesCreate a seeded sandbox/api/v1/sandboxesList seeded sandboxes/api/v1/sandboxes/{id}Get a seeded sandbox/api/v1/demosCreate a demo environment/api/v1/demosList demo environments/api/v1/datasetsRegister a seed dataset/api/v1/guardrailsCreate a cost guardrail/api/v1/guardrailsList cost guardrails/api/v1/guardrails/{id}/breachRecord a cost guardrail breach/api/v1/policiesCreate a teardown policy/api/v1/policiesList teardown policies/api/v1/leases/expiringList leases due to expire (sweep candidates)/api/v1/usageTenant usage ledger + SS-10 delivery status/api/v1/infoService info + capability envelopeArchitecture placement
Ephemeral environments & sandboxes does not reimplement the platform — it composes it. These are the services it leans on and the seams between them.
SkyForge's own PR-preview fast path shares the same lease-and-sweep model; envs is the general environment plane.
Seeded sandboxes and previews attach ephemeral DBaaS claims that are erased on teardown.
Cost estimates and guardrail breaches feed the tenant usage ledger and SS-10 delivery.
Attached evidence and teardown records make ephemeral environments auditable.