[PR #1074] [MERGED] fix(evidence): report missing evidence files instead of permission advice #2623

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1074
Author: @kaoru0822-kitauji
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @kaoru0822-kitauji

Base: main ← Head: fix/evidence-file-missing


📝 Commits (1)

  • 89252f1 fix(evidence): report missing evidence files instead of permission advice

📊 Changes

6 files changed (+92 additions, -16 deletions)

View changed files

📝 src/application/JsonFiles.ts (+44 -9)
📝 src/domain/analysisErrorPresentation.ts (+9 -3)
📝 src/domain/analysisErrorProjection.ts (+5 -1)
📝 src/domain/evidenceErrors.ts (+6 -2)
📝 tests/boundary/filesystem/evidenceBundleFiles.test.ts (+27 -0)
📝 tests/conformance/contracts/analysisErrorProjection.test.ts (+1 -1)

📄 Description

Problem

Several file operations failed with reason: "io", the message "Evidence file could not be accessed. Check file permissions and try again.", and no path:

  • reading a nonexistent Evidence bundle (evidence-import, evidence-export, compare, MCP import_evidence_bundle, compare_bundles);
  • reading a nonexistent snapshot (MCP open_binary snapshot_path);
  • exporting into a directory that does not exist.
{"code":"execution_failure","message":"Evidence file could not be accessed. Check file permissions and try again.","details":{"operation":"read","reason":"io"}}

Permissions are not the problem in any of these cases. With rea compare left.json right.json, the caller can't even tell which of the two files is missing.

Change

  • JsonFiles maps ENOENT and ENOTDIR to a new EvidenceFileError reason, missing. The message depends on the operation:
    • read: "Evidence file does not exist at the selected path. Check the path and try again."
    • write: "Evidence output directory does not exist. Choose an existing directory and try again."
  • Every EvidenceFileError from JsonFiles now carries the caller path, resolved against the working directory. It is projected as details.path, so the failing side of a comparison is identified.
  • Permission and other I/O failures keep reason: "io" and the existing advice. The error code and category are unchanged.

The error details schema is the generic record, so no advertised schema changes.

Verification

  • npm run test:focused -- tests/boundary/filesystem/evidenceBundleFiles.test.ts tests/conformance/contracts/analysisErrorProjection.test.ts: passed. The new read and write case fails with the source change reverted. The projection conformance test now includes the missing variant.
  • All 46 test files that reference JsonFiles, snapshots, EvidenceFileError or error projection: 392 passed. The one failure, hopperClient.cleanup.test.ts ("kills only its owned Hopper group…"), times out identically on unmodified main on this host.
  • npm run check:fast
  • rea compare /missing.json existing.json now returns the missing-file message with details.path.

No real Hopper or Ghidra verification was run, because this change does not touch those providers.

🤖 Generated with Claude Code


🔄 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/1074 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/8/2026 **Merged by:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Base:** `main` ← **Head:** `fix/evidence-file-missing` --- ### 📝 Commits (1) - [`89252f1`](https://github.com/morluto/rea/commit/89252f1f35de91494bd49460b1645d8c09cc6d33) fix(evidence): report missing evidence files instead of permission advice ### 📊 Changes **6 files changed** (+92 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `src/application/JsonFiles.ts` (+44 -9) 📝 `src/domain/analysisErrorPresentation.ts` (+9 -3) 📝 `src/domain/analysisErrorProjection.ts` (+5 -1) 📝 `src/domain/evidenceErrors.ts` (+6 -2) 📝 `tests/boundary/filesystem/evidenceBundleFiles.test.ts` (+27 -0) 📝 `tests/conformance/contracts/analysisErrorProjection.test.ts` (+1 -1) </details> ### 📄 Description ## Problem Several file operations failed with `reason: "io"`, the message "Evidence file could not be accessed. Check file permissions and try again.", and no path: - reading a nonexistent Evidence bundle (`evidence-import`, `evidence-export`, `compare`, MCP `import_evidence_bundle`, `compare_bundles`); - reading a nonexistent snapshot (MCP `open_binary` `snapshot_path`); - exporting into a directory that does not exist. ```json {"code":"execution_failure","message":"Evidence file could not be accessed. Check file permissions and try again.","details":{"operation":"read","reason":"io"}} ``` Permissions are not the problem in any of these cases. With `rea compare left.json right.json`, the caller can't even tell which of the two files is missing. ## Change - `JsonFiles` maps `ENOENT` and `ENOTDIR` to a new `EvidenceFileError` reason, `missing`. The message depends on the operation: - read: "Evidence file does not exist at the selected path. Check the path and try again." - write: "Evidence output directory does not exist. Choose an existing directory and try again." - Every `EvidenceFileError` from `JsonFiles` now carries the caller path, resolved against the working directory. It is projected as `details.path`, so the failing side of a comparison is identified. - Permission and other I/O failures keep `reason: "io"` and the existing advice. The error code and category are unchanged. The error details schema is the generic record, so no advertised schema changes. ## Verification - `npm run test:focused -- tests/boundary/filesystem/evidenceBundleFiles.test.ts tests/conformance/contracts/analysisErrorProjection.test.ts`: passed. The new read and write case fails with the source change reverted. The projection conformance test now includes the `missing` variant. - All 46 test files that reference `JsonFiles`, snapshots, `EvidenceFileError` or error projection: 392 passed. The one failure, `hopperClient.cleanup.test.ts` ("kills only its owned Hopper group…"), times out identically on unmodified `main` on this host. - `npm run check:fast` - `rea compare /missing.json existing.json` now returns the missing-file message with `details.path`. No real Hopper or Ghidra verification was run, because this change does not touch those providers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:08:19 +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#2623
No description provided.