Commit Graph
21082 Commits
Author SHA1 Message Date
Neil 84fc2c87e3 Merge pull request #191 from nwparker/cloud/code-checkpoints
feat(native-chat): per-turn code checkpoints; Rewind can also restore files
2026-11-10 01:18:54 -08:00
Neil 027ca19046 fix(checkpoints): newline-safe undo coverage, path-matched workspace busy, focus Cancel
- assertUndoCovers never asks batch-check about a path with a newline (counts as
  unsaved), so answers can't shift.
- The workspace-busy probe matches rows by workspace id or worktree realpath and
  treats a truncated listing as busy.
- Rewind dialog opens with focus on Cancel; a disabled option reads as disabled.
- Notes: unreadable tracked deletes keep their staged blob; the turn-starting
  mark is process-local by design.
2026-11-10 01:14:22 -08:00
Neil 80af83cb46 fix(checkpoints): nested repos, undo coverage, workspace-wide busy; W10 copy
- Refuse a restore that would write or delete inside a nested repository, and
  verify every on-disk path it touches is in the undo tree first (git add can
  skip a path without failing).
- A turn counts as busy from its snapshot until the hand-off; terminal agents
  working in the workspace make restores refuse; the preview reports busy and
  the dialog disables the files choice.
- W10 copy: statement description, i18n plurals, state-dependent detail line,
  option directly under the description, 'The chat was rewound, but…' errors.
- Index restore keeps skip-worktree bits; large-file scan honours the deadline.
- Component fixture for the rewind prompt states.
2026-11-10 01:08:53 -08:00
Neil ce388262db test(e2e): live spec settles on a quiet chat, logs dispatch state 2026-11-10 01:08:53 -08:00
Neil 94d0d4041f test(e2e): live rewind-with-restore against a real Claude Code agent 2026-11-10 01:08:53 -08:00
Neil 6e1905851c fix(checkpoints): address data-loss review
- A restore that fails partway names its undo point; the error toast offers Undo.
- Refuse when an ignored file sits where the checkpoint needs a folder, or when
  a file to overwrite is unreadable (neither could be saved first).
- Busy check runs inside the per-worktree queue and covers every chat in the
  worktree; the rewind stays pending until files are back.
- add --ignore-errors exit 1 (unreadable/nested repo) no longer disables
  checkpoints; untracked files over 10 MB are left out of snapshots (saved only
  if a restore would overwrite them); one deadline per capture.
- Skip-worktree/assume-unchanged entries are left alone; stale temp indexes swept;
  retention never prunes the checkpoint just written.
2026-11-10 01:08:53 -08:00
Neil c43d52f48b feat(native-chat): per-turn code checkpoints; Rewind can also restore files
Before each turn a message opens, the host snapshots the chat's worktree as a
stash-like commit under refs/orca/checkpoints/<session>/turn/<item> (working
tree incl. untracked files, staged tree as second parent), via a private temp
index. HEAD, the branch, the user's index and the stash list are untouched.

Rewind to here now offers 'Also restore files (N changed)', on by default when
a snapshot exists. Restore first saves an undo checkpoint (also covering ignored
files it overwrites), refuses on merge conflicts or file/folder clashes before
writing anything, never moves HEAD, and restores staging only while HEAD is
unchanged. The toast offers Undo. Retention: newest 50 turn / 10 undo
checkpoints per chat, nothing older than 30 days.

