Skip to content

⚗️ Rebuild process adapters on a native-listener core - #246

Closed
taras wants to merge 1 commit into
mainfrom
spike/native-process-core
Closed

⚗️ Rebuild process adapters on a native-listener core#246
taras wants to merge 1 commit into
mainfrom
spike/native-process-core

Conversation

@taras

@taras taras commented Aug 12, 2026

Copy link
Copy Markdown
Member

Closed: superseded by #247, which carries the native-listener direction as an incremental production change instead of a wholesale rework.

Motivation

Exploration of rebuilding the process adapters so the child process is wired entirely through native Node event listeners attached in the same synchronous continuation as the spawn, removing the fromReadable pump architecture — to see what that structure does to the orphan window (#236), output completeness at join() (#244), and adapter duplication.

Approach

Replace the fromReadable pump architecture with a single
createNativeProcess core that wires the child process entirely through
native Node listeners attached in the same synchronous continuation as
the spawn. posix and win32 reduce to SpawnStrategy objects: how to
spawn, and how to shut down.

Consequences:

- the orphan window from #236 closes: a guard teardown registers before
  the child exists and the spawn plus all listener wiring follow with no
  suspension points in between, so a halt can never land between a live
  process and an armed teardown
- close-settled means raw-output-complete by construction (#244): Node
  emits "close" only after both stdio streams have closed, and chunk
  delivery into the raw signals is synchronous with stream emission
- Stdio middleware becomes a consumer layer over the raw signals; a
  sequencer settles join()/expect() only after both consumers drain, and
  a failing handler resolves the result with Err instead of hanging
- the graceful-shutdown drain contract is preserved: the primary
  teardown registers after the consumers, so they are still alive to
  forward output produced during termination

Ports the halt-sweep regression test from #237 and the output
completeness and middleware failure tests from #245; all bite when their
respective guarantees are mutated out.
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a8a277c0-ae71-40c3-b935-6b811e711433

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Aug 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@effectionx/process@246

commit: 8e2f1d2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant