[GH-ISSUE #112] Allow explicit evidence-preserving continuation after artifact integrity mismatches #72

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

Originally created by @morluto on GitHub (Jul 13, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/112

Summary

Add an explicit fail-closed-by-default policy that can record an artifact integrity mismatch as evidence and continue analyzing unaffected portions of the artifact graph without treating the mismatched entry as trusted or equivalent.

Current behavior

REA correctly verifies Electron ASAR integrity metadata and currently aborts the entire inventory or cross-version investigation at the first mismatch.

With Linzumi.app, the installed application is validly Apple-signed, but the ASAR metadata disagrees with its unpacked native addon:

  • logical path: Contents/Resources/app.asar/build/Release/macos_notifications.node
  • declared SHA-256: 2bdeeaadd90f17021d17ebe3d514973de33430168ac3b824762d08fd83ee32c3
  • observed SHA-256: 7823556ce50de454b5338f99723c27082c6d40543da7e597c3d20c5668d9172c
  • unpacked: true

The mismatch is important evidence, but it blocks persistent investigate-versions before any workspace or comparison evidence is produced.

User problem

A single known or packaging-generated mismatch prevents analysis of thousands of unaffected entries. Operators must choose between abandoning the comparison and bypassing REA with less rigorous tools.

The desired behavior is not to ignore integrity. It is to preserve the contradiction, quarantine the affected subtree, and continue only where conclusions remain valid.

Proposal

Add an explicit policy:

  • fail: current default; stop at the first integrity mismatch;
  • record-and-continue: requires explicit per-call approval and operator policy.

For record-and-continue:

  1. Emit an observed integrity-contradiction record containing logical path, declared identity, observed identity, entry kind, unpacked state, parent artifact, and provenance.
  2. Mark the entry content as untrusted/mismatched rather than verified.
  3. Prevent equivalence claims for the entry or any conclusion that requires its declared identity.
  4. Continue traversing and comparing unaffected siblings.
  5. Mark comparisons involving the mismatched entry as changed, contradiction, or unknown—never unchanged.
  6. Add the contradiction to the Evidence v2 bundle and persistent investigation workspace.
  7. Preserve both original metadata and observed bytes; never rewrite the artifact.
  8. Support multiple bounded mismatches with explicit limits.

Trust propagation

Define how mismatch state propagates:

  • the mismatched occurrence is untrusted;
  • its observed content may be hashed and analyzed as observed-untrusted evidence;
  • descendants derived from mismatched container bytes inherit a limitation;
  • unrelated siblings retain their own verified status;
  • a valid outer code signature is independent corroborating evidence, not proof that ASAR-declared hashes match.

Acceptance criteria

  • Default behavior remains fail closed.
  • record-and-continue requires explicit approval and configured operator policy.
  • Integrity contradictions contain declared and observed hashes plus logical location.
  • Unaffected siblings can still be inventoried and compared.
  • The mismatched entry can never contribute to an unchanged/equivalent verdict.
  • Trust/limitation propagation is deterministic and documented.
  • Persistent investigation workspaces checkpoint the contradiction and can resume safely.
  • compare_artifacts and find_changed_behavior preserve contradiction versus unknown semantics.
  • Mismatch count, bytes, depth, and traversal remain bounded.
  • Tests cover embedded entries, .asar.unpacked entries, nested containers, multiple mismatches, signed outer bundles, resume, and strict default behavior.
  • CLI and MCP return the same typed evidence and limitations.

Non-goals

  • Silently disabling integrity checks.
  • Repairing or resigning artifacts.
  • Treating a valid outer signature as proof of inner metadata consistency.
  • Claiming causal behavior from a static mismatch.

Relationships

  • #100 defines the typed structured error/evidence contract.
  • #111 covers diagnostic details currently lost through sanitization.
  • #99 may expose contradiction records as resources.
Originally created by @morluto on GitHub (Jul 13, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/112 ## Summary Add an explicit fail-closed-by-default policy that can record an artifact integrity mismatch as evidence and continue analyzing unaffected portions of the artifact graph without treating the mismatched entry as trusted or equivalent. ## Current behavior REA correctly verifies Electron ASAR integrity metadata and currently aborts the entire inventory or cross-version investigation at the first mismatch. With Linzumi.app, the installed application is validly Apple-signed, but the ASAR metadata disagrees with its unpacked native addon: - logical path: Contents/Resources/app.asar/build/Release/macos_notifications.node - declared SHA-256: 2bdeeaadd90f17021d17ebe3d514973de33430168ac3b824762d08fd83ee32c3 - observed SHA-256: 7823556ce50de454b5338f99723c27082c6d40543da7e597c3d20c5668d9172c - unpacked: true The mismatch is important evidence, but it blocks persistent investigate-versions before any workspace or comparison evidence is produced. ## User problem A single known or packaging-generated mismatch prevents analysis of thousands of unaffected entries. Operators must choose between abandoning the comparison and bypassing REA with less rigorous tools. The desired behavior is not to ignore integrity. It is to preserve the contradiction, quarantine the affected subtree, and continue only where conclusions remain valid. ## Proposal Add an explicit policy: - fail: current default; stop at the first integrity mismatch; - record-and-continue: requires explicit per-call approval and operator policy. For record-and-continue: 1. Emit an observed integrity-contradiction record containing logical path, declared identity, observed identity, entry kind, unpacked state, parent artifact, and provenance. 2. Mark the entry content as untrusted/mismatched rather than verified. 3. Prevent equivalence claims for the entry or any conclusion that requires its declared identity. 4. Continue traversing and comparing unaffected siblings. 5. Mark comparisons involving the mismatched entry as changed, contradiction, or unknown—never unchanged. 6. Add the contradiction to the Evidence v2 bundle and persistent investigation workspace. 7. Preserve both original metadata and observed bytes; never rewrite the artifact. 8. Support multiple bounded mismatches with explicit limits. ## Trust propagation Define how mismatch state propagates: - the mismatched occurrence is untrusted; - its observed content may be hashed and analyzed as observed-untrusted evidence; - descendants derived from mismatched container bytes inherit a limitation; - unrelated siblings retain their own verified status; - a valid outer code signature is independent corroborating evidence, not proof that ASAR-declared hashes match. ## Acceptance criteria - [ ] Default behavior remains fail closed. - [ ] record-and-continue requires explicit approval and configured operator policy. - [ ] Integrity contradictions contain declared and observed hashes plus logical location. - [ ] Unaffected siblings can still be inventoried and compared. - [ ] The mismatched entry can never contribute to an unchanged/equivalent verdict. - [ ] Trust/limitation propagation is deterministic and documented. - [ ] Persistent investigation workspaces checkpoint the contradiction and can resume safely. - [ ] compare_artifacts and find_changed_behavior preserve contradiction versus unknown semantics. - [ ] Mismatch count, bytes, depth, and traversal remain bounded. - [ ] Tests cover embedded entries, .asar.unpacked entries, nested containers, multiple mismatches, signed outer bundles, resume, and strict default behavior. - [ ] CLI and MCP return the same typed evidence and limitations. ## Non-goals - Silently disabling integrity checks. - Repairing or resigning artifacts. - Treating a valid outer signature as proof of inner metadata consistency. - Claiming causal behavior from a static mismatch. ## Relationships - #100 defines the typed structured error/evidence contract. - #111 covers diagnostic details currently lost through sanitization. - #99 may expose contradiction records as resources.
Author
Owner

@morluto commented on GitHub (Jul 17, 2026):

Completed on current main. Artifact trust and integrity handling includes explicit approval, deterministic contradiction handling, quarantine of mismatched nested containers, preservation of siblings, bounded mismatch reporting, CLI flags, and checkpoint/reuse/CAS behavior. The artifact MCP and investigation workspace suites cover these outcomes end to end.

<!-- gh-comment-id:5001542097 --> @morluto commented on GitHub (Jul 17, 2026): Completed on current main. Artifact trust and integrity handling includes explicit approval, deterministic contradiction handling, quarantine of mismatched nested containers, preservation of siblings, bounded mismatch reporting, CLI flags, and checkpoint/reuse/CAS behavior. The artifact MCP and investigation workspace suites cover these outcomes end to end.
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#72
No description provided.