Tracked by #66. This issue covers the three byte-current Bun fixtures currently marked FAIL at packages/runtime/test/bun-corpus/expectations.txt:28-30:
test/js/node/test/parallel/test-stream-wrap.jstest/js/node/test/parallel/test-stream-wrap-drain.jstest/js/node/test/parallel/test-stream-wrap-encoding.js
Current generic gaps:
internalBinding("stream_wrap")is unavailable; only the public deprecated_stream_wrapplaceholder exists.internal/js_stream_socketis not registered.- Generic Duplex/net state lacks the write backpressure, drain, shutdown serialization, encoding, object-mode, and terminal behavior these Node fixtures exercise.
Implementation scope:
- Add
ShutdownWrapandWriteWraprequest objects to a realstream_wrapinternal binding. - Add Node-compatible
internal/js_stream_socket, exportingJSStreamSocketand static.StreamWrapwith a retained_handle. - Serialize shutdown behind pending writes, complete each request exactly once, and report negative cancellation after destroy.
- Implement generic Duplex high-water-mark accounting, write callbacks, one-shot drain, pause/resume,
setEncoding, andreadableObjectModechecks. - Reject StringDecoder/object-mode input exactly once with
ERR_STREAM_WRAPand the Node message.
Exact removal gate:
- Run all three copied fixtures without their expectation lines and require zero failures/timeouts with every mustCall/expectsError obligation satisfied.
test-stream-wrap.js: shutdown callback exactly once with a negative status after destroy.test-stream-wrap-drain.js: write callback, underlying drain, and ShutdownWrap completion exactly once, with shutdown ordered after the pending write.test-stream-wrap-encoding.js: exactly twoERR_STREAM_WRAPerrors for decoder and object-mode cases.- Run the combined three-file selector plus adjacent Home generic stream/net logical contracts.
Remove all three markers only after that exact gate is green. No fixture-name branches or synthetic pass paths.