Commit Graph
941 Commits
Author SHA1 Message Date
Neil bde0bed3ce fix(sandbox-control): no snapshot leaks on any delete path, and nothing deletes a snapshot still in use
- snapshot-refs.ts: one check for what live things still boot from (goldens of any live status, pool
  images, active environment builds, live workspaces' own snapshots, and a live workspace's boot image
  until it has a snapshot of its own).
- Retired goldens beyond the rollback and deleted environments' builds are marked deleted only after the
  provider delete succeeded (a failed delete used to be marked and leaked for good), and are deferred
  while in use. A new hourly housekeeping step (sweepReleasedSnapshots) retries both.
- Team delete marks the team's environments deleted, so their build snapshots are freed (they leaked).
- Environment prune skips a build a live workspace still boots from.
- Orphan sweeps (per box and project-wide automatic) also respect pool and boot-image references.
- The golden smoke box is non-persistent: it no longer leaves a ~325 MB automatic snapshot behind.
2026-11-14 20:57:17 -08:00
Neil f2888317b4 feat(cloud): plans dialog before the web console; billing serves each plan's card copy
"Plan & billing", "Upgrade to Orca Cloud", "Choose plan" and every "Compare plans" now open an
in-app plans dialog first: the team's plan and status (trial hours left, active with hours and
seats, payment failed, or no plan with the trial billing offers), then billing's plan cards (Team
with a monthly/annual toggle, Enterprise with contact sales). "Continue in browser" opens the
console's billing page through the existing sign-in ticket. Members see the same plan info with
"Ask a team admin to upgrade" (Plan & billing is back in their account menu, read-only). Read-only:
no checkout, usage history or admin settings return to the desktop.

Everything shown is billing's: names, Stripe prices, seat pricing, feature bullets and trial terms
from GET /v1/plans, now also each plan's tagline, feature-list lead and button label (new optional
catalog `marketing`, unversioned copy, plus `omitFeatures` so Enterprise stops advertising egress
controls). Main's lenient parse keeps a newer or older service safe; without the catalog the
entitlement's offers stand in, and with neither the dialog says plans didn't load and still offers
the console. While billing loads the title is neutral, so a paying team never sees an upsell flash.

