[PR #4897] fix(update): bound update subprocess output collection (#4888) #6669

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4897
Author: @ArifAli8866
Created: 10/17/2026
Status: 🔄 Open

Base: main ← Head: fix/update-subprocess-output-bound


📝 Commits (10+)

  • ecc80d4 fix(update): bound update subprocess output collection (#4888)
  • e81b46e fix(update): escalate to SIGKILL and test shared output budget
  • 2865e54 Merge remote-tracking branch 'upstream/main' into fix/update-subprocess-output-bound
  • 0365553 fix(update): enforce default subprocess output limit when argument is omitted
  • 59acce0 Merge remote-tracking branch 'upstream/main' into fix/update-subprocess-output-bound
  • 5bd984c fix(update): align complete-output budget and terminate uncooperative writers
  • 93b7a72 Merge upstream/main into fix/update-subprocess-output-bound
  • f37c479 fix(update): preserve stream errors by tracking output overflow explicitly
  • 08968de fix(update): clarify drain comment and test subprocess termination and install overflow
  • d42f64f Merge upstream/main into fix/update-subprocess-output-bound

📊 Changes

3 files changed (+335 additions, -9 deletions)

View changed files

📝 src/application/UpdateCommandRunner.ts (+111 -9)
📝 tests/process-global/updateMaintenance.test.ts (+143 -0)
📝 tests/process-global/updateOutput.test.ts (+81 -0)

📄 Description

Summary

Related to #4888.

Upstream main (7404847f6) unified update subprocesses under UpdateCommandRunner with probe timeout and cleanup tracking, retaining update subprocess output within UPDATE_COMMAND_OUTPUT_BYTES (4 MiB) via ProviderProcessSupervisor, discarding later bytes while draining finite replies, and rejecting oversized complete-output metadata replies after the command exits.

This PR adds configurable output collection limits to UpdateCommandRunner via UpdateCommandLimits (maxOutputBytes = UPDATE_COMMAND_OUTPUT_BYTES, terminationGraceMs = DEFAULT_UPDATE_TERMINATION_GRACE_MS) and actively terminates complete-output metadata commands that exceed maxOutputBytes and fail to exit within the drain grace period (SIGTERM, escalating to SIGKILL after terminationGraceMs, while destroying stdout and stderr). Diagnostic-only package installations (runInstall, which uses retention === "diagnostics") remain unaffected so verbose installs can finish normally.

Problem and expected behavior

While main bounds retained memory to UPDATE_COMMAND_OUTPUT_BYTES (4 MiB) and rejects oversized complete replies once the subprocess closes, runUpdateProcess still waits on supervisor.waitForOutputClose() until probeTimeoutMs (10s) if a complete-output metadata command enters an infinite output loop or keeps writing without exiting after overflowing the retention budget.

Expected behavior:

  • Complete-output commands (UpdateCommandRunner.runProbe) retain output up to maxOutputBytes (defaulting to UPDATE_COMMAND_OUTPUT_BYTES, 4 MiB).
  • When an output event exceeds maxOutputBytes, it is recorded via outputBudgetExceeded = true and given terminationGraceMs (defaulting to DEFAULT_UPDATE_TERMINATION_GRACE_MS, 1,000 ms; immediate when <= 0) to finish draining and exit cleanly so finite oversized commands exit normally without premature signal termination.
  • If the command is still running after the drain grace period, runUpdateProcess destroys stdout and stderr, sends SIGTERM, and escalates to SIGKILL after terminationGraceMs if the subprocess ignores SIGTERM, then returns commandFailure(\Update command output exceeded the ${String(maxOutputBytes)}-byte complete-output retention budget; reply was not accepted.`) (kind: "execution"`).
  • Failures observed before overflow (such as stream errors below the budget) and probe cancellations keep their own failure report rather than being masked as a budget overflow.
  • Diagnostic-only commands (runInstall with retention === "diagnostics") never schedule overflow termination, preserving normal completion for verbose package installations while keeping failure diagnostics bounded.

Change and scope

  • Export DEFAULT_UPDATE_TERMINATION_GRACE_MS = 1_000 and UpdateCommandLimits in src/application/UpdateCommandRunner.ts.
  • Accept optional limits: UpdateCommandLimits in UpdateCommandRunner constructor, forwarding maxOutputBytes to ProviderProcessSupervisor as maxDiagnosticBytes. Only test suites configure custom UpdateCommandLimits; production callers (src/application/UpdateRuntime.ts) instantiate UpdateCommandRunner with default limits.
  • When retention === "complete" and an output event reports event.truncated === true, mark outputBudgetExceeded = true (if no prior error) and schedule termination after terminationGraceMs (or immediately when terminationGraceMs <= 0). If the subprocess has not exited when the grace timer fires, destroy child.stdout and child.stderr, send SIGTERM, and schedule a SIGKILL fallback timer after terminationGraceMs. Clean up all timers on process exit and in finally.
  • Check retention === "complete" && outputBudgetExceeded before secondary stream teardown or nonzero exit errors so cleanup side-effects do not mask the complete-output retention budget error. Errors occurring prior to overflow and probe cancellations retain their distinct diagnostics.
  • Add regression coverage in tests/process-global/updateOutput.test.ts verifying that stream errors below the budget report the stream error rather than the budget error.
  • Add explicit process termination coverage in tests/process-global/updateOutput.test.ts verifying child.signalCode transitions to SIGTERM (and SIGKILL on escalation) when a probe overflows and does not exit, and verifying verbose runInstall commands survive output overflow and exit normally (exitCode === 0, signalCode === null).
  • Intentionally not included: No termination on retention === "diagnostics" (runInstall), and no changes to existing caller behavior when optional configuration is omitted.

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.

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/application/UpdateCommandRunner.ts (UpdateCommandRunner / runUpdateProcess)
  • Contribution scope fit and linked maintainer decision: hardening within existing update subprocess boundary; ordinary fix within existing boundaries (maintainer decision not applicable). Active termination after a drain grace window complements probe timeout and bounds resource consumption for uncooperative writers.
  • CLI and MCP/tool-catalog contract: none
  • Provider, bridge, target-format, or platform compatibility: none
  • Evidence, artifact, provenance, or reconstruction contract: none
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): none
  • 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:
    • In tests/process-global/updateMaintenance.test.ts:
      1. Oversized finite output (UPDATE_COMMAND_OUTPUT_BYTES + 1 bytes) with default parameters returning the retention budget error.
      2. Endless streaming child termination with default parameters (UPDATE_COMMAND_OUTPUT_BYTES = 4 MiB).
      3. Custom maxOutputBytes limit (1,024 bytes) with an infinite writer.
      4. SIGKILL escalation after terminationGraceMs (200 ms) when an endless writer ignores SIGTERM.
      5. Immediate SIGKILL escalation when terminationGraceMs is 0.
      6. Shared stdout + stderr budget enforcement when neither stream exceeds maxOutputBytes alone (60 + 50 > 100 bytes).
      7. Exact combined stdout + stderr budget acceptance (60 + 40 === 100 bytes).
    • In tests/process-global/updateOutput.test.ts:
      8. Preserves actual stream error cause for stream failures below the output budget without masking as a budget overflow.
      9. Uncooperative probe writer termination actively verifying process exit via signal (child.signalCode === "SIGTERM").
      10. SIGKILL escalation verification on uncooperative probe writer ignoring SIGTERM (child.signalCode === "SIGKILL").
      11. Verbose package installation (runInstall) surviving output overflow and completing normally (exitCode === 0, signalCode === null).
  • Base reproduction or other evidence:
    Executing an endless writer against previous behavior hangs in supervisor.waitForOutputClose() until the probe timeout. With this change, the endless writer is terminated after the 1,000 ms drain grace window and returns the complete-output retention budget error, while finite oversized outputs in tests/process-global/updateOutput.test.ts still drain and exit with code 0.
  • User-visible CLI/MCP output (if applicable): Returns Update command output exceeded the 4194304-byte complete-output retention budget; reply was not accepted. when a complete-output update metadata command exceeds the default 4 MiB budget.
  • Remaining proof gaps: GitHub Actions workflows (CI, PR title) on bd49463a2 await standard maintainer workflow approval; child.kill signals the direct spawned subprocess (matching ProviderProcessSupervisor's non-group ownsProcessLifetime path), so grandchild process trees and macOS/Windows execution were not exercised locally.

For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.

  • Boundary regressions: The shared output budget cap enforces retention limits across stdout and stderr streams, rejecting oversized probe output while preserving normal drain behavior for finite commands.
  • Lifecycle regressions: Subprocess lifecycle cleanup is asserted via active termination of uncooperative probe writers after the drain grace period (SIGTERM, escalating to SIGKILL), verifying pipe destruction and subprocess termination without leaking processes or hanging until the 10-second probe deadline. In contrast, package installation commands (runInstall) retain diagnostic-only handling without scheduling overflow termination, ensuring verbose package installations complete normally without interruption.

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

  • npm run test:focused -- tests/process-global/updateOutput.test.ts tests/process-global/updateMaintenance.test.ts tests/acceptance/setup/updateAliasCli.test.ts src/setupEnvironment.test.ts src/application/Update.test.ts src/application/UpdateCommandProgress.test.ts src/process/ProviderProcessOutput.test.ts — PASS locally on Linux Node v24.22.1 (7 test files, 148/148 tests passed)
  • Independent VM verification on bd49463a2 by @CassieFox23 (review):
    • npm run test:focused -- tests/process-global/updateOutput.test.ts tests/process-global/updateMaintenance.test.ts — PASS on Node 22.23.4, 24.22.1, and 26.12.1 (61/61 tests passed on each)
    • npm run test:fast — PASS on Node 24.22.1 (1,222 test files, 22,527 passed, 16 skipped, 0 failed)
  • npm run check:fast — PASS locally (deps:check, typecheck, and lint passed)
  • npm run verify:test-discovery && npm run verify:module-boundaries && npm run format:check && npm run metadata:check && npm run verify:architecture-guards && npm run knip:production && npm run lint:typed — PASS locally (2,937 test files discovered, 3,506 module boundaries checked, 6,616 files formatted, 2,321 architecture-guard files passed, knip:production passed, and lint:typed passed with 0 errors across 6,142 files; npm run knip currently reports 1 unrelated upstream unused type in src/process/DarwinHelperCache.ts:465:13 from c534e249d on main)
  • git diff --check upstream/main — PASS locally (no whitespace or conflict marker issues; diff strictly scoped to UpdateCommandRunner.ts, updateMaintenance.test.ts, and updateOutput.test.ts)

Compatibility, safety, and release

  • Breaking changes or migration steps: None. maxOutputBytes defaults to UPDATE_COMMAND_OUTPUT_BYTES (4 MiB) and terminationGraceMs defaults to DEFAULT_UPDATE_TERMINATION_GRACE_MS (1,000 ms), preserving full backwards compatibility with all existing callers.
  • Real Hopper/Ghidra, browser, or OS coverage: Not applicable (local Node subprocess management for package-manager update commands).
  • Package or release metadata impact: None.
  • Security, privacy, process, or containment review: Prevents runProbe from hanging until probe timeout when a complete-output subprocess continues writing unbounded output without exiting, while ensuring child streams are destroyed and lingering processes are cleaned up via SIGTERM and SIGKILL fallback.

Author readiness

Human owner: @ArifAli8866

  • 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/4897 **Author:** [@ArifAli8866](https://github.com/ArifAli8866) **Created:** 10/17/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/update-subprocess-output-bound` --- ### 📝 Commits (10+) - [`ecc80d4`](https://github.com/morluto/rea/commit/ecc80d4ddd38a5b4e835064850634cec0fc4b5e6) fix(update): bound update subprocess output collection (#4888) - [`e81b46e`](https://github.com/morluto/rea/commit/e81b46e1fc710275be32915181a4ab30308c1085) fix(update): escalate to SIGKILL and test shared output budget - [`2865e54`](https://github.com/morluto/rea/commit/2865e542a02a8b7a6d3bb4186e28ee4ea43086e2) Merge remote-tracking branch 'upstream/main' into fix/update-subprocess-output-bound - [`0365553`](https://github.com/morluto/rea/commit/0365553c69876a24b9a053ff786dae12e3ca5fae) fix(update): enforce default subprocess output limit when argument is omitted - [`59acce0`](https://github.com/morluto/rea/commit/59acce0202a00b2b0884db27f82a60ff60d4b420) Merge remote-tracking branch 'upstream/main' into fix/update-subprocess-output-bound - [`5bd984c`](https://github.com/morluto/rea/commit/5bd984c7cc59ac73f9a82ffa1ba292fe04b18034) fix(update): align complete-output budget and terminate uncooperative writers - [`93b7a72`](https://github.com/morluto/rea/commit/93b7a72eeb5320ed3cae6912ee335e8494b5bc7e) Merge upstream/main into fix/update-subprocess-output-bound - [`f37c479`](https://github.com/morluto/rea/commit/f37c479cec216f0bc4da27e899dcd96299d511aa) fix(update): preserve stream errors by tracking output overflow explicitly - [`08968de`](https://github.com/morluto/rea/commit/08968de03760f7e26e67a25061fae54d645cb52d) fix(update): clarify drain comment and test subprocess termination and install overflow - [`d42f64f`](https://github.com/morluto/rea/commit/d42f64f4da7e8fa5255e000e7b41f51d54f7d59d) Merge upstream/main into fix/update-subprocess-output-bound ### 📊 Changes **3 files changed** (+335 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/application/UpdateCommandRunner.ts` (+111 -9) 📝 `tests/process-global/updateMaintenance.test.ts` (+143 -0) 📝 `tests/process-global/updateOutput.test.ts` (+81 -0) </details> ### 📄 Description ## Summary Related to #4888. Upstream `main` (`7404847f6`) unified update subprocesses under `UpdateCommandRunner` with probe timeout and cleanup tracking, retaining update subprocess output within `UPDATE_COMMAND_OUTPUT_BYTES` (4 MiB) via `ProviderProcessSupervisor`, discarding later bytes while draining finite replies, and rejecting oversized complete-output metadata replies after the command exits. This PR adds configurable output collection limits to `UpdateCommandRunner` via `UpdateCommandLimits` (`maxOutputBytes = UPDATE_COMMAND_OUTPUT_BYTES`, `terminationGraceMs = DEFAULT_UPDATE_TERMINATION_GRACE_MS`) and actively terminates complete-output metadata commands that exceed `maxOutputBytes` and fail to exit within the drain grace period (`SIGTERM`, escalating to `SIGKILL` after `terminationGraceMs`, while destroying `stdout` and `stderr`). Diagnostic-only package installations (`runInstall`, which uses `retention === "diagnostics"`) remain unaffected so verbose installs can finish normally. ## Problem and expected behavior While `main` bounds retained memory to `UPDATE_COMMAND_OUTPUT_BYTES` (4 MiB) and rejects oversized complete replies once the subprocess closes, `runUpdateProcess` still waits on `supervisor.waitForOutputClose()` until `probeTimeoutMs` (10s) if a complete-output metadata command enters an infinite output loop or keeps writing without exiting after overflowing the retention budget. Expected behavior: - Complete-output commands (`UpdateCommandRunner.runProbe`) retain output up to `maxOutputBytes` (defaulting to `UPDATE_COMMAND_OUTPUT_BYTES`, 4 MiB). - When an output event exceeds `maxOutputBytes`, it is recorded via `outputBudgetExceeded = true` and given `terminationGraceMs` (defaulting to `DEFAULT_UPDATE_TERMINATION_GRACE_MS`, 1,000 ms; immediate when `<= 0`) to finish draining and exit cleanly so finite oversized commands exit normally without premature signal termination. - If the command is still running after the drain grace period, `runUpdateProcess` destroys `stdout` and `stderr`, sends `SIGTERM`, and escalates to `SIGKILL` after `terminationGraceMs` if the subprocess ignores `SIGTERM`, then returns `commandFailure(\`Update command output exceeded the ${String(maxOutputBytes)}-byte complete-output retention budget; reply was not accepted.\`)` (`kind: "execution"`). - Failures observed before overflow (such as stream errors below the budget) and probe cancellations keep their own failure report rather than being masked as a budget overflow. - Diagnostic-only commands (`runInstall` with `retention === "diagnostics"`) never schedule overflow termination, preserving normal completion for verbose package installations while keeping failure diagnostics bounded. ## Change and scope - Export `DEFAULT_UPDATE_TERMINATION_GRACE_MS = 1_000` and `UpdateCommandLimits` in `src/application/UpdateCommandRunner.ts`. - Accept optional `limits: UpdateCommandLimits` in `UpdateCommandRunner` constructor, forwarding `maxOutputBytes` to `ProviderProcessSupervisor` as `maxDiagnosticBytes`. Only test suites configure custom `UpdateCommandLimits`; production callers (`src/application/UpdateRuntime.ts`) instantiate `UpdateCommandRunner` with default limits. - When `retention === "complete"` and an output event reports `event.truncated === true`, mark `outputBudgetExceeded = true` (if no prior error) and schedule termination after `terminationGraceMs` (or immediately when `terminationGraceMs <= 0`). If the subprocess has not exited when the grace timer fires, destroy `child.stdout` and `child.stderr`, send `SIGTERM`, and schedule a `SIGKILL` fallback timer after `terminationGraceMs`. Clean up all timers on process `exit` and in `finally`. - Check `retention === "complete" && outputBudgetExceeded` before secondary stream teardown or nonzero exit errors so cleanup side-effects do not mask the complete-output retention budget error. Errors occurring prior to overflow and probe cancellations retain their distinct diagnostics. - Add regression coverage in `tests/process-global/updateOutput.test.ts` verifying that stream errors below the budget report the stream error rather than the budget error. - Add explicit process termination coverage in `tests/process-global/updateOutput.test.ts` verifying `child.signalCode` transitions to `SIGTERM` (and `SIGKILL` on escalation) when a probe overflows and does not exit, and verifying verbose `runInstall` commands survive output overflow and exit normally (`exitCode === 0`, `signalCode === null`). - Intentionally not included: No termination on `retention === "diagnostics"` (`runInstall`), and no changes to existing caller behavior when optional configuration is omitted. 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. ## Contract and boundary impact - Semantic owner and earliest changed stage: `src/application/UpdateCommandRunner.ts` (`UpdateCommandRunner` / `runUpdateProcess`) - Contribution scope fit and linked maintainer decision: hardening within existing update subprocess boundary; ordinary fix within existing boundaries (maintainer decision not applicable). Active termination after a drain grace window complements probe timeout and bounds resource consumption for uncooperative writers. - CLI and MCP/tool-catalog contract: none - Provider, bridge, target-format, or platform compatibility: none - Evidence, artifact, provenance, or reconstruction contract: none - Target selection, authority, upstream behavior, and cleanup details (if applicable): none - 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. - [x] 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: - In `tests/process-global/updateMaintenance.test.ts`: 1. Oversized finite output (`UPDATE_COMMAND_OUTPUT_BYTES + 1` bytes) with default parameters returning the retention budget error. 2. Endless streaming child termination with default parameters (`UPDATE_COMMAND_OUTPUT_BYTES` = 4 MiB). 3. Custom `maxOutputBytes` limit (1,024 bytes) with an infinite writer. 4. `SIGKILL` escalation after `terminationGraceMs` (200 ms) when an endless writer ignores `SIGTERM`. 5. Immediate `SIGKILL` escalation when `terminationGraceMs` is `0`. 6. Shared `stdout` + `stderr` budget enforcement when neither stream exceeds `maxOutputBytes` alone (60 + 50 > 100 bytes). 7. Exact combined `stdout` + `stderr` budget acceptance (`60 + 40 === 100` bytes). - In `tests/process-global/updateOutput.test.ts`: 8. Preserves actual stream error cause for stream failures below the output budget without masking as a budget overflow. 9. Uncooperative probe writer termination actively verifying process exit via signal (`child.signalCode === "SIGTERM"`). 10. `SIGKILL` escalation verification on uncooperative probe writer ignoring `SIGTERM` (`child.signalCode === "SIGKILL"`). 11. Verbose package installation (`runInstall`) surviving output overflow and completing normally (`exitCode === 0`, `signalCode === null`). - Base reproduction or other evidence: Executing an endless writer against previous behavior hangs in `supervisor.waitForOutputClose()` until the probe timeout. With this change, the endless writer is terminated after the 1,000 ms drain grace window and returns the complete-output retention budget error, while finite oversized outputs in `tests/process-global/updateOutput.test.ts` still drain and exit with code `0`. - User-visible CLI/MCP output (if applicable): Returns `Update command output exceeded the 4194304-byte complete-output retention budget; reply was not accepted.` when a complete-output update metadata command exceeds the default 4 MiB budget. - Remaining proof gaps: GitHub Actions workflows (`CI`, `PR title`) on `bd49463a2` await standard maintainer workflow approval; `child.kill` signals the direct spawned subprocess (matching `ProviderProcessSupervisor`'s non-group `ownsProcessLifetime` path), so grandchild process trees and macOS/Windows execution were not exercised locally. For boundary fixes, identify the applicable [boundary regressions](https://github.com/morluto/rea/blob/main/docs/testing.md#boundary-regressions) and [lifecycle regressions](https://github.com/morluto/rea/blob/main/docs/testing.md#lifecycle-regressions) covered by the evidence above, and explain relevant gaps. - Boundary regressions: The shared output budget cap enforces retention limits across `stdout` and `stderr` streams, rejecting oversized probe output while preserving normal drain behavior for finite commands. - Lifecycle regressions: Subprocess lifecycle cleanup is asserted via active termination of uncooperative probe writers after the drain grace period (`SIGTERM`, escalating to `SIGKILL`), verifying pipe destruction and subprocess termination without leaking processes or hanging until the 10-second probe deadline. In contrast, package installation commands (`runInstall`) retain diagnostic-only handling without scheduling overflow termination, ensuring verbose package installations complete normally without interruption. 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 - `npm run test:focused -- tests/process-global/updateOutput.test.ts tests/process-global/updateMaintenance.test.ts tests/acceptance/setup/updateAliasCli.test.ts src/setupEnvironment.test.ts src/application/Update.test.ts src/application/UpdateCommandProgress.test.ts src/process/ProviderProcessOutput.test.ts` — PASS locally on Linux Node `v24.22.1` (7 test files, 148/148 tests passed) - Independent VM verification on `bd49463a2` by `@CassieFox23` ([review](https://github.com/morluto/rea/pull/4897#pullrequestreview-5746758227)): - `npm run test:focused -- tests/process-global/updateOutput.test.ts tests/process-global/updateMaintenance.test.ts` — PASS on Node `22.23.4`, `24.22.1`, and `26.12.1` (61/61 tests passed on each) - `npm run test:fast` — PASS on Node `24.22.1` (`1,222` test files, `22,527` passed, `16` skipped, `0` failed) - `npm run check:fast` — PASS locally (`deps:check`, `typecheck`, and `lint` passed) - `npm run verify:test-discovery && npm run verify:module-boundaries && npm run format:check && npm run metadata:check && npm run verify:architecture-guards && npm run knip:production && npm run lint:typed` — PASS locally (`2,937` test files discovered, `3,506` module boundaries checked, `6,616` files formatted, `2,321` architecture-guard files passed, `knip:production` passed, and `lint:typed` passed with `0` errors across `6,142` files; `npm run knip` currently reports 1 unrelated upstream unused type in `src/process/DarwinHelperCache.ts:465:13` from `c534e249d` on `main`) - `git diff --check upstream/main` — PASS locally (no whitespace or conflict marker issues; diff strictly scoped to `UpdateCommandRunner.ts`, `updateMaintenance.test.ts`, and `updateOutput.test.ts`) ## Compatibility, safety, and release - Breaking changes or migration steps: None. `maxOutputBytes` defaults to `UPDATE_COMMAND_OUTPUT_BYTES` (4 MiB) and `terminationGraceMs` defaults to `DEFAULT_UPDATE_TERMINATION_GRACE_MS` (1,000 ms), preserving full backwards compatibility with all existing callers. - Real Hopper/Ghidra, browser, or OS coverage: Not applicable (local Node subprocess management for package-manager update commands). - Package or release metadata impact: None. - Security, privacy, process, or containment review: Prevents `runProbe` from hanging until probe timeout when a complete-output subprocess continues writing unbounded output without exiting, while ensuring child streams are destroyed and lingering processes are cleaned up via `SIGTERM` and `SIGKILL` fallback. ## Author readiness Human owner: @ArifAli8866 - [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>
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#6669
No description provided.