Merge remote-tracking branch 'origin/main' into feat/pkg-inventory
# Conflicts: # docs/product-catalog.json # docs/verification/managed-conformance-manifest.json # skills/reverse-engineer-anything/SKILL.md # src/generatedMcpToolCatalog.ts
This commit is contained in:
@@ -110,6 +110,32 @@ describe("ASAR path boundary", () => {
|
||||
});
|
||||
|
||||
describe("ASAR inventory freshness", () => {
|
||||
it("preserves missing-container I/O as an I/O failure instead of malformed format", async () => {
|
||||
const root = await createTestTempDirectory("rea-asar-missing-");
|
||||
const reader = new AsarArtifactReader(join(root, "missing.asar"));
|
||||
|
||||
await expect(
|
||||
reader.entries()[Symbol.asyncIterator]().next(),
|
||||
).rejects.toMatchObject({
|
||||
reason: "io",
|
||||
message: expect.stringContaining("ENOENT"),
|
||||
});
|
||||
});
|
||||
|
||||
it("preserves an ASAR path replaced by a directory as a filesystem failure", async () => {
|
||||
const fixture = await archiveFixture();
|
||||
await rm(fixture.archive);
|
||||
await mkdir(fixture.archive);
|
||||
const reader = new AsarArtifactReader(fixture.archive);
|
||||
|
||||
await expect(
|
||||
reader.entries()[Symbol.asyncIterator]().next(),
|
||||
).rejects.toMatchObject({
|
||||
reason: "io",
|
||||
message: expect.stringContaining("EISDIR"),
|
||||
});
|
||||
});
|
||||
|
||||
it.each(["archive", "bundle"] as const)(
|
||||
"refreshes a replaced archive when inventorying a %s target",
|
||||
async (target) => {
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
import { writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
import { expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
ProviderProcessSupervisor,
|
||||
spawnOwnedProviderProcess,
|
||||
} from "../../../src/process/ProviderProcess.js";
|
||||
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
|
||||
|
||||
it.skipIf(process.platform === "win32")(
|
||||
"rejects a FIFO replacement without blocking the owner process",
|
||||
async () => {
|
||||
const root = await createTestTempDirectory("rea-directory-fifo-");
|
||||
await writeFile(join(root, "module.js"), "export {}\n");
|
||||
const probe = fileURLToPath(
|
||||
new URL("../../fixtures/directoryReaderFifoProbe.mjs", import.meta.url),
|
||||
);
|
||||
const readerModule = fileURLToPath(
|
||||
new URL(
|
||||
"../../../dist/artifacts/DirectoryArtifactReader.js",
|
||||
import.meta.url,
|
||||
),
|
||||
);
|
||||
const launch = await spawnOwnedProviderProcess({
|
||||
command: process.execPath,
|
||||
arguments: [probe, readerModule, root],
|
||||
runId: `rea-fifo-probe-${randomUUID()}`,
|
||||
cwd: tmpdir(),
|
||||
hostEnvironment: process.env,
|
||||
});
|
||||
const supervisor = new ProviderProcessSupervisor({
|
||||
...launch,
|
||||
ownsProcessLifetime: true,
|
||||
});
|
||||
|
||||
try {
|
||||
const closed = await supervisor.waitForOutputClose(2_000);
|
||||
expect(closed).toBe(true);
|
||||
expect(supervisor.snapshot().stdout.text.trim()).toBe("integrity");
|
||||
} finally {
|
||||
const stopped = await supervisor.stop({
|
||||
terminationGraceMs: 100,
|
||||
killGraceMs: 500,
|
||||
});
|
||||
expect(stopped.status).not.toBe("incomplete");
|
||||
}
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user