Settings > Account's billing row opens the dialog ("View plans"); "Update payment method" still
goes straight to the console.
2026-11-14 16:37:59 -08:00
Neil 8104f84b94 billing: record one plan start per Checkout
One Checkout sends checkout.session.completed, customer.subscription.created and invoice.paid,
often concurrently; each that re-read the row before another wrote it saw the plan start and
pushed billing.plan_started with its own 'at', so the event ids differed and the team's audit
log showed it twice. A plan starting or ending now carries a once key (subscription id and
period start), so every racer pushes the same event id and the control plane's INSERT OR IGNORE
keeps one.
2026-11-14 03:45:08 -08:00
Neil b9a2ff9896 feat(billing): Checkout and the Customer Portal started from the web console return to its billing page
POST /v1/billing/checkout and /portal accept returnTo: 'console'. The return URL is built from
this Worker's CONSOLE_URL (else the setup pages' auth origin, which forwards /console) and the
caller's own team, never from the request. Desktop-started flows keep the /return handoff page.
2026-11-14 02:18:51 -08:00
Neil f1573ece1c test(billing): use the real help@stably.ai inbox in supportUrl fixtures (orca.dev has no MX) (#740) 2026-11-14 02:01:12 -08:00
Neil 84a776923c docs(cloud): sandbox-control typecheck split pinned by path; README on why raw tsc shows imported diagnostics 2026-11-13 11:16:23 -08:00
Neil ec679a8f52 fix(cloud): sandbox-control typecheck to zero (SANDBOX-CONTROL-TYPECHECK) 2026-11-13 11:14:50 -08:00
Neil d20dc4e20a feat(cloud): TRANSFER-SLOW-N60 a completed owner hand-off logs how long each step took 2026-11-13 11:04:44 -08:00
Neil 46f081f336 Merge pull request #703 from nwparker/cloud/g9-claude-key-tail
fix(cloud): G9 never write a real ANTHROPIC_API_KEY tail into ~/.claude.json
2026-11-13 10:33:28 -08:00
Neil 648f5bb67f feat(cloud): OWNER-TRANSFER previous-owner notices expire after 90 days and go with a deleted team 2026-11-13 07:39:07 -08:00
Neil a58aad5522 Merge pull request #713 from nwparker/cloud/owner-transfer-notify
feat(cloud): OWNER-TRANSFER tell the previous owner; expose the owner-changed mark
2026-11-13 07:27:20 -08:00
Neil 881b82e401 Merge pull request #711 from nwparker/create-speed/snap404-skip-deleted
fix(cloud): the fresh-build 404 retry never runs for a create its owner deleted
2026-11-13 07:16:53 -08:00
Neil 04457ec384 fix(cloud): OWNER-TRANSFER an email answer with no mode is not a delivery (sso-scim review) 2026-11-13 07:15:58 -08:00
Neil 8026ca98af feat(cloud): OWNER-TRANSFER tell the previous owner (notice in Orca, email asked of auth, audit row); expose the owner-changed mark 2026-11-13 07:14:33 -08:00
Neil 950a8165c8 Merge pull request #691 from nwparker/cloud/ep10-cancel-on-delete
feat(billing): EP-10 team delete can cancel a plan that's already set to end (cancel-now)
2026-11-13 07:11:50 -08:00
Neil 7922504e4b fix(cloud): the fresh-build 404 retry never runs for a create its owner deleted 2026-11-13 06:59:42 -08:00
Neil e05dee2312 Merge remote-tracking branch 'private/cloud/integration' into cloud/env-build-churn 2026-11-13 06:50:47 -08:00
Neil 59ed67dd0c Merge pull request #689 from nwparker/cloud/ep9-billing-mint-org
fix(cloud): EP-9 billing tokens name the team this device shows (cross-device active-team leak)
2026-11-13 06:49:21 -08:00
Neil 5e6fcd30f3 Merge pull request #702 from nwparker/cloud/owner-transfer-fix
fix(cloud): OWNER-TRANSFER a workspace is only handed to a current team member, and a transferred workspace stays in shared mode for credentials
2026-11-13 06:42:12 -08:00
Neil 77db6ffc48 fix(billing): EP-10 cancel-now decides on Stripe's live state: a plan resumed after auth's delete check is refused (409 not_cancelling) (sso-scim) 2026-11-13 06:39:43 -08:00
Neil 3e228f227d feat(billing): EP-10 team delete can cancel a plan that is already set to end
GET /v1/internal/accounts/:accountId/subscription adds cancelling / endsAt / periodEnd (additive);
new POST .../subscription/cancel-now (membership-sync token) cancels the team's subscription
immediately (invoice_now: reported overage is billed; prorate false: no refund) but only one
already set to end (cancel_at_period_end or a portal cancel_at); a renewing plan gets 409
not_cancelling. Idempotent; a Stripe failure is a 502 and changes nothing, so auth must not
delete the team. Mirror re-read from Stripe, grants revoked.
2026-11-13 06:39:43 -08:00
Neil 15b94d9567 Merge remote-tracking branch 'private/cloud/integration' into cloud/ep9-billing-mint-org 2026-11-13 06:39:11 -08:00
Neil 1b59a54b9f Merge remote-tracking branch 'private/cloud/integration' into cloud/env-build-churn 2026-11-13 06:39:03 -08:00
Neil 5faae7d94b Merge pull request #686 from nwparker/cloud/ep9-cancel-at
fix(billing): EP-9 a portal cancel (Stripe cancel_at) shows as the team's own plan ending
2026-11-13 06:32:14 -08:00
Neil b671273718 Merge remote-tracking branch 'private/cloud/integration' into cloud/env-build-churn
# Conflicts:
#	cloud/apps/sandbox-control/src/environments.ts
2026-11-13 06:18:54 -08:00
Neil 477583f9f4 fix(cloud): EP-5 a cancelled create never goes on with a new row; cancel sweeps the workspace 2026-11-13 06:18:39 -08:00
Neil 771b19d532 Merge remote-tracking branch 'private/cloud/integration' into cloud/owner-transfer-fix
# Conflicts:
#	cloud/apps/sandbox-control/src/index.ts
2026-11-13 06:14:23 -08:00
Neil 0a9b8a6bde test(cloud): OWNER-TRANSFER a wake racing the hand-off refuses it and leaves the VM as woken 2026-11-13 06:13:47 -08:00
Neil 90e181af0f fix(cloud): OWNER-TRANSFER stop before the write; refuse during a boot or stop, and when the stop fails (sso-scim review) 2026-11-13 06:13:02 -08:00
Neil ff8f915c05 fix(cloud): G9 ~/.claude.json pre-approves only an Orca placeholder's tail; a real ANTHROPIC_API_KEY leaves nothing of itself on disk and an older tail is scrubbed 2026-11-13 06:10:57 -08:00
Neil e746a764e5 Merge pull request #699 from nwparker/cloud/e3-swap-fail-closed
fix(cloud): EGRESS-SWAP-FAIL-CLOSED withhold keys without the egress proxy in deployed envs; health 503 egress_proxy_missing
2026-11-13 06:09:26 -08:00
Neil 93f2066812 fix(cloud): OWNER-TRANSFER a workspace is only handed to a current team member, and a transferred workspace is in shared mode for credentials for good 2026-11-13 06:09:22 -08:00
Neil 20c83d1412 fix(cloud): EGRESS-SWAP-FAIL-CLOSED review: egress_swap_disabled log when an operator turns placeholders off, proxy refuses without its URL 2026-11-13 06:05:44 -08:00
Neil c9f68dfa63 fix(cloud): EGRESS-SWAP-FAIL-CLOSED merged spec: egress_swap_unavailable at error level (count only), health keySwap on/off, design-squad message, deployed-with-proxy test 2026-11-13 06:04:30 -08:00
Neil a5cf31a7a8 Merge pull request #694 from nwparker/create-speed/build-snapshot-404
fix(cloud): retry a fresh build snapshot's 404 once; name orcad start failures
2026-11-13 06:03:14 -08:00
Neil ee19ee2684 fix(cloud): EGRESS-SWAP-FAIL-CLOSED a deployed env without EGRESS_PROXY_URL withholds model keys and account sign-ins (firewall answers the placeholder), logs once per session, /v1/health 503 egress_proxy_missing 2026-11-13 06:03:03 -08:00
Neil 138a2e8b9f Merge remote-tracking branch 'private/cloud/integration' into cloud/env-build-churn 2026-11-13 05:57:36 -08:00
Neil 931eeaa835 wip(cloud): ENV-BUILD-CHURN server side 2026-11-13 05:57:34 -08:00
Neil 1aa00c9ab8 Merge pull request #693 from nwparker/cloud/e3-push-cap
fix(cloud): PUSH-CAP plain message when a git push exceeds the egress proxy's ~100 MB cap
2026-11-13 05:56:03 -08:00
Neil 24eb6a0e41 Merge pull request #688 from nwparker/cloud/auto-env-deps-every-build
fix(cloud): every build of an automatic environment installs from its lockfile (AUTO-ENV-DEPS-NOT-RUNNING)
2026-11-13 05:54:09 -08:00
Neil a50afdc731 fix(cloud): retry a fresh build snapshot's 404 once; name orcad start failures (CREATE-BUILD-SNAPSHOT-404, CREATE-FAIL-LABELS) 2026-11-13 05:51:24 -08:00
Neil 7014c59a2d fix(cloud): PUSH-CAP design-squad wording; 'connect GitHub' catalog form in the no-access line 2026-11-13 05:45:44 -08:00
Neil f7d3a47079 fix(cloud): PUSH-CAP git shim replaces the bare HTTP 413 on a github.com push over the egress proxy cap with a plain Orca line 2026-11-13 05:44:51 -08:00
Neil 389292a819 fix(billing): EP-9b reconcile counts a cancel_at change as a fix (sso-scim nit) 2026-11-13 05:35:01 -08:00
Neil de4286aa73 fix(cloud): EP-9 billing tokens are minted for the team this device shows, never auth's shared active team
The desktop minted billing tokens with an empty body, so auth picked the team from the cloud
profile's active team, which every device of the same user shares: one device switching teams made
the other read (and act on) that team's plan, hours and usage. mintBillingToken now sends {orgId}
for this device's team (auth #761), refuses a token whose org claim is any other team (fail
closed: billing_org_mismatch), and falls back to {} on an older auth (400) with the claim still
checked. Mirrors the sandbox mint (#634).
Billing test: two teams of one owner on one Stripe customer each read only their own plan/hours.
2026-11-13 05:30:51 -08:00
Neil 881bdac5f4 fix(cloud): every build of an automatic environment installs from its lockfile (AUTO-ENV-DEPS-NOT-RUNNING)
Only the first build and the failed-build retry used autoConfig(); a golden refresh reused the active
build's stored (pre-#660) config, and a manual Rebuild built a default config, so neither got
ORCA_AUTO_INSTALL (and a Rebuild lost the blobless clone). startBuild now derives both from the
environment's kind: every build of an automatic environment, whatever started it, clones blobless and
installs from the lockfile. Tests for create, retry, golden refresh and manual Rebuild.
2026-11-13 05:29:24 -08:00
Neil c93623e1bc Merge remote-tracking branch 'private/cloud/integration' into create-speed/ep5-cancel-create 2026-11-13 05:24:56 -08:00
Neil edaa5ecd46 fix(billing): EP-9 a portal cancel (Stripe cancel_at) shows as the team's plan ending on that date
Stripe's portal on API 2025-09-30.clover cancels by setting cancel_at, not cancel_at_period_end,
so billing never saw the cancellation: no 'Plan ends', no grant end. The mirror now stores
cancel_at (migration 0009); cancel_at_period_end is the 'cancelling' flag for either form; grants
end at cancel_at; entitlements carry cancelAt; the desktop's 'Plan ends' uses it.
Test: two teams of one owner (separate customers), one cancels via cancel_at: its own plan shows
ending on that date, the other is untouched; un-cancelling clears it.
2026-11-13 05:24:47 -08:00
Neil 80d65a5b1c feat(cloud): EP-3c the control plane takes member display names from auth, as labels only 2026-11-13 05:13:29 -08:00
Neil 4d5fb95f9b Merge remote-tracking branch 'private/cloud/integration' into create-speed/ep5-cancel-create 2026-11-13 05:08:01 -08:00