fix(artifacts): bind ASAR interpretation to owned snapshots

Verify captured container bytes against their inventoried digest before listing or reading packed members. Isolate per-reader ASAR metadata, preserve original unpacked companions, and retain complete inventories when snapshot cleanup fails.
This commit is contained in:
morluto
2026-10-10 06:20:28 +08:00
parent bf934d5592
commit d79317cda0
7 changed files with 323 additions and 78 deletions
@@ -122,7 +122,7 @@ describe("JavaScript artifact ingestion content identities", () => {
}
});
it("retains native filesystem errors for outer IO classification", async () => {
it("retains filesystem error context in typed IO failures", async () => {
const { archive } = await fixture();
const snapshot = await scanArtifactInventory(archive);
await rm(archive);
@@ -130,7 +130,7 @@ describe("JavaScript artifact ingestion content identities", () => {
try {
await expect(
readJavaScriptArtifactFiles(reader, snapshot),
).rejects.toMatchObject({ code: "ENOENT" });
).rejects.toMatchObject({ reason: "io", cause: { code: "ENOENT" } });
} finally {
await reader.close();
}