[PR #1274] [MERGED] fix(process): preserve unknown filesystem absence in partial captures #2757

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

📋 Pull Request Information

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

Base: main ← Head: fix/process-filesystem-absence


📝 Commits (1)

  • ebbf69e fix(process): preserve unknown filesystem absence in partial captures

📊 Changes

11 files changed (+402 additions, -29 deletions)

View changed files

📝 docs/process-capture.md (+8 -0)
📝 src/domain/process/processCapture.ts (+13 -0)
➕ src/process/capture/FilesystemCoverage.test.ts (+137 -0)
📝 src/process/capture/FilesystemSnapshot.ts (+21 -13)
📝 src/process/capture/ProcessCaptureLifecycle.ts (+19 -4)
📝 src/process/capture/ProcessCaptureObservation.test.ts (+4 -4)
📝 src/process/capture/ProcessFilesystemEffects.ts (+57 -5)
📝 src/process/capture/ProcessHarness.ts (+1 -1)
📝 tests/boundary/process/processCaptureLifecycle.test.ts (+2 -1)
➕ tests/boundary/process/processFilesystemCoverageAdapters.test.ts (+139 -0)
📝 tests/boundary/process/processPreparation.test.ts (+1 -1)

📄 Description

With a two-entry filesystem budget, creating a.txt could push an unchanged z.txt out of the final snapshot and make REA report it as deleted. A partial initial snapshot could likewise mislabel an existing file as created.

Track exhausted path enumeration per observation root separately from content-hash coverage. Infer creation/deletion only when absence is established; otherwise return an unknown effect with the observed before/after state and a reason. Preserve known effects in exhausted roots and outside unfollowed symlink subtrees. An observed missing root is an empty baseline, rather than a truncated scan. Both top-level effects and checkpoint effects share these rules, and filesystem uncertainty propagates into comparison results.

Closes #1231.

The additive effect variant through CLI/MCP is:

{"path":"root_0:z.txt","status":"unknown","before":{"path":"root_0:z.txt","mode":33188,"size":9,"type":"file","sha256":"aaa8d3c8d74ad3e8f6b1772aa9c7e0eaa528cb42fc93599ce2f125b00d4c424c","symlink_target":null},"after":null,"reason":"The after snapshot did not exhaust path enumeration under root_0; absence remains unknown."}

null in this variant means unobserved, not confirmed absence. Other effect variants retain their existing meaning.

Validation:

  • Regressions fail before the fix for partial before/after snapshots, CLI/MCP false deletion, an unfollowed replacement symlink and false truncation of an observed-missing root.
  • 46 focused tests across 9 files cover filesystem identity/hashing, initial/final snapshots, cleanup failures, capture validation, comparisons and trace adapters.
  • npm run check:fast and npm run docs:check.
  • Actual CLI/stdio MCP probe validates the unknown effect, its advertised output schema, the complete-snapshot control and retained cancellation cleanup.

Local verification: Linux x64, Node 24.18.0, one CPU, 768MiB Node heap. No real Hopper/Ghidra verification was needed or performed for this filesystem-capture change.


🔄 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/1274 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/process-filesystem-absence` --- ### 📝 Commits (1) - [`ebbf69e`](https://github.com/morluto/rea/commit/ebbf69e6ad5dc6fa859f1f1d3fcd2cfbd2db205a) fix(process): preserve unknown filesystem absence in partial captures ### 📊 Changes **11 files changed** (+402 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `docs/process-capture.md` (+8 -0) 📝 `src/domain/process/processCapture.ts` (+13 -0) ➕ `src/process/capture/FilesystemCoverage.test.ts` (+137 -0) 📝 `src/process/capture/FilesystemSnapshot.ts` (+21 -13) 📝 `src/process/capture/ProcessCaptureLifecycle.ts` (+19 -4) 📝 `src/process/capture/ProcessCaptureObservation.test.ts` (+4 -4) 📝 `src/process/capture/ProcessFilesystemEffects.ts` (+57 -5) 📝 `src/process/capture/ProcessHarness.ts` (+1 -1) 📝 `tests/boundary/process/processCaptureLifecycle.test.ts` (+2 -1) ➕ `tests/boundary/process/processFilesystemCoverageAdapters.test.ts` (+139 -0) 📝 `tests/boundary/process/processPreparation.test.ts` (+1 -1) </details> ### 📄 Description With a two-entry filesystem budget, creating `a.txt` could push an unchanged `z.txt` out of the final snapshot and make REA report it as deleted. A partial initial snapshot could likewise mislabel an existing file as created. Track exhausted path enumeration per observation root separately from content-hash coverage. Infer creation/deletion only when absence is established; otherwise return an `unknown` effect with the observed before/after state and a reason. Preserve known effects in exhausted roots and outside unfollowed symlink subtrees. An observed missing root is an empty baseline, rather than a truncated scan. Both top-level effects and checkpoint effects share these rules, and filesystem uncertainty propagates into comparison results. Closes #1231. The additive effect variant through CLI/MCP is: ```json {"path":"root_0:z.txt","status":"unknown","before":{"path":"root_0:z.txt","mode":33188,"size":9,"type":"file","sha256":"aaa8d3c8d74ad3e8f6b1772aa9c7e0eaa528cb42fc93599ce2f125b00d4c424c","symlink_target":null},"after":null,"reason":"The after snapshot did not exhaust path enumeration under root_0; absence remains unknown."} ``` `null` in this variant means unobserved, not confirmed absence. Other effect variants retain their existing meaning. Validation: - Regressions fail before the fix for partial before/after snapshots, CLI/MCP false deletion, an unfollowed replacement symlink and false truncation of an observed-missing root. - 46 focused tests across 9 files cover filesystem identity/hashing, initial/final snapshots, cleanup failures, capture validation, comparisons and trace adapters. - `npm run check:fast` and `npm run docs:check`. - Actual CLI/stdio MCP probe validates the unknown effect, its advertised output schema, the complete-snapshot control and retained cancellation cleanup. Local verification: Linux x64, Node 24.18.0, one CPU, 768MiB Node heap. No real Hopper/Ghidra verification was needed or performed for this filesystem-capture change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:09:53 +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#2757
No description provided.