* feat(runtime): tell phones when git status changes
* fix(runtime): tell phones about HEAD and packed-refs moves too
* fix(runtime): don't let a phone's status re-read join a read begun before the change
* perf(runtime): limit status-read invalidation to the checkouts an outside change touched
* fix(runtime): match a checkout's status keys under any execution host
* fix(runtime): invalidate globally while a primary checkout is unread
* test(mobile): re-record the Changes and settings goldens on the rebased main
* fix(runtime): invalidate globally while a listed checkout has no cached path
* test: follow the moved paired-client harness
* refactor(mobile): let the host list's catalog read hold the event router
Adds commit actions to the Git Graph: check out a commit or branch, cherry-pick, revert, and create a branch from a commit. Conflicts hand off to Source Control with continue and abort. Works on local, WSL and remote hosts.
* refactor(git): share the .gitattributes ancestor stamp paths
* perf(git): reuse the branch-compare changed-files list per commit pair
* perf(git): charge cached change lists for the stdout their paths retain
* perf(git): bound branch change-list reuse to five minutes for unstamped system attributes
* refactor(git): share the deadline-bounded stamp probe
* perf(git): bound branch change-list attribute stamps by a 2s deadline and 4096 paths
* refactor(git): move porcelain status streaming into its own module
* perf(git): let status use the untracked cache and expand collapsed directories
-uall never matches the untracked cache's stored mode, so every poll rescanned the whole tree. Scan in the configured mode and list only the collapsed '? dir/' rows with ls-files, reapplying the entry cap so results match -uall exactly. Ignored reads and status.showUntrackedFiles=no keep -uall.
* refactor(git): let the settled diff cache and stamp serve multi-path reads
* perf(git): reuse status numstat passes while their stamped inputs are unchanged
Each poll re-ran up to two whole-worktree numstat diffs even when nothing changed. Cache each pass in a SettledDiffCache validated by the worktree diff stamp (HEAD, index, .gitmodules, plus every unstaged working file for the unstaged pass); racy writes, mutations and submodule rows still recompute.
* perf(git): defer status while index.lock is held
A status read during an agent's commit sees a half-written state and is immediately redone. Wait (up to 1s, abortable, inside the shared lease) for the lock in the worktree's own gitdir to go away; a lock that survives a full wait is remembered as stale so later reads skip waiting.
* perf(git): pick the untracked scan from config and fall back to -uall when expansion cannot win
Read status.showUntrackedFiles and core.untrackedCache in one config call, remember worktrees that need -uall so polls do not scan twice, and rescan with -uall when rows sit outside cwd, need more than one ls-files chunk, or list empty.
* refactor(git): keep numstat cache limits beside the file diff limits
* refactor(git): stamp host settings files and resolve the common gitdir
* perf(git): read untracked-scan config from a stamped snapshot, with a rollback switch
Cache 'git config --list --show-origin' per worktree while every config file it named (plus repo, worktree and global candidates) keeps its stamp, so steady-state polls spawn no config read. WSL and UNC checkouts keep -uall: their config cannot be stamped from the host and network mtimes cannot vouch for the untracked cache. ORCA_GIT_STATUS_UNTRACKED_EXPANSION=0 restores the plain -uall scan.
* fix(git): stamp config and attributes before reusing status numstat
Numstat output also depends on Git config (including includes) and on .gitattributes, info/attributes and core.attributesFile. Stamp all of them, plus every .gitattributes that can apply to a changed path, and skip reuse under WSL. ORCA_GIT_STATUS_NUMSTAT_REUSE=0 recomputes every pass.
* fix(git): stamp include targets and onbranch HEAD in the config snapshot, and share one read
Include and includeIf targets (and HEAD for onbranch conditions) are now stamped, so a branch switch or a filled-in include re-reads config. Concurrent cold reads coalesce, both numstat passes share one config read, folders without their own gitdir skip the snapshot, aborted reads keep the cached entry, and Windows HOME follows Git's HOMEDRIVE/HOMEPATH order.
* perf(git): expand untracked directories only when the untracked cache is opted in
Git's default core.untrackedCache=keep only reuses a cache someone already built, and fresh repos have none, so status plus ls-files cost more than one -uall scan. Expand only for core.untrackedCache=true or feature.manyFiles=true without an override.
* fix(git): bound config stamps on dead mounts and share commondir resolution
Config file stats run under the same 2s deadline as local-git-config-signature, coalesced per file set, so a hung home or network mount skips reuse instead of stalling status. readHeadComponent now uses resolveGitCommonDir.
* test(git): pin the -uall truncation contract of untracked directory expansion
* fix(git): treat an unreadable commondir as unstampable config
main's resolveGitCommonDir rethrows non-missing errors; the config snapshot must fall back to -uall rather than reject the status read.
* refactor(git): share common-dir resolution and stat stamps from worktree-diff-stamp
* perf(git): cache branch-compare merge-base and ahead/behind by commit OID pair
* fix(git): only store a commit-pair answer when its scope survived the walk
* refactor(git): type commit-pair stores per answer kind and pin test mtimes
* fix(git): skip the commit-pair cache whenever replace refs, grafts or relocating env could apply
* fix(git): apply textconv filter to original blob in diff view (#37100)
Apply git cat-file --textconv when reading non-previewable blobs for diffs so that encrypted or filtered files (git-crypt, sops, etc.) are rendered as readable text instead of binary.
Fixes#37100
* fix(git): apply textconv to binary working-tree files for unstaged diffs
* fix(git): textconv only diffs whose editable side stays byte-exact
Unstaged diffs keep raw bytes unless the path's driver leaves the working
tree unchanged (clean/smudge encryption such as git-crypt); the check runs
in a scratch object store so nothing is written to the repo. Drops the
binary working-tree textconv, which made converted text editable.
* fix(git): read the stored blob first and convert only paths with a driver
cat-file --textconv pretty-prints trees, so a directory replaced by a file
showed a tree listing. Reading the blob first keeps absence and type
handling unchanged, and drivers are looked up in parallel so paths without
one cost no extra wait. Driver failures are kept out of the settled cache,
deleted files convert, and the clean-filter probe gets a read deadline.
* fix(git): never settle-cache diffs that ran a textconv driver
Driver output depends on config, keys and tools the worktree stamp does not
cover, so a locked key or failing driver could pin a raw result. Deleted
files stay raw, since Monaco's revert arrows would restore converted text,
and drivers run off the WSL direct-read route so profile variables reach
them.
* fix(git): show the editable unstaged side against checkout bytes
A worktree that the driver leaves unchanged does not make the converted
original safe: Monaco's revert copies the original into the editable side,
and a driver like `tr a-z A-Z` would restore ONE where checkout writes
one. Unstaged diffs now read the Git side with `cat-file --filters`, which
is exactly what checkout writes and decrypts clean/smudge encryption, so
the scratch-store probe is gone.
* fix(git): share one driver lookup per path and keep editable ranges in checkout form
check-attr is a read, so it no longer counts as a worktree mutation or
waits on WSL write probes. Commit, branch and submodule diffs look the
driver up once per path, the unstaged submodule range shows checkout bytes
like the rest of the editable side, and a staged rename stays out of the
settled cache when either path has a driver.
* test(git): age the diff stamp with a fixed timestamp
---------
Co-authored-by: Hrithik <hrithik@Hrithiks-MacBook-Pro.local>
Co-authored-by: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com>
git status honors status.renames/diff.renames, but the numstat pass that
attaches line counts always forced -M. With rename detection off, status
listed an added and a deleted row while numstat reported one rename, so
the added row showed +0 and the deleted row had no counts.
Each staged/unstaged numstat pass now uses -M only when that area's
parsed status rows contain a rename, and --no-renames otherwise.
Fixes#36689
Co-authored-by: Neil <neil@stably.ai>
Buffered gitExecFileAsync reads now always fence login-shell rc output, and
non-zero exits de-fence error.stdout. The per-call captureWslLoginShellOutput
opt-in is removed since it is no longer meaningful.
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
* fix(source-control): hide discard for present submodule gitlinks
Parent git restore --worktree without --recurse-submodules leaves a dirty or moved submodule untouched, so Discard reported success while the row stayed. Hide row/section discard for present gitlinks and submodule children; deleted submodule dirs and staged gitlink discard (which unstages) keep working.
* fix(source-control): keep submodule discard when submodule.recurse is on
Plain git restore recurses into active submodules when submodule.recurse=true, so status now stamps restoreRecurses on gitlink entries and the shared discard guards keep those rows discardable.
---------
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
Read .gitmodules with config -z so a submodule name or path containing a
space (the default when 'git submodule add' targets a spaced path) keeps
its real path instead of being split at the first space.
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
git show :<path> and git show HEAD:<path> treat a missing blob spec as a
pathspec, exit 0, and print the HEAD commit when the path contains [, *
or ?. Orca then showed the commit header as the original side of new
files such as app/[id]/page.tsx. Read index and tree blobs with
git cat-file blob, and on older Git that only reports 'Not a valid
object name' prove absence with an empty literal ls-files/ls-tree probe.
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
* feat(source-control): resolve conflicts with one host operation shared by desktop and mobile
* feat(mobile): resolve merge conflicts and complete merges from Source Control
* test(mobile): pin Complete merge refusals and the older-desktop message
* fix(source-control): only resolve paths Git still reports as conflicted
* fix(source-control): refuse to keep a missing file and serialize conflict resolution per worktree
* fix(source-control): resolve only the exact conflicted path
* fix(source-control): match conflicted paths in Git's separator form on Windows and WSL
* fix(source-control): accept only the resolutions the live conflict offers
* fix(source-control): refuse to keep a both-modified file that is gone from disk
* feat(mobile): translate the merge conflict actions
* test(runtime): keep the mobile allowlist test under its line cap
* fix(mobile): let VoiceOver reach conflict action buttons
* fix(source-control): resolve delete/modify conflicts and complete merges from the panel
* fix(source-control): address review findings on conflict resolution
* fix(source-control): save every view of the file before marking a conflict resolved
* fix(source-control): match unsaved conflict views by physical file only
* test(source-control): prove completeMerge refuses with a commit template set
* refactor(source-control): reuse autosave view matching and refresh only after a completed merge
* fix(source-control): drop the untranslated Complete merge fallback text
* fix(source-control): refuse Keep file when the file is gone and re-read unsaved views on retry
* fix(source-control): let Keep file stage conflicted symlinks with missing targets
* fix(source-control): run one conflict resolution per file at a time
When git status failed (e.g. a corrupted index), the read returned an empty
result and Source Control said the workspace was clean. getStatus now carries
Git's error as an optional readError; the store keeps the last known entries
and conflicts while it is set, and the panel shows a status-read banner with
Git's message and Retry instead of the clean empty state. The Retry logic is
shared with the too-many-changes banner, and the per-worktree error is cleaned
up on teardown and migrated on worktree rename.
Fixes#28033
Co-authored-by: Neil <neil@stably.ai>
* feat(media): read remote media ranges through the paired runtime
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(media): stream remote media through orca-media grants
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(editor): play video and audio from remote runtime workspaces
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(media): surface update-required for remote media and cancel in-flight chunks
Probe files.readChunk once per environment and pairing revision before minting a
grant so older servers show the update message. Closing a media stream now aborts
the in-flight remote chunk. Also validate the IPC address, fix extension-only
names, and tighten the preview return type.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(files): one classifier decides which viewer opens a file
Local reads, files.readPreview on hosts, git blob previews and the desktop's
remote binary handling each kept their own image/PDF extension table, and
media had another. file-preview-kind.ts is now the one table: image, PDF,
audio or video, with the MIME type. AVIF, which only local reads knew,
previews on hosts and in git diffs too.
* perf(runtime): give byte-range reads their own small call lane
files.readChunk (media streams, paged files, downloads) now runs in a
two-call lane per environment, so a playing video or a download never holds
the slots terminal input and workspace calls use.
* feat(files): stream previews from paired runtimes by byte range
Generalises the remote media grant into one byte-range preview path: an
orca-media:// grant keyed by environment, worktree, path and pairing
revision, streamed over files.stat/readChunk. Audio and video use it now;
the shared classifier decides which viewers do.
- One files.stat at mint replaces the readChunk probe: it proves the host
serves range reads and that the path is a file, so an old host or a
missing file fails in the tab, not as a silent player error.
- A burst of range requests shares one stat (reused for 1s), so seeking
costs one round trip less on a slow link; later requests re-stat, so a
growing recording keeps playing.
- Removing a paired runtime revokes its grants; a re-paired one answers
410 and drops the grant.
- Only readers that render bytes mint a stream; baseline checks don't.
Co-authored-by: Sahil Sharma <128581847+SahilSharma0810@users.noreply.github.com>
* fix(files): prove chunk reads at mint, and let a reload report the new size
Hosts from v1.4.5 answer files.stat but only v1.4.111 and later answer
files.readChunk, and no capability names it, so minting reads one byte,
cached per pairing, and an older host fails in the tab with the update
message. A re-mint seeds the grant with its fresh stat, so a reload never
reuses an older size. A renderer gone mid-mint mints nothing. Preview
chunks time out after 20s so a stalled one frees its lane sooner.
Co-authored-by: Sahil Sharma <128581847+SahilSharma0810@users.noreply.github.com>
* fix(files): resolve preview hosts in the pairing registry's own directory
The remote preview reader looked environments up under the canonical
user-data path, while the pairing IPC writes the registry under
app.getPath('userData'), which can differ in casing on case-sensitive
installs. Both now use one getter. A chunk-read verdict is cached only
when a pairing revision pins it, so it can't outlive a re-pair.
Co-authored-by: Sahil Sharma <128581847+SahilSharma0810@users.noreply.github.com>
* fix(files): read the pairing registry from one directory everywhere
Doc previews resolved paired servers under the canonical user-data path,
the same casing mismatch the media reader had. They and every other main
caller that names the registry directory inline now use
getRuntimeEnvironmentRegistryRoot(), so it has one source.
Co-authored-by: Sahil Sharma <128581847+SahilSharma0810@users.noreply.github.com>
* fix(files): pin an unpinned preview grant to the pairing it was minted on
A renderer that hadn't loaded the environment's pairing revision yet sent
none, and every later chunk read went unguarded, so a re-pair under the
same environment id would let the old URL read from the new host. Main now
pins the registered revision at mint.
Co-authored-by: Sahil Sharma <128581847+SahilSharma0810@users.noreply.github.com>
* refactor(files): route the remaining pairing-registry readers through the one getter
AI-vault host scans, the settings runtime-environment preference, skill
capability checks and the mobile relay host list named the registry
directory inline. They now use getRuntimeEnvironmentRegistryRoot() too;
callers that also use the directory for other storage keep their own path.
Co-authored-by: Sahil Sharma <128581847+SahilSharma0810@users.noreply.github.com>
* refactor(files): write new pairings through the same registry root
The ephemeral VM pairing writer named the registry directory inline; it now
uses getRuntimeEnvironmentRegistryRoot() like every reader.
Co-authored-by: Sahil Sharma <128581847+SahilSharma0810@users.noreply.github.com>
---------
Co-authored-by: Sahil Sharma <128581847+SahilSharma0810@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Follow-ups from the large-file audit (E7):
- files.search had no byte budget: a result past the remote reply cap failed outright with
reply_too_large. It now keeps the whole files that fit and marks the result truncated, as
files.listAll and searchPaths already do. Local callers stay uncapped.
- A diff side past the 10 MiB read cap came back as binary, so the diff said "Binary file
changed" for a large text file. Blob reads mark it `tooLarge`, the binary diff result carries an
optional `tooLarge`, and both diff views say "File too large to diff". Older clients ignore the
field and keep the binary view. buildDiffResult builds its binary sides without a cast.
- The real-WSL lane pages a 100 MB file over the plain distro's shared control socket in the
editor's 384 KiB chunks and records the time, chunk count and orcad's VmHWM. Record-only: it
asserts nothing, and a failure is recorded in the receipt.
* refactor: group local and WSL filesystem watchers
* test: isolate startup ordering from watcher initialization
* test: collect the startup preflight subject once
The Git runner sends a command into WSL when the working directory is a
\wsl.localhost UNC path, even if no WSL distro is set in the options.
literalPathspec only looked at the options, so Windows-style backslashes
in file paths reached Git inside WSL unconverted and stage, unstage and
discard failed to match the file.
literalPathspec now also checks the worktree path, and every caller
passes it.
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
* fix(wsl): recheck watcher-reported paths with full stat on Windows Git drive checkouts
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(wsl): keep rechecked-dirty drive-checkout paths through watcher overflow and restarts
A path the default-stat recheck proved dirty stays a suspect until a recheck proves it clean,
so an overflow, interruption, watcher reinstall, or closed watcher no longer drops it back to
minimal-only status, where it would silently read as clean.
* fix(wsl): stage and discard rechecked drive-checkout paths with full stat
Status rechecks watcher-reported paths with core.checkStat=default, but add and
restore ran with the injected minimal stat, so a same-size rewrite that kept its
mtime showed as modified yet Stage and Discard silently did nothing. Path writes
now redo the tracked suspects inside their scope with default stat; everything
else stays minimal.
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix(wsl): run WSL git with Windows Git settings on Windows-authored drive checkouts
* fix(wsl): detect Windows Git checkouts from host autocrlf plus a whole-tree sample
* fix(wsl): keep WSL-created worktrees on Linux Git defaults and never commit CRLF on an unproven checkout
- worktree add / clone write a new checkout whose .git points at /mnt/..., which Windows Git
cannot open; injecting autocrlf=true there produced CRLF files later read unflagged.
- Writes on a host-autocrlf=true checkout whose sample is unproven run with autocrlf=input,
so staging normalizes CRLF without ever writing CRLF to disk.
- Writes wait for a stale host answer and re-check checkout identity after joining a sample.
* fix(wsl): compare a joined sample with the checkout identity read after it settles
* wip: delete the SSH relay server and its build, assets and tests
* wip: drop main/relay plugin conformance; WSL reader lookup test
* fix: drop the emptied relay bench; prune baselines
* test: keep the native halves of tests that also covered the relay
* chore(ci): drop shard timings for the deleted relay server tests
* fix: keep the directory listing budget that darwin terminal names now import
---------
Co-authored-by: m4air <m4air@Mac.localdomain>
Extract subprocess execution and process contracts into @orca/process-host with explicit public entry points, independent checks, and one Node 18 compatible CommonJS runtime. Migrate application consumers and integrate package builds, dependency selection, import enforcement, and runtime resource staging.
Preserve daemon startup ownership and profile isolation, and qualify development rebuild recovery and concurrent output publication. Remove unnecessary aliases, test forwarding exports, and a duplicate output scan.
Validation: full typechecks, changed-code quality, package and artifact checks, native Windows builds/types plus 306 runtime tests, and independent native reviews.
Matched full E2E controls on original main and unchanged reviewed head both pass all 17 applicable tests (nine skips). Earlier intermittent E2E failures are documented in the PR; no assertions were weakened. The final combined-tree audit preserves both branches with no import-boundary violations.
* fix(remote-terminal): keep a reconnected pane's size after an SSH outage (P1-4) (#26625)
* fix(remote-terminal): keep a reconnected pane's grid when its stale stream is reaped (P1-4)
The host's width floor only handed ownership to viewers that had claimed
since subscribing. A reconnecting desktop pane re-subscribes without
claiming, so when the heartbeat later reaped the dead socket that owned the
floor, the host reclaimed the PTY to its spawn size (120x40) and held the
pane there. The owner's same-client replacement stream now inherits the
floor, and a pane whose stream was reaped before it reconnected resumes
ownership on re-register unless the host or another viewer claimed since.
* fix(remote-terminal): host typing during an outage revokes the reaped owner's resume
Host input reaches the PTY without a renderer viewport claim once the host has
reclaimed its grid, so the orphaned-owner entitlement survived and a passive
reconnect resized the host pane back to the remote grid. The host write path
now clears that entitlement on driving input (query replies, focus reports and
launch writes excluded).
* test(pty): stub the runtime's host-input note in write-path handler tests
---------
Co-authored-by: m4air <m4air@Mac.localdomain>
* fix(remote): an oversized RPC reply fails that request instead of closing the host connection (#26624)
Expanding a folder with ~80k entries on a managed SSH host produced a
files.readDir reply over the 4 MiB encrypted-reply cap. The channel treated
that as a transport fault and closed the whole control socket (1013), and the
explorer rendered the failed folder as empty.
- The WebSocket RPC transport now answers an over-cap reply with a
reply_too_large error for that request id, so the channel never sees it.
- files.readDir checks remote listings against the request's content budget
and names the entry count.
- The explorer shows a subfolder's read error on its expanded row.
Finding: HH-2 (Phase 3.7 hostile-host).
Co-authored-by: m4air <m4air@Mac.localdomain>
* fix(ssh): let a slow host finish installing the pinned Node runtime (HH-3) (#26631)
* fix(ssh): let a slow host finish installing the pinned Node runtime
The POSIX promote (extract, hash, self-test and publish the ~110 MiB node
binary) ran under the 30 s default exec timeout. On slow home storage it
timed out, the remote work kept running, and the runtime store lock it held
stayed until the 20-minute stale rule, so relay rung A queued behind it past
its own deploy bound.
Give both platforms the 300 s promote bound and have the host release the
store lock itself when the promote exits, with owner-checked releases so a
late release never removes a lock someone else took. (HH-3)
* fix(ssh): let the host release the store lock after a slow under-lock re-hash
The under-lock re-check of a sibling-published runtime hashed the ~110 MiB
executable as its own command under the 30 s exec default and outside the
host-side lock release. On slow storage it timed out, the client correctly
kept the lock, and nothing on the host freed it until the 20-minute stale
rule, so later installers ran out their deploy bound.
Run the re-hash and the conditional promote as one host command wrapped in
the host release, and give every full-runtime hash, including the initial
probe, the slow-storage bound. (HH-3)
* test(ssh): count the combined under-lock re-probe and promote as one host command
---------
Co-authored-by: m4air <m4air@Mac.localdomain>
* fix(ssh): shell startup output on stdout no longer breaks SSH connect (HH-1) (#26617)
* fix(ssh): fence captured exec stdout so shell rc output cannot break connect
sshd runs the user's login shell before Orca's /bin/sh wrapper, so any
startup-file stdout (fish/tcsh/zsh/bash echo, or a bare terminal-title escape)
was glued onto every captured answer. The home probe read "banner\n/home/u"
and connect failed with "Remote home is not a valid path".
execCommand now wraps wrapped POSIX commands in a per-call nonce fence and
returns only the payload between the markers; the SSH folder browser gets the
same fence. The fence is the existing WSL captured-login-shell fence, moved to
src/shared/posix-stdout-fence.ts so both transports share it.
Finding: HH-1 (phase 3.7 hostile-host). Refs #8324.
* fix(ssh): fence the login-shell Node probe and fall back from a noisy SFTP handshake
The login-shell 'command -v node' probe ran unwrapped, so output from sshd's
shell and the nested login profile became the Node path. It now prints a
one-line fence every login shell parses, inside that shell.
An external sftp-server is started through the user's shell, so startup output
corrupts the SFTP handshake. ssh2 reports that parse failure only before the
session is ready, so SshConnection.sftp tags it, and relay install transfers
treat it as SFTP unavailable and stream over exec stdin.
Finding: HH-1 follow-up (phase 3.7 hostile-host). Refs #8324.
* fix(ssh): keep the stdout fence marker out of the command text
The runtime-store inventory lists processes with ps, which prints its own
script, so a literal marker in the script was read as the fence and the
store GC skipped every pass. printf now joins the marker from two halves.
---------
Co-authored-by: m4air <m4air@Mac.localdomain>
* fix(orcad): finish an abandoned update on connect, and refresh renderers after a main-side re-pair (P1-A, P1-C) (#26635)
* fix(orcad): finish an update or rollback its client abandoned, and tell renderers about main-side re-pairs
P1-A: a wake that finds the activation fence now runs crash recovery, which takes
only a stale, previous-boot or exited-own fence. Recovery of an activation
interrupted after the candidate launched resumes it: the candidate commits if it
passes the readiness gate, else the activation is undone as before.
P1-C: invalidating a still-linked environment's transport restarts its status
owner, and a renderer that sees status under a newer pairing revision re-reads
the catalog before applying it.
* fix(orcad): a resumed update keeps the app version that started it
Recovery that commits an abandoned candidate stamped no activeAppVersion, so an
older desktop read the host as pre-tracking and downgraded it over state the
newer build had migrated. The activate journal now records the initiating app
version; recovery stamps it, and a journal too old to carry it is undone instead
of committed.
* test(runtime-env): answer nothing for the status restart a re-pair now triggers
* fix(orcad): recovery leaves running an update server a too-old journal cannot commit
A journal without candidateAppVersion was sent to undo, which stopped a
healthy candidate that had already migrated state and then refused to
restart the incumbent, leaving the host serving nothing. Refuse instead,
keeping the fence and the candidate, until the operator accepts Restore.
---------
Co-authored-by: m4air <m4air@Mac.localdomain>
* fix(terminal): a remote recovery never splices stale history above the new screen (P2-5, P2-7) (#26647)
* fix(terminal): a remote recovery never splices stale history above the new screen
A pushed remote snapshot (overflow recovery, seq-gap resync, first attach) is
sent because the client's stream broke, so the pane's own history ends before
that image. Since #26319 a screen-only image kept that history, splicing a
stale block directly above the final screen with a silent gap of up to ~270k
lines (P2-5), and a first attach to an older host left silent holes (P2-7).
- Host: the ACK-overflow recovery serializes up to 1000 history rows.
- Client: the seq-gap resync asks for the same 1000 rows.
- Client: a pushed snapshot always replaces the pane's scrollback; the
keep-local-scrollback path is removed. A screen-only image from an older host
now shows only its screen, which is lossy but never misleading.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(terminal): a pushed image replaces the normal buffer over a live alt screen too
Over a pane already on the alternate screen, an image that also ended on alt
repainted only its alt frame and kept the pane's normal buffer, inferring the two
had frozen together. Inside the gap the TUI can exit, the shell print and a second
TUI start, so once that TUI exited the pane showed its stale history where the host
had the missed output. A pushed image now always rebuilds the normal buffer and
history from the host before entering alt itself.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(terminal): bound recovery history by link slack and keep pre-TUI scrollback under screen-only images
A recovery that carries history now goes out only when the stream's ACK
window has drained; under a sustained flood recoveries stay screen-only and
the owed history follows once the client catches up, so snapshot bytes no
longer outgrow the client's intake.
A pushed image without history (scrollbackRows absent or 0) over a live alt
screen repaints only the alt frame again, so a reconnect to an older host
no longer wipes the pane's pre-TUI scrollback.
---------
Co-authored-by: m4air <m4air@Mac.localdomain>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(source-control): Stage All stages every change when the listing hit the 1,000 cap (HH-4) (#26618)
* fix(source-control): Stage All stages every change when the listing hit the 1,000 cap
The status listing stops at 1,000 rows, but Stage All built its path list
from those rows, so it staged 1,000 of 20,000 changes and the next commit
was silently partial. When the listing is capped, Stage All (and the
Changes header Stage all) now asks the host to stage the whole worktree
via an optional scope on git.bulkStage; unresolved conflicts stay
unstaged. Older hosts ignore the field and stage the listed paths.
Fixes HH-4.
* fix(source-control): whole-worktree Stage All needs a host receipt, skips shared links, and reaches mobile
- Scoped stage sends no paths and requires a stagedScope receipt, so an older
runtime or relay stages nothing and the client reports it instead of a
silent partial stage.
- Scoped 'all' skips Orca's shared symlinks (configured and really a link),
matching the status listing.
- The capped-listing banner offers Stage All, reachable when the visible
prefix is entirely staged.
- Mobile reads didHitLimit and uses the same scoped stage and receipt.
* test(source-control): type the Stage All test stubs so lint and the mobile test typecheck pass
* fix(source-control): match Shared Paths saved as ./name or name/ against git's spelling
The Shared Paths setting keeps entries as typed, but git prints worktree paths
without a leading ./ or trailing /. Stage All's conflict path compared the raw
spelling to git's untracked list and staged the shared node_modules link, and
an exclude pathspec ending in / made git refuse the add after tracked changes
were already staged. Status listing had the same mismatch. getSafeRelativePath
now returns git's spelling, so every caller gets it, including saved settings.
---------
Co-authored-by: m4air <m4air@Mac.localdomain>
* fix(ssh): redeploy a managed server another desktop stopped; forget one whose host is gone (P1-D, P1-E) (#26628)
* fix(ssh): redeploy a server another desktop stopped; let a dead managed host be forgotten
P1-D: a connect whose linked server the host reports as not activated (another desktop
stopped it) now goes on to the update check, which redeploys it in place.
P1-E: add Forget (managedServer.forget, orca environment forget, Settings row) that runs
Stop's local unlink without contacting the host; the verdict stays unverifiable.
* test(ssh): type the forget test's hoisted store without an assertion
* fix(ssh): never downgrade a stopped host; redeploy it mid-session and retry after a failure
A stop now keeps the stopped build's Orca version, so an older desktop's
reconnect skips as host-newer instead of starting an older server on a
store a newer build migrated. A stop recorded without that version is not
guessed at. A stopped host retries the redeploy on each connect instead of
the once-per-version failure suppression, and a runtime call that finds
the server stopped mid-session redeploys it before the call.
* fix(ssh): rebuild the managed forward after redeploying a stopped host
A redeploy can bind a different port than the reused forward targets.
* fix(ssh): keep stop journals readable by older desktops and recheck version policy under the fence
- The stop journal's recordAfter is the core deactivated record older peers compute; the
committed record keeps activeAppVersion (which released planners already honour) and
rolledBackFrom, rebuilt from recordBefore on recovery.
- Auto-update re-applies its version policy to the record read under the host fence, and a
census counted against another incumbent is treated as unverifiable.
* fix(ssh): file a dispatched stop where older desktops cannot commit it, so their recovery never drops the version guard
* fix(ssh): refuse a fresh deploy of an older orcad onto a host a newer desktop stopped
The unlinked deploy path never consulted the stopped record's activeAppVersion, so a desktop
without a link to the host could activate its older build over state a newer build migrated.
Both the auto-update planner and the fresh deploy now apply one downgrade rule under the fence.
---------
Co-authored-by: m4air <m4air@Mac.localdomain>
* fix(ssh): redeploy a managed server a pre-version Stop left; let a forced deploy run over a newer one (#26766)
A stopped activation record without activeAppVersion is what every Stop on
main writes, so refusing it stranded those hosts behind an unforceable
policy refusal. Only a provably newer host is now refused; a forced fresh
deploy runs this version anyway, and the refusal names both versions.
Co-authored-by: m4air <m4air@m4airs-MacBook-Air.local>
* fix(remote-terminal): no keystroke lost, duplicated or split across a silent outage (P1-1, P1-2, P1-3) (#26630)
* fix(remote-terminal): no keystroke lost, duplicated or split across a silent outage
Remote pane input was fire-and-forget: keys handed to a socket that had
silently died were gone, keys still in the 8 ms debounce at detection were
cleared, and held keys were discarded when the auto-recovery window ran out.
- New negotiated `inputAck` capability: the client names an input session
and sequences Input frames (existing frame header `seq`); the host records
the last applied sequence per (PTY, session) across connections, writes
each sequence once and acks it with new opcode InputAck (18), sent only
to clients that advertised the capability.
- The pane keeps sent-but-unacked input and replays it to the same
terminal on reattach; the host dedupes. Old hosts keep current behavior.
- Debounced and claim-queued input at detection is held, not cleared.
- Held input survives the 'disconnected' phase; the hold coalesces keys so
minutes of typing do not hit the per-entry cap.
- Banner copy no longer claims a one-minute retry window.
Fixes P1-1, P1-2, P1-3 (phase 3.7 network findings).
* fix(remote-terminal): never replay into a restarted runtime; keep Ctrl+C and validating paste in order
- Host publishes inputLedgerId with inputAck; the client drops unacknowledged input sent to a
different ledger (runtime restart with the same PTY) instead of running it twice.
- A replayed duplicate is acked only after the original write settles.
- Accepted input (Ctrl+C, Escape, paste) rides the sequenced stream and resolves on the host ack.
- Keys typed while held queue behind a paste still in size validation.
* fix(remote-terminal): parse subscribed capabilities into a typed shape instead of Reflect.get
* fix(remote-terminal): ack only applied input; withdraw writes their caller gave up on
- Host ledger records each write's outcome: a refused write is rolled back and
never acked, so the client's replay writes it; nothing queued behind it runs or
is acked. A write that threw is acked as delivery-unknown, so the client
reports it failed and never replays it.
- Paste and file-drop timeouts abort their accepted write: a copy still held for
an outage is withdrawn, and a journaled copy is left out of the replay.
- A batch of sequenced input keeps one endpoint and ledger, so a send that
retires the stream mid-batch no longer discards earlier unacked input.
* fix(remote-terminal): host writes sequenced input strictly in order and asks the live stream to resend after a refusal
- The ledger admits only the next sequence; a refusal or gap answers with an InputAck resend request instead of WriteUnavailable, so the pane keeps its journal and resends on the same stream (no remount, no carrier bookkeeping).
- Sequenced input uses the provider's settled write; an unverifiable handoff is delivery-unknown, not refused.
- Replays fill given-up slots with empty input so the host can continue; the client remounts only after every resend backoff is refused.
- Typing batched ahead of a paste goes out as its own sequences, so cancelling the paste keeps it.
* refactor(remote-terminal): deliver sequenced input with standard go-back-N
Replace the hand-built "block on refusal" bookkeeping with go-back-N:
- Host: per (PTY, input session) the ledger keeps only appliedSeq, the
highest contiguous confirmed write. Frames run one at a time in arrival
order: a duplicate is re-acked, the next sequence is written and acked
on confirmed success, and a refusal or gap is answered with a resend
request carrying appliedSeq. No blocked state; every stream is equal.
A settlement that proves no byte left is a refusal; one that may have
written advances as delivery-unknown and is never retried.
- Client: one journal keeps unacked input in order and resends from
appliedSeq + 1 on a resend request (with backoff), on a new stream, or
when acks stall. Refusals never remount the pane. Withdrawn pastes,
stale query replies and over-budget bytes resend as empty slots.
- The recovery hold pauses (keeps the rest) when a release is cut short
by another outage, and keeps delivering typing after an accepted write
a sequenced stream withdrew or could not confirm.
- Add a seeded model-based test that drives the real pane transport,
multiplexer and journal against the real host dispatcher and ledger
through 2,000 random fault schedules.
* test(remote-terminal): cover the refusal remount on a stream without sequenced input
A sequenced stream now resends refused input on the same stream instead of remounting, so the end-to-end remount check negotiates no inputAck, as an older peer does.
* fix(remote-terminal): escalate persistent input refusals, drop input once recovery gives up, and never report a lost unknown ack as applied
- The pane falls back to its remount path when the host keeps refusing input past the resend backoff ladder.
- Held and journaled input is discarded when auto-recovery gives up, and input typed under the disconnected banner is not held.
- The host ledger answers a duplicate for its own sequence and remembers delivery-unknown outcomes; the client settles a write as applied only from its own ack.
- The input model now requires a write reported applied to have reached the PTY whole, and covers a refusal that never clears.
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: m4air <m4air@Mac.localdomain>
Co-authored-by: m4air <m4air@m4airs-MacBook-Air.local>
Co-authored-by: Claude <noreply@anthropic.com>
* fix(remote-terminal): keep input typed past the auto-recovery window for the same terminal, within a bounded grace (P1-3) (#26832)
The last round of #26630 discarded held and journaled input as soon as auto-recovery gave up,
and refused input under the disconnected banner. On a real host a 200 s outage lost 102 of
120 keystrokes, although the pane reattached the same terminal on its own seconds later.
Input now stays held for the same handle and incarnation while the pane is disconnected, for
up to 5 minutes after it gave up. Past that grace it is discarded, and typing into the dead
pane is refused, so stale keys never run at an arbitrary later reconnect. The grace is a
timestamp checked when input moves, so a latched pane stays free of timers.
Co-authored-by: m4air <m4air@Mac.localdomain>
Co-authored-by: Claude <noreply@anthropic.com>
---------
Co-authored-by: m4air <m4air@Mac.localdomain>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: m4air <m4air@m4airs-MacBook-Air.local>