fix(artifacts): report encrypted archive entries as unsupported extraction
extract_artifact on a ZIP containing a password-protected entry failed the whole extraction with "Artifact is invalid or has changed. Get a fresh copy" and named only an opaque occurrence ID. The archive was intact; REA does not decrypt entries, so complete extraction is unsupported for this target. Raise AnalysisUnsupportedTargetError naming the encrypted entry's path. Other unextractable occurrences keep their format failure but now name the logical path alongside the occurrence ID. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8e74c9c62f
commit
de43da71ae
@@ -89,6 +89,22 @@ it("preserves encrypted-member and corrupt-CRC observations", async () => {
|
||||
hash_status: "unavailable",
|
||||
}),
|
||||
);
|
||||
// REA does not decrypt entries, so complete extraction is unsupported.
|
||||
const extractionRoot = join(root, "encrypted-output");
|
||||
expect(
|
||||
await new ArtifactProvider()
|
||||
.createClient(encryptedTarget.value)
|
||||
.execute("extract_artifact", { output_root: extractionRoot }),
|
||||
).toMatchObject({
|
||||
ok: false,
|
||||
error: {
|
||||
_tag: "AnalysisUnsupportedTargetError",
|
||||
reason: expect.stringContaining("Archive entry secret.txt is encrypted"),
|
||||
},
|
||||
});
|
||||
await expect(readFile(extractionRoot)).rejects.toMatchObject({
|
||||
code: "ENOENT",
|
||||
});
|
||||
|
||||
const corruptPath = join(root, "corrupt-crc.zip");
|
||||
const corruptWriter = new ZipWriter(new Uint8ArrayWriter());
|
||||
|
||||
Reference in New Issue
Block a user