[PR #1358] [MERGED] fix(process): keep unobserved file contents unknown #2824

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

📋 Pull Request Information

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

Base: main ← Head: fix/process-filesystem-content-unknown


📝 Commits (3)

  • e9791db fix(process): keep unobserved file contents unknown
  • 731da90 fix(process): reconcile filesystem coverage tests with main
  • 8f9f098 fix(ci): integrate upstream native dossier fixture correction

📊 Changes

4 files changed (+267 additions, -35 deletions)

View changed files

📝 src/process/capture/FilesystemCoverage.test.ts (+163 -1)
📝 src/process/capture/ProcessCaptureLifecycle.ts (+12 -14)
📝 src/process/capture/ProcessFilesystemEffects.ts (+23 -4)
📝 tests/boundary/process/processFilesystemCoverageAdapters.test.ts (+69 -16)

📄 Description

Summary

Return unknown for regular-file contents when either snapshot lacks a digest and the observed metadata matches. Preserve definite changes established by metadata or two available digests.

This addresses a directly reported bug; there is no linked GitHub issue.

Problem and expected behavior

With a hashing budget below six bytes, rewriting "before" to "after!" leaves both snapshots with equal size, permissions, and null hashes. Comparing serialized states previously reported unchanged. One missing digest could instead produce a false modified classification solely because hash coverage differed.

Matching metadata cannot establish equal contents. Both cases now report unknown with a content-specific reason.

Change and scope

  • Compare observed metadata explicitly and require both regular-file hashes before claiming unchanged contents.
  • Retain modified when type, size, permissions, symlink target, or available content hashes establish a change.
  • Carry each distinct filesystem effect's actual unknown reason into capture limitations and residual unknowns.
  • Preserve creation, deletion, incomplete enumeration, and symlink absence handling.

Contract and boundary impact

  • Semantic owner and earliest changed stage: process filesystem snapshot effect classification.
  • CLI and MCP/tool-catalog contract: existing unknown effect variant and schema; no new fields or tools.
  • Provider, bridge, target-format, or platform compatibility: platform-neutral classifier; POSIX permission and symlink controls skip Windows.
  • Evidence, artifact, provenance, or reconstruction contract: snapshots and checkpoints retain their evidence; missing digests remain explicit uncertainty.
  • Process execution, authorization, cleanup, or containment impact: none.
  • Generated metadata, package, or installation impact: none; no dependencies or generated outputs changed.

Evidence and regression coverage

  • Real filesystem snapshots cover both missing hashes, either phase missing its hash, and untouched files without hashes. Positive controls cover equal/different hashes, changed size, type, permissions, directories, and symlinks.
  • All four missing-hash regression cases failed against the base revision: both missing hashes reported unchanged; one missing hash reported modified.
  • Real CLI/MCP regressions rewrite the six-byte file and validate Evidence, checkpoints, actual unknown reasons, and capture comparison.
  • Representative public result: { status: "unknown", before: { size: 6, sha256: null }, after: { size: 6, sha256: null }, reason: "A file content hash is unavailable in at least one snapshot; matching metadata does not establish unchanged contents." }.
  • Executed public proof: Linux CI passed all five CLI/MCP filesystem capture tests, including both new same-size rewrite cases. All four full-suite shards passed (6,215 tests passed; 89 skipped for existing capability/platform conditions).
  • Local limitation: native capture cannot launch because this managed sandbox's ps cannot inspect REA's own process. All three existing public capture tests also failed before launch on the unmodified base; CI closes this proof gap without weakening ownership checks.

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:local -- src/process/capture/FilesystemCoverage.test.ts src/process/capture/FilesystemSnapshot.test.ts src/process/capture/ProcessCaptureObservation.test.ts src/domain/process/processCapture.comparison.test.ts src/domain/process/processCapture.validation.test.ts: 33 tests passed across five files.
  • npm run check:ci: all eight tasks passed.
  • npm run verify:test-discovery: all 698 test files discovered exactly once.
  • git diff --check: passed.
  • GitHub Actions at e9791db1716ffdbb444f31123e0ed908a6bffd5e: static checks, all four test shards, and the coverage/timing gate passed; processFilesystemCoverageAdapters.test.ts passed all five tests on Linux. The 12 real-snapshot coverage tests passed too.
  • Two independent read-only reviews found no issues. Additional real-filesystem probes passed for hashing empty files after budget exhaustion, metadata changes with only one digest, field-order-independent equality, and deduplicated mixed content/enumeration unknowns. Commit hooks left the verified tree unchanged.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; consumers may now receive the existing unknown status where equality was previously claimed without evidence.
  • Real Hopper/Ghidra, browser, or OS coverage: real local filesystem IO exercised; real CLI/MCP process capture verified on Linux CI. Binary providers and browser paths are outside this change.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no execution authority or ownership checks changed; no sensitive data added.

Review checklist

  • This PR addresses a concrete problem.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • The reason for not linking an issue is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Existing contracts and metadata cover the result; no documentation or catalog changes required.
  • User-visible CLI/MCP changes include representative output.
  • Final diff checked 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/1358 **Author:** [@Y0UW1SH](https://github.com/Y0UW1SH) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/process-filesystem-content-unknown` --- ### 📝 Commits (3) - [`e9791db`](https://github.com/morluto/rea/commit/e9791db1716ffdbb444f31123e0ed908a6bffd5e) fix(process): keep unobserved file contents unknown - [`731da90`](https://github.com/morluto/rea/commit/731da90d35ed35fbb9b33cea9bbe6a4cf1f2c294) fix(process): reconcile filesystem coverage tests with main - [`8f9f098`](https://github.com/morluto/rea/commit/8f9f098b6b967c4b8892b11a96eed71a0ee64ad0) fix(ci): integrate upstream native dossier fixture correction ### 📊 Changes **4 files changed** (+267 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `src/process/capture/FilesystemCoverage.test.ts` (+163 -1) 📝 `src/process/capture/ProcessCaptureLifecycle.ts` (+12 -14) 📝 `src/process/capture/ProcessFilesystemEffects.ts` (+23 -4) 📝 `tests/boundary/process/processFilesystemCoverageAdapters.test.ts` (+69 -16) </details> ### 📄 Description ## Summary Return `unknown` for regular-file contents when either snapshot lacks a digest and the observed metadata matches. Preserve definite changes established by metadata or two available digests. This addresses a directly reported bug; there is no linked GitHub issue. ## Problem and expected behavior With a hashing budget below six bytes, rewriting `"before"` to `"after!"` leaves both snapshots with equal size, permissions, and null hashes. Comparing serialized states previously reported `unchanged`. One missing digest could instead produce a false `modified` classification solely because hash coverage differed. Matching metadata cannot establish equal contents. Both cases now report `unknown` with a content-specific reason. ## Change and scope - Compare observed metadata explicitly and require both regular-file hashes before claiming unchanged contents. - Retain `modified` when type, size, permissions, symlink target, or available content hashes establish a change. - Carry each distinct filesystem effect's actual unknown reason into capture limitations and residual unknowns. - Preserve creation, deletion, incomplete enumeration, and symlink absence handling. ## Contract and boundary impact - Semantic owner and earliest changed stage: process filesystem snapshot effect classification. - CLI and MCP/tool-catalog contract: existing `unknown` effect variant and schema; no new fields or tools. - Provider, bridge, target-format, or platform compatibility: platform-neutral classifier; POSIX permission and symlink controls skip Windows. - Evidence, artifact, provenance, or reconstruction contract: snapshots and checkpoints retain their evidence; missing digests remain explicit uncertainty. - Process execution, authorization, cleanup, or containment impact: none. - Generated metadata, package, or installation impact: none; no dependencies or generated outputs changed. ## Evidence and regression coverage - Real filesystem snapshots cover both missing hashes, either phase missing its hash, and untouched files without hashes. Positive controls cover equal/different hashes, changed size, type, permissions, directories, and symlinks. - All four missing-hash regression cases failed against the base revision: both missing hashes reported `unchanged`; one missing hash reported `modified`. - Real CLI/MCP regressions rewrite the six-byte file and validate Evidence, checkpoints, actual unknown reasons, and capture comparison. - Representative public result: `{ status: "unknown", before: { size: 6, sha256: null }, after: { size: 6, sha256: null }, reason: "A file content hash is unavailable in at least one snapshot; matching metadata does not establish unchanged contents." }`. - Executed public proof: Linux CI passed all five CLI/MCP filesystem capture tests, including both new same-size rewrite cases. All four full-suite shards passed (6,215 tests passed; 89 skipped for existing capability/platform conditions). - Local limitation: native capture cannot launch because this managed sandbox's `ps` cannot inspect REA's own process. All three existing public capture tests also failed before launch on the unmodified base; CI closes this proof gap without weakening ownership checks. 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:local -- src/process/capture/FilesystemCoverage.test.ts src/process/capture/FilesystemSnapshot.test.ts src/process/capture/ProcessCaptureObservation.test.ts src/domain/process/processCapture.comparison.test.ts src/domain/process/processCapture.validation.test.ts`: 33 tests passed across five files. - `npm run check:ci`: all eight tasks passed. - `npm run verify:test-discovery`: all 698 test files discovered exactly once. - `git diff --check`: passed. - GitHub Actions at `e9791db1716ffdbb444f31123e0ed908a6bffd5e`: static checks, all four test shards, and the coverage/timing gate passed; `processFilesystemCoverageAdapters.test.ts` passed all five tests on Linux. The 12 real-snapshot coverage tests passed too. - Two independent read-only reviews found no issues. Additional real-filesystem probes passed for hashing empty files after budget exhaustion, metadata changes with only one digest, field-order-independent equality, and deduplicated mixed content/enumeration unknowns. Commit hooks left the verified tree unchanged. ## Compatibility, safety, and release - Breaking changes or migration steps: none; consumers may now receive the existing `unknown` status where equality was previously claimed without evidence. - Real Hopper/Ghidra, browser, or OS coverage: real local filesystem IO exercised; real CLI/MCP process capture verified on Linux CI. Binary providers and browser paths are outside this change. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no execution authority or ownership checks changed; no sensitive data added. ## Review checklist - [x] This PR addresses a concrete problem. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] The reason for not linking an issue is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Existing contracts and metadata cover the result; no documentation or catalog changes required. - [x] User-visible CLI/MCP changes include representative output. - [x] Final diff checked 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:10:42 +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#2824
No description provided.