Skip to content

fix(npm): preserve failed native child completion - #19

Draft
ruvnet wants to merge 1 commit into
mainfrom
dream/2026-09-26-npm-child-completion
Draft

ruvnet wants to merge 1 commit into
mainfrom
dream/2026-09-26-npm-child-completion

Conversation

@ruvnet

@ruvnet ruvnet commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Closes #18. Broader release qualification remains tracked in #17.

Both npm consumers converted a signal-terminated native child into exit code0, so interrupted commands could be mistaken for successful work. This minimal patch preserves numeric exit codes, maps absent status to generic failure1, and waits for stream closure before returning captured output.

Frozen validation

Baseline 945fc6fc5ca2fd25ede088e6b612d8f27f670229:6/12. Candidate:12/12. Separately installed packed consumer:12/12. Unchanged corpus covers exits0/7, SIGTERM/SIGINT/SIGKILL in CLI/API,256KiB stdout/stderr and spawn EACCES. An independent reviewer reproduced all results and verified a separate delayed-descendant-output case: baseline returns empty output, candidate preserves both streams. POSIX fixture only; explicit Windows skip before setup.

Run from qudag-npm:

npm ci --ignore-scripts --no-audit --no-fund
npm run build
./node_modules/.bin/tsc --module commonjs --target es2020 --esModuleInterop --skipLibCheck --outDir test-dist tests/process-status.test.ts
node --test test-dist/process-status.test.js

Packed replay uses QUDAG_TEST_PACKAGE pointing at a clean installed tarball. Installation lifecycle scripts were intentionally skipped because native release assets are independently unavailable; only a harmless local executable fixture is substituted. This validates shipped JavaScript wrapper behavior, not native QuDAG functionality.

ADR207 records the stable Node completion contract, baseline, threshold and limitations. Source: https://nodejs.org/api/child_process.html#event-close (retrieved2026-09-26). Newer runtime APIs were unnecessary and would raise the existing support floor.

Existing integration fixtures27/27pass. Native npm test remains blocked by missing binary, local Rust toolchain is unconfigured, existing exact-main workflows fail, and existing elevated dependency findings require private handling. No workflow, dependency, native crypto, release, permission or promotion gate changed. Research optimization remains INCONCLUSIVE; no method improvement claimed.

Independent critique accepts only this bounded POSIX repair. Human review and all required current-head checks remain required; no merge/release/deployment is authorized by this draft.

Core Memory idempotency: dream-2026-09-26-qudag-signal-status. Federation intent686d1cae73147af27fdfbd85eecbcf2c36a35d63b719b1fd3450c68e2968d81d. Evidence will be retained in Dream Machine's2026-09-26 report.

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.

fix(npm): signal-terminated native commands report success in CLI and API

1 participant