[PR #7083] [MERGED] fix(javascript): report fork's silent stdio as piped #7629

Closed
opened 2026-11-03 13:39:13 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7083
Author: @Adolanium
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @morluto

Base: main ← Head: fix/js-fork-silent-stdio


📝 Commits (2)

  • 1e058ed fix(javascript): report fork's silent stdio as piped
  • f90d270 fix(javascript): apply fork's silent rule to other known stdio values

📊 Changes

2 files changed (+58 additions, -2 deletions)

View changed files

📝 src/domain/javascript/childProcessOptionsRegression.test.ts (+30 -0)
📝 src/domain/javascript/javascriptSemanticChildProcesses.ts (+28 -2)

📄 Description

Summary

Fixes #7084.

analyze_javascript_application reports fork("worker.js", { silent: true }) with stdio_mode: "default", which for fork means inherited streams plus IPC. Node pipes stdin, stdout and stderr to the parent in that case. REA never read silent; the unset-stdio case of fork now does.

Problem and expected behavior

Node's child_process.fork sets options.stdio = stdioStringToArray(options.silent ? 'pipe' : 'inherit', 'ipc') when options.stdio is neither a string nor an array, and its docs say for silent: "If true, stdin, stdout, and stderr of the child will be piped to the parent". stdioMode in javascriptSemanticChildProcesses.ts returned default whenever stdio was missing or nullish, regardless of silent.

Expected for fork whose stdio is missing, nullish, or another known non-string, non-array value: truthy silent gives pipe, falsy or missing gives default, and an unresolved silent gives dynamic. An explicit string or array stdio still wins, an unresolved stdio stays dynamic, and other methods are unchanged.

Change and scope

  • src/domain/javascript/javascriptSemanticChildProcesses.ts: a small unsetStdioMode helper used where stdio is missing or nullish. For fork it reads silent with the existing staticObjectProperty and staticJavaScriptTruthiness helpers; other methods keep default.

Not included: utilityProcess.fork (Electron) is analyzed elsewhere and has no silent option.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contribution scope: not applicable. This is a fix inside the existing JavaScript child-process analysis.

Contract and boundary impact

  • Semantic owner and earliest changed stage: stdioMode in javascriptSemanticChildProcesses.ts.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: no schema change; stdio_mode for fork with silent changes as described.
  • Provider, bridge, target-format, or platform compatibility: Node child_process.fork semantics.
  • Evidence, artifact, provenance, or reconstruction contract: the reported stdio mode matches Node's behavior; unresolved silent stays dynamic instead of a guess.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: src/domain/javascript/childProcessOptionsRegression.test.ts, "reads fork's silent option when stdio is not a string or array": { silent: true } gives pipe, [], { silent: false } gives default, { silent: 1, stdio: null } gives pipe, { silent: true, stdio: "inherit" } gives inherit, { silent: process.env.QUIET } gives dynamic, spawn("tool", { silent: true }) stays default, { stdio: false, silent: true } gives pipe, { stdio: {}, silent: false } gives default, and an unresolved stdio stays dynamic.
  • Base reproduction or other evidence: with javascriptSemanticChildProcesses.ts from upstream/main 0a2b7af90 and the new test, the test fails.
  • User-visible CLI/MCP output (if applicable): the child-process stdio_mode in analyze_javascript_application results.
  • Remaining proof gaps: no real application bundle; the fixture is inline source.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

On Linux (WSL Ubuntu, Node 24.22.1) at 1e058ed7a (on upstream/main 0a2b7af90), after npm ci and npm run build:cached:

  • npx tsc -p . --noEmit passed.
  • npx oxfmt --check on the changed files: clean. node scripts/ci/static-check-report.mjs lint: 0 errors.
  • npx vitest run on the child-process domain tests, src/application/javascript and tests/acceptance/applications/javascriptChildProcessStdioCli.test.ts: 605 passed, in two runs.
  • The negative check above failed the new test.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: Linux only.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner: @Adolanium

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/7083 **Author:** [@Adolanium](https://github.com/Adolanium) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/js-fork-silent-stdio` --- ### 📝 Commits (2) - [`1e058ed`](https://github.com/morluto/rea/commit/1e058ed7aa2ba0645ece1b4ca0518fab13deae9c) fix(javascript): report fork's silent stdio as piped - [`f90d270`](https://github.com/morluto/rea/commit/f90d2704d0eae694ec0d8995e4d94f321d6a4db2) fix(javascript): apply fork's silent rule to other known stdio values ### 📊 Changes **2 files changed** (+58 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascript/childProcessOptionsRegression.test.ts` (+30 -0) 📝 `src/domain/javascript/javascriptSemanticChildProcesses.ts` (+28 -2) </details> ### 📄 Description ## Summary Fixes #7084. `analyze_javascript_application` reports `fork("worker.js", { silent: true })` with `stdio_mode: "default"`, which for `fork` means inherited streams plus IPC. Node pipes stdin, stdout and stderr to the parent in that case. REA never read `silent`; the unset-stdio case of `fork` now does. ## Problem and expected behavior Node's `child_process.fork` sets `options.stdio = stdioStringToArray(options.silent ? 'pipe' : 'inherit', 'ipc')` when `options.stdio` is neither a string nor an array, and its docs say for `silent`: "If true, stdin, stdout, and stderr of the child will be piped to the parent". `stdioMode` in `javascriptSemanticChildProcesses.ts` returned `default` whenever `stdio` was missing or nullish, regardless of `silent`. Expected for `fork` whose `stdio` is missing, nullish, or another known non-string, non-array value: truthy `silent` gives `pipe`, falsy or missing gives `default`, and an unresolved `silent` gives `dynamic`. An explicit string or array `stdio` still wins, an unresolved `stdio` stays `dynamic`, and other methods are unchanged. ## Change and scope - `src/domain/javascript/javascriptSemanticChildProcesses.ts`: a small `unsetStdioMode` helper used where `stdio` is missing or nullish. For `fork` it reads `silent` with the existing `staticObjectProperty` and `staticJavaScriptTruthiness` helpers; other methods keep `default`. Not included: `utilityProcess.fork` (Electron) is analyzed elsewhere and has no `silent` option. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Unresolved scope, authority, side effects, or required verification block integration. Link the required maintainer scope decision for new providers or capabilities involving target execution, injection, mutation, or protection recovery; ordinary fixes within existing boundaries may state "not applicable". Draft PRs may leave the scope decision pending and the readiness and merge checklists unchecked. Maintainers can help resolve open questions. Contribution scope: not applicable. This is a fix inside the existing JavaScript child-process analysis. ## Contract and boundary impact - Semantic owner and earliest changed stage: `stdioMode` in `javascriptSemanticChildProcesses.ts`. - Contribution scope fit and linked maintainer decision: not applicable. - CLI and MCP/tool-catalog contract: no schema change; `stdio_mode` for `fork` with `silent` changes as described. - Provider, bridge, target-format, or platform compatibility: Node `child_process.fork` semantics. - Evidence, artifact, provenance, or reconstruction contract: the reported stdio mode matches Node's behavior; unresolved `silent` stays `dynamic` instead of a guess. - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact (CI generates and validates ignored catalogs and `skills/`; edit authored instructions in `.agents/skills/reverse-engineer-anything/` and never commit build outputs): none. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `src/domain/javascript/childProcessOptionsRegression.test.ts`, "reads fork's silent option when stdio is not a string or array": `{ silent: true }` gives `pipe`, `[], { silent: false }` gives `default`, `{ silent: 1, stdio: null }` gives `pipe`, `{ silent: true, stdio: "inherit" }` gives `inherit`, `{ silent: process.env.QUIET }` gives `dynamic`, `spawn("tool", { silent: true })` stays `default`, `{ stdio: false, silent: true }` gives `pipe`, `{ stdio: {}, silent: false }` gives `default`, and an unresolved `stdio` stays `dynamic`. - Base reproduction or other evidence: with `javascriptSemanticChildProcesses.ts` from upstream/main 0a2b7af90 and the new test, the test fails. - User-visible CLI/MCP output (if applicable): the child-process `stdio_mode` in `analyze_javascript_application` results. - Remaining proof gaps: no real application bundle; the fixture is inline source. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed On Linux (WSL Ubuntu, Node 24.22.1) at 1e058ed7a (on upstream/main 0a2b7af90), after `npm ci` and `npm run build:cached`: - `npx tsc -p . --noEmit` passed. - `npx oxfmt --check` on the changed files: clean. `node scripts/ci/static-check-report.mjs lint`: 0 errors. - `npx vitest run` on the child-process domain tests, `src/application/javascript` and `tests/acceptance/applications/javascriptChildProcessStdioCli.test.ts`: 605 passed, in two runs. - The negative check above failed the new test. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: Linux only. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none. ## Author readiness <!-- The human owner completes these declarations before requesting review. The PR author is the owner by default. A different owner must explicitly accept ownership on this PR. AI agents must leave these declarations to a human to dictate to them or there could be catastrophic consequences for many users of REA. Draft PRs may leave them unchecked. These declarations record initial readiness when opening the PR for review; later pushes do not require a new human sign-off. Keep the description and validation evidence current as the work changes. See CONTRIBUTING.md#pull-request-ownership-and-readiness. --> Human owner: @Adolanium - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge <!-- Draft PRs may leave pending items unchecked. Resolve material scope and authority questions before integration. --> - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] The PR has one focused outcome and the title follows `type(scope): outcome`. - [ ] Related issue is linked, or the reason for not linking one is stated above. - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. - [ ] User-visible CLI/MCP changes include representative output. - [ ] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 13:39:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7629
No description provided.