[PR #1588] [MERGED] fix(browser): skip Windows Electron signals without verified lineage #2990

Closed
opened 2026-10-17 21:12:38 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/windows-electron-cleanup


📝 Commits (2)

  • 0f3b483 fix(browser): skip Windows Electron signals without verified lineage
  • af53ec7 fix(browser): reconcile Electron cleanup coverage with main

📊 Changes

2 files changed (+84 additions, -6 deletions)

View changed files

📝 src/browser/PlaywrightElectronActiveProvider.test.ts (+71 -2)
📝 src/browser/PlaywrightElectronActiveProvider.ts (+13 -4)

📄 Description

Summary

Fixes #1589.

capture_electron_scenario on Windows force-kills the recorded Electron PID and then reports cleanup_failed. Related context: #288 tracks Job Object ownership for Ghidra and does not cover this Electron path.

Problem and expected behavior

On Windows, createSystemProcessOwnershipHost returns an empty process list, so Electron lineage stays unavailable. cleanupElectronProcesses still ran taskkill.exe /pid <leader> /t /f, then returned cleaned: false because lineage was not verified.

docs/electron-observation.md says cleanup uncertainty does not authorize signaling unrelated processes. A PID alone is not ownership after exit or reuse. POSIX cleanup revalidates the run before signaling. Windows should refuse the signal when lineage is unverified, and signal the leader and descendants only after lineage is verified.

An unverified Windows capture still ends as cleanup_failed with partial_observation. This change does not make that lane succeed, and it does not implement Job Object ownership.

Change and scope

The Windows branch now returns the existing unverified-cleanup failure before calling taskkill. Verified lineage still terminates the leader and each descendant. POSIX cleanup is unchanged.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Electron active-observation cleanup, after capture and application.close().
  • CLI and MCP/tool-catalog contract: none. capture_electron_scenario still returns cleanup_failed when Windows lineage cannot be verified.
  • Provider, bridge, target-format, or platform compatibility: Windows Electron cleanup no longer signals an unproven PID. Verified lineage behavior is unchanged.
  • Evidence, artifact, provenance, or reconstruction contract: none. A failed cleanup still retains collected observations as partial_observation.
  • Process execution, authorization, cleanup, or containment impact: removes the PID taskkill that ran without lineage proof.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Evidence and regression coverage

  • Tests added or updated: src/browser/PlaywrightElectronActiveProvider.test.ts covers unavailable lineage (no terminate call) and verified lineage (leader then descendant).
  • Base reproduction or other evidence: source path. On Windows the process table is empty, so observeOwnedProcessLineage returns unavailable before any signal. The previous branch called cleanupWindowsProcessTree first.
  • User-visible CLI/MCP output (if applicable): an unverified Windows capture still fails with cleanup_failed. It no longer runs taskkill first.
  • Remaining proof gaps: no live Electron process was launched. Job Object ownership that could let this lane succeed on Windows remains #288.

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 -- src/browser/PlaywrightElectronActiveProvider.test.ts — 3 tests passed.
  • npx tsc --noEmit --pretty false — no errors.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Windows captures that cannot prove lineage still fail closed, without the extra signal.
  • Real Hopper/Ghidra, browser, or OS coverage: not run. The regression injects the Windows platform and a terminate function.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: stops signaling a PID that the Windows process table cannot tie to this run.

Review checklist

  • This PR addresses a concrete problem or an agreed enhancement.
  • 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/1588 **Author:** [@Adolanium](https://github.com/Adolanium) **Created:** 10/10/2026 **Status:** ✅ Merged **Merged:** 10/10/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/windows-electron-cleanup` --- ### 📝 Commits (2) - [`0f3b483`](https://github.com/morluto/rea/commit/0f3b4835af33f108d0d60ea9eeb60acc6a39b9cf) fix(browser): skip Windows Electron signals without verified lineage - [`af53ec7`](https://github.com/morluto/rea/commit/af53ec7c25ee556172ba361a2cfd05d25af52b1a) fix(browser): reconcile Electron cleanup coverage with main ### 📊 Changes **2 files changed** (+84 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/browser/PlaywrightElectronActiveProvider.test.ts` (+71 -2) 📝 `src/browser/PlaywrightElectronActiveProvider.ts` (+13 -4) </details> ### 📄 Description ## Summary Fixes #1589. `capture_electron_scenario` on Windows force-kills the recorded Electron PID and then reports `cleanup_failed`. Related context: #288 tracks Job Object ownership for Ghidra and does not cover this Electron path. ## Problem and expected behavior On Windows, `createSystemProcessOwnershipHost` returns an empty process list, so Electron lineage stays `unavailable`. `cleanupElectronProcesses` still ran `taskkill.exe /pid <leader> /t /f`, then returned `cleaned: false` because lineage was not verified. `docs/electron-observation.md` says cleanup uncertainty does not authorize signaling unrelated processes. A PID alone is not ownership after exit or reuse. POSIX cleanup revalidates the run before signaling. Windows should refuse the signal when lineage is unverified, and signal the leader and descendants only after lineage is verified. An unverified Windows capture still ends as `cleanup_failed` with `partial_observation`. This change does not make that lane succeed, and it does not implement Job Object ownership. ## Change and scope The Windows branch now returns the existing unverified-cleanup failure before calling `taskkill`. Verified lineage still terminates the leader and each descendant. POSIX cleanup is unchanged. ## Contract and boundary impact - Semantic owner and earliest changed stage: Electron active-observation cleanup, after capture and `application.close()`. - CLI and MCP/tool-catalog contract: none. `capture_electron_scenario` still returns `cleanup_failed` when Windows lineage cannot be verified. - Provider, bridge, target-format, or platform compatibility: Windows Electron cleanup no longer signals an unproven PID. Verified lineage behavior is unchanged. - Evidence, artifact, provenance, or reconstruction contract: none. A failed cleanup still retains collected observations as `partial_observation`. - Process execution, authorization, cleanup, or containment impact: removes the PID `taskkill` that ran without lineage proof. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none. ## Evidence and regression coverage - Tests added or updated: `src/browser/PlaywrightElectronActiveProvider.test.ts` covers unavailable lineage (no terminate call) and verified lineage (leader then descendant). - Base reproduction or other evidence: source path. On Windows the process table is empty, so `observeOwnedProcessLineage` returns unavailable before any signal. The previous branch called `cleanupWindowsProcessTree` first. - User-visible CLI/MCP output (if applicable): an unverified Windows capture still fails with `cleanup_failed`. It no longer runs `taskkill` first. - Remaining proof gaps: no live Electron process was launched. Job Object ownership that could let this lane succeed on Windows remains #288. 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 -- src/browser/PlaywrightElectronActiveProvider.test.ts` — 3 tests passed. - `npx tsc --noEmit --pretty false` — no errors. ## Compatibility, safety, and release - Breaking changes or migration steps: none. Windows captures that cannot prove lineage still fail closed, without the extra signal. - Real Hopper/Ghidra, browser, or OS coverage: not run. The regression injects the Windows platform and a terminate function. - Package or release metadata impact: none. - Security, privacy, process, or containment review: stops signaling a PID that the Windows process table cannot tie to this run. ## Review checklist - [x] This PR addresses a concrete problem or an agreed enhancement. - [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-10-17 21:12:38 +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#2990
No description provided.