[PR #1616] [MERGED] fix(firmware): recover after workspace removal failures #4703

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

📋 Pull Request Information

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

Base: main ← Head: fix/firmware-workspace-recovery-20261010


📝 Commits (3)

  • e9f3f85 fix(firmware): recover after workspace removal failures
  • 90ce244 Merge remote-tracking branch 'origin/main' into fix/firmware-workspace-recovery-20261010
  • 9e976d6 Merge remote-tracking branch 'origin/main' into fix/firmware-workspace-recovery-20261010

📊 Changes

7 files changed (+356 additions, -183 deletions)

View changed files

📝 src/domain/firmware/firmwareAnalysis.ts (+2 -0)
➖ src/firmware/FirmwareProvider.test.ts (+0 -98)
📝 src/firmware/FirmwareProvider.ts (+144 -72)
📝 tests/boundary/firmware/firmwareIntegration.test.ts (+11 -3)
➕ tests/boundary/firmware/firmwareWorkspaceRecovery.test.ts (+164 -0)
📝 tests/fixtures/firmware/producer.mjs (+13 -2)
📝 tests/fixtures/firmware/provider.ts (+22 -8)

📄 Description

A failed private-workspace removal must not replay an old extraction error onto a new firmware inspection after its worker has been verified stopped. Retain each cleanup owner separately, allow subsequent operations in disjoint workspaces, and retry/report every retained root at shutdown. Unverified process cleanup still blocks new launches; recovery uses the original owned-process identity.

Preserve completed extraction results together with raw producer data, artifact identity and source metadata when cleanup fails. Preserve both the primary report failure and the cleanup failure through the existing shared error projection. The existing partial_observation.result shape remains intact; provenance is additive.

Replace three helper-only cleanup tests with real subprocess/filesystem boundaries: EACCES after two completed extractions, subsequent Binwalk work on the same provider, MCP error serialization, all-root cleanup after permission recovery, and combined report/cleanup failures. Correct the stale assertion that an unverified worker allows another launch.

Fixes #1501.

Validation: 45 focused firmware/process-ownership tests; typecheck/lint/static checks; generated documentation and test-discovery checks; real Binwalk 3.1.0 and Unblob 26.6.4 CLI/stdio MCP verification (independent offsets/digests, selected ranges, unknown chunks and depth limits). Qwen 0.25.0, Pi 1.1.0, Hermes (normal/sticky profiles) and DeepSeek Harness 0.2.0-rc.2 native flows also passed against all 170 tools; loopback model fixtures only. Linux x64, Node 24.18.0. No real Hopper/Ghidra verification; their code is unchanged. No new tools or catalog filtering.


🔄 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/1616 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/10/2026 **Status:** ✅ Merged **Merged:** 10/10/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/firmware-workspace-recovery-20261010` --- ### 📝 Commits (3) - [`e9f3f85`](https://github.com/morluto/rea/commit/e9f3f852b17de1ab6b310940576609bc5fc6ee5e) fix(firmware): recover after workspace removal failures - [`90ce244`](https://github.com/morluto/rea/commit/90ce2448e1f62379ec11685c6028d5d089cfc93b) Merge remote-tracking branch 'origin/main' into fix/firmware-workspace-recovery-20261010 - [`9e976d6`](https://github.com/morluto/rea/commit/9e976d62c9f31e1bbc17a9f5d97b7cc1c8e565d4) Merge remote-tracking branch 'origin/main' into fix/firmware-workspace-recovery-20261010 ### 📊 Changes **7 files changed** (+356 additions, -183 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/firmware/firmwareAnalysis.ts` (+2 -0) ➖ `src/firmware/FirmwareProvider.test.ts` (+0 -98) 📝 `src/firmware/FirmwareProvider.ts` (+144 -72) 📝 `tests/boundary/firmware/firmwareIntegration.test.ts` (+11 -3) ➕ `tests/boundary/firmware/firmwareWorkspaceRecovery.test.ts` (+164 -0) 📝 `tests/fixtures/firmware/producer.mjs` (+13 -2) 📝 `tests/fixtures/firmware/provider.ts` (+22 -8) </details> ### 📄 Description A failed private-workspace removal must not replay an old extraction error onto a new firmware inspection after its worker has been verified stopped. Retain each cleanup owner separately, allow subsequent operations in disjoint workspaces, and retry/report every retained root at shutdown. Unverified process cleanup still blocks new launches; recovery uses the original owned-process identity. Preserve completed extraction results together with raw producer data, artifact identity and source metadata when cleanup fails. Preserve both the primary report failure and the cleanup failure through the existing shared error projection. The existing `partial_observation.result` shape remains intact; provenance is additive. Replace three helper-only cleanup tests with real subprocess/filesystem boundaries: EACCES after two completed extractions, subsequent Binwalk work on the same provider, MCP error serialization, all-root cleanup after permission recovery, and combined report/cleanup failures. Correct the stale assertion that an unverified worker allows another launch. Fixes #1501. Validation: 45 focused firmware/process-ownership tests; typecheck/lint/static checks; generated documentation and test-discovery checks; real Binwalk 3.1.0 and Unblob 26.6.4 CLI/stdio MCP verification (independent offsets/digests, selected ranges, unknown chunks and depth limits). Qwen 0.25.0, Pi 1.1.0, Hermes (normal/sticky profiles) and DeepSeek Harness 0.2.0-rc.2 native flows also passed against all 170 tools; loopback model fixtures only. Linux x64, Node 24.18.0. No real Hopper/Ghidra verification; their code is unchanged. No new tools or catalog filtering. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:54:10 +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#4703
No description provided.