ReviewOS

home-lang/home

Port Bun core ReadableStream stdin matrix

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

Port the exact upstream test/js/bun/spawn/spawn-stdin-readable-stream.test.ts corpus into Home without whole-file TODO rewriting.

Scope:

  • consume string, Uint8Array, pull-driven, delayed, transformed, tee, empty, null-byte, and large streams
  • preserve backpressure pull counts and parallel subprocess use
  • handle stream errors without unhandled rejections
  • reject already-disturbed streams
  • cancel stdin exactly once when AbortSignal terminates the subprocess
  • preserve immediate success/failure exit codes and resource cleanup
  • add a durable Home regression for the exact upstream file

Acceptance:

  • corpus remains byte-identical to ~/Code/bun
  • 21 active tests pass, 0 fail, 0 unsupported
  • 2 explicit upstream TODOs remain
  • adjacent stdin/pipe ownership matrices remain green
  • full home_test gate passes
10 days ago

Completed in 845b91d.

Evidence:

  • Exact upstream corpus is byte-identical to ~/Code/bun/test/js/bun/spawn/spawn-stdin-readable-stream.test.ts.
  • Exact matrix: 21 pass, 0 fail, 0 unsupported, 2 explicit upstream TODOs preserved.
  • Added promise-backed subprocess stdout, ordered string/byte/pull consumption, partial delivery across stream errors, immediate-exit cancellation, disturbed-stream rejection, AbortSignal cancellation exactly once, backpressure, parallel process, transform, tee, and reader release compatibility.
  • Fixed async start() error/close handling so queued bytes drain once without unhandled rejection or pull-loop starvation.
  • Adjacent spawn-stdin-pipe-fd-leak.test.ts: 2 pass, 0 fail, 0 unsupported, 1 upstream Zig/Rust divergence TODO.
  • Adjacent spawn-unread-stdout-gc.test.ts: 1 pass, 0 fail, 0 unsupported, 0 TODO.
  • Full ./pantry/.bin/zig build test -Dfilter=home_test --summary failures: exit 0.
  • No upstream corpus edits; whole-file TODO rewriting removed and a durable 21+2 regression added.

Sign in to comment on this issue.