[PR #2931] [CLOSED] fix(process): retain withheld-process observations on cleanup failures #5499

Closed
opened 2026-10-31 01:07:07 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2931
Author: @CodeAlex52
Created: 10/13/2026
Status: ❌ Closed

Base: main ← Head: fix/process-retain-withheld-observations


📝 Commits (2)

  • d1b6ce2 fix(process): retain withheld-process observations on cleanup failures
  • efe9928 test(process): assert withheld observation and failure reasons

📊 Changes

2 files changed (+120 additions, -5 deletions)

View changed files

📝 src/process/ProcessOwnership.ts (+23 -5)
➕ src/process/cleanup-withheld.regression.test.ts (+97 -0)

📄 Description

Summary

Fixes #2543.

Cleanup failures now retain the sweep's withheld-process observations: the revalidation-failure and signal-error returns no longer drop the PID and diagnostic that successful cleanup preserves.

Problem and expected behavior

cleanupOwnedProcessGroup returned a revalidation failure (ProcessOwnership.ts:255) and a signal error (:263-269) without the plan's observations, while the success return (:273-277) and the unresolved-failure return kept them. An unrelated process whose environment the OS withholds therefore lost its uncertainty evidence depending on which branch finished the attempt.

Expected (per the issue's restoration check): all three fixture cases retain PID 900 with platform_binary_environment_withheld, each keeping its own cleanup status, mismatch or signal-error reason, and signal-call count. A control with no withheld candidate must not invent an observation.

Change and scope

src/process/ProcessOwnership.ts: added withUnverifiedObservations, which attaches the plan's observations to a failure result that does not already carry its own, and used it on both returns. Ownership authority, reasons and signaling behaviour are unchanged.

Verification

Added src/process/cleanup-withheld.regression.test.ts with the issue's it.each fixture (revalidation / signal-error / success) plus the documented control expectations.

I traced all three fixtures through the plan, the revalidation and the signal paths by hand; I could not run Vitest in this environment (no local checkout), so please let CI run npm run test:focused -- src/process/cleanup-withheld.regression.test.ts and the static checks.


🔄 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/2931 **Author:** [@CodeAlex52](https://github.com/CodeAlex52) **Created:** 10/13/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/process-retain-withheld-observations` --- ### 📝 Commits (2) - [`d1b6ce2`](https://github.com/morluto/rea/commit/d1b6ce29f9cf3ccc58f8b81253a1a6bb05c14a67) fix(process): retain withheld-process observations on cleanup failures - [`efe9928`](https://github.com/morluto/rea/commit/efe9928e932d81ef94a434ac2da10a5a2f932820) test(process): assert withheld observation and failure reasons ### 📊 Changes **2 files changed** (+120 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/process/ProcessOwnership.ts` (+23 -5) ➕ `src/process/cleanup-withheld.regression.test.ts` (+97 -0) </details> ### 📄 Description ## Summary Fixes #2543. Cleanup failures now retain the sweep's withheld-process observations: the revalidation-failure and signal-error returns no longer drop the PID and diagnostic that successful cleanup preserves. ## Problem and expected behavior `cleanupOwnedProcessGroup` returned a revalidation failure (`ProcessOwnership.ts:255`) and a signal error (`:263-269`) without the plan's observations, while the success return (`:273-277`) and the unresolved-failure return kept them. An unrelated process whose environment the OS withholds therefore lost its uncertainty evidence depending on which branch finished the attempt. Expected (per the issue's restoration check): all three fixture cases retain PID 900 with `platform_binary_environment_withheld`, each keeping its own cleanup status, mismatch or signal-error reason, and signal-call count. A control with no withheld candidate must not invent an observation. ## Change and scope `src/process/ProcessOwnership.ts`: added `withUnverifiedObservations`, which attaches the plan's observations to a failure result that does not already carry its own, and used it on both returns. Ownership authority, reasons and signaling behaviour are unchanged. ## Verification Added `src/process/cleanup-withheld.regression.test.ts` with the issue's `it.each` fixture (revalidation / signal-error / success) plus the documented control expectations. I traced all three fixtures through the plan, the revalidation and the signal paths by hand; I could not run Vitest in this environment (no local checkout), so please let CI run `npm run test:focused -- src/process/cleanup-withheld.regression.test.ts` and the static checks. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:07:07 +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#5499
No description provided.