Measured: capture p50 356 ms on a 40k-file repo, 637 ms on 200k files; restore
0.44 s / 0.78 s.
2026-11-10 01:08:53 -08:00
Neil 63b6999dee feat(cloud): pdx1 default region, iad1 fallback, golden per region; Standard = 8 vCPU / 16 GB (U17, U18) (#194)
* feat(cloud): pdx1 default region with iad1 fallback and one golden per region; Standard is 8 vCPU / 16 GB (U17, U18)

- golden_images and environment_builds record their region (0040, backfilled iad1); rotation,
  git-source builds, smoke and activation run per region; lifecycle picks the region's golden.
- New creates default to pdx1; a create with no pinned region falls back to iad1 automatically on a
  capacity/provider error (VERCEL_FALLBACK_REGIONS). Until pdx1 has an image, creates use iad1.
- Environment builds boot and smoke in their own region; workspaces from a build boot there.
- One size: Standard = 8 vCPU / 16 GB (ORCA_CLOUD_SANDBOX_SPEC). Legacy 'large' requests map to
  standard; 0040 rewrites existing large rows.

* merge cloud/integration (ORCA_CLOUD_SANDBOX_SPEC landed in #196)
2026-11-10 01:07:56 -08:00
Neil b22512a759 Merge pull request #196 from nwparker/cloud/standard-8vcpu-copy
feat(cloud): one sandbox size (8 vCPU · 16 GB, 1×): billing and copy
2026-11-10 01:00:13 -08:00
Neil c893c5d570 Merge pull request #195 from nwparker/cloud/agents-node-ca
fix(cloud): orcad and its terminals trust the egress proxy's CA (Gemini CLI hung in cloud terminals)
2026-11-10 00:59:02 -08:00
Neil c997f9cf3c fix(cloud): orcad and its terminals trust the egress proxy's CA (Gemini CLI hung in every cloud terminal)
Hosts with credential rules (model APIs, api.github.com) are answered by Vercel's egress proxy with a
certificate from its CA. Vercel's command env trusts it (NODE_USE_SYSTEM_CA, NODE_EXTRA_CA_CERTS,
SSL_CERT_FILE) but orcad starts under env -i, so Node clients in terminals used Node's bundled roots:
Gemini CLI retried forever ('This is taking a bit longer') while the same call from a command
returned at once. Found on the live proof of the new agents; NODE_USE_SYSTEM_CA=1 in the terminal
fixed it there (1 s to the provider's answer).
2026-11-10 00:57:32 -08:00
Neil ff12245a82 feat(cloud): one sandbox size (8 vCPU · 16 GB, 1×) — billing counts every size 1×, plans/usage/run-on/env/CLI/phone copy from ORCA_CLOUD_SANDBOX_SPEC, size pickers removed 2026-11-10 00:54:28 -08:00
Neil b403e6d459 Merge pull request #193 from nwparker/cloud/w2-wake-live-fixes
fix(cloud): slow wake leaves no dead pane; no reconnect banner during a wake; pill below the tab strip; predictive pill shows at once
2026-11-10 00:51:30 -08:00
Neil 9d1ae65dbc Merge pull request #192 from nwparker/cloud/control-staging-auth
feat(sandbox-control): dev trusts staging auth sandbox tokens (U19 e2e)
2026-11-10 00:49:41 -08:00
Neil 2e16712692 fix(cloud): pane layout send returns a tagged result (type-aware lint) 2026-11-10 00:48:28 -08:00
Neil 0ca83ef860 feat(sandbox-control): dev control plane also trusts staging auth sandbox tokens
Staging sign-in now works end to end in dev without a dev operator key on the user's machine.
Same account ids as billing dev (which trusts staging already); never honored when SANDBOX_ENV=prod;
a staging key cannot pass as the prod issuer.
2026-11-10 00:46:50 -08:00
Neil 5f82993ac6 fix(cloud): a slow wake no longer leaves the woken pane dead (calls and streams wait for the in-flight wake instead of being refused at their call timeout; waking refusals retry soon; pane layout push retries); the pill waits until the pane takes input and fails visibly at 8s; no reconnect banner during a wake, cloud copy names the workspace; pill sits below the pane tab strip; earlier-started wakes show at once 2026-11-10 00:44:42 -08:00
Neil 64fbff83f1 Merge pull request #190 from nwparker/cloud/agents-in-image
feat(cloud): OpenCode, Gemini CLI, Cursor agent and Copilot CLI in the image; their keys swapped at egress
2026-11-10 00:33:06 -08:00
Neil 4286eb9cfc fix(cloud): no swappable key reaches the VM unrouted; Cursor's exchange reply passes only the access token
Security review: a Copilot BYOK key without a usable base URL (or with one from another scope) had
no route, so it went to the VM as itself. Every swappable name now becomes a placeholder, routed or
not, and the Copilot pair resolves like the other agent keys (shared beats personal, as a pair).
The Cursor exchange reply is parsed whatever its content type and cut down to accessToken; headers
(set-cookie) are not passed. opencode.ai is not allowlisted (anonymous share uploads).
2026-11-10 00:24:34 -08:00
Neil a1d4aad723 build(cloud): source-build smoke prints used disk and /opt/orca size 2026-11-10 00:20:05 -08:00
Neil 095c4ed960 build(cloud): fail the golden build when a new agent CLI does not start; smoke checks them 2026-11-10 00:19:31 -08:00
Neil 2086f40305 feat(cloud): OpenCode, Gemini CLI, Cursor agent and Copilot CLI in the golden image, keys swapped at egress
Image: pinned opencode-ai 1.19.5, @google/gemini-cli 0.67.0, @github/copilot 1.0.108 (npm) and
cursor-agent 2026.11.05-86047df (checksummed tarball). opencode's unused linux build variant is
dropped (~205 MB). First-run screens are answered at every boot/secret refresh (folder trust for
Gemini, Cursor and Copilot; Gemini's auth picker when a Gemini key is set; OpenCode's gateway model
from ANTHROPIC_MODEL/OPENAI_MODEL); self-update is off for all four.

Egress: GEMINI_API_KEY / GOOGLE_GENERATIVE_AI_API_KEY (generativelanguage.googleapis.com,
x-goog-api-key), CURSOR_API_KEY (api2.cursor.sh, only POST /auth/exchange_user_api_key; the
refresh token is stripped so nothing long-lived lands on the VM) and COPILOT_PROVIDER_API_KEY /
BEARER_TOKEN (host of COPILOT_PROVIDER_BASE_URL, same scope only) are placeholders in the VM and
swapped by the proxy. Allowlist adds the agents' API and sign-in hosts. API/MCP accept the image's
agents; routines stay on claude/codex.
2026-11-10 00:19:04 -08:00
Neil 8e9c8e71d4 fix: no cast in isOrcaCloudImageAgent 2026-11-10 00:13:19 -08:00
Neil ebf1d8c7bc Merge pull request #186 from nwparker/cloud/w9-eval
feat(cloud): real-UI audit run — downloads, remote desktop, local core workflow (m4air)
2026-11-09 23:52:09 -08:00
Neil 4b3e0b62d3 docs(cloud): lift download/remote-desktop audit caps after real-UI run on m4air 2026-11-09 23:50:14 -08:00
Neil f8058b55a5 feat(cloud): desktop UI checks for acc.download, acc.remote-desktop and local.core-workflow (W9D_ONLY=ui-audit)
- local.core-workflow: composer local worktree (Blank Terminal), edit in its terminal, diff in
  Source Control and the diff tab, Stage All, commit
- acc.download: Explorer Download… (20 MiB file) and Download as ZIP… (folder) with progress and
  success toasts and sha256 checks; only the native Save panel's answer is stubbed in main via the
  inspector (W9D_MAIN_INSPECT)
- acc.remote-desktop: workspace menu Open remote desktop -> orcaDesktop connected, noVNC canvas
  sampled, a red xterm launched on DISPLAY=:1 shows up; guest screenshots over CDP
- local rows without a host badge count as local
2026-11-09 23:50:14 -08:00
Neil 20acffd882 feat(cloud): one list of the agent CLIs the Orca Cloud image ships 2026-11-09 23:48:55 -08:00
Neil 3e21f651d7 perf(orcad): overlap the profile writer thread and the daemon launch with startup (~45 ms off ready) (#185)
Three startup changes, each generic:
- orcad serve starts the profile store's writer thread before its preflight (~40 ms of thread and
  module startup), and the store adopts it. The thread waits for its initialization as its first
  message; an unclaimed thread is unref'd and discarded after 30 s, and a dead or mismatched one
  is replaced by a fresh spawn as before.
- Before the ~100 ms of synchronous module imports, orcad lets the terminal daemon's launch reach
  its fork (bounded at 50 ms), so the daemon boots alongside the imports instead of after them.
- The journal's storage-row schemas are built on first use. They cost ~15 ms to construct and
  nothing reads journal rows before ready (V8 coverage at ready: journalRowDeclaresMore count 0).

Measured on 4-vCPU VMs from the current golden, n=20 interleaved readyMs:
2.9 GHz host p50 617 -> 572, p95 662 -> 646; 2.5 GHz host p50 882 -> 834, p95 969 -> 905.
2026-11-09 23:45:33 -08:00
Neil bf07f743a6 Merge pull request #184 from nwparker/cloud/w9-eval
fix(cloud): evaluation report applies independent-audit caps and adds Conductor local-workflow rows
2026-11-09 23:34:35 -08:00
Neil 1e2dc4f00f fix(cloud): acceptance report applies independent-audit caps (partial) and adds local core workflow, run actions, read-while-asleep and checkpoints rows 2026-11-09 23:31:50 -08:00
Neil d9b9e23ca3 docs(cloud): acceptance wake delivery on snap_6kSW (#173/#175) 2026-11-09 23:31:50 -08:00
Neil 855d8ed34b Merge pull request #183 from nwparker/cloud/w2-wake-visibility
fix(cloud): wake visibility (W10 audit): slow hint at 10s, Connecting… until the pane re-attaches, type-through fixtures
2026-11-09 23:27:47 -08:00
Neil 06ca3350e7 fix(cloud): wake attach hold: no narrowing type guard (typecheck) 2026-11-09 23:25:36 -08:00
Neil 0c7fc55008 fix(cloud): slow hint text left-aligned inside the right-anchored type-through card (W10 nit) 2026-11-09 23:23:35 -08:00
Neil dd1edba0a7 fix(cloud): wake attach hold derives state during render and polls through the window-visibility interval (lint gates) 2026-11-09 23:22:43 -08:00
Neil beb94f3703 Merge pull request #181 from nwparker/cloud/w5-cli-wake
feat(cli): always show cloud wake, sleep and --on cloud create progress
2026-11-09 23:21:15 -08:00
Neil 4a1e476b38 fix(w8): long-wake note hands over to the plain note in place: no blink, announced once (iOS once; Android live region off after first) (#182) 2026-11-09 23:18:03 -08:00
Neil 37001fc918 fix(cloud): type-through waking pill anchors top-right, clear of the prompt line (W10 P2) 2026-11-09 23:15:18 -08:00
Neil a8179682e6 feat(cli): always show cloud wake, sleep and --on cloud create progress
W10 wake-visibility P1s. stderr '- …' lines (NDJSON phase events with
--progress json; --json defaults to none; stdout keeps only the result):
- wake: 'Waking <ws>...', one 'Still waking (Ns)…' line at 10 s,
  '<name> is awake (took Ns).', or, when the API answers still waking
  after its wait, '<name> is still waking. Check with: …' (exit 0, status
  waking kept in the result)
- sleep: 'Putting <ws> to sleep...' / '<name> is asleep (took Ns).'
- worktree create --on cloud: 'Still starting (Ns)…' at 10 s and
  'Workspace <id> is running (took Ns).'
Lifecycle handler moved to cloud-lifecycle.ts; shared helper cloud-progress.ts.
2026-11-09 23:14:14 -08:00
Neil b6b6902f57 W8: reassure on the phone when a wake runs long (files are safe; queued prompt sends once awake) (#180)
* feat(w8): reassure after 10 s of waking (files are safe; a queued prompt sends once awake), under the steps with the timer still running

* fix(w8): wake-slow note: iOS-only announce, prompt sentence only while waking, whole-run reassurance from 20 s, fresh per run
2026-11-09 23:14:10 -08:00
Neil 558b9d6111 fix(cloud): wake visibility (W10 audit): slow hint at 10s with reassurance, also in type-through; pill holds as Connecting… until the pane in front re-attaches (bounded 8s); keys-waiting plurals; type-through wake fixtures 2026-11-09 23:12:35 -08:00
Neil e358654757 Merge pull request #179 from nwparker/cloud/w5-issue-comments
fix(sandbox-control): routine comments on plain issues (issues:write token)
2026-11-09 23:09:13 -08:00
Neil 4dd72d4c35 fix(orcad): scrub the qualification dir from panes, create it on first record (#178)
A user's own orcad started from a server pane must not share or overwrite the server's
marker, so the variable joins ORCAD_SERVER_LAUNCH_ENV_KEYS. The launcher may name a directory
that does not exist yet; create it (0700) before writing the marker.
2026-11-09 23:07:46 -08:00
Neil 20338e08c5 fix(sandbox-control): routine comments mint an issues:write token so plain issues get comments (falls back when the installation lacks it) 2026-11-09 23:05:42 -08:00
Neil 5099c08e6b perf(orcad): load RPC method handlers on first call, not before ready (~50 ms off ready) (#177)
The dispatcher now takes either a method list or a loader. The RPC server's default is a loader
that imports the method registry on the first call; orcad preloads it right after its ready line,
so a reconnecting client normally finds it loaded. Concurrent first calls share one load; a failed
import answers those calls with an RPC error and the next call retries.

The legacy relay CLI imported the registry statically, which kept it on orcad's startup path; it
now loads it with its first relayed command (its dispatcher moves to its own file for that).

Measured on a 4-vCPU VM from the current golden, n=20 interleaved: readyMs p50 679 -> 621,
p95 716 -> 665.
2026-11-09 23:02:38 -08:00
Neil 546e58e92a Merge pull request #176 from nwparker/cloud/stale-running-wake
fix(cloud): a VM slept from the CLI/phone/another window wakes promptly
2026-11-09 22:50:29 -08:00
Neil c9a87ee49c test: no casts in the remote-sleep tests' mock state 2026-11-09 22:48:32 -08:00
Neil 26939bbfb6 fix(cloud): a VM slept from the CLI/phone/another window wakes promptly
The desktop's runtime record kept saying 'running' after a sleep from another
client until lost-contact tripped (minutes), so an open or predictive wake
returned at once without resuming, and the row read awake.

- Wake path: a cloud record still 'running' asks the control plane; when the
  sandbox is suspended the record is marked asleep and the resume runs.
- Status reads (window refresh, predictive preflight, the 1 min beat) mark a
  running record asleep when the control plane says sleeping, so the row
  reads Asleep. Only when the record is unchanged since it was read.
- Quiet (predictive) wakes report whether a resume actually ran; one that
  found the VM up is 'skipped': no unopened hold, no backoff, no short idle
  window in main.
- A skipped wake (preflight no, or nothing to resume) gives the 30 s
  hover/focus gap back.
2026-11-09 22:47:22 -08:00
Neil 543cff405e perf(cloud): seal the ready offer into the start line; poll ready every 10 ms (#175)
The wake phase "orcad ready" (W9) runs from orcad's spawn to the control plane
having the pairing offer. After orca-sandbox-start exits, the control plane
made a second Vercel round trip (files API, ~120 ms from here) to read the
offer, because command stdout is kept as logs.

startOrcad now passes a fresh 32-byte key per call in env (env is not kept).
The start script adds "sealedOffer": "<iv>.<base64 AES-256-CTR(offer line)>"
to the pointer line it already prints, so the logs only hold ciphertext and
the control plane opens the offer locally. The key is unset first thing in the
script and in the prelude, so nothing the script starts inherits it. If the
offer is missing or does not open (older image, no openssl, wrong key), the
control plane reads the file as before. Older Workers send no key, and
current images then print the plain pointer.

The ready poll in the start script drops from 50 ms to 10 ms (~20 ms mean),
keeping the 60 s minimum timeout.

Verified on a VM from snap_aQmW, driving the start script like the control
plane: all four starts, including an idempotent second start, opened without
the files API, and the stdout never held the pairing code.
2026-11-09 22:01:32 -08:00
Neil 72cdbaee54 Merge pull request #174 from nwparker/cloud/w2-predict-drag
fix(cloud): predictive wake: any row drag cancels the press wake (m4air finding)
2026-11-09 21:57:26 -08:00