Commit Graph
482 Commits
Author SHA1 Message Date
Neil a1676f8109 Merge pull request #105 from nwparker/cloud/staging-test-accounts
chore(cloud): durable staging test-account setup
2026-11-09 15:17:25 -08:00
Neil d843e88b18 chore(cloud): durable staging test-account setup (provision, headless desktop sign-in, >100-invites live check) 2026-11-09 15:16:59 -08:00
Neil 44e7c9fdf6 fix(sandbox-control): register the workspace project in orcad at every start (API, MCP, routines, phone see the repo) (#104)
orcad listed the cloned project only after a client called repo.add, which only the desktop does on
connect. orca-sandbox-start now runs 'orca repo add --path /vercel/sandbox/project' (folder kind
when it is not a git checkout) in the background once orcad is ready; re-adding is a no-op. Verified
on a VM from the active golden: repo list shows /vercel/sandbox/project right after start.
2026-11-09 15:14:54 -08:00
Neil d7497308c1 feat(sandbox-control): egress key swap on by default for every team, per-team kill switch SECRETS_EGRESS_PLACEHOLDERS_OFF 2026-11-09 15:13:19 -08:00
Neil 604ce7c913 Merge pull request #99 from nwparker/cloud/w6-mcp-final
W6: MCP config sync into Orca Cloud sandboxes (egress hosts + OAuth loopback relay)
2026-11-09 15:10:16 -08:00
Neil 53dced42c8 fix(cloud): MCP sync review — generic OAuth relay accepts only a loopback GET for its port (2-min TTL, never displaces a sign-in), first sync is an explicit consent before tokens leave this computer, no '.' on the image PATH 2026-11-09 15:09:45 -08:00
Neil fa70f42ae1 fix(sandbox-control): honest create timing (create_ms/wake_ms, migration 0035); operator golden rotation script (#102)
* feat(sandbox-control): operator golden rotation from a git ref (image/rotate-golden-from-source.ts)

Fallback while the Worker's git-source build can't read the repo: uploads git archive of the ref
(default private/cloud/integration) into a managed-image build sandbox, runs source-build.sh (now
accepts an uploaded ORCA_SRC_DIR), wipes, snapshots, smoke-boots (SOURCE_COMMIT matches, tools, orca
CLI reaches orcad, stop/resume), and registers a smoking golden_images row with bundle_sha256
git:<sha>. Refuses a desktop-less image when the manifest pins one. Durable ledger in
~/.orca-cloud-ops (survives /tmp wipes); --cleanup deletes orphans of an interrupted run.

* fix(sandbox-control): honest create timing: create_ms/wake_ms written once per start, not ready_at - created_at

GET /v1/config said create p95 23 s. Its source, ready_at - created_at, moves on every wake, so every
sandbox slept and woken within two minutes of creation (bench and smoke cycles: 15-23 s, 35-90 s) counted
as a slow create. Real creates on dev are p50 2.9 s / p95 4.0 s. Migration 0035 adds create_ms
(write-ahead row to first ready) and wake_ms (resume claim to ready); createTiming reads create_ms.
2026-11-09 15:08:16 -08:00
Neil 04305cecbe Merge pull request #101 from nwparker/cloud/w4-name
feat(cloud): label teammates from the token name claim (W4, migration 0034)
2026-11-09 15:04:19 -08:00
Neil 119ffb907e feat(cloud): label teammates from the token name claim (member_names, migration 0034)
Each member's own /v1/team request records the sanitized name claim for their account;
workspace views return memberNames for owner, creator, last active and presence ids. Home
falls back to these when the org roster has no entry (dev orgs, members who left). Labels
only; access never reads them. Write failures never fail the request.
2026-11-09 15:03:14 -08:00
Neil d3a9385ab8 fix(cloud): review round 1: cache /v1/config timing per isolate, pending actions stay focusable, retry config after offline, reactive repos in the sidebar row, focus + URL tests 2026-11-09 14:48:07 -08:00
Neil ee1f14b871 Revert "fix(sandbox-control): a workspace started without a repo gets an empty repository Orca can open"
This reverts commit 0c4ec3ac451e173fe0b0c5840a139b08728fc9fb.
2026-11-09 14:48:07 -08:00
Neil 991d8ad665 fix(sandbox-control): a workspace started without a repo gets an empty repository Orca can open 2026-11-09 14:48:07 -08:00
Neil a8d6bb4698 fix(cloud): build sheet round 4: glossary cards, GitHub not connected + no GitHub remote before any sandbox, measured start hint from /v1/config, Orca Cloud host label
- Account/billing cards use glossary titles (Out of sandbox hours, Spend cap reached, Payment failed,
  running-sandbox limits), role-aware next steps, and 'Nothing was created, and you weren't charged.'
- 409 github_not_connected: 'GitHub isn't connected for <owner/repo>' + Connect GitHub (POST
  /v1/github/connect, opens the GitHub install page) + Try again.
- A repo without a GitHub remote is refused in main before the control plane is called, with
  Start empty / Push to GitHub first.
- GET /v1/config serves createTiming (p50/p95 of recent create-to-ready); the sheet's 'usually ~Ns'
  reads it and shows no hint without a measurement.
- Orca Cloud servers display as 'Orca Cloud' in sidebar host labels and the usage segment; legacy
  '<repo> VM <id>' names are renamed at startup.
2026-11-09 14:48:06 -08:00
Neil ea9bac87ee test(billing): robust 3DS e2e (match ACS buttons by name, commit-level waits, settle missed redirects) 2026-11-09 08:55:56 -08:00
Neil 6bd93fc20b feat(cloud): meter environment build time; no setup-script nudge for env-build workspaces (#94)
* fix(sandbox-control): read the orgRole claim that Orca Cloud auth mints (#29)

Auth mints the live org role as orgRole on sandbox tokens (same claim as billing
tokens, stablyai/orca-cloud#695); the verifier read org_role, so admins would
never have been recognized.

* wip(cloud): environment builds control plane

* wip(cloud): environment build boot path, staleness, routes

* wip(cloud): env build tests, anonymous staleness fallback

* wip(cloud): migration 0008 (claimed), quieter recovered clone errors

* fix(cloud): env build review: interrupted-snapshot recovery, bounded log reads, secret redaction, activation guard, hook/prelude fixes

* fix(cloud): wait briefly for the build exit code after its log ends; print the base image and package manager

* wip(desktop): org environments client, IPC, CLI, settings UI, orcad disk usage + low-disk banner

* perf(cloud): smoke-boot each environment build before activating it; skip the redundant prelude fetch

* fix(cloud): a GitHub token error fails the build as github_unavailable instead of cloning anonymously

* perf(cloud): warm pool VMs per hot environment build, so a create from an org environment skips the provider boot

* wip(desktop): cloud environment UI round-3 fixes

* fix(cloud): pool-per-build review: smoke race safety, provider hiccups skip smoke, usage-based hot builds with caps, bounded boots, index

* fix(desktop): Configure with an agent hands the prompt over at launch (trust dialog swallowed the pasted Enter); CLI builds table widths

* polish(desktop): W10 P2s — InlineError action slot, shared focus-ring, copy

* feat(cloud): build event stream heartbeat every 20 s

* fix(desktop): FE review — stable virtualizer, shadow-buffer replays, heartbeat-aware build watch, CLI follower restarts, repo import path checks, poll races

* feat(cloud): meter environment build sandbox time to the member who started it; no setup-script nudge for workspaces booted from an env build
2026-11-09 08:11:06 -08:00
Neil 0df9ea1fbf feat(cloud): org environment builds — desktop: Settings → Cloud environment, live logs, CLI, low-disk banner (#47)
* fix(sandbox-control): read the orgRole claim that Orca Cloud auth mints (#29)

Auth mints the live org role as orgRole on sandbox tokens (same claim as billing
tokens, stablyai/orca-cloud#695); the verifier read org_role, so admins would
never have been recognized.

* wip(cloud): environment builds control plane

* wip(cloud): environment build boot path, staleness, routes

* wip(cloud): env build tests, anonymous staleness fallback

* wip(cloud): migration 0008 (claimed), quieter recovered clone errors

* fix(cloud): env build review: interrupted-snapshot recovery, bounded log reads, secret redaction, activation guard, hook/prelude fixes

* fix(cloud): wait briefly for the build exit code after its log ends; print the base image and package manager

* wip(desktop): org environments client, IPC, CLI, settings UI, orcad disk usage + low-disk banner

* perf(cloud): smoke-boot each environment build before activating it; skip the redundant prelude fetch

* fix(cloud): a GitHub token error fails the build as github_unavailable instead of cloning anonymously

* perf(cloud): warm pool VMs per hot environment build, so a create from an org environment skips the provider boot

* wip(desktop): cloud environment UI round-3 fixes

* fix(cloud): pool-per-build review: smoke race safety, provider hiccups skip smoke, usage-based hot builds with caps, bounded boots, index

* fix(desktop): Configure with an agent hands the prompt over at launch (trust dialog swallowed the pasted Enter); CLI builds table widths

* polish(desktop): W10 P2s — InlineError action slot, shared focus-ring, copy

* feat(cloud): build event stream heartbeat every 20 s

* fix(desktop): FE review — stable virtualizer, shadow-buffer replays, heartbeat-aware build watch, CLI follower restarts, repo import path checks, poll races
2026-11-09 08:03:35 -08:00
Neil 3c553acc77 feat(cloud): MCP servers panel on Orca Cloud workspaces; resolve stdio commands like agent launches; image puts node/npx on agents' PATH 2026-11-09 07:59:02 -08:00
Neil 07f607d414 fix(cloud): default workspace git author on images older than the start-script default 2026-11-09 07:48:30 -08:00
Neil 5c53102202 Merge pull request #90 from nwparker/cloud/w6-mcp-egress
W6: per-workspace egress hosts for synced remote MCP servers
2026-11-09 07:46:17 -08:00
Neil 6c2a37c83b feat(sandbox-control): per-workspace tool egress hosts for synced remote MCP servers (PUT/GET /v1/sandboxes/:id/egress/hosts, migration 0032) 2026-11-09 07:46:04 -08:00
Neil 1ba34366c9 chore(cloud): regenerate VM scripts
# Conflicts:
#	cloud/apps/sandbox-control/image/vm-scripts.generated.ts
2026-11-09 07:30:56 -08:00
Neil 6afde0d63d fix(cloud): attest plain terminals by handle+pane (agent terminals still prove their launch token); default workspace git author 2026-11-09 07:30:50 -08:00
Neil baef8f91e0 feat(cloud): member git identity only within a window after the member's own client reports a send (0031); entry points kept current per boot
# Conflicts:
#	cloud/apps/sandbox-control/image/vm-scripts.generated.ts
2026-11-09 07:30:39 -08:00
Neil a3c5f1ed50 fix(cloud): owner device joins the VM member map as soon as it is recorded 2026-11-09 07:30:27 -08:00
Neil fc50ad9466 feat(cloud): per-device sender attestation (orcad orchestration.turnSender, orca sender), root-only member identities + sudo helper, sender-aware git in VMs (default on); terminal-agent sender envelope; follow teammates into chats and chat links; name claim
# Conflicts:
#	cloud/apps/sandbox-control/image/vm-scripts.generated.ts
#	src/renderer/src/components/cloud-workspaces/CloudMemberAvatars.tsx
2026-11-09 07:30:27 -08:00
Neil 2d01a3d1b2 feat(w3): remote desktop polish — glossary copy, InlineError toasts with one next action, fixtures (#83) 2026-11-09 07:27:19 -08:00
Neil e141a74ead feat(cloud): one idle-sleep constant (ORCA_CLOUD_IDLE_SLEEP_MINUTES = 15) for control plane, desktop scheduler, billing plans and toasts; GET /v1/config serves it (#80)
Plans said 15 minutes, the desktop slept at 20. The shared wire module now owns the value; the
control plane serves it at GET /v1/config (public product constants), the desktop driver's idleStopMs,
billing's Team plan idleSleepMinutes and the billing fixtures read the constant, and the idle-sleep
toast already prints the scheduler's value from the event.
2026-11-09 07:15:51 -08:00
Neil 0272e323b3 docs(sandbox-control): glossary pass on OpenAPI, /docs and MCP tool descriptions (sandbox, team, sleep/wake/delete, Orca API keys) 2026-11-09 07:12:44 -08:00
Neil 5ab167c0d1 Merge pull request #76 from nwparker/cloud/w2-transfer
feat(cloud): move a cloud workspace to this computer (worktree, changes, chats) + preview wake helper
2026-11-09 07:04:00 -08:00
Neil 165d6813fe Merge remote-tracking branch 'private/cloud/integration' into cloud/w2-transfer
# Conflicts:
#	src/main/hosted-sandbox/hosted-sandbox-install.ts
#	src/preload/api-types.ts
#	src/renderer/src/components/sidebar/workspace-actions/context-menu/WorktreeContextMenuView.tsx
2026-11-09 07:02:59 -08:00
Neil b0b593ed45 Merge remote-tracking branch 'private/cloud/integration' into cloud/w2-transfer
# Conflicts:
#	cloud/apps/sandbox-control/src/index.ts
#	cloud/apps/sandbox-control/src/lifecycle.ts
#	cloud/apps/sandbox-control/src/pool.ts
#	cloud/apps/sandbox-control/src/sandbox-vm-commands.ts
#	cloud/apps/sandbox-control/test/fake-vercel.ts
#	cloud/apps/sandbox-control/test/lifecycle-flow.test.ts
#	src/main/hosted-sandbox/hosted-sandbox-control-plane-client.ts
#	src/preload/api-types.ts
#	src/renderer/src/components/sidebar/workspace-actions/context-menu/WorktreeContextMenuView.tsx
#	src/shared/hosted-sandbox/hosted-sandbox-wire.ts
2026-11-09 07:01:38 -08:00
Neil 702ce21a21 feat(billing): dev Worker trusts staging auth and reads staging seat counts (dev only) 2026-11-09 07:01:19 -08:00
Neil 32d8f0589c Merge pull request #68 from nwparker/cloud/accounts-ux
feat(team): Team page, upgrade moments and in-app checkout for Orca Cloud
2026-11-09 06:57:01 -08:00
Neil 7f65f2bdf5 refactor(sandbox-control): API access uses W4's canSee/canOpen; teammate messages carry the sender envelope (spoofed envelopes stripped) 2026-11-09 06:56:04 -08:00
Neil 8b070704e8 fix(team): review round 2 polish (design P2s, FE P2s) 2026-11-09 06:55:56 -08:00
Neil 45caa0c93a fix(team): review round 1 (design + FE): copy, focus, live regions, roster/overlay races, summary generations, checkout watch + single live session 2026-11-09 06:55:56 -08:00
Neil dde40cbdeb wip(team): W10 round-1 fixes, return page, docs 2026-11-09 06:55:55 -08:00
Neil 90adbc6601 wip(team): team page, checkout flow, dev billing token 2026-11-09 06:55:54 -08:00
Neil e7c1831e60 Merge pull request #58 from nwparker/cloud/w4-multiplayer
feat(cloud): W4 team collaboration on cloud workspaces
2026-11-09 06:53:38 -08:00
Neil 777f078c76 feat(cloud): W4 team collaboration on cloud workspaces
## W4: team collaboration on Orca Cloud workspaces

### Control plane (`cloud/apps/sandbox-control`)
- **Registry** (`0024_workspace_registry.sql`, applied on dev D1): owner (reassignable), `created_by`, branch, `visibility` (private default / team), section, last activity, token spend. Reuses 0020's `name`/`archived_at`.
- **Routes under `/v1/team/*`** (W5 owns `/v1/workspaces`): list with Mine/Team/All, By, In, Archived filters; PATCH (rename, share or make private, section, archive, reassign owner); presence heartbeats; wake and lease for teammates; links resolve; org prompts/PR instructions (compare-and-set).
- **Security fix:** `/v1/sandboxes/:id` used to be account-scoped, so any org member could resume a teammate's sandbox and receive its orcad pairing code. It is now owner-only; admins can still suspend and destroy.
- **Per-member, per-device E2EE grants:**
  - The VM mints a single-device orcad offer and seals it to the requesting device's X25519 key.
  - The control plane stores only the orcad device id.
  - Revocation runs `orca pair --revoke`, which closes the device's live sockets, plus an on-disk registry removal.
  - When the VM is asleep, the revoke is queued and applied at boot before orcad starts.
  - Triggers: explicit revoke, making a workspace private, archive, reassign, member removal (internal route), and phone device-session revoke (W8).
  - VMs from older images get the entry points installed on demand.
- **Git as the sender:** a member's own GitHub user-to-server token (App OAuth, envelope-encrypted) is swapped in at egress only for the workspace repo. The VM gets per-member git configs and `orca-git-as`.
- **Cost:** metered compute × billing rate, plus optional token spend.

### orcad (generic)
- New owner-only RPC `pairing.revokeDevice` and `orca pair --revoke <device-id>`: revokes a device and closes its open connections immediately.

### Desktop
- A "Cloud workspaces" section on Home: Team/Mine, By, In and Archived filters; sections; live presence; cost; last activity. Single-click Open on a teammate workspace pairs this device through an E2EE grant. Also a row menu (share/private, move to section, reassign, archive) and copy link.
- Deep links `orca://cloud/w/<id>[/c/<chat>]` (open-url, argv, second instance, sidecar handoff) and the `cloudWorkspace.copyLink` keybinding.
- Messages to agents in shared workspaces carry a sender envelope.
- Uses the W10 shared primitives.
- Two rounds of adversarial design and frontend review.

### Evidence
Real Vercel VMs; see the W4 report. Numbers:
- grant issued in 0.55 s, paired in 1.35 s
- revoke closes the live desktop socket ~30 ms after the PATCH returns
- two members' pushes land on GitHub with their own author identities (shared dev Worker, preview alias w4); a push to another repo gets 403
2026-11-09 06:53:24 -08:00
Neil b0b224de2b Merge pull request #67 from nwparker/cloud/w5-grant-host
feat(mcp): connected-app grants show the client's redirect hosts
2026-11-09 06:50:46 -08:00
Neil 8a657067bd fix(cloud): SSH/transfer security review: owner-only SSH setup + DELETE, managed authorized_keys block, stable bridge token via subprotocol, boot-scoped pids + required healthz, owner re-check on ssh-wake, safe tar/gzip extraction, transcript-only chats, VM cleanup in finally, transfer sweep, unique aliases, shell-safe ProxyCommand launcher (Windows/AppImage), login-user fix-up 2026-11-09 06:50:38 -08:00
Neil 8ff954b08b feat(mcp): connected-app grants show the client's redirect hosts 2026-11-09 06:50:34 -08:00
Neil 309245d0d4 feat(w3): remote desktop for Orca Cloud workspaces (Xvnc + noVNC over the port forward) (#61) 2026-11-09 06:43:19 -08:00
Neil 984f29fc37 feat(cloud): SSH into Orca Cloud workspaces (orca ssh, ssh-proxy, VS Code/Cursor Remote-SSH) (#55)
* feat(cloud): SSH into Orca Cloud workspaces (orca ssh, ssh-proxy, VS Code/Cursor Remote-SSH)

- VM: unprivileged key-only sshd on 127.0.0.1:2222 (orca-sshd), host key and Orca-managed
  authorized_keys on the persistent disk; orca-ssh-keys entry point; provision extracts only the
  server binaries (dnf or apt, +1.5-2 MB) and unlocks the sandbox user for key logins.
- Control plane: POST/DELETE /v1/sandboxes/:id/ssh-keys runs the fixed entry point and answers
  the pinned host key; editor Remote-SSH server hosts on the egress allowlist.
- Desktop: per-workspace ed25519 keys in userData (0600), Orca-owned ssh_config + pinned
  known_hosts, ~/.ssh/config Include only after consent; wake -> key -> runtime port forward
  (openRuntimePortForward reason 'ssh'); revoke (deferred while asleep); SSH traffic keeps the
  workspace awake.
- CLI: orca ssh-proxy <workspace> (ProxyCommand) and orca ssh <workspace>.
- UI: Open in -> VS Code / Cursor over Remote SSH, SSH submenu (Copy SSH Command, Revoke),
  include consent dialog, progress/error toasts.

* fix(cloud-ssh): review fixes — no agent forwarding, reinstall per VM boot, wake to revoke

- ForwardAgent/ForwardX11 no in Orca's host blocks; AllowAgentForwarding no in the VM's sshd.
- Reinstall the key (idempotent; restarts sshd, re-pins the host key) once per VM boot, so a
  wiped disk, rollover or dead sshd heals on the next connection.
- Revoke wakes the VM to remove its copy; only an unreachable VM falls back to the queue.
- orca-ssh-keys rejects multi-line keys; sshd log truncated per start; audit log entries for
  ssh key add/remove; state parsed per entry; % escaped in ssh_config paths; ProxyCommand pinned
  to this app's profile; ssh-proxy flushes stdout before exit; --print shell-quotes; editors
  open via --folder-uri with a checked path; "Remove from ~/.ssh/config" + one-time backup.
2026-11-09 06:37:23 -08:00
Neil 1737dcdfbd feat(cloud): share links for Orca Cloud workspace ports (W3) (#51)
* feat(cloud): share links for Orca Cloud workspace ports (gateway, in-VM share proxy, wake interstitial, Ports panel UI)

* fix(cloud): share-link security review (no cookie fallback, path mode dev-only, per-link cookie scoping, SW and Referer blocked, proxy key via stdin, connection deadline, link-bound viewer, wake cap, rate limit, secret rotation)

* fix(cloud): share links re-review (host-only app cookies in subdomain mode, previous-secret proxy retry, 30 min connection cap, share-domain pinning on the desktop)
2026-11-09 06:30:40 -08:00
Neil 484b999dc8 feat(sandbox-control): golden image tracks cloud/integration HEAD (orcad built from source, rebuilt when HEAD touches VM code); sshd in image (#57)
GOLDEN_IMAGE_SOURCE=git:<repo>#<branch>: each cron tick resolves the branch HEAD through the GitHub
App installation on that repo (read-only single-repo token, operator-only request surface) and, when
HEAD differs from the active image's commit and the compare touches VM paths, starts a source build:
fetch the commit, build orcad + bundled orca CLI, provision, then the existing wipe, snapshot, smoke,
atomic activate (previous image kept as rollback). The commit is recorded as bundle_sha256 git:<sha>
(kept through clone refreshes) and in /opt/orca/runtime/orcad/SOURCE_COMMIT. Also (W2): openssh-server
in the image (on demand only), https apt sources, unlocked password field for key-only sshd.
2026-11-09 06:17:08 -08:00
Neil eb844e7ed3 Merge pull request #56 from nwparker/cloud/w2-lifecycle
fix(cloud): archive capture keeps the first path char; OOM victim reports the process, not its thread
2026-11-09 06:14:36 -08:00
Neil d6679e8e93 feat(cloud): move a cloud workspace to this computer, wake on SSH (sshd over a wss bridge + desktop ProxyCommand), preview wake helper 2026-11-09 06:11:42 -08:00
Neil e70317fa7c perf(cloud): warm pool per hot environment build; smoke-boot builds; clearer GitHub failures (#54)
Follow-up to #49 (W1 environment builds), control plane only.

- **Warm pool per hot environment build** (`pool.ts`): alongside the golden pool, keep 1 ready VM booted from the active build of each environment that was used or built in the last 2 hours (standard size, at most 20 builds). A create from that environment claims it. Pool deletes never remove the image a VM booted from.
- **Smoke-boot every build before activating it**: orcad must answer on the new image. If the install script broke Orca, that build fails as `smoke_failed` and never reaches a workspace. The boot also takes the first-boot cost so users don't.
- **Prelude**: skips the fetch when the build is already on the requested branch, because Orca fetches the base right before `worktree add`.
- **GitHub token errors**: a minting error now fails the build as `github_unavailable` (step clone). Before, it cloned anonymously and failed with a misleading 404, seen live.

Evidence: shared dev preview alias, private repo, sequential, n=12.

| Create → orcad ready | p50 | p95 |
|---|---|---|
| Before | 4.99 s | 6.71 s |
| After | 3.76 s | 5.67 s |

The only sample above 3.9 s was the first one, which missed the pool while it was cold. Pool hits put the VM phase at 0.25 s. Tests: 221 pass, plus typecheck.
2026-11-09 06:08:11 -08:00