Repository navigation
fix(artifacts): report which path constraint failed - #847
Merged
Merged
Conversation
Artifact path failures told callers to "inspect the reported path" but
reported none: `ArtifactReaderFailure` messages such as
`Artifact path collision: ...` were dropped when converted to
`ArtifactOperationError`, leaving only `{ operation, reason: "path" }`.
Carry the failure message into `details.detail` for artifact tools and
JavaScript application analysis. Name both spellings in case-fold
collisions and include the JSON-escaped input in unsafe and
non-normalized path messages.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Oct 7, 2026
9 tasks done
darsrc
pushed a commit
to darsrc/rea
that referenced
this pull request
Oct 10, 2026
Artifact path failures told callers to "inspect the reported path" but
reported none: `ArtifactReaderFailure` messages such as
`Artifact path collision: ...` were dropped when converted to
`ArtifactOperationError`, leaving only `{ operation, reason: "path" }`.
Carry the failure message into `details.detail` for artifact tools and
JavaScript application analysis. Name both spellings in case-fold
collisions and include the JSON-escaped input in unsafe and
non-normalized path messages.
This was referenced Oct 20, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When an archive fails REA's path-safety checks, the caller-visible error says to inspect a path that it never reports:
{ "code": "artifact_operation_failed", "message": "Artifact contains an unsafe or conflicting internal path. Inspect the reported path and correct the artifact before retrying.", "details": { "operation": "analyze_javascript_application", "reason": "path" } }The specific failure, for example
Artifact path collision: a.js, exists as theArtifactReaderFailuremessage. However,ArtifactProvider.translateFailureandJavaScriptApplicationServicedrop it when they build theArtifactOperationError. With 87 throw sites, the reason alone (path,format,limit, …) can't tell an analyst which entry or constraint failed. AGENTS.md: "Diagnostics should identify the failed constraint and the target… generic catches must not erase actionable validation details."Real archives can trigger this. Case-fold collisions such as
Main.js+main.jsare legal in ZIP/ASAR files built on case-sensitive filesystems, and REA deliberately rejects them (fail-closed). This PR leaves that policy unchanged; it only makes the rejection explain itself.Fix
ArtifactOperationErrorgets an optionaldetail, which both conversion sites fill fromArtifactReaderFailure.message. The error projection emits it asdetails.detail.export_web_scriptsalready preserved its message this way.Artifact path collision: main.js differs only in case from Main.js(both spellings).Artifact path is absolute or unsafe: "a\\b.js"andArtifact path is not normalized: "../escape". The input is JSON-escaped because such names can contain NUL or control characters.After the change:
Contract / behavior changes
artifact_operation_failederrors gain an optionaldetails.detailstring. The published error contract already defines that variant'sdetailsas an open record, sodocs:checkpasses with no regeneration.details, is unchanged.Verification
tests/boundary/providers/native/artifactProvider.failureDetail.test.tsuses real ZIPs (Main.js+main.js, anda\b.js) through the publicArtifactProviderandprojectAnalysisError. Both cases fail onmainand pass here.analyze-javascript-applicationandinspect-artifacton crafted ASARs (case collision, backslash, NUL, and/in a name) now report adetailfor each.npm run check:changed(33 files / 333 tests),npm run check:fast, andnpm run docs:checkpassed.No Hopper/Ghidra/IDA involvement.
🤖 Generated with Claude Code