Repository navigation
fix: shape fidelity for replay (timedOut, failed derivation, subprocess-API stubs) - #127
Merged
Merged
Conversation
Tinyexec aborted-call coverage waits on the pre-await capture fix tracked in #126.
This was referenced May 3, 2026
- Hoist subprocess-API stubs and frozen empty arrays to module scope so synth no longer allocates them per call. - Extract a single isTerminated const reusing the signal-check. - Tighten the comment blocks in synth to keep only the WHY. - Move SLEEP_5S to tests/helpers/subprocess-targets.ts and share across 4 test files. - Extract the replayExeca helper used by 3 unit-test files. Refs #128 (test export leakage) and #129 (killed derivation) for follow-ups discovered during this pass.
slgoodrich
added a commit
that referenced
this pull request
May 3, 2026
Patch release covering two bug-fix PRs since v0.6.0: - #127 (replay shape fidelity): timedOut, failed-derivation correctness, and execa subprocess-API stubs - #130 (record-side flag capture): killed/aborted captured correctly on both adapters; inputFile double-read retired; internal export leakage removed Cassette schema stays at version 2; new Result fields are JSON-additive.
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.
What Changed
timedOutis now captured and surfaced. Aborted, signal-killed, andmaxBuffer-exceeded calls no longer replay as success — synth resolvesfailedvia fallback derivation (exitCode !== 0 || signal !== null || aborted) and the reject branch keys on the resolved value.result.kill(),result.pipe(), andfor await (line of result)on execa replay no longer raiseTypeError.isMaxBuffer,isForcefullyTerminated,isGracefullyCanceled. All five new optional flag fields added to theResultschema (additive; cassette schema stays at version 2).Resultboolean (isTerminated,isMaxBuffer,isForcefullyTerminated,isGracefullyCanceled, plus emptypipedFrom/ipcOutput) so user assertions reach reachable values.kill()(no-op returningfalse),pipe()(throwsUnsupportedOptionError),Symbol.asyncIterator(throwsUnsupportedOptionError). Mirrors tinyexec's existing pattern.docs/execa.mdReplay-fidelity section expanded with the full flag table and stubs subsection.docs/tinyexec.mdadds a "Failed flag" section explaining the derivation.docs/troubleshooting.mdadds an execa-side counterpart to the existing tinyexec replay-method section. CHANGELOG[Unreleased]filled in.Why
Replay shape now matches real execa/tinyexec behavior on failure paths. Tests asserting on
result.timedOut === true,result.isMaxBuffer === true, orresult.isForcefullyTerminated === trueafter a recorded failure now work as expected. Tests that aborted a call no longer silently pass under replay because the cassette is treated as a success. Cassettes recorded before the new fields existed auto-upgrade their replay correctness without re-recording — the fallback derivation handles signal-kill and aborted cases the oldexitCode !== 0check missed.Related Issues
Refs #126.
Test Plan
npm run lint— cleannpm run typecheck— cleannpm test— 762 passed, 2 skipped (POSIX-only test guards)npm run build— cleanNotes
aborted/killedfrom the awaitedOutput(those getters live on the pre-awaitExecProcess). Cassettes recorded by tinyexec currently storeaborted: falseregardless of whether the call was canceled. Replay-side handling is correct. Tracked in tinyexec adapter: aborted/killed not captured on record path #126; the wrapper restructure is out of scope for this PR._captureResultForTestingis exported fromsrc/execa.tsandsrc/tinyexec.ts(both public package entry points) to let unit tests exercise the pure capture function without spawning a subprocess. The underscore prefix marks the symbol as non-public by convention. A follow-up could move it behind a non-exported test-helpers module if the autocomplete leakage becomes a concern.iterable(),readable(),writable(),duplex()) and stream-property getters on execa replay are not stubbed; calls produceTypeError. Tests using these patterns must run withSHELL_CASSETTE_MODE=passthrough.