ReviewOS

home-lang/home

Port Bun.spawn stdin destroy after exit regression

#128
Closed chris opened this 10 days ago ·
10 days ago

Scope

Activate the byte-identical js/bun/spawn/spawn-stdin-destroy.test.ts corpus and bad-fixture.js.

The upstream regression launches a real child that reads stdin and throws, waits for the early exit, writes and flushes additional stdin, closes the sink, drains stdout, and verifies child.exited resolves to code 1 instead of rejecting with an internal TODO error.

Baseline

The exact file is currently rewritten to one native todo:

  • 0 pass
  • 0 fail
  • 0 unsupported
  • 1 todo

Both the test and child fixture are byte-identical to ~/Code/bun.

Acceptance

  • Preserve upstream byte identity.
  • Run the original test through the real native spawn bridge and home-debug child process.
  • Preserve the 80 ms pre-write delay, stdin write/flush/end sequence, stdout async iteration, exit-code assertion, and forced-GC tail.
  • Do not synthesize the child result.
  • Add a permanent unchanged-corpus regression.
  • Pass the exact file and full home_test gate.
  • Commit and push as Chris Breuer with no coauthors.
  • Link completion to #66.
10 days ago

Implemented and pushed in 2da4cc0.

The byte-identical test and bad-fixture.js now run as the original active regression. The generic native Bun.spawn fallback launches the real throwing home-debug child and now exposes a reusable stdin pipe sink when stdin: pipe is requested. The sink supports byte-counted write, harmless flush, and idempotent end even after the child has exited; stdout and exit status remain the real native subprocess results.

Validation:

  • exact spawn-stdin-destroy.test.ts: 1 pass, 0 fail, 0 todo, 0 unsupported
  • original 80 ms delay, two writes, flush, end, stdout async iteration, exit-code 1 assertion, and GC tail remain in the prepared corpus
  • permanent unchanged-corpus regression runs the original file
  • both upstream files remain byte-identical
  • Zig formatting and diff checks pass
  • full home_test gate passes with no failures

No bad-fixture-specific result was synthesized. The commit is authored and committed as Chris Breuer with no coauthors. This advances #66.

Sign in to comment on this issue.