effect(snapshot): migrate to AppProcess.run#27189
Merged
Merged
Conversation
ebc8050 to
bf596d5
Compare
802609d to
a0f3716
Compare
Route non-stdin git calls through AppProcess.run. Keep stdin-feed calls (check-ignore --stdin, rm --pathspec-from-file=-, add --pathspec-from-file=-, cat-file --batch) on raw spawn — AppProcess.run does not yet accept a stdin Stream.
a0f3716 to
651c915
Compare
AIALRA-0
pushed a commit
to AIALRA-0/opencode-turn-engine
that referenced
this pull request
Jun 10, 2026
AIALRA-0
pushed a commit
to AIALRA-0/opencode-turn-engine
that referenced
this pull request
Jun 10, 2026
avion23
pushed a commit
to avion23/opencode
that referenced
this pull request
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 sweep: migrate
src/snapshot/index.tsfrom rawChildProcessSpawnertoAppProcess.Stacked on #27178.
Migrated call sites
All non-stdin
gitinvocations now go throughappProcess.run(ChildProcess.make("git", ...))via a thingithelper that translatesRunResult-> the existingGitResultshape. UsesinterpretExitCode: () => "success"so non-zero exits flow through (preserving the prior behavior where the helper swallowed errors viaEffect.catchand returned{ code: 1, ... }).Call sites flowing through the new
githelper:excludes()—git rev-parse --git-path info/excludeadd()—git diff-files --name-only -z,git ls-files --others --exclude-standard -zcleanup()—git gc --prune=<duration>track()—git init,git config core.*x4,git write-treepatch()—git diff --cached --no-ext-diff --name-only <hash>restore()—git read-tree <snapshot>,git checkout-index -a -frevert()—git checkout,git ls-tree(single + batched paths)diff()—git diff --cached --no-ext-diff <hash>diffFull()—git show <ref>:<file>(per-file fallback),git diff --name-status,git diff --numstatStayed on raw spawn (
appProcess.spawn)Four sites feed bytes into git's stdin via
Stream, andAppProcess.rundoes not yet expose a stdin-Stream API. They now useappProcess.spawn(...)(inherited platform method) — same shape as before, no behavior change:ignore()—git check-ignore --stdin -z(NUL-delimited path list)drop()—git rm --cached --pathspec-from-file=- --pathspec-file-nulstage()—git add --all --sparse --pathspec-from-file=- --pathspec-file-nuldiffFull()load()—git cat-file --batch(newline-delimited ref list)These are isolated in a
gitWithStdinhelper alongsidegitto make the distinction explicit at the call site.AppProcess API feedback
A
runStdin(command, { stdin: Stream<Uint8Array> })helper (or astdinfield onRunOptions) would let these last four sites migrate. Filing as future work — out of scope for this PR.LOC delta
+45 / -14in a single file (src/snapshot/index.ts).Verification
bun run test test/snapshot/-> 52 pass, 1 skip, 0 failbun run test test/session/snapshot-tool-race.test.ts-> 1 pass, 0 failbun run typecheck-> 0 errors