[GH-ISSUE #111] Do not discard actionable local diagnostics when sanitizing CLI and MCP errors #70

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

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

Problem

REA 1.3.0 sanitizes expected local analysis failures so aggressively that it removes the information needed to diagnose or remediate them. REA is a local analysis tool, and artifact paths, mismatch locations, declared digests, and calculated digests are core reverse-engineering evidence rather than incidental implementation details.

A concrete regression occurs with the Linzumi Electron ASAR.

In REA 1.2.0, artifact inventory reported:

Artifact inventory_artifact failed: integrity at build/Release/macos_notifications.node
(declared_sha256=2bdeeaadd90f17021d17ebe3d514973de33430168ac3b824762d08fd83ee32c3,
 calculated_sha256=7823556ce50de454b5338f99723c27082c6d40543da7e597c3d20c5668d9172c,
 unpacked=true)

In REA 1.3.0, even --format json --full-output returns only:

{
  "error": "Analysis failed",
  "category": "integrity_mismatch",
  "message": "Artifact is invalid or has changed. Get a fresh copy and try again."
}

The logical path, both hashes, and unpacked status are lost. This also makes behavior inconsistent: investigate-versions currently surfaces the underlying detailed ArtifactOperationError for the same mismatch while direct inventory-artifact hides it.

Why this matters

The missing fields answer the important questions:

  • Which entry disagreed?
  • Was it embedded or .asar.unpacked?
  • Is the declared identity known?
  • Is this one changed native addon or broad archive corruption?
  • Can the operator compare it against an installed, signed, or historical artifact?

Without them, an agent cannot distinguish a packaging metadata defect from unexpected mutation and cannot cite the mismatch as evidence.

Proposal

Preserve actionable local diagnostic details in structured output. For this error, return at least:

{
  "error": "ArtifactOperationError",
  "category": "integrity_mismatch",
  "message": "Artifact integrity metadata does not match the observed entry.",
  "details": {
    "logical_path": "build/Release/macos_notifications.node",
    "declared_sha256": "...",
    "calculated_sha256": "...",
    "unpacked": true
  }
}

If redaction is still desired for outputs that may leave the machine, make it explicit and configurable rather than destructive:

  • local CLI default: full non-secret diagnostics;
  • MCP: structured details with path normalization or aliases where configured;
  • optional --redact-paths / policy flag for operators who need it;
  • never redact content digests, entry kind, mismatch classification, or other evidence required to reproduce the finding.

Sensitive values such as credentials, environment values, request authorization headers, and captured content still require separate redaction. That concern should not classify local artifact paths and SHA-256 identities as secrets by default.

Acceptance criteria

  • Direct CLI inventory exposes the mismatched logical path, declared/calculated digest, and unpacked state.
  • --full-output never contains less diagnostic information than the ordinary structured result.
  • CLI, MCP, and investigate-versions use the same typed error projection.
  • Error details are available in machine-readable structured output, not only prose.
  • Optional path redaction preserves stable aliases and all non-path evidence.
  • Tests cover embedded and unpacked ASAR integrity mismatches.
  • Tests prove genuinely sensitive fields remain redacted.

Related: #100 tracks consistent outputSchema, structuredContent, and typed error details across the MCP surface. This issue specifically covers the 1.3.0 diagnostic-loss regression and local-first redaction policy.

Originally created by @morluto on GitHub (Jul 13, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/111 ## Problem REA 1.3.0 sanitizes expected local analysis failures so aggressively that it removes the information needed to diagnose or remediate them. REA is a local analysis tool, and artifact paths, mismatch locations, declared digests, and calculated digests are core reverse-engineering evidence rather than incidental implementation details. A concrete regression occurs with the Linzumi Electron ASAR. In REA 1.2.0, artifact inventory reported: ```text Artifact inventory_artifact failed: integrity at build/Release/macos_notifications.node (declared_sha256=2bdeeaadd90f17021d17ebe3d514973de33430168ac3b824762d08fd83ee32c3, calculated_sha256=7823556ce50de454b5338f99723c27082c6d40543da7e597c3d20c5668d9172c, unpacked=true) ``` In REA 1.3.0, even `--format json --full-output` returns only: ```json { "error": "Analysis failed", "category": "integrity_mismatch", "message": "Artifact is invalid or has changed. Get a fresh copy and try again." } ``` The logical path, both hashes, and unpacked status are lost. This also makes behavior inconsistent: `investigate-versions` currently surfaces the underlying detailed `ArtifactOperationError` for the same mismatch while direct `inventory-artifact` hides it. ## Why this matters The missing fields answer the important questions: - Which entry disagreed? - Was it embedded or `.asar.unpacked`? - Is the declared identity known? - Is this one changed native addon or broad archive corruption? - Can the operator compare it against an installed, signed, or historical artifact? Without them, an agent cannot distinguish a packaging metadata defect from unexpected mutation and cannot cite the mismatch as evidence. ## Proposal Preserve actionable local diagnostic details in structured output. For this error, return at least: ```json { "error": "ArtifactOperationError", "category": "integrity_mismatch", "message": "Artifact integrity metadata does not match the observed entry.", "details": { "logical_path": "build/Release/macos_notifications.node", "declared_sha256": "...", "calculated_sha256": "...", "unpacked": true } } ``` If redaction is still desired for outputs that may leave the machine, make it explicit and configurable rather than destructive: - local CLI default: full non-secret diagnostics; - MCP: structured details with path normalization or aliases where configured; - optional `--redact-paths` / policy flag for operators who need it; - never redact content digests, entry kind, mismatch classification, or other evidence required to reproduce the finding. Sensitive values such as credentials, environment values, request authorization headers, and captured content still require separate redaction. That concern should not classify local artifact paths and SHA-256 identities as secrets by default. ## Acceptance criteria - [ ] Direct CLI inventory exposes the mismatched logical path, declared/calculated digest, and unpacked state. - [ ] `--full-output` never contains less diagnostic information than the ordinary structured result. - [ ] CLI, MCP, and `investigate-versions` use the same typed error projection. - [ ] Error details are available in machine-readable structured output, not only prose. - [ ] Optional path redaction preserves stable aliases and all non-path evidence. - [ ] Tests cover embedded and unpacked ASAR integrity mismatches. - [ ] Tests prove genuinely sensitive fields remain redacted. Related: #100 tracks consistent `outputSchema`, `structuredContent`, and typed error details across the MCP surface. This issue specifically covers the 1.3.0 diagnostic-loss regression and local-first redaction policy.
bsakaguchi 2026-10-15 18:20:48 +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#70
No description provided.