[PR #5645] [CLOSED] fix(process): retain compiler roots after bounded output drain #7012

Closed
opened 2026-11-01 21:44:42 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5645
Author: @Hrithik-Gavankar
Created: 10/20/2026
Status: ❌ Closed

Base: main ← Head: fix/5616-compiler-scratch-root-lifecycle


📝 Commits (3)

  • e471bee fix(process): retain compiler roots after bounded output drain
  • 388cbd2 fix: address P1 review findings from Greptile and Codex
  • fc7ac5b Merge morluto/main and fix #5616: Remove reader destruction to match upstream behavior

📊 Changes

4 files changed (+39 additions, -6 deletions)

View changed files

📝 src/native/NativeUiHelperRuntime.ts (+8 -2)
📝 src/process/DarwinProcessRunTokenReader.ts (+2 -1)
📝 src/process/ExecFileOutput.ts (+19 -2)
📝 tests/process-global/darwinCompilerCleanup.test.ts (+10 -1)

📄 Description

Summary

Fixes #5616 by reverting to upstream behavior where execFileOutput waits naturally for inherited-pipe descendants to close their output streams, rather than forcibly cutting off readers.

Problem and expected behavior

When a stoppable execFileOutput command exits while a descendant keeps inherited stdout/stderr open, the original PR #5587 approach of cutting off readers after stop grace was fundamentally incompatible with upstream expectations. The upstream test "keeps scratch files until an inherited-pipe descendant closes them" expects NO reader destruction.

Change and scope

Final approach (matching upstream):

  • Removed reader destruction after grace timeout - execFileOutput now waits naturally for all inherited-pipe descendants to close their output streams
  • Removed outputReadersCutOff and outputTruncated tracking (no longer needed)
  • Removed BootstrapProcessTable.ts and CompilerProcessFamilySettlement.ts (no longer needed)
  • Simplified cleanup blocks in DarwinProcessRunTokenReader.ts and NativeUiHelperRuntime.ts

Follow the contribution scope. Not applicable — lifecycle fix within existing process boundaries.

Contract and boundary impact

  • Semantic owner and earliest changed stage: execFileOutput / process preparation cleanup.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: Darwin helper compilation path.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): matches upstream behavior of waiting for inherited-pipe descendants.
  • Generated metadata impact: none.

Expected effects:

  • 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: removed test expecting outputReadersCutOff behavior; removed test for family-exit waiting
  • All upstream tests now pass, including critical test "keeps scratch files until an inherited-pipe descendant closes them"
  • Verified on Node 24.18.0, macOS arm64

Validation performed

  • npx vitest run src/process/ExecFileOutput.test.ts — 31/31 passed
  • npx vitest run tests/process-global/darwinCompilerCleanup.test.ts — 14/14 passed

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not run; focused process-global tests on macOS.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: not applicable.

Author readiness

Human owner: @Hrithik-Gavankar

  • 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/5645 **Author:** [@Hrithik-Gavankar](https://github.com/Hrithik-Gavankar) **Created:** 10/20/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/5616-compiler-scratch-root-lifecycle` --- ### 📝 Commits (3) - [`e471bee`](https://github.com/morluto/rea/commit/e471beead8465ecdd6d1cfc88e800d07b57189e5) fix(process): retain compiler roots after bounded output drain - [`388cbd2`](https://github.com/morluto/rea/commit/388cbd20b3a8c5b81827cc120fd76e62fdc039b1) fix: address P1 review findings from Greptile and Codex - [`fc7ac5b`](https://github.com/morluto/rea/commit/fc7ac5b96aad6f8bd79bdf1652c8e3b83a1fe5d9) Merge morluto/main and fix #5616: Remove reader destruction to match upstream behavior ### 📊 Changes **4 files changed** (+39 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/native/NativeUiHelperRuntime.ts` (+8 -2) 📝 `src/process/DarwinProcessRunTokenReader.ts` (+2 -1) 📝 `src/process/ExecFileOutput.ts` (+19 -2) 📝 `tests/process-global/darwinCompilerCleanup.test.ts` (+10 -1) </details> ### 📄 Description ## Summary Fixes #5616 by reverting to upstream behavior where `execFileOutput` waits naturally for inherited-pipe descendants to close their output streams, rather than forcibly cutting off readers. ## Problem and expected behavior When a stoppable `execFileOutput` command exits while a descendant keeps inherited stdout/stderr open, the original PR #5587 approach of cutting off readers after stop grace was **fundamentally incompatible** with upstream expectations. The upstream test `"keeps scratch files until an inherited-pipe descendant closes them"` expects NO reader destruction. ## Change and scope **Final approach (matching upstream):** - Removed reader destruction after grace timeout - `execFileOutput` now waits naturally for all inherited-pipe descendants to close their output streams - Removed `outputReadersCutOff` and `outputTruncated` tracking (no longer needed) - Removed `BootstrapProcessTable.ts` and `CompilerProcessFamilySettlement.ts` (no longer needed) - Simplified cleanup blocks in `DarwinProcessRunTokenReader.ts` and `NativeUiHelperRuntime.ts` Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Not applicable — lifecycle fix within existing process boundaries. ## Contract and boundary impact - Semantic owner and earliest changed stage: `execFileOutput` / process preparation cleanup. - Contribution scope fit and linked maintainer decision: not applicable. - CLI and MCP/tool-catalog contract: none. - Provider, bridge, target-format, or platform compatibility: Darwin helper compilation path. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): matches upstream behavior of waiting for inherited-pipe descendants. - Generated metadata impact: none. Expected effects: - [ ] 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: removed test expecting `outputReadersCutOff` behavior; removed test for family-exit waiting - All upstream tests now pass, including critical test `"keeps scratch files until an inherited-pipe descendant closes them"` - Verified on Node 24.18.0, macOS arm64 ## Validation performed - `npx vitest run src/process/ExecFileOutput.test.ts` — 31/31 passed - `npx vitest run tests/process-global/darwinCompilerCleanup.test.ts` — 14/14 passed ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not run; focused process-global tests on macOS. - Package or release metadata impact: none. - Security, privacy, process, or containment review: not applicable. ## Author readiness Human owner: @Hrithik-Gavankar - [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 - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] 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-01 21:44:42 +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#7012
No description provided.