[GH-ISSUE #2050] Selecting one Evidence record where a bundle is expected is reported as an integrity mismatch #677

Closed
opened 2026-10-15 18:27:17 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @kaoru0822-kitauji on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/2050

Observed behavior

Selecting a single Evidence record, such as one command's --json result, where an Evidence bundle is expected is reported as an integrity failure:

$ rea inspect-macho /bin/ls --json > record.json
$ rea evidence-import record.json --json
{"code":"evidence_integrity_mismatch","category":"integrity_mismatch","retryable":false,
 "message":"Expected an Evidence bundle with records and manifest arrays, but this JSON is one Evidence record (ev_…). Export a session bundle with the MCP export_evidence_bundle tool and supply that file.", …}

The same happens for rea evidence-export, rea compare, MCP import_evidence_bundle and compare_evidence_bundles, and inspect-analysis-view. All of them read the caller-selected file through readEvidenceBundle / readImmutableEvidenceBundle.

Why this is wrong

The file is intact and its Evidence record authenticates. The caller selected the wrong kind of file, and the message itself says to supply a different one. code/category say integrity mismatch, which in this taxonomy means the bytes contradict their identity: "get a fresh copy", possible tampering. An agent that branches on category gets the wrong recovery path.

#1256 moved the other caller-selection failures for Evidence files (missing, not-file, exists) to invalid_request / invalid_input. It kept unparseable content (invalid-json) as an integrity mismatch. A well-formed record that is not a bundle is a selection error, not damaged content.

Expected behavior

code: "invalid_request", category: "invalid_input", with details.path naming the selected file and the existing guidance to export a session bundle. Malformed or tampered bundles remain evidence_integrity_mismatch.

Originally created by @kaoru0822-kitauji on GitHub (Oct 12, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/2050 ## Observed behavior Selecting a single Evidence record, such as one command's `--json` result, where an Evidence bundle is expected is reported as an integrity failure: ``` $ rea inspect-macho /bin/ls --json > record.json $ rea evidence-import record.json --json {"code":"evidence_integrity_mismatch","category":"integrity_mismatch","retryable":false, "message":"Expected an Evidence bundle with records and manifest arrays, but this JSON is one Evidence record (ev_…). Export a session bundle with the MCP export_evidence_bundle tool and supply that file.", …} ``` The same happens for `rea evidence-export`, `rea compare`, MCP `import_evidence_bundle` and `compare_evidence_bundles`, and `inspect-analysis-view`. All of them read the caller-selected file through `readEvidenceBundle` / `readImmutableEvidenceBundle`. ## Why this is wrong The file is intact and its Evidence record authenticates. The caller selected the wrong kind of file, and the message itself says to supply a different one. `code`/`category` say integrity mismatch, which in this taxonomy means the bytes contradict their identity: "get a fresh copy", possible tampering. An agent that branches on `category` gets the wrong recovery path. #1256 moved the other caller-selection failures for Evidence files (`missing`, `not-file`, `exists`) to `invalid_request` / `invalid_input`. It kept unparseable content (`invalid-json`) as an integrity mismatch. A well-formed record that is not a bundle is a selection error, not damaged content. ## Expected behavior `code: "invalid_request"`, `category: "invalid_input"`, with `details.path` naming the selected file and the existing guidance to export a session bundle. Malformed or tampered bundles remain `evidence_integrity_mismatch`.
bsakaguchi 2026-10-15 18:27:17 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@kaoru0822-kitauji commented on GitHub (Oct 12, 2026):

Fixed on main by d8c76b629. On current main, rea evidence-import record.json with one authentic Evidence record returns invalid_request / invalid_input with the export guidance. A record with a modified body still returns evidence_integrity_mismatch. Closing #2051 as superseded.

<!-- gh-comment-id:6119412627 --> @kaoru0822-kitauji commented on GitHub (Oct 12, 2026): Fixed on main by d8c76b629. On current main, `rea evidence-import record.json` with one authentic Evidence record returns `invalid_request` / `invalid_input` with the export guidance. A record with a modified body still returns `evidence_integrity_mismatch`. Closing #2051 as superseded.
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#677
No description provided.