mirror of
https://github.com/morluto/rea.git
synced 2026-11-14 02:32:54 +00:00
test: remove per-test deadlines owned by project policy
Explicit deadlines at or below the project deadline only shortened it: a literal 30-second value also disabled the coverage scaling, which timed out wide-capacity regressions on main. Workloads above the built deadline use the long-running tag. Deadlines derived from an operation budget remain. Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
62798fa8b0
commit
46728ca41d
278 files changed
+1528
-1953
No files matched your search
@@ -191,7 +191,7 @@ fi`,
|
||||
await Promise.allSettled([inspection, closing]);
|
||||
await provider.close();
|
||||
}
|
||||
}, 15_000);
|
||||
});
|
||||
|
||||
it("fails closed when adb exits successfully without a recognized version", async () => {
|
||||
const stdout = `unexpected adb output ${"x".repeat(700)}\n`;
|
||||
|
||||
@@ -58,7 +58,6 @@ it.skipIf(process.platform === "win32")(
|
||||
await fixture.cleanup([probe]);
|
||||
}
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
|
||||
let commands = new ApktoolCommandCleanup();
|
||||
|
||||
@@ -284,133 +284,137 @@ const REVIEWED_CLIENT_IDS = [
|
||||
"amp",
|
||||
];
|
||||
|
||||
it("resolves selected-environment paths and scopes without external catalog readers", async () => {
|
||||
const home = await createTestTempDirectory("rea-registration-catalog-");
|
||||
const processes = createTestProcessRegistry();
|
||||
try {
|
||||
await mkdir(join(home, "config"));
|
||||
const child = await processes.run(
|
||||
process.execPath,
|
||||
["--import", "tsx", "--input-type=module", "--eval", CATALOG_PROGRAM],
|
||||
{
|
||||
timeoutMs: 50_000,
|
||||
env: {
|
||||
PATH: process.env.PATH,
|
||||
SystemRoot: process.env.SystemRoot,
|
||||
WINDIR: process.env.WINDIR,
|
||||
TMPDIR: process.env.TMPDIR,
|
||||
TMP: process.env.TMP,
|
||||
TEMP: process.env.TEMP,
|
||||
HOME: home,
|
||||
USERPROFILE: home,
|
||||
XDG_CONFIG_HOME: join(home, "config"),
|
||||
XDG_DATA_HOME: join(home, "data"),
|
||||
XDG_CACHE_HOME: join(home, "cache"),
|
||||
XDG_STATE_HOME: join(home, "state"),
|
||||
APPDATA: join(home, "appdata"),
|
||||
LOCALAPPDATA: join(home, "localappdata"),
|
||||
it(
|
||||
"resolves selected-environment paths and scopes without external catalog readers",
|
||||
{ tags: ["long-running"] },
|
||||
async () => {
|
||||
const home = await createTestTempDirectory("rea-registration-catalog-");
|
||||
const processes = createTestProcessRegistry();
|
||||
try {
|
||||
await mkdir(join(home, "config"));
|
||||
const child = await processes.run(
|
||||
process.execPath,
|
||||
["--import", "tsx", "--input-type=module", "--eval", CATALOG_PROGRAM],
|
||||
{
|
||||
timeoutMs: 50_000,
|
||||
env: {
|
||||
PATH: process.env.PATH,
|
||||
SystemRoot: process.env.SystemRoot,
|
||||
WINDIR: process.env.WINDIR,
|
||||
TMPDIR: process.env.TMPDIR,
|
||||
TMP: process.env.TMP,
|
||||
TEMP: process.env.TEMP,
|
||||
HOME: home,
|
||||
USERPROFILE: home,
|
||||
XDG_CONFIG_HOME: join(home, "config"),
|
||||
XDG_DATA_HOME: join(home, "data"),
|
||||
XDG_CACHE_HOME: join(home, "cache"),
|
||||
XDG_STATE_HOME: join(home, "state"),
|
||||
APPDATA: join(home, "appdata"),
|
||||
LOCALAPPDATA: join(home, "localappdata"),
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
expect(child.exitCode, child.stderr).toBe(0);
|
||||
const result = catalogObservationsSchema.parse(JSON.parse(child.stdout));
|
||||
assertKiloNativeLayers(result, home);
|
||||
expect(result.empty.ok).toBe(true);
|
||||
if (!result.empty.ok) throw new Error(result.empty.error.message);
|
||||
expect(result.empty.value.map((client) => client.id)).toEqual(
|
||||
REVIEWED_CLIENT_IDS,
|
||||
);
|
||||
expect(result.layeredKilo.ok).toBe(true);
|
||||
if (!result.layeredKilo.ok)
|
||||
throw new Error(result.layeredKilo.error.message);
|
||||
const kiloLayers = [
|
||||
"config.json",
|
||||
"kilo.json",
|
||||
"kilo.jsonc",
|
||||
"opencode.json",
|
||||
"opencode.jsonc",
|
||||
].map((name) => join(home, "layered", "kilo", name));
|
||||
expect(result.layeredKilo.value[0]).toMatchObject({
|
||||
configPath: kiloLayers.at(-1),
|
||||
configPaths: kiloLayers,
|
||||
});
|
||||
expect(result.layeredOpenCode.ok).toBe(true);
|
||||
if (!result.layeredOpenCode.ok)
|
||||
throw new Error(result.layeredOpenCode.error.message);
|
||||
expect(result.layeredOpenCode.value[0]?.configPaths).toEqual(
|
||||
["config.json", "opencode.json", "opencode.jsonc"].map((name) =>
|
||||
join(home, "config", "opencode", name),
|
||||
),
|
||||
);
|
||||
expect(result.explicit.ok).toBe(true);
|
||||
if (!result.explicit.ok) throw new Error(result.explicit.error.message);
|
||||
expect(result.explicit.value.map((client) => client.id)).toEqual([
|
||||
"codex",
|
||||
"amp",
|
||||
"gemini-cli",
|
||||
"fx",
|
||||
"windsurf",
|
||||
]);
|
||||
expect(result.explicit.value[0]?.configPath).toBe(
|
||||
join(home, "selected-codex", "config.toml"),
|
||||
);
|
||||
expect(
|
||||
result.explicit.value.find((client) => client.id === "fx"),
|
||||
).toMatchObject({ format: "fx", privateProfile: true });
|
||||
expect(result.detected.ok).toBe(true);
|
||||
if (!result.detected.ok) throw new Error(result.detected.error.message);
|
||||
expect(result.detected.value.map((client) => client.id)).toEqual([
|
||||
"claude-code",
|
||||
"cursor",
|
||||
"amp",
|
||||
]);
|
||||
expect(result.project.ok, JSON.stringify(result.project)).toBe(true);
|
||||
if (!result.project.ok) throw new Error(result.project.error.message);
|
||||
expect(result.project.value[0]?.format).toBe("copilot_cli_project");
|
||||
expect(
|
||||
result.project.value.map(({ configPath, scope }) => ({
|
||||
configPath,
|
||||
scope,
|
||||
})),
|
||||
).toEqual([
|
||||
{
|
||||
configPath: join(home, "project", ".github", "mcp.json"),
|
||||
scope: "project",
|
||||
},
|
||||
...(process.platform === "win32"
|
||||
? []
|
||||
: [
|
||||
{
|
||||
configPath: join(home, "project", ".kilocode", "kilo.jsonc"),
|
||||
scope: "project",
|
||||
},
|
||||
]),
|
||||
{
|
||||
configPath: join(home, "project", "opencode.jsonc"),
|
||||
scope: "project",
|
||||
},
|
||||
]);
|
||||
for (const refused of [
|
||||
result.onlyGlobal,
|
||||
result.defaultProject,
|
||||
result.projectAmp,
|
||||
result.unknown,
|
||||
...(result.blockedCandidate === null ? [] : [result.blockedCandidate]),
|
||||
result.unknownDetection,
|
||||
]) {
|
||||
expect(refused.ok).toBe(false);
|
||||
if (refused.ok) throw new Error("Expected preflight refusal.");
|
||||
expect(refused.error.tag).toBe("ConfigurationError");
|
||||
);
|
||||
expect(child.exitCode, child.stderr).toBe(0);
|
||||
const result = catalogObservationsSchema.parse(JSON.parse(child.stdout));
|
||||
assertKiloNativeLayers(result, home);
|
||||
expect(result.empty.ok).toBe(true);
|
||||
if (!result.empty.ok) throw new Error(result.empty.error.message);
|
||||
expect(result.empty.value.map((client) => client.id)).toEqual(
|
||||
REVIEWED_CLIENT_IDS,
|
||||
);
|
||||
expect(result.layeredKilo.ok).toBe(true);
|
||||
if (!result.layeredKilo.ok)
|
||||
throw new Error(result.layeredKilo.error.message);
|
||||
const kiloLayers = [
|
||||
"config.json",
|
||||
"kilo.json",
|
||||
"kilo.jsonc",
|
||||
"opencode.json",
|
||||
"opencode.jsonc",
|
||||
].map((name) => join(home, "layered", "kilo", name));
|
||||
expect(result.layeredKilo.value[0]).toMatchObject({
|
||||
configPath: kiloLayers.at(-1),
|
||||
configPaths: kiloLayers,
|
||||
});
|
||||
expect(result.layeredOpenCode.ok).toBe(true);
|
||||
if (!result.layeredOpenCode.ok)
|
||||
throw new Error(result.layeredOpenCode.error.message);
|
||||
expect(result.layeredOpenCode.value[0]?.configPaths).toEqual(
|
||||
["config.json", "opencode.json", "opencode.jsonc"].map((name) =>
|
||||
join(home, "config", "opencode", name),
|
||||
),
|
||||
);
|
||||
expect(result.explicit.ok).toBe(true);
|
||||
if (!result.explicit.ok) throw new Error(result.explicit.error.message);
|
||||
expect(result.explicit.value.map((client) => client.id)).toEqual([
|
||||
"codex",
|
||||
"amp",
|
||||
"gemini-cli",
|
||||
"fx",
|
||||
"windsurf",
|
||||
]);
|
||||
expect(result.explicit.value[0]?.configPath).toBe(
|
||||
join(home, "selected-codex", "config.toml"),
|
||||
);
|
||||
expect(
|
||||
result.explicit.value.find((client) => client.id === "fx"),
|
||||
).toMatchObject({ format: "fx", privateProfile: true });
|
||||
expect(result.detected.ok).toBe(true);
|
||||
if (!result.detected.ok) throw new Error(result.detected.error.message);
|
||||
expect(result.detected.value.map((client) => client.id)).toEqual([
|
||||
"claude-code",
|
||||
"cursor",
|
||||
"amp",
|
||||
]);
|
||||
expect(result.project.ok, JSON.stringify(result.project)).toBe(true);
|
||||
if (!result.project.ok) throw new Error(result.project.error.message);
|
||||
expect(result.project.value[0]?.format).toBe("copilot_cli_project");
|
||||
expect(
|
||||
result.project.value.map(({ configPath, scope }) => ({
|
||||
configPath,
|
||||
scope,
|
||||
})),
|
||||
).toEqual([
|
||||
{
|
||||
configPath: join(home, "project", ".github", "mcp.json"),
|
||||
scope: "project",
|
||||
},
|
||||
...(process.platform === "win32"
|
||||
? []
|
||||
: [
|
||||
{
|
||||
configPath: join(home, "project", ".kilocode", "kilo.jsonc"),
|
||||
scope: "project",
|
||||
},
|
||||
]),
|
||||
{
|
||||
configPath: join(home, "project", "opencode.jsonc"),
|
||||
scope: "project",
|
||||
},
|
||||
]);
|
||||
for (const refused of [
|
||||
result.onlyGlobal,
|
||||
result.defaultProject,
|
||||
result.projectAmp,
|
||||
result.unknown,
|
||||
...(result.blockedCandidate === null ? [] : [result.blockedCandidate]),
|
||||
result.unknownDetection,
|
||||
]) {
|
||||
expect(refused.ok).toBe(false);
|
||||
if (refused.ok) throw new Error("Expected preflight refusal.");
|
||||
expect(refused.error.tag).toBe("ConfigurationError");
|
||||
}
|
||||
expect(result.cancelled).toMatchObject({
|
||||
ok: false,
|
||||
error: { tag: "AnalysisCancelledError" },
|
||||
});
|
||||
} finally {
|
||||
await processes.shutdown();
|
||||
await rm(home, { recursive: true, force: true });
|
||||
}
|
||||
expect(result.cancelled).toMatchObject({
|
||||
ok: false,
|
||||
error: { tag: "AnalysisCancelledError" },
|
||||
});
|
||||
} finally {
|
||||
await processes.shutdown();
|
||||
await rm(home, { recursive: true, force: true });
|
||||
}
|
||||
}, 60_000);
|
||||
},
|
||||
);
|
||||
|
||||
const assertKiloNativeLayers = (
|
||||
result: z.infer<typeof catalogObservationsSchema>,
|
||||
|
||||
@@ -353,7 +353,6 @@ it.skipIf(process.platform !== "linux")(
|
||||
spy.mockRestore();
|
||||
}
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
|
||||
describe.skipIf(process.platform !== "linux")(
|
||||
@@ -416,7 +415,7 @@ describe.skipIf(process.platform !== "linux")(
|
||||
expect(
|
||||
JSON.parse(await readFile(join(output, "capture.json"), "utf8")),
|
||||
).toEqual(JSON.parse(JSON.stringify(evidence)));
|
||||
}, 30_000);
|
||||
});
|
||||
|
||||
it("keeps a baseline-only capture when cancelled before any checkpoint", async () => {
|
||||
const { root, home, environment } = await fixture();
|
||||
@@ -517,7 +516,7 @@ describe.skipIf(process.platform !== "linux")(
|
||||
after: expect.objectContaining({ sha256: sha256("count=2\n") }),
|
||||
}),
|
||||
]);
|
||||
}, 30_000);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
@@ -589,7 +588,7 @@ describe.skipIf(process.platform !== "linux")(
|
||||
{ name: "stop", trigger: "stop" },
|
||||
{ name: "exit", trigger: "exit" },
|
||||
]);
|
||||
}, 30_000);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
@@ -644,7 +643,6 @@ describe.skipIf(process.platform !== "linux")(
|
||||
details: { cleanup: "incomplete", resources: [statePath] },
|
||||
});
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -678,7 +676,7 @@ describe.skipIf(process.platform !== "linux")(
|
||||
expect(await readdir(root)).toEqual(
|
||||
expect.arrayContaining(["group-term", "setsid-term"]),
|
||||
);
|
||||
}, 30_000);
|
||||
});
|
||||
|
||||
it("stops the application gracefully and removes retained content when the session fails", async () => {
|
||||
const { root, home, environment } = await fixture();
|
||||
@@ -703,7 +701,7 @@ describe.skipIf(process.platform !== "linux")(
|
||||
expect(await readdir(root)).toEqual(
|
||||
expect.arrayContaining(["group-term", "setsid-term"]),
|
||||
);
|
||||
}, 30_000);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
@@ -774,7 +772,7 @@ describe.skipIf(process.platform !== "linux")(
|
||||
expect(capture.limitations).toContainEqual(
|
||||
expect.stringMatching(/^The window list could not be read in [34] /u),
|
||||
);
|
||||
}, 30_000);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -693,25 +693,31 @@ describe("ReleaseExposureReader limits", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("counts members past the package entry cap and marks coverage unknown", async () => {
|
||||
const root = await createTestTempDirectory("rea-release-exposure-entries-");
|
||||
const files = [
|
||||
...Array.from({ length: 4096 }, (_, index) => ({
|
||||
path: `f${String(index)}.bin`,
|
||||
bytes: Buffer.from("x"),
|
||||
})),
|
||||
{ path: "hidden.js.map", bytes: Buffer.from("{not json") },
|
||||
{ path: "secret.txt", bytes: Buffer.from("hello\n") },
|
||||
];
|
||||
await writeFile(join(root, "app.dll"), dotnetBundleFixture(files).bytes);
|
||||
const scanned = await inspect(root);
|
||||
expect(scanned.coverage).toBe("unknown");
|
||||
expect(scanned.source_maps.skipped).toBeGreaterThan(0);
|
||||
expect(scanned.text_members.skipped).toBeGreaterThan(0);
|
||||
expect(scanned.omitted.map((item) => item.subject)).toEqual(
|
||||
expect.arrayContaining(["source maps", "text members"]),
|
||||
);
|
||||
}, 60_000);
|
||||
it(
|
||||
"counts members past the package entry cap and marks coverage unknown",
|
||||
{ tags: ["long-running"] },
|
||||
async () => {
|
||||
const root = await createTestTempDirectory(
|
||||
"rea-release-exposure-entries-",
|
||||
);
|
||||
const files = [
|
||||
...Array.from({ length: 4096 }, (_, index) => ({
|
||||
path: `f${String(index)}.bin`,
|
||||
bytes: Buffer.from("x"),
|
||||
})),
|
||||
{ path: "hidden.js.map", bytes: Buffer.from("{not json") },
|
||||
{ path: "secret.txt", bytes: Buffer.from("hello\n") },
|
||||
];
|
||||
await writeFile(join(root, "app.dll"), dotnetBundleFixture(files).bytes);
|
||||
const scanned = await inspect(root);
|
||||
expect(scanned.coverage).toBe("unknown");
|
||||
expect(scanned.source_maps.skipped).toBeGreaterThan(0);
|
||||
expect(scanned.text_members.skipped).toBeGreaterThan(0);
|
||||
expect(scanned.omitted.map((item) => item.subject)).toEqual(
|
||||
expect.arrayContaining(["source maps", "text members"]),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
it("does not drop native images before the service samples them", async () => {
|
||||
const root = await createTestTempDirectory("rea-release-exposure-natives-");
|
||||
@@ -1500,28 +1506,34 @@ describe("ReleaseExposureReader member allowances", () => {
|
||||
},
|
||||
);
|
||||
|
||||
it("keeps a later source map readable after many large binary members", async () => {
|
||||
const root = await createTestTempDirectory("rea-release-exposure-budget-");
|
||||
const binary = Buffer.alloc(MAX_RELEASE_EXPOSURE_TEXT_MEMBER_BYTES);
|
||||
const oversizedScript = Buffer.alloc(
|
||||
MAX_RELEASE_EXPOSURE_TEXT_MEMBER_BYTES + 1,
|
||||
0x20,
|
||||
);
|
||||
await writeFile(
|
||||
join(root, "app.asar"),
|
||||
asarArchive([
|
||||
...Array.from({ length: 160 }, (_, index) => ({
|
||||
name: `a${String(index)}.bin`,
|
||||
bytes: binary,
|
||||
})),
|
||||
{ name: "b.js", bytes: oversizedScript },
|
||||
{ name: "z.js.map", bytes: embeddedSourceMap() },
|
||||
]),
|
||||
);
|
||||
const scanned = await inspect(join(root, "app.asar"));
|
||||
expect(scanned.source_maps).toMatchObject({ embedded: 1, skipped: 1 });
|
||||
expect(scanned.extractable.readable_members).toBe(162);
|
||||
}, 60_000);
|
||||
it(
|
||||
"keeps a later source map readable after many large binary members",
|
||||
{ tags: ["long-running"] },
|
||||
async () => {
|
||||
const root = await createTestTempDirectory(
|
||||
"rea-release-exposure-budget-",
|
||||
);
|
||||
const binary = Buffer.alloc(MAX_RELEASE_EXPOSURE_TEXT_MEMBER_BYTES);
|
||||
const oversizedScript = Buffer.alloc(
|
||||
MAX_RELEASE_EXPOSURE_TEXT_MEMBER_BYTES + 1,
|
||||
0x20,
|
||||
);
|
||||
await writeFile(
|
||||
join(root, "app.asar"),
|
||||
asarArchive([
|
||||
...Array.from({ length: 160 }, (_, index) => ({
|
||||
name: `a${String(index)}.bin`,
|
||||
bytes: binary,
|
||||
})),
|
||||
{ name: "b.js", bytes: oversizedScript },
|
||||
{ name: "z.js.map", bytes: embeddedSourceMap() },
|
||||
]),
|
||||
);
|
||||
const scanned = await inspect(join(root, "app.asar"));
|
||||
expect(scanned.source_maps).toMatchObject({ embedded: 1, skipped: 1 });
|
||||
expect(scanned.extractable.readable_members).toBe(162);
|
||||
},
|
||||
);
|
||||
|
||||
it("reports an oversized linker map as a debug companion wherever it ships", async () => {
|
||||
const root = await createTestTempDirectory("rea-release-exposure-link-");
|
||||
|
||||
@@ -366,7 +366,7 @@ describe("Apple asset catalog and Interface Builder concurrency", () => {
|
||||
},
|
||||
});
|
||||
expect(result.catalogs).toHaveLength(1);
|
||||
}, 5_000);
|
||||
});
|
||||
|
||||
it("cancels the Interface Builder analysis and reports a catalog failure", async () => {
|
||||
let cancelled = false;
|
||||
|
||||
@@ -90,7 +90,6 @@ it.each(["", "h:"])(
|
||||
await browser.close();
|
||||
}
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
|
||||
it.each(["progress", "enable", "terminal", "complete"] as const)(
|
||||
|
||||
@@ -1367,5 +1367,5 @@ describe("XML namespace resolution ordering and capacity", () => {
|
||||
expect(result.urls).toEqual([
|
||||
approvedHref(elements.length, `${origin}/deep`),
|
||||
]);
|
||||
}, 30_000);
|
||||
});
|
||||
});
|
||||
@@ -86,7 +86,7 @@ describe("runSolveHelper", () => {
|
||||
stop.abort();
|
||||
await Promise.allSettled([started, solved]);
|
||||
}
|
||||
}, 30_000);
|
||||
});
|
||||
|
||||
it("records a helper stopped at its deadline without a report as a failed solve of unknown cost, its cleanup known", async () => {
|
||||
const runner = await fakeAgentEnvSolves([SOLVE]);
|
||||
@@ -109,7 +109,7 @@ describe("runSolveHelper", () => {
|
||||
});
|
||||
expect(report.error).toMatch(/stopped \(SIG[A-Z]+\) without a report/u);
|
||||
expect(retained).toHaveLength(0);
|
||||
}, 30_000);
|
||||
});
|
||||
|
||||
it("keeps a helper whose cleanup failed, so closing can retry it, and reports what is left", async () => {
|
||||
const runner = await fakeAgentEnvSolves([SOLVE]);
|
||||
@@ -146,7 +146,7 @@ describe("runSolveHelper", () => {
|
||||
status: "verified-cleanup",
|
||||
});
|
||||
retained[0]?.dispose();
|
||||
}, 30_000);
|
||||
});
|
||||
});
|
||||
|
||||
it("retains a reported sandbox on failed removal, then retries that exact sandbox", async () => {
|
||||
@@ -184,7 +184,7 @@ it("retains a reported sandbox on failed removal, then retries that exact sandbo
|
||||
expect(failure.cleanupIncomplete).toBe(false);
|
||||
expect(failure.cleanupResources).toEqual([]);
|
||||
retained[0]?.dispose();
|
||||
}, 30_000);
|
||||
});
|
||||
|
||||
it("retains a completed report if cancellation arrives during final cleanup", async () => {
|
||||
const runner = await fakeAgentEnvSolves([SOLVE]);
|
||||
@@ -211,7 +211,7 @@ it("retains a completed report if cancellation arrives during final cleanup", as
|
||||
cause: reason,
|
||||
report: { outcome: "passed", turns: 3, usd: 0.1 },
|
||||
});
|
||||
}, 30_000);
|
||||
});
|
||||
|
||||
it("retains an unrecognized sandbox root entry and retries after it is repaired", async () => {
|
||||
const runner = await fakeAgentEnvSolves([SOLVE]);
|
||||
@@ -240,7 +240,7 @@ it("retains an unrecognized sandbox root entry and retries after it is repaired"
|
||||
if (!(failure instanceof ProviderCleanupError)) throw failure;
|
||||
expect(failure.cleanupIncomplete).toBe(false);
|
||||
retained[0]?.dispose();
|
||||
}, 30_000);
|
||||
});
|
||||
|
||||
it("retains root cleanup and the spawn failure when admission fails", async () => {
|
||||
const runner = await fakeAgentEnvSolves([SOLVE]);
|
||||
@@ -274,4 +274,4 @@ it("retains root cleanup and the spawn failure when admission fails", async () =
|
||||
expect(failure.cleanupIncomplete).toBe(false);
|
||||
expect(failure.cleanupResources).toEqual([]);
|
||||
retained[0]?.dispose();
|
||||
}, 30_000);
|
||||
});
|
||||
@@ -157,7 +157,7 @@ describe.skipIf(process.platform !== "linux")("runDesktopSession", () => {
|
||||
await expect(runDesktopSession(plan)).rejects.toBe(failure);
|
||||
expect(checkpoints).toEqual(["stop", "exit"]);
|
||||
expect(vi.mocked(terminateTokenOwnedProcesses)).toHaveBeenCalledTimes(1);
|
||||
}, 30_000);
|
||||
});
|
||||
|
||||
it("launches the application without the agent environment's variables", async () => {
|
||||
const root = await createTestTempDirectory("desktop-session-env-");
|
||||
@@ -184,7 +184,7 @@ describe.skipIf(process.platform !== "linux")("runDesktopSession", () => {
|
||||
"REA_PROCESS_RUN_ID",
|
||||
]),
|
||||
);
|
||||
}, 30_000);
|
||||
});
|
||||
});
|
||||
|
||||
describe.skipIf(process.platform !== "linux")(
|
||||
@@ -209,7 +209,7 @@ describe.skipIf(process.platform !== "linux")(
|
||||
entry.pid !== outcome.session.launch_pid,
|
||||
).length,
|
||||
).toBeGreaterThan(0);
|
||||
}, 30_000);
|
||||
});
|
||||
|
||||
it("does not take samples whose window list was unreadable as the application having exited", async () => {
|
||||
const root = await createTestTempDirectory("desktop-session-unread-");
|
||||
@@ -230,7 +230,7 @@ describe.skipIf(process.platform !== "linux")(
|
||||
expect(outcome.session.end_reason).toBe("application_exited");
|
||||
expect(outcome.unreadableWindowSamples).toBe(4);
|
||||
expect(samples).toBeGreaterThanOrEqual(6);
|
||||
}, 30_000);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
@@ -385,7 +385,7 @@ describe.skipIf(process.platform === "win32")(
|
||||
expect(stderr).not.toContain("runtime 0 of 400");
|
||||
expect(Buffer.byteLength(stderr)).toBeLessThanOrEqual(8 * 1024);
|
||||
expect(stderr_truncated).toBe(true);
|
||||
}, 30_000);
|
||||
});
|
||||
|
||||
it("gives each checkpoint the titles the app's own windows have shown so far", async () => {
|
||||
const root = await createTestTempDirectory("desktop-session-titles-");
|
||||
@@ -422,7 +422,7 @@ describe.skipIf(process.platform === "win32")(
|
||||
});
|
||||
|
||||
expect(seen.at(-1)).toEqual(["today.txt - Notes"]);
|
||||
}, 30_000);
|
||||
});
|
||||
|
||||
it("launches the app with glibc's fatal errors sent to its stderr, not its terminal", async () => {
|
||||
const root = await createTestTempDirectory("desktop-session-libc-");
|
||||
@@ -435,6 +435,6 @@ describe.skipIf(process.platform === "win32")(
|
||||
);
|
||||
|
||||
expect(outcome.session.stderr).toContain("LIBC_FATAL_STDERR_=1");
|
||||
}, 30_000);
|
||||
});
|
||||
},
|
||||
);
|
||||
@@ -272,34 +272,30 @@ describe("compositions serving could not keep", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it(
|
||||
"indexes a wide body's repeated values once, and only when a string is left to compose",
|
||||
{ timeout: 5_000 },
|
||||
() => {
|
||||
const n = 8_000;
|
||||
const shared = `https://shared.example.test/${"x".repeat(64)}`;
|
||||
const body: JsonObject = Object.fromEntries(
|
||||
Array.from({ length: n }, (_, index) => [`e${String(index)}`, shared]),
|
||||
);
|
||||
const rules: FieldRule[] = Array.from({ length: n }, (_, index) => ({
|
||||
field: `e${String(index)}`,
|
||||
rule: "echo",
|
||||
}));
|
||||
let reads = 0;
|
||||
const counted = new Proxy(body, {
|
||||
get: (target, key) => {
|
||||
reads += 1;
|
||||
return Reflect.get(target, key);
|
||||
},
|
||||
});
|
||||
const composer = createdComposer(counted, rules, []);
|
||||
expect(reads).toBe(0);
|
||||
expect(composer("e0")).toBeUndefined();
|
||||
expect(composer("e1")).toBeUndefined();
|
||||
// One read per source to index them, once, and one per composed field.
|
||||
expect(reads).toBe(n + 2);
|
||||
},
|
||||
);
|
||||
it("indexes a wide body's repeated values once, and only when a string is left to compose", () => {
|
||||
const n = 8_000;
|
||||
const shared = `https://shared.example.test/${"x".repeat(64)}`;
|
||||
const body: JsonObject = Object.fromEntries(
|
||||
Array.from({ length: n }, (_, index) => [`e${String(index)}`, shared]),
|
||||
);
|
||||
const rules: FieldRule[] = Array.from({ length: n }, (_, index) => ({
|
||||
field: `e${String(index)}`,
|
||||
rule: "echo",
|
||||
}));
|
||||
let reads = 0;
|
||||
const counted = new Proxy(body, {
|
||||
get: (target, key) => {
|
||||
reads += 1;
|
||||
return Reflect.get(target, key);
|
||||
},
|
||||
});
|
||||
const composer = createdComposer(counted, rules, []);
|
||||
expect(reads).toBe(0);
|
||||
expect(composer("e0")).toBeUndefined();
|
||||
expect(composer("e1")).toBeUndefined();
|
||||
// One read per source to index them, once, and one per composed field.
|
||||
expect(reads).toBe(n + 2);
|
||||
});
|
||||
|
||||
describe("slug spellings", () => {
|
||||
it("spells & in a slug part as the word only when the part says so", () => {
|
||||
|
||||
@@ -85,38 +85,34 @@ describe("members a created field derives from", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it(
|
||||
"finds the echoed members a wide body's constants hold without searching each text for each",
|
||||
{ timeout: 5_000 },
|
||||
() => {
|
||||
const n = 8_000;
|
||||
const body = Object.fromEntries(
|
||||
Array.from({ length: n }, (_, index) => [
|
||||
`e${String(index)}`,
|
||||
`echoed value ${String(index).padStart(6, "0")}`,
|
||||
]),
|
||||
);
|
||||
const constants = Object.fromEntries(
|
||||
Array.from({ length: n }, (_, index) => [
|
||||
`k${String(index)}`,
|
||||
`constant text ${String(index)}`,
|
||||
]),
|
||||
);
|
||||
const result = create(
|
||||
{
|
||||
id: 1,
|
||||
...body,
|
||||
...constants,
|
||||
last: `see ${body[`e${String(n - 1)}`]!}`,
|
||||
},
|
||||
body,
|
||||
() => [],
|
||||
);
|
||||
expect(result.fixed).toEqual([
|
||||
{ member: `e${String(n - 1)}`, sent: body[`e${String(n - 1)}`] },
|
||||
]);
|
||||
},
|
||||
);
|
||||
it("finds the echoed members a wide body's constants hold without searching each text for each", () => {
|
||||
const n = 8_000;
|
||||
const body = Object.fromEntries(
|
||||
Array.from({ length: n }, (_, index) => [
|
||||
`e${String(index)}`,
|
||||
`echoed value ${String(index).padStart(6, "0")}`,
|
||||
]),
|
||||
);
|
||||
const constants = Object.fromEntries(
|
||||
Array.from({ length: n }, (_, index) => [
|
||||
`k${String(index)}`,
|
||||
`constant text ${String(index)}`,
|
||||
]),
|
||||
);
|
||||
const result = create(
|
||||
{
|
||||
id: 1,
|
||||
...body,
|
||||
...constants,
|
||||
last: `see ${body[`e${String(n - 1)}`]!}`,
|
||||
},
|
||||
body,
|
||||
() => [],
|
||||
);
|
||||
expect(result.fixed).toEqual([
|
||||
{ member: `e${String(n - 1)}`, sent: body[`e${String(n - 1)}`] },
|
||||
]);
|
||||
});
|
||||
|
||||
describe("coincidences no member derives a created field from", () => {
|
||||
it.each([
|
||||
|
||||
@@ -922,66 +922,58 @@ it.each<[string, string, boolean]>([
|
||||
expect(prefixRelated(right, left)).toBe(related);
|
||||
});
|
||||
|
||||
it(
|
||||
"explains many copied and slugged fields of a wide body without searching it again for each",
|
||||
{ timeout: 5_000 },
|
||||
() => {
|
||||
const n = 8_000;
|
||||
const value = (index: number) => `value-${String(index).padStart(6, "0")}`;
|
||||
const nested = Object.fromEntries(
|
||||
Array.from({ length: n }, (_, index) => [
|
||||
`g${String(index)}`,
|
||||
{ s: value(index) },
|
||||
]),
|
||||
);
|
||||
const copies = Object.fromEntries(
|
||||
Array.from({ length: n }, (_, index) => [
|
||||
`c${String(index)}`,
|
||||
value(index),
|
||||
]),
|
||||
);
|
||||
const copied = explainCreate(created({ id: 1, ...copies }, nested));
|
||||
expect(ruleFor(copied.rules, `c${String(n - 1)}`)).toEqual({
|
||||
field: `c${String(n - 1)}`,
|
||||
rule: "copy",
|
||||
from: `/g${String(n - 1)}/s`,
|
||||
});
|
||||
// Strings no member slugs to, in a body of many members, each tried as a slug.
|
||||
const flat = Object.fromEntries(
|
||||
Array.from({ length: n }, (_, index) => [
|
||||
`m${String(index)}`,
|
||||
`Member ${String(index)}`,
|
||||
]),
|
||||
);
|
||||
const others = Object.fromEntries(
|
||||
Array.from({ length: n }, (_, index) => [
|
||||
`o${String(index)}`,
|
||||
`x${String(index)}`,
|
||||
]),
|
||||
);
|
||||
const slugged = explainCreate(
|
||||
created({ id: 1, ...others, s: "member-7" }, flat),
|
||||
);
|
||||
expect(ruleFor(slugged.rules, "s")).toEqual({
|
||||
field: "s",
|
||||
rule: "slug",
|
||||
from: "m7",
|
||||
});
|
||||
},
|
||||
);
|
||||
it("explains many copied and slugged fields of a wide body without searching it again for each", () => {
|
||||
const n = 8_000;
|
||||
const value = (index: number) => `value-${String(index).padStart(6, "0")}`;
|
||||
const nested = Object.fromEntries(
|
||||
Array.from({ length: n }, (_, index) => [
|
||||
`g${String(index)}`,
|
||||
{ s: value(index) },
|
||||
]),
|
||||
);
|
||||
const copies = Object.fromEntries(
|
||||
Array.from({ length: n }, (_, index) => [
|
||||
`c${String(index)}`,
|
||||
value(index),
|
||||
]),
|
||||
);
|
||||
const copied = explainCreate(created({ id: 1, ...copies }, nested));
|
||||
expect(ruleFor(copied.rules, `c${String(n - 1)}`)).toEqual({
|
||||
field: `c${String(n - 1)}`,
|
||||
rule: "copy",
|
||||
from: `/g${String(n - 1)}/s`,
|
||||
});
|
||||
// Strings no member slugs to, in a body of many members, each tried as a slug.
|
||||
const flat = Object.fromEntries(
|
||||
Array.from({ length: n }, (_, index) => [
|
||||
`m${String(index)}`,
|
||||
`Member ${String(index)}`,
|
||||
]),
|
||||
);
|
||||
const others = Object.fromEntries(
|
||||
Array.from({ length: n }, (_, index) => [
|
||||
`o${String(index)}`,
|
||||
`x${String(index)}`,
|
||||
]),
|
||||
);
|
||||
const slugged = explainCreate(
|
||||
created({ id: 1, ...others, s: "member-7" }, flat),
|
||||
);
|
||||
expect(ruleFor(slugged.rules, "s")).toEqual({
|
||||
field: "s",
|
||||
rule: "slug",
|
||||
from: "m7",
|
||||
});
|
||||
});
|
||||
|
||||
it(
|
||||
"searches a wide request body for a copied value in linear time",
|
||||
{ timeout: 5_000 },
|
||||
() => {
|
||||
// Shifting each value off the queue made one fruitless search over 500,000 zeros take about a minute.
|
||||
const wide = Array.from({ length: 500_000 }, () => 0);
|
||||
const result = explainCreate(
|
||||
created({ id: 1, note: "not anywhere in the body" }, { items: wide }),
|
||||
);
|
||||
expect(ruleFor(result.rules, "note")).toBeUndefined();
|
||||
},
|
||||
);
|
||||
it("searches a wide request body for a copied value in linear time", () => {
|
||||
// Shifting each value off the queue made one fruitless search over 500,000 zeros take about a minute.
|
||||
const wide = Array.from({ length: 500_000 }, () => 0);
|
||||
const result = explainCreate(
|
||||
created({ id: 1, note: "not anywhere in the body" }, { items: wide }),
|
||||
);
|
||||
expect(ruleFor(result.rules, "note")).toBeUndefined();
|
||||
});
|
||||
|
||||
const ID = (n: number): string =>
|
||||
`00000000-0000-4000-8000-${String(n).padStart(12, "0")}`;
|
||||
|
||||
@@ -275,7 +275,7 @@ describe("call path topology and capacity", () => {
|
||||
expect(result.status).toBe("unknown");
|
||||
expect(result.search_scope.exhaustive).toBe(false);
|
||||
expect(result.limitations).toEqual(limitations);
|
||||
}, 30_000);
|
||||
});
|
||||
|
||||
it("retains every shortest path through merging branches and cycles", () => {
|
||||
const result = run([
|
||||
|
||||
@@ -124,7 +124,7 @@ describe("private receiver field ownership", () => {
|
||||
status: "literal",
|
||||
value: 1,
|
||||
});
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
it.each([
|
||||
[
|
||||
|
||||
@@ -1076,7 +1076,7 @@ describe("property mutation collection on minified bundles", () => {
|
||||
{ value: { status: "unknown" } },
|
||||
],
|
||||
});
|
||||
}, 30000);
|
||||
});
|
||||
});
|
||||
|
||||
describe("results of methods on an escaped receiver", () => {
|
||||
@@ -1112,7 +1112,7 @@ describe("results of methods on an escaped receiver", () => {
|
||||
status: "array",
|
||||
items: [{ value: { status: "unknown" } }],
|
||||
});
|
||||
}, 30000);
|
||||
});
|
||||
});
|
||||
|
||||
it.each([
|
||||
|
||||
@@ -26,7 +26,7 @@ describe("bounded paths through dynamic selectors and class origins", () => {
|
||||
value: 42,
|
||||
});
|
||||
expect(performance.now() - start).toBeLessThan(2000);
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
it("retains effects through class getter aliases while bounding loop paths", () => {
|
||||
expect(
|
||||
@@ -65,7 +65,7 @@ describe("bounded paths through dynamic selectors and class origins", () => {
|
||||
"unknown",
|
||||
);
|
||||
expect(performance.now() - start).toBeLessThan(2000);
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
it("retains shared-child mutations reached by dynamic-key alias loops", () => {
|
||||
expect(
|
||||
@@ -103,7 +103,7 @@ describe("bounded member path propagation", () => {
|
||||
);
|
||||
expect(callable.returnSites[0]?.value.status).toBe("unknown");
|
||||
expect(performance.now() - start).toBeLessThan(2000);
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
it("preserves Array prototype effects through an otherwise unknown alias", () => {
|
||||
expect(
|
||||
@@ -125,7 +125,7 @@ describe("bounded member path propagation", () => {
|
||||
),
|
||||
).toEqual({ status: "literal", value: 3 });
|
||||
expect(performance.now() - start).toBeLessThan(2000);
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
// A dynamic self alias escapes its repeated prefix, which conservatively
|
||||
// covers every child; a static key without that slot keeps the literal.
|
||||
@@ -144,7 +144,6 @@ describe("bounded member path propagation", () => {
|
||||
expect(performance.now() - start).toBeLessThan(2000);
|
||||
expect(value?.status).toBe(status);
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
it.each([
|
||||
@@ -196,7 +195,6 @@ describe("bounded member path propagation", () => {
|
||||
expect(performance.now() - start).toBeLessThan(2000);
|
||||
expect(value?.status).toBe(status);
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
it.each([
|
||||
@@ -282,7 +280,7 @@ describe("reference lifetimes across calls and shallow copies", () => {
|
||||
`const alias0 = [1]; ${declarations} const ${pattern} = alias9; return alias0[0];`,
|
||||
);
|
||||
expect(performance.now() - start).toBeLessThan(2000);
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
it("bounds conditional shallow-copy traversal while retaining shared children", () => {
|
||||
const declarations = Array.from(
|
||||
@@ -297,7 +295,7 @@ describe("reference lifetimes across calls and shallow copies", () => {
|
||||
)?.status,
|
||||
).toBe("unknown");
|
||||
expect(performance.now() - start).toBeLessThan(2000);
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
it.each([
|
||||
["child: {}", "child: {}", "literal"],
|
||||
|
||||
@@ -580,7 +580,7 @@ describe("managed artifact coded indexes", () => {
|
||||
(attribute) => attribute.type_name === "Fixture.LookupAttribute",
|
||||
),
|
||||
).toBe(true);
|
||||
}, 30_000);
|
||||
});
|
||||
});
|
||||
|
||||
it.each([false, true])(
|
||||
|
||||
@@ -40,7 +40,7 @@ it("rejects a long interior separator run without pathological backtracking", as
|
||||
killSignal: "SIGKILL",
|
||||
},
|
||||
);
|
||||
}, 20_000);
|
||||
});
|
||||
it("distinguishes raw bytes, empty code and malformed UTF-8", () => {
|
||||
const bytes = Uint8Array.from([0xff, 0x00]);
|
||||
const decoded = decodeEvmBytecodeCarrier(bytes, "raw");
|
||||
|
||||
@@ -5,6 +5,7 @@ import { validateNativeAotReport } from "./NativeAotReport.js";
|
||||
|
||||
it.skipIf(!process.env.JAVA_HOME || !process.env.GSON_JAR)(
|
||||
"accepts transaction reports from the Java producer with controlled APIs",
|
||||
{ tags: ["long-running"] },
|
||||
async () => {
|
||||
const output = await runOwnedCommand(
|
||||
{
|
||||
@@ -37,5 +38,4 @@ it.skipIf(!process.env.JAVA_HOME || !process.env.GSON_JAR)(
|
||||
}),
|
||||
).toBeNull();
|
||||
},
|
||||
90_000,
|
||||
);
|
||||
@@ -781,7 +781,6 @@ describe("attached IDA regex supervision", () => {
|
||||
await client.close();
|
||||
}
|
||||
},
|
||||
15_000,
|
||||
);
|
||||
it("bounds regex matching without caller cancellation and preserves subsequent searches", async () => {
|
||||
const { producer, client } = await fixture();
|
||||
@@ -827,7 +826,7 @@ describe("attached IDA regex supervision", () => {
|
||||
} finally {
|
||||
await client.close();
|
||||
}
|
||||
}, 15_000);
|
||||
});
|
||||
});
|
||||
|
||||
describe("attached IDA function failure handling", () => {
|
||||
|
||||
@@ -45,6 +45,7 @@ it.each([
|
||||
"utf8-cleanup-retry",
|
||||
] as const)(
|
||||
"authenticates the physical worker transfer at the source-analysis port: %s",
|
||||
{ tags: ["long-running"] },
|
||||
async (mode) => {
|
||||
const controller = new AbortController();
|
||||
const cancellation = { reason: "cancel after physical transfer failure" };
|
||||
@@ -153,5 +154,4 @@ it.each([
|
||||
if (root === undefined) throw new Error("Worker root was not acquired");
|
||||
await expect(lstat(root)).rejects.toMatchObject({ code: "ENOENT" });
|
||||
},
|
||||
40_000,
|
||||
);
|
||||
@@ -1089,14 +1089,18 @@ it("leaves GNU property rows unknown behind a compressed note section", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("admits a hostile section table without rescanning every span", () => {
|
||||
const started = performance.now();
|
||||
const image = readElfHardening(
|
||||
elfHardeningFixture({ disjointNoteSections: 65000 }),
|
||||
);
|
||||
expect(performance.now() - started).toBeLessThan(5000);
|
||||
expect(findRow(image.rows, "cet_ibt_shstk").state).toBe("unknown");
|
||||
}, 60000);
|
||||
it(
|
||||
"admits a hostile section table without rescanning every span",
|
||||
{ tags: ["long-running"] },
|
||||
() => {
|
||||
const started = performance.now();
|
||||
const image = readElfHardening(
|
||||
elfHardeningFixture({ disjointNoteSections: 65000 }),
|
||||
);
|
||||
expect(performance.now() - started).toBeLessThan(5000);
|
||||
expect(findRow(image.rows, "cet_ibt_shstk").state).toBe("unknown");
|
||||
},
|
||||
);
|
||||
|
||||
it("cites a non-ASCII import name by its source bytes", () => {
|
||||
const name = "__\u00ff_chk";
|
||||
|
||||
@@ -921,45 +921,49 @@ describe("ELF section lookups", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("resolves a full slot budget against a near-maximal section table in one pass", async () => {
|
||||
const base = elf64PieInitializers();
|
||||
const slots = MAX_NATIVE_INITIALIZER_ENTRIES;
|
||||
const payload = Buffer.alloc(slots * 8);
|
||||
for (let slot = 0; slot < slots; slot += 1)
|
||||
payload.writeBigUInt64LE(0x100n, slot * 8);
|
||||
// Allocated, unnamed sections that cover every slot and target address.
|
||||
const extra = Buffer.alloc((0xffff - 12) * 64);
|
||||
for (let at = 0; at < extra.length; at += 64) {
|
||||
extra.writeUInt32LE(1, at + 4);
|
||||
extra.writeBigUInt64LE(2n, at + 8);
|
||||
extra.writeBigUInt64LE(0x100000n, at + 32);
|
||||
}
|
||||
const bytes = Buffer.concat([
|
||||
base,
|
||||
payload,
|
||||
base.subarray(0x800, 0x800 + 12 * 64),
|
||||
extra,
|
||||
]);
|
||||
bytes.writeBigUInt64LE(BigInt(base.length + payload.length), 40);
|
||||
bytes.writeUInt16LE(0xffff, 60);
|
||||
// The single PT_LOAD maps the whole file; DT_INIT_ARRAY moves to the payload.
|
||||
bytes.writeBigUInt64LE(BigInt(bytes.length), 64 + 32);
|
||||
bytes.writeBigUInt64LE(BigInt(bytes.length), 64 + 40);
|
||||
bytes.writeBigUInt64LE(BigInt(base.length), 0x300 + 2 * 16 + 8);
|
||||
bytes.writeBigUInt64LE(BigInt(slots * 8), 0x300 + 3 * 16 + 8);
|
||||
const started = performance.now();
|
||||
const report = await read(bytes);
|
||||
// A per-lookup header walk is about 4e9 comparisons here; the index is a few hundred ms.
|
||||
expect(performance.now() - started).toBeLessThan(10_000);
|
||||
expect(report.coverage.examined_entries).toBe(slots);
|
||||
const slot = report.entries.find((entry) => entry.kind === "init_array");
|
||||
expect(slot).toMatchObject({
|
||||
value_va: "0x100",
|
||||
slot_section: null,
|
||||
section: { name: ".text" },
|
||||
symbol: { name: "ctor_a" },
|
||||
});
|
||||
}, 180_000);
|
||||
it(
|
||||
"resolves a full slot budget against a near-maximal section table in one pass",
|
||||
{ tags: ["long-running"] },
|
||||
async () => {
|
||||
const base = elf64PieInitializers();
|
||||
const slots = MAX_NATIVE_INITIALIZER_ENTRIES;
|
||||
const payload = Buffer.alloc(slots * 8);
|
||||
for (let slot = 0; slot < slots; slot += 1)
|
||||
payload.writeBigUInt64LE(0x100n, slot * 8);
|
||||
// Allocated, unnamed sections that cover every slot and target address.
|
||||
const extra = Buffer.alloc((0xffff - 12) * 64);
|
||||
for (let at = 0; at < extra.length; at += 64) {
|
||||
extra.writeUInt32LE(1, at + 4);
|
||||
extra.writeBigUInt64LE(2n, at + 8);
|
||||
extra.writeBigUInt64LE(0x100000n, at + 32);
|
||||
}
|
||||
const bytes = Buffer.concat([
|
||||
base,
|
||||
payload,
|
||||
base.subarray(0x800, 0x800 + 12 * 64),
|
||||
extra,
|
||||
]);
|
||||
bytes.writeBigUInt64LE(BigInt(base.length + payload.length), 40);
|
||||
bytes.writeUInt16LE(0xffff, 60);
|
||||
// The single PT_LOAD maps the whole file; DT_INIT_ARRAY moves to the payload.
|
||||
bytes.writeBigUInt64LE(BigInt(bytes.length), 64 + 32);
|
||||
bytes.writeBigUInt64LE(BigInt(bytes.length), 64 + 40);
|
||||
bytes.writeBigUInt64LE(BigInt(base.length), 0x300 + 2 * 16 + 8);
|
||||
bytes.writeBigUInt64LE(BigInt(slots * 8), 0x300 + 3 * 16 + 8);
|
||||
const started = performance.now();
|
||||
const report = await read(bytes);
|
||||
// A per-lookup header walk is about 4e9 comparisons here; the index is a few hundred ms.
|
||||
expect(performance.now() - started).toBeLessThan(10_000);
|
||||
expect(report.coverage.examined_entries).toBe(slots);
|
||||
const slot = report.entries.find((entry) => entry.kind === "init_array");
|
||||
expect(slot).toMatchObject({
|
||||
value_va: "0x100",
|
||||
slot_section: null,
|
||||
section: { name: ".text" },
|
||||
symbol: { name: "ctor_a" },
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
describe("Mach-O symbol tables", () => {
|
||||
|
||||
@@ -207,7 +207,6 @@ describe("execFileOutput", () => {
|
||||
await execution;
|
||||
}
|
||||
},
|
||||
10_000,
|
||||
);
|
||||
|
||||
it.skipIf(process.platform === "win32")(
|
||||
@@ -562,7 +561,7 @@ describe.skipIf(process.platform === "win32")(
|
||||
killFailure = await stopOwnedDescendant(pid, finished);
|
||||
}
|
||||
if (killFailure !== undefined) throw killFailure;
|
||||
}, 15_000);
|
||||
});
|
||||
|
||||
it("keeps scratch files until an inherited-pipe descendant closes them", async () => {
|
||||
const directory = await createTestTempDirectory("rea-exec-inherited-");
|
||||
|
||||
@@ -291,7 +291,7 @@ it("records no exit code when no exit was observed", async () => {
|
||||
result.finalization?.exit_code,
|
||||
"an unobserved exit has no code to record",
|
||||
).toBeNull();
|
||||
}, 10_000);
|
||||
});
|
||||
|
||||
it("records every delivery result and publishes attempts incrementally", async () => {
|
||||
snapshots.length = 0;
|
||||
@@ -422,7 +422,7 @@ it("stops waiting for a hung delivery once the exit is observed", async () => {
|
||||
},
|
||||
]);
|
||||
expect(exit.signal, "the observed exit is kept").toBe(0);
|
||||
}, 10_000);
|
||||
});
|
||||
|
||||
it("retains a thrown signal error as an unverified delivery reason", async () => {
|
||||
const fake = fakeTerminal(
|
||||
@@ -491,7 +491,7 @@ it("stops waiting when the escalation delivery never settles and no exit arrives
|
||||
reason: "delivery did not settle within 1000 ms",
|
||||
});
|
||||
expect(result.finalization?.elapsed_ms, "no exit was observed").toBeNull();
|
||||
}, 10_000);
|
||||
});
|
||||
|
||||
const activeTimers = (): number =>
|
||||
process.getActiveResourcesInfo().filter((name) => name === "Timeout").length;
|
||||
|
||||
@@ -785,7 +785,7 @@ it("answers an oversized sessionless POST promptly instead of stalling on the pr
|
||||
{ type: "text", text: "still served" },
|
||||
]);
|
||||
await client.close();
|
||||
}, 20_000);
|
||||
});
|
||||
|
||||
it("closes the connection after a reply sent before the request body was read, on a keep-alive client", async () => {
|
||||
const { served } = await start();
|
||||
|
||||
@@ -80,7 +80,7 @@ it("recovers expanded ASAR listing admission on the same MCP connection independ
|
||||
} finally {
|
||||
await client.close();
|
||||
}
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
it("advertises exact contracts and recovers a full large-index archive over one MCP connection", async () => {
|
||||
const root = await createTestTempDirectory("rea-runtime-settings-");
|
||||
@@ -214,7 +214,7 @@ it("advertises exact contracts and recovers a full large-index archive over one
|
||||
} finally {
|
||||
await client.close();
|
||||
}
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
it.each(["0", "2147483648"])(
|
||||
"keeps invalid JADX launch timeout %s local and repairable through MCP",
|
||||
@@ -279,7 +279,6 @@ it.each(["0", "2147483648"])(
|
||||
await client.close();
|
||||
}
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
it("lowers, restores and seeds the native matching allowance over MCP", async () => {
|
||||
@@ -427,7 +426,7 @@ it("lowers, restores and seeds the native matching allowance over MCP", async ()
|
||||
} finally {
|
||||
await invalid.client.close();
|
||||
}
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
it("starts with invalid runtime seeds and recovers ASAR and capture work on the same connection", async () => {
|
||||
const root = await createTestTempDirectory("rea-invalid-runtime-seeds-");
|
||||
@@ -517,7 +516,7 @@ it("starts with invalid runtime seeds and recovers ASAR and capture work on the
|
||||
} finally {
|
||||
await client.close();
|
||||
}
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
it.skipIf(process.platform === "win32")(
|
||||
"ignores Windows ChangeTime launch settings on other hosts",
|
||||
@@ -539,5 +538,4 @@ it.skipIf(process.platform === "win32")(
|
||||
await client.close();
|
||||
}
|
||||
},
|
||||
30000,
|
||||
);
|
||||
@@ -44,7 +44,6 @@ cliTest(
|
||||
).toBe(createHash("sha256").update(name).digest("hex"));
|
||||
expect(evidence.normalized_result.coverage.status).toBe("complete");
|
||||
},
|
||||
45000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
|
||||
@@ -171,7 +171,6 @@ describe.skipIf(process.platform !== "darwin")(
|
||||
}
|
||||
}
|
||||
},
|
||||
45_000,
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -534,7 +534,7 @@ it("preserves complete line-comment source-map URLs through CLI and MCP", async
|
||||
);
|
||||
}
|
||||
expect((await analyzeThroughStdioMcp(root)).graph).toEqual(graph);
|
||||
}, 20_000);
|
||||
});
|
||||
|
||||
it("resolves source-map URL paths once without changing their declarations", async () => {
|
||||
const root = await createTestTempDirectory("rea-source-map-encoding-cli-");
|
||||
@@ -654,7 +654,7 @@ it("resolves source-map URL paths once without changing their declarations", asy
|
||||
),
|
||||
).toBe(false);
|
||||
expect((await analyzeThroughStdioMcp(root)).graph).toEqual(graph);
|
||||
}, 20_000);
|
||||
});
|
||||
|
||||
describe("JavaScript application path CLI", () => {
|
||||
it("retains the admitted relative CLI selection and canonical artifact identity", async () => {
|
||||
@@ -683,7 +683,7 @@ describe("JavaScript application path CLI", () => {
|
||||
},
|
||||
subject: { local_path: absolute.value.subject?.local_path },
|
||||
});
|
||||
}, 20_000);
|
||||
});
|
||||
|
||||
it("returns the self-import graph consistently through CLI and stdio MCP", async () => {
|
||||
const root = await createTestTempDirectory(
|
||||
@@ -706,7 +706,7 @@ describe("JavaScript application path CLI", () => {
|
||||
expect(mcpResult.semantic_graph).toEqual(
|
||||
result.normalized_result.semantic_graph,
|
||||
);
|
||||
}, 20_000);
|
||||
});
|
||||
|
||||
it("preserves canonical Electron API aliases through CLI and stdio MCP", async () => {
|
||||
const root = await createTestTempDirectory("rea-electron-api-alias-");
|
||||
@@ -758,7 +758,7 @@ describe("JavaScript application path CLI", () => {
|
||||
expect(mcpResult.summary).toEqual(cliResult.summary);
|
||||
expect(mcpResult.graph).toEqual(cliResult.graph);
|
||||
expect(mcpResult.semantic_graph).toEqual(cliResult.semantic_graph);
|
||||
}, 20_000);
|
||||
});
|
||||
});
|
||||
|
||||
describe("application workflow CLI parity", () => {
|
||||
@@ -857,7 +857,7 @@ describe("application workflow CLI parity", () => {
|
||||
},
|
||||
},
|
||||
});
|
||||
}, 20_000);
|
||||
});
|
||||
|
||||
it("traces the same authenticated semantic graph through the CLI", async () => {
|
||||
const root = await createTestTempDirectory("rea-semantic-cli-");
|
||||
@@ -897,7 +897,7 @@ describe("application workflow CLI parity", () => {
|
||||
source_graph_id: result.semantic_graph.graph_id,
|
||||
},
|
||||
});
|
||||
}, 20_000);
|
||||
});
|
||||
});
|
||||
|
||||
it("traces all endpoint carriers and their response consumers through CLI and MCP", async () => {
|
||||
@@ -1018,7 +1018,7 @@ it("traces all endpoint carriers and their response consumers through CLI and MC
|
||||
coverage: { status: "partial" },
|
||||
});
|
||||
expect(await readFile(sourcePath, "utf8")).toBe(source);
|
||||
}, 20_000);
|
||||
});
|
||||
|
||||
describe("rest parameter semantic trace CLI", () => {
|
||||
it("traces each ordinary rest argument to its parameter through public application Evidence", async () => {
|
||||
@@ -1068,7 +1068,7 @@ describe("rest parameter semantic trace CLI", () => {
|
||||
},
|
||||
});
|
||||
}
|
||||
}, 20_000);
|
||||
});
|
||||
});
|
||||
|
||||
describe("empty property key application CLI", () => {
|
||||
@@ -1100,7 +1100,6 @@ describe("empty property key application CLI", () => {
|
||||
},
|
||||
});
|
||||
},
|
||||
20_000,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1251,7 +1250,7 @@ describe("Webpack factory CommonJS export keys", () => {
|
||||
expectBundleExports(evidence, "5", []);
|
||||
expectBundleExports(evidence, "6", ["__proto__"]);
|
||||
}
|
||||
}, 20_000);
|
||||
});
|
||||
});
|
||||
|
||||
describe("application workflow CLI input", () => {
|
||||
@@ -1411,7 +1410,7 @@ describe("application workflow CLI copy boundaries", () => {
|
||||
),
|
||||
},
|
||||
});
|
||||
}, 20_000);
|
||||
});
|
||||
});
|
||||
|
||||
describe("application workflow CLI and MCP capture lifetimes", () => {
|
||||
@@ -1521,7 +1520,7 @@ describe("application workflow CLI and MCP capture lifetimes", () => {
|
||||
await runCli(["compare-javascript-export-shapes", inputPath, "--json"]),
|
||||
).toMatchObject(expected);
|
||||
expect(await compareThroughStdioMcp(input)).toMatchObject(expected);
|
||||
}, 20_000);
|
||||
});
|
||||
});
|
||||
|
||||
describe("application workflow CLI export Evidence", () => {
|
||||
@@ -1568,7 +1567,7 @@ describe("application workflow CLI export Evidence", () => {
|
||||
),
|
||||
).toMatchObject(expected);
|
||||
expect(await compareThroughStdioMcp(input)).toMatchObject(expected);
|
||||
}, 20_000);
|
||||
});
|
||||
|
||||
it("preserves uncertainty after a helper can mutate an awaited return object", async () => {
|
||||
const root = await createTestTempDirectory("rea-awaited-export-shape-cli-");
|
||||
@@ -1604,7 +1603,7 @@ describe("application workflow CLI export Evidence", () => {
|
||||
]),
|
||||
},
|
||||
});
|
||||
}, 20_000);
|
||||
});
|
||||
|
||||
it("compares exact export shapes from file-backed Evidence", async () => {
|
||||
const root = await createTestTempDirectory("rea-export-shape-cli-");
|
||||
@@ -1663,7 +1662,7 @@ describe("application workflow CLI export Evidence", () => {
|
||||
]),
|
||||
},
|
||||
});
|
||||
}, 20_000);
|
||||
});
|
||||
});
|
||||
|
||||
describe("application workflow CLI export property presence", () => {
|
||||
@@ -1759,7 +1758,7 @@ describe("application workflow CLI export property presence", () => {
|
||||
]),
|
||||
},
|
||||
});
|
||||
}, 20_000);
|
||||
});
|
||||
});
|
||||
|
||||
describe("application workflow CLI validation", () => {
|
||||
@@ -1794,7 +1793,7 @@ describe("application workflow CLI validation", () => {
|
||||
]),
|
||||
},
|
||||
});
|
||||
}, 20_000);
|
||||
});
|
||||
});
|
||||
|
||||
const compareThroughStdioMcp = async (
|
||||
|
||||
@@ -432,7 +432,6 @@ cliTest(
|
||||
|
||||
await assertCoverageControls({ left, right, inventory, compare });
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
|
||||
cliTest.skipIf(process.platform === "win32")(
|
||||
@@ -469,7 +468,6 @@ cliTest.skipIf(process.platform === "win32")(
|
||||
],
|
||||
});
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
|
||||
cliTest.skipIf(process.platform === "win32")(
|
||||
@@ -521,7 +519,6 @@ cliTest.skipIf(process.platform === "win32")(
|
||||
]),
|
||||
});
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
|
||||
cliTest.skipIf(process.platform === "win32")(
|
||||
@@ -579,7 +576,6 @@ cliTest.skipIf(process.platform === "win32")(
|
||||
);
|
||||
}
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -620,7 +616,6 @@ cliTest(
|
||||
]),
|
||||
});
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
|
||||
@@ -170,5 +170,4 @@ cliTest.skipIf(process.platform !== "darwin")(
|
||||
});
|
||||
}
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
@@ -225,7 +225,6 @@ cliTest(
|
||||
ibResult.documents[0]?.archive_sha256,
|
||||
);
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -278,5 +277,4 @@ cliTest(
|
||||
expect(mcpResult).toEqual(cliResult);
|
||||
expect(Buffer.compare(await readFile(archivePath), bytes)).toBe(0);
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
@@ -176,6 +176,7 @@ cliTest.skipIf(isWindows)(
|
||||
|
||||
cliTest.skipIf(isWindows)(
|
||||
"returns a typed failure when an executable exits before Electron starts and keeps the MCP server and its Evidence",
|
||||
{ tags: ["long-running"] },
|
||||
async ({ cli }) => {
|
||||
const root = await createTestTempDirectory("rea-electron-early-exit-");
|
||||
const application = await createElectronApplication(root);
|
||||
@@ -229,7 +230,6 @@ cliTest.skipIf(isWindows)(
|
||||
expect(session.isError, JSON.stringify(session)).not.toBe(true);
|
||||
expect(await retained()).toEqual(before);
|
||||
},
|
||||
180_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
|
||||
@@ -103,7 +103,6 @@ const checkSelectors = async (
|
||||
|
||||
cliTest(
|
||||
"queries same-name BEAM export arities through CLI/MCP after deleting the source",
|
||||
{ timeout: 60_000 },
|
||||
async ({ cli }) => {
|
||||
const root = await createTestTempDirectory("rea-beam-views-");
|
||||
const path = join(root, "app.beam");
|
||||
|
||||
@@ -142,5 +142,4 @@ cliTest(
|
||||
});
|
||||
expect(withoutAuthoredField?.attributes).not.toHaveProperty("className");
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
@@ -147,7 +147,7 @@ it("preserves MCP analysis limits in retained Evidence and an exported bundle ro
|
||||
const imported = await call("import_evidence_bundle", { path });
|
||||
expect(imported.isError, JSON.stringify(imported.content)).not.toBe(true);
|
||||
expect(await getBundle(call)).toEqual(retained);
|
||||
}, 60_000);
|
||||
});
|
||||
|
||||
cliTest(
|
||||
"retains caller limits and applicable file scopes after an actual analysis timeout",
|
||||
@@ -261,7 +261,6 @@ cliTest(
|
||||
expectFileAnalysisApplicability(evidence, interrupted);
|
||||
await client.ping();
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
|
||||
@@ -124,7 +124,7 @@ it("preserves earlier and sibling effects without inventing replaced cached-modu
|
||||
expect(response.isError, JSON.stringify(response)).not.toBe(true);
|
||||
expect(response.structuredContent).toEqual(evidence);
|
||||
await client.ping();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
it("excludes monkey-patched CommonJS effects from CLI and MCP evidence", async () => {
|
||||
const root = await createTestTempDirectory("rea-builtin-mutated-");
|
||||
@@ -175,7 +175,7 @@ it("excludes monkey-patched CommonJS effects from CLI and MCP evidence", async (
|
||||
expect(response.isError, JSON.stringify(response)).not.toBe(true);
|
||||
expect(response.structuredContent).toEqual(evidence);
|
||||
await client.ping();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
it("retains CommonJS builtin effects and handle links through CLI and MCP", async () => {
|
||||
const root = await createTestTempDirectory("rea-builtin-commonjs-");
|
||||
@@ -252,7 +252,7 @@ it("retains CommonJS builtin effects and handle links through CLI and MCP", asyn
|
||||
expect(response.isError, JSON.stringify(response)).not.toBe(true);
|
||||
expect(response.structuredContent).toEqual(evidence);
|
||||
await client.ping();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
it.each([
|
||||
"import fs from 'node:fs';",
|
||||
@@ -294,7 +294,6 @@ it.each([
|
||||
]),
|
||||
);
|
||||
},
|
||||
20_000,
|
||||
);
|
||||
|
||||
it("keeps only direct logical defaults and actual argv elements in the public CLI graph", async () => {
|
||||
@@ -399,4 +398,4 @@ function shadowed(process) { return process.argv[3]; }`,
|
||||
},
|
||||
),
|
||||
).toHaveLength(1);
|
||||
}, 20_000);
|
||||
});
|
||||
@@ -57,5 +57,4 @@ cliTest(
|
||||
]),
|
||||
);
|
||||
},
|
||||
90_000,
|
||||
);
|
||||
@@ -67,7 +67,6 @@ cliTest(
|
||||
},
|
||||
);
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -133,7 +132,6 @@ console.log(JSON.stringify([captured(5),assigned(5),between(5),intermediate(5),n
|
||||
);
|
||||
});
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -180,7 +178,6 @@ console.log(JSON.stringify([delayed(),incoming(5),delayedPrivate(),staticField()
|
||||
);
|
||||
});
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -246,7 +243,6 @@ console.log(JSON.stringify([optionalCall(null),optionalCall(receiver),optionalCa
|
||||
"app.ts",
|
||||
);
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -310,7 +306,6 @@ console.log(JSON.stringify([objectOrder(),bothSides(),arrayOrder(),computedOrder
|
||||
);
|
||||
});
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -361,7 +356,6 @@ console.log(JSON.stringify([read(),captured(object=>{object.value=3;})]));`,
|
||||
);
|
||||
});
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -431,7 +425,6 @@ console.log(JSON.stringify([objectPresent(),objectMissing(),arrayPresent(),array
|
||||
);
|
||||
});
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -508,5 +501,4 @@ cliTest(
|
||||
await harness.close();
|
||||
}
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
@@ -60,7 +60,6 @@ cliTest.skipIf(process.versions.bun !== undefined).for([
|
||||
{ laterSources: 1, heapMb: 448, methodsCount: 600, retainGraph: false },
|
||||
])(
|
||||
"preserves evidence with $laterSources later checkpoints and a $heapMb MiB parent heap",
|
||||
{ timeout: 90_000 },
|
||||
async ({ laterSources, heapMb, methodsCount, retainGraph }, { cli }) => {
|
||||
const root = await createTestTempDirectory("rea-js-checkpoint-reserve-");
|
||||
const source = Array.from(
|
||||
@@ -173,7 +172,6 @@ cliTest.skipIf(process.versions.bun !== undefined).for([
|
||||
|
||||
cliTest.skipIf(process.versions.bun !== undefined)(
|
||||
"keeps every source's static facts after semantic results use the parent result budget",
|
||||
{ timeout: 90_000 },
|
||||
async ({ cli }) => {
|
||||
const root = await createTestTempDirectory("rea-js-static-capacity-");
|
||||
// Plain functions produce semantic graphs large enough to use the result
|
||||
|
||||
@@ -99,7 +99,7 @@ stable.kill();
|
||||
family === "child-process" && reason === "ambiguous-target",
|
||||
),
|
||||
).toHaveLength(2);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
it("keeps deferred instance field child ownership uncertain through CLI and MCP", async () => {
|
||||
const evidence = await analyzeThroughCliAndMcp(
|
||||
@@ -140,4 +140,4 @@ stable.kill();
|
||||
family === "child-process" && reason === "ambiguous-target",
|
||||
),
|
||||
).toHaveLength(1);
|
||||
}, 60000);
|
||||
});
|
||||
@@ -160,7 +160,7 @@ it("reports a candidate endpoint through the worker boundary in the public CLI",
|
||||
({ target_node_id }) => target_node_id === endpoint?.node_id,
|
||||
);
|
||||
expect(edge?.properties).toMatchObject({ interpretation: "candidate" });
|
||||
}, 20_000);
|
||||
});
|
||||
|
||||
it("preserves SQLite constructor certainty through the public worker and graph", async () => {
|
||||
const root = await createTestTempDirectory("rea-storage-candidate-cli-");
|
||||
@@ -218,4 +218,4 @@ it("preserves SQLite constructor certainty through the public worker and graph",
|
||||
]),
|
||||
},
|
||||
});
|
||||
}, 20_000);
|
||||
});
|
||||
@@ -157,7 +157,6 @@ cliTest(
|
||||
await transport.close();
|
||||
}
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
interface EndpointWorkflowInput {
|
||||
|
||||
@@ -160,7 +160,6 @@ cliTest(
|
||||
await transport.close();
|
||||
}
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -221,5 +220,4 @@ cliTest(
|
||||
);
|
||||
expect(new Set(trace.seed_node_ids)).toEqual(retained);
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
@@ -417,7 +417,6 @@ cliTest(
|
||||
}
|
||||
}
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -500,5 +499,4 @@ cliTest(
|
||||
);
|
||||
}
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
@@ -119,7 +119,6 @@ cliTest(
|
||||
Buffer.byteLength(inline.stdout),
|
||||
);
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -152,7 +151,6 @@ cliTest(
|
||||
});
|
||||
expect(await readFile(output, "utf8")).toBe("kept");
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
|
||||
// A one-line module finishes well within 5 s; a string-array-style module of
|
||||
@@ -227,7 +225,6 @@ cliTest(
|
||||
]),
|
||||
);
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
// Drive the real staged publication of the partial Evidence across its
|
||||
@@ -305,7 +302,6 @@ cliTest(
|
||||
});
|
||||
expect(staging).toHaveLength(1);
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -327,7 +323,6 @@ cliTest(
|
||||
});
|
||||
expect(staging).toEqual([]);
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -356,5 +351,4 @@ cliTest(
|
||||
});
|
||||
expect(staging).toEqual([]);
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
@@ -61,5 +61,4 @@ it.each([
|
||||
);
|
||||
expect(targets).toEqual(targetLine === null ? [] : [targetLine]);
|
||||
},
|
||||
20_000,
|
||||
);
|
||||
@@ -72,5 +72,4 @@ const assertReturns = (fields: JavaScriptReturnFields): void => {
|
||||
cliTest(
|
||||
"preserves yielded-object mutation uncertainty through CLI and stdio MCP",
|
||||
({ cli }) => verifyJavaScriptReturnShapes(cli, source, assertReturns),
|
||||
120_000,
|
||||
);
|
||||
@@ -57,5 +57,4 @@ cliTest(
|
||||
),
|
||||
).toBe(true);
|
||||
},
|
||||
20_000,
|
||||
);
|
||||
@@ -141,5 +141,4 @@ fetch("/copied-module");`,
|
||||
expect(analyzed.isError, JSON.stringify(analyzed.content)).not.toBe(true);
|
||||
verify(analyzed.structuredContent);
|
||||
},
|
||||
90_000,
|
||||
);
|
||||
@@ -210,7 +210,6 @@ cliTest(
|
||||
assertReturns(fields);
|
||||
assertWideReturns(fields);
|
||||
}),
|
||||
120_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -224,5 +223,4 @@ cliTest(
|
||||
assertWideReturns,
|
||||
);
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
@@ -94,5 +94,4 @@ const assertReturns = (fields: JavaScriptReturnFields): void => {
|
||||
cliTest(
|
||||
"does not report stale literals after storing references in member slots",
|
||||
({ cli }) => verifyJavaScriptReturnShapes(cli, source, assertReturns),
|
||||
120_000,
|
||||
);
|
||||
@@ -20,7 +20,6 @@ cliTest.for([
|
||||
{ format: "asar", command: "analyze-javascript-application" },
|
||||
])(
|
||||
"analyzes selected $format sources through $command with complete artifact identity",
|
||||
{ timeout: 60_000 },
|
||||
async ({ format, command }, { cli }) => {
|
||||
const directory = await createTestTempDirectory("rea-js-source-selection-");
|
||||
const files = await writeJavaScriptSourceSelectionFixture(directory);
|
||||
@@ -202,7 +201,6 @@ cliTest.for([
|
||||
},
|
||||
])(
|
||||
"appends $source --source-paths-json selections for $format through $command",
|
||||
{ timeout: 60_000 },
|
||||
async ({ command, source, format }, { cli }) => {
|
||||
const directory = await createTestTempDirectory(
|
||||
"rea-js-source-paths-json-",
|
||||
@@ -324,7 +322,6 @@ cliTest(
|
||||
|
||||
cliTest(
|
||||
"accepts legal ASAR JSON whitespace while preserving selected-source identity",
|
||||
{ timeout: 60_000 },
|
||||
async ({ cli }) => {
|
||||
const root = await createTestTempDirectory("rea-js-asar-whitespace-");
|
||||
await writeJavaScriptSourceSelectionFixture(root);
|
||||
|
||||
@@ -88,5 +88,4 @@ cliTest(
|
||||
}
|
||||
}
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
@@ -140,7 +140,6 @@ const fixtures = [
|
||||
|
||||
cliTest.for(fixtures)(
|
||||
"preserves entry kinds in $family projections through CLI and stdio MCP",
|
||||
{ timeout: 60_000 },
|
||||
async (fixture, { cli }) => {
|
||||
const root = await createTestTempDirectory("rea-mobile-directory-");
|
||||
const environment = { HOME: root, USERPROFILE: root };
|
||||
@@ -320,7 +319,6 @@ cliTest.for([
|
||||
},
|
||||
])(
|
||||
"preserves encrypted $family path facts through CLI and stdio MCP",
|
||||
{ timeout: 60_000 },
|
||||
async (fixture, { cli }) => {
|
||||
const root = await createTestTempDirectory("rea-mobile-encrypted-paths-");
|
||||
const environment = { HOME: root, USERPROFILE: root };
|
||||
|
||||
@@ -138,5 +138,4 @@ cliTest(
|
||||
}
|
||||
}
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
@@ -72,7 +72,6 @@ cliTest(
|
||||
},
|
||||
);
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -113,5 +112,4 @@ cliTest(
|
||||
},
|
||||
);
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
@@ -20,7 +20,6 @@ const viewContract = toolContract("inspect_analysis_view");
|
||||
|
||||
cliTest.for(["pe", "elf"] as const)(
|
||||
"queries retained %s exports through CLI and actual stdio MCP after the source is deleted",
|
||||
{ timeout: 60_000 },
|
||||
async (format, { cli }) => {
|
||||
const root = await createTestTempDirectory("rea-export-views-");
|
||||
const path = join(root, `library.${format}`);
|
||||
|
||||
@@ -189,7 +189,6 @@ describe.skipIf(process.platform !== "darwin")(
|
||||
expect(Buffer.compare(await readFile(binaryPath), binaryBytes)).toBe(0);
|
||||
expect(Buffer.compare(await readFile(xmlPath), xmlBytes)).toBe(0);
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -169,7 +169,6 @@ describe.skipIf(process.platform !== "darwin")(
|
||||
).toBe(false);
|
||||
}
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -196,5 +196,4 @@ cliTest(
|
||||
);
|
||||
expect(Buffer.compare(await readFile(path), archive)).toBe(0);
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
@@ -531,5 +531,4 @@ cliTest(
|
||||
}
|
||||
}
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
@@ -70,7 +70,6 @@ const assertSparseSelectors = async (
|
||||
|
||||
cliTest(
|
||||
"queries same-name pyc objects through CLI/MCP after deleting the source",
|
||||
{ timeout: 60_000 },
|
||||
async ({ cli }) => {
|
||||
const root = await createTestTempDirectory("rea-pyc-views-");
|
||||
const path = join(root, "module.pyc");
|
||||
|
||||
@@ -145,7 +145,7 @@ describe("production stdio runtime", () => {
|
||||
);
|
||||
expect(stderr).not.toContain("HOPPER_LOADER_ARGS_JSON");
|
||||
expect(stderr).not.toContain(fixturePath);
|
||||
}, 15_000);
|
||||
});
|
||||
|
||||
it.runIf(process.platform === "darwin")(
|
||||
"returns the selected document on macOS through MCP and structured logs",
|
||||
@@ -175,7 +175,6 @@ describe("production stdio runtime", () => {
|
||||
expect(stderr).not.toContain("HOPPER_LOADER_ARGS_JSON");
|
||||
expect(stderr).not.toContain(fixturePath);
|
||||
},
|
||||
15_000,
|
||||
);
|
||||
|
||||
// Use the suite's bounded acceptance deadline, including its coverage allowance.
|
||||
@@ -315,6 +314,5 @@ describe("production stdio saved-database admission", () => {
|
||||
),
|
||||
).toBe(false);
|
||||
},
|
||||
15_000,
|
||||
);
|
||||
});
|
||||
@@ -140,5 +140,4 @@ cliTest.skipIf(process.platform !== "darwin")(
|
||||
});
|
||||
expect(await attachedImagePaths()).not.toContain(resolvedImage);
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
@@ -83,5 +83,4 @@ cliTest(
|
||||
expect(response.isError).toBe(true);
|
||||
expect(parseMcpToolError(response)).toEqual({ error: rejected.json });
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
@@ -131,5 +131,4 @@ cliTest(
|
||||
await browser.close();
|
||||
}
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
@@ -19,7 +19,6 @@ cliTest.for([
|
||||
["stdio MCP", "cookie"],
|
||||
] as const)(
|
||||
"reports undeclared references through %s for a wide %s list",
|
||||
{ timeout: 60_000 },
|
||||
async ([surface, placement], { cli }) => {
|
||||
const home = await createTestTempDirectory("rea-scenario-reference-");
|
||||
const input = browserScenarioReferences(placement, 130_000);
|
||||
|
||||
@@ -56,4 +56,4 @@ for (const shared of [false, true])
|
||||
)?.evidence.normalized_result;
|
||||
expect(graph).toMatchObject({ manifest: { occurrence_count: 1001 } });
|
||||
}
|
||||
}, 120_000);
|
||||
});
|
||||
@@ -219,7 +219,7 @@ for (const format of ["dotnet-bundle", "pyinstaller"] as const) {
|
||||
outputs.map((output) => rm(output, { recursive: true, force: true })),
|
||||
);
|
||||
}
|
||||
}, 120_000);
|
||||
});
|
||||
}
|
||||
|
||||
test("reports excessive bundle path depth as a public CLI limit", async ({
|
||||
|
||||
@@ -79,7 +79,6 @@ cliTest(
|
||||
}
|
||||
await client.ping();
|
||||
},
|
||||
60000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -191,7 +190,6 @@ cliTest(
|
||||
}
|
||||
await client.ping();
|
||||
},
|
||||
60000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -250,7 +248,6 @@ cliTest(
|
||||
details: { issues: [{ path: ["evidence_output"] }] },
|
||||
});
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -280,7 +277,6 @@ cliTest(
|
||||
expect(parseMcpToolError(response).error).toMatchObject(expected);
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -307,7 +303,6 @@ cliTest(
|
||||
expect(infos[1]).toEqual(infos[0]);
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
for (const bits of [32, 64] as const) {
|
||||
@@ -357,7 +352,6 @@ for (const bits of [32, 64] as const) {
|
||||
expect(buildInfos[1]).toEqual(buildInfos[0]);
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -413,7 +407,6 @@ cliTest(
|
||||
}
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
for (const expectedErrno of ["ELOOP", "ENAMETOOLONG"] as const) {
|
||||
@@ -717,5 +710,4 @@ cliTest(
|
||||
expectCliMcpEvidenceParity(evidence, mcpReply.structuredContent, path);
|
||||
await client.ping();
|
||||
},
|
||||
60000,
|
||||
);
|
||||
@@ -76,5 +76,4 @@ cliTest(
|
||||
expect(parseMcpToolError(response)).toEqual({ error: rejected.json });
|
||||
await client.ping();
|
||||
},
|
||||
60000,
|
||||
);
|
||||
@@ -383,7 +383,6 @@ cliTest(
|
||||
}),
|
||||
]);
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -424,5 +423,4 @@ cliTest(
|
||||
}
|
||||
}
|
||||
},
|
||||
30000,
|
||||
);
|
||||
@@ -234,4 +234,4 @@ test("preserves Harmony archive formats through the public CLI/MCP lifecycle", a
|
||||
} finally {
|
||||
await client.close();
|
||||
}
|
||||
}, 120_000);
|
||||
});
|
||||
@@ -109,7 +109,6 @@ cliTest(
|
||||
});
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -176,7 +175,6 @@ cliTest(
|
||||
}
|
||||
}
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -238,7 +236,6 @@ cliTest(
|
||||
}
|
||||
}
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -312,7 +309,6 @@ cliTest(
|
||||
expect(Buffer.compare(await readFile(path), fixture.bytes)).toBe(0);
|
||||
}
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -431,7 +427,6 @@ cliTest(
|
||||
}
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -487,7 +482,6 @@ cliTest(
|
||||
}
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -562,7 +556,6 @@ cliTest(
|
||||
}
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
const metadataPageReader =
|
||||
@@ -750,7 +743,7 @@ it("queries compact retained metadata through the real SDK with exact row identi
|
||||
});
|
||||
expect(parseMcpToolError(invalid).error.code).toBe("invalid_request");
|
||||
await client.ping();
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
it("imports historical metadata Evidence with unavailable member collections without inventing empty results", async () => {
|
||||
const root = await createTestTempDirectory("rea-il2cpp-history-"),
|
||||
@@ -827,7 +820,7 @@ it("imports historical metadata Evidence with unavailable member collections wit
|
||||
view: { kind: "il2cpp-metadata", collection: "parameters" },
|
||||
});
|
||||
expect(parseMcpToolError(unavailable).error.code).toBe("invalid_request");
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
cliTest(
|
||||
"exports complete metadata Evidence for compact CLI delivery and portable selected reads",
|
||||
@@ -906,7 +899,6 @@ cliTest(
|
||||
parent_evidence_id: evidence.evidence_id,
|
||||
});
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest.skipIf(process.platform === "win32")(
|
||||
@@ -950,7 +942,6 @@ cliTest.skipIf(process.platform === "win32")(
|
||||
expect(read.exitCode, read.stderr).toBe(0);
|
||||
expect(read.stdout).toContain(saved.value.records[0]?.evidence_id);
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -1042,7 +1033,6 @@ cliTest(
|
||||
);
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -1088,7 +1078,6 @@ cliTest(
|
||||
).toEqual(report.method_addresses);
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -1157,7 +1146,6 @@ cliTest(
|
||||
}
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -1218,7 +1206,6 @@ cliTest(
|
||||
}
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -1301,7 +1288,6 @@ cliTest(
|
||||
}
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -1339,7 +1325,6 @@ cliTest(
|
||||
),
|
||||
).toBe(true);
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -1653,5 +1638,4 @@ cliTest(
|
||||
).toEqual(entry.methods);
|
||||
}
|
||||
},
|
||||
60000,
|
||||
);
|
||||
@@ -57,5 +57,4 @@ cliTest(
|
||||
expect(parseMcpToolError(result).error).toMatchObject(expected);
|
||||
}
|
||||
},
|
||||
30000,
|
||||
);
|
||||
@@ -10,7 +10,6 @@ import { cliTest } from "../support/cli/cliFixture.js";
|
||||
|
||||
cliTest(
|
||||
"reports the complete-fact ceiling for wide async chunk metadata",
|
||||
{ timeout: 60_000 },
|
||||
async ({ cli }) => {
|
||||
// This bounded public control exceeds the complete-fact allowance. The
|
||||
// forked boundary regression separately owns call-argument capacity.
|
||||
|
||||
@@ -607,7 +607,6 @@ cliTest(
|
||||
await browser.close();
|
||||
}
|
||||
},
|
||||
120000,
|
||||
);
|
||||
|
||||
it("keeps a large source's partial route facts queryable through SDK delivery", async () => {
|
||||
@@ -662,4 +661,4 @@ it("keeps a large source's partial route facts queryable through SDK delivery",
|
||||
expect(
|
||||
routeViewFromEvidence(unknowns.structuredContent).items.length,
|
||||
).toBeGreaterThan(0);
|
||||
}, 60000);
|
||||
});
|
||||
@@ -92,5 +92,4 @@ it.skipIf(
|
||||
.digest("hex"),
|
||||
).toBe(digest);
|
||||
},
|
||||
90_000,
|
||||
);
|
||||
@@ -117,7 +117,6 @@ cliTest.skipIf(process.platform !== "darwin")(
|
||||
expect(Buffer.compare(await readFile(first), Buffer.from(bytes))).toBe(0);
|
||||
expect(Buffer.compare(await readFile(second), Buffer.from(bytes))).toBe(0);
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest.skipIf(process.platform !== "darwin")(
|
||||
@@ -174,7 +173,6 @@ cliTest.skipIf(process.platform !== "darwin")(
|
||||
expect(Buffer.compare(await readFile(target), bytes)).toBe(0);
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest.skipIf(process.platform !== "darwin")(
|
||||
@@ -308,7 +306,6 @@ cliTest.skipIf(process.platform !== "darwin")(
|
||||
expect(Buffer.compare(await readFile(target), Buffer.from(bytes))).toBe(0);
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest.skipIf(process.platform !== "darwin")(
|
||||
|
||||
@@ -88,5 +88,4 @@ cliTest(
|
||||
}
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
@@ -89,7 +89,6 @@ cliTest.skipIf(missingNative)(
|
||||
.digest("hex"),
|
||||
).toBe(before);
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
it.skipIf(missingNative)(
|
||||
@@ -141,5 +140,4 @@ it.skipIf(missingNative)(
|
||||
}
|
||||
}
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
@@ -58,5 +58,4 @@ it.skipIf(
|
||||
);
|
||||
}
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
@@ -276,7 +276,6 @@ const expectIgnoringFinalization = (outcome: CaptureOutcome): void => {
|
||||
|
||||
cliCaptureTest.for(["CLI", "MCP"] as const)(
|
||||
"captures a cooperative finalizer through the compiled %s workflow",
|
||||
{ timeout: 20_000 },
|
||||
async (adapter, { cli }) => {
|
||||
const root = await createTestTempDirectory("rea-finalization-accept-");
|
||||
const scenario = captureScenario("cooperative", root, {
|
||||
@@ -293,7 +292,6 @@ cliCaptureTest.for(["CLI", "MCP"] as const)(
|
||||
|
||||
cliCaptureTest.for(["CLI", "MCP"] as const)(
|
||||
"records the non-zero exit code of a finalizer through the compiled %s workflow",
|
||||
{ timeout: 20_000 },
|
||||
async (adapter, { cli }) => {
|
||||
const root = await createTestTempDirectory("rea-finalization-accept-");
|
||||
const scenario = captureScenario(
|
||||
@@ -312,7 +310,6 @@ cliCaptureTest.for(["CLI", "MCP"] as const)(
|
||||
|
||||
cliCaptureTest.for(["CLI", "MCP"] as const)(
|
||||
"forces SIGKILL after the finalization interval through the compiled %s workflow",
|
||||
{ timeout: 20_000 },
|
||||
async (adapter, { cli }) => {
|
||||
const root = await createTestTempDirectory("rea-finalization-accept-");
|
||||
const scenario = captureScenario("ignoring", root, {
|
||||
@@ -386,12 +383,10 @@ captureTest(
|
||||
observeProcessStartIdentity(childPid),
|
||||
).resolves.toBeUndefined();
|
||||
},
|
||||
20_000,
|
||||
);
|
||||
|
||||
cliCaptureTest.for(["CLI", "MCP"] as const)(
|
||||
"keeps the default identity through the compiled %s workflow without finalization_ms",
|
||||
{ timeout: 20_000 },
|
||||
async (adapter, { cli }) => {
|
||||
const root = await createTestTempDirectory("rea-finalization-default-");
|
||||
const scenario = captureScenario("ignoring", root, { timeout_ms: 500 });
|
||||
@@ -583,5 +578,4 @@ captureTest(
|
||||
"MCP cancellation does not wait for the grace interval",
|
||||
).toBeLessThan(8_000);
|
||||
},
|
||||
20_000,
|
||||
);
|
||||
@@ -68,7 +68,6 @@ cliTest.skipIf(CAPTURE_SKIP_REASON)(
|
||||
expect(result.stderr).not.toContain(literal);
|
||||
verify(result.json);
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
|
||||
itWithCaptureCapability(
|
||||
|
||||
@@ -66,7 +66,6 @@ cliCaptureTest(
|
||||
expect(capture.exit, name).toMatchObject(expected);
|
||||
}
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
|
||||
captureTest(
|
||||
@@ -94,5 +93,4 @@ captureTest(
|
||||
reason: "exited",
|
||||
});
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
@@ -61,7 +61,6 @@ const closeWithLateBridge = async (
|
||||
|
||||
test.for(["target", "loader"] as const)(
|
||||
"preserves a prepared target or refuses literal-unsafe %s before handoff",
|
||||
{ timeout: 90_000 },
|
||||
async (source, { workspace, cli }) => {
|
||||
const target = workspace.path(
|
||||
source === "target" ? 'quoted"target' : "loader-target",
|
||||
@@ -244,7 +243,6 @@ test("recovers a denied Hopper launch through the same stdio MCP session and CLI
|
||||
|
||||
test.for(["handoff", "not-found"] as const)(
|
||||
"preserves an unconfirmed %s handoff and closes only a late bridge with matching run identity",
|
||||
{ timeout: 60_000 },
|
||||
async (launchMode, { workspace }) => {
|
||||
const target = workspace.path("target");
|
||||
await copyFile("/usr/bin/true", target);
|
||||
|
||||
@@ -14,57 +14,44 @@ if (releaseExposureContract === undefined)
|
||||
throw new Error("Missing release exposure contract");
|
||||
const outputSchema = releaseExposureContract.outputSchema;
|
||||
|
||||
cliTest(
|
||||
"exits 3 when a shipped source map embeds sources",
|
||||
async ({ cli }) => {
|
||||
const root = await createTestTempDirectory("rea-release-exposure-cli-");
|
||||
await writeFile(join(root, "app.js"), "export const value = 1;\n");
|
||||
await writeFile(
|
||||
join(root, "app.js.map"),
|
||||
JSON.stringify({
|
||||
version: 3,
|
||||
file: "app.js",
|
||||
sources: ["app.js"],
|
||||
names: [],
|
||||
mappings: "",
|
||||
sourcesContent: [`export const value = "${PLANTED_SOURCE}";\n`],
|
||||
}),
|
||||
);
|
||||
const clean = await cli.run({
|
||||
arguments: ["audit-release-exposure", root, "--json"],
|
||||
});
|
||||
expect(clean.exitCode, clean.stderr).toBe(0);
|
||||
const evidence = outputSchema.parse(clean.json);
|
||||
const report = evidence.normalized_result;
|
||||
expect(
|
||||
report.checks.find(
|
||||
(check) => check.id === "javascript.source_map_sources",
|
||||
),
|
||||
).toMatchObject({ status: "exposed", severity: "high" });
|
||||
expect(
|
||||
report.checks.find((check) => check.id === "electron.run_as_node")
|
||||
?.status,
|
||||
).toBe("unknown");
|
||||
expect(
|
||||
report.checks.find((check) => check.id === "native.pdb_path")?.status,
|
||||
).toBe("not_applicable");
|
||||
expect(
|
||||
report.checks.find((check) => check.id === "go.build_paths")?.status,
|
||||
).toBe("not_applicable");
|
||||
expect(JSON.stringify(evidence)).not.toContain(PLANTED_SOURCE);
|
||||
const gated = await cli.run({
|
||||
arguments: [
|
||||
"audit-release-exposure",
|
||||
root,
|
||||
"--fail_on",
|
||||
"high",
|
||||
"--json",
|
||||
],
|
||||
});
|
||||
expect(gated.exitCode, gated.stderr).toBe(3);
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
cliTest("exits 3 when a shipped source map embeds sources", async ({ cli }) => {
|
||||
const root = await createTestTempDirectory("rea-release-exposure-cli-");
|
||||
await writeFile(join(root, "app.js"), "export const value = 1;\n");
|
||||
await writeFile(
|
||||
join(root, "app.js.map"),
|
||||
JSON.stringify({
|
||||
version: 3,
|
||||
file: "app.js",
|
||||
sources: ["app.js"],
|
||||
names: [],
|
||||
mappings: "",
|
||||
sourcesContent: [`export const value = "${PLANTED_SOURCE}";\n`],
|
||||
}),
|
||||
);
|
||||
const clean = await cli.run({
|
||||
arguments: ["audit-release-exposure", root, "--json"],
|
||||
});
|
||||
expect(clean.exitCode, clean.stderr).toBe(0);
|
||||
const evidence = outputSchema.parse(clean.json);
|
||||
const report = evidence.normalized_result;
|
||||
expect(
|
||||
report.checks.find((check) => check.id === "javascript.source_map_sources"),
|
||||
).toMatchObject({ status: "exposed", severity: "high" });
|
||||
expect(
|
||||
report.checks.find((check) => check.id === "electron.run_as_node")?.status,
|
||||
).toBe("unknown");
|
||||
expect(
|
||||
report.checks.find((check) => check.id === "native.pdb_path")?.status,
|
||||
).toBe("not_applicable");
|
||||
expect(
|
||||
report.checks.find((check) => check.id === "go.build_paths")?.status,
|
||||
).toBe("not_applicable");
|
||||
expect(JSON.stringify(evidence)).not.toContain(PLANTED_SOURCE);
|
||||
const gated = await cli.run({
|
||||
arguments: ["audit-release-exposure", root, "--fail_on", "high", "--json"],
|
||||
});
|
||||
expect(gated.exitCode, gated.stderr).toBe(3);
|
||||
});
|
||||
|
||||
cliTest(
|
||||
"gates a marker in a text file outside the extension list",
|
||||
@@ -98,7 +85,6 @@ cliTest(
|
||||
],
|
||||
});
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -120,5 +106,4 @@ cliTest(
|
||||
expect(report.summary.no_exposure_observed_in_assessed_checks).toBe(true);
|
||||
expect(report.summary.by_status.not_assessed).toBe(3);
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
@@ -74,7 +74,6 @@ cliTest(
|
||||
}
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -240,7 +239,6 @@ cliTest(
|
||||
}
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest("returns null metadata when .dep-v0 is absent", async ({ cli }) => {
|
||||
@@ -427,7 +425,6 @@ cliTest(
|
||||
});
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -485,7 +482,6 @@ cliTest(
|
||||
expectCliMcpEvidenceParity(evidence, response.structuredContent, path);
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -532,7 +528,6 @@ cliTest(
|
||||
expect(parseMcpToolError(response).error).toMatchObject(expectedFailure);
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -689,7 +684,6 @@ cliTest(
|
||||
}
|
||||
await client.ping();
|
||||
},
|
||||
30000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
|
||||
@@ -309,7 +309,6 @@ cliTest(
|
||||
).toMatchObject({ code: "invalid_request" });
|
||||
}
|
||||
},
|
||||
60000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -451,5 +450,4 @@ cliTest(
|
||||
}
|
||||
expect((await readFile(path)).length).toBeGreaterThan(0);
|
||||
},
|
||||
30000,
|
||||
);
|
||||
@@ -86,5 +86,4 @@ cliTest(
|
||||
code: "ENOENT",
|
||||
});
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
@@ -139,7 +139,6 @@ cliTest(
|
||||
});
|
||||
expect(await readFile(config, "utf8")).toBe(updatedConfiguration);
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -767,7 +766,6 @@ cliTest(
|
||||
},
|
||||
});
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
for (const [client, provider] of [
|
||||
@@ -903,7 +901,6 @@ for (const [client, provider] of [
|
||||
});
|
||||
}
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
for (const invalidSetting of [
|
||||
@@ -955,7 +952,6 @@ for (const invalidSetting of [
|
||||
code: "ENOENT",
|
||||
});
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -1018,5 +1014,4 @@ cliTest(
|
||||
code: "ENOENT",
|
||||
});
|
||||
},
|
||||
120_000,
|
||||
);
|
||||
@@ -194,5 +194,4 @@ it.skipIf(
|
||||
error: { code: "invalid_request" },
|
||||
});
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
@@ -131,4 +131,4 @@ it("preserves file URL scheme spelling and script identity after real Inspector
|
||||
expect(original.predicate_type).toBe(first.predicate_type);
|
||||
expect(original.normalized_result).toEqual(first.normalized_result);
|
||||
expect(await readFile(source, "utf8")).toBe(sourceText);
|
||||
}, 30_000);
|
||||
});
|
||||
@@ -122,4 +122,4 @@ it("observes a real Node Inspector and releases attachments after cancellation a
|
||||
details: { reason: "endpoint_unreachable" },
|
||||
},
|
||||
});
|
||||
}, 30_000);
|
||||
});
|
||||
@@ -413,7 +413,7 @@ it("rejects OS-invalid local inputs through the real advertised MCP contracts",
|
||||
],
|
||||
},
|
||||
});
|
||||
}, 60_000);
|
||||
});
|
||||
|
||||
const ignoredOptions = [
|
||||
{ terminal: { columns: 80, row: 12 } },
|
||||
@@ -583,9 +583,6 @@ captureTest(
|
||||
},
|
||||
});
|
||||
},
|
||||
// 22 malformed requests plus two filesystem errors each start a fresh CLI.
|
||||
// Cache compilation, but allow for startup at the bounded fanout of two.
|
||||
120_000,
|
||||
);
|
||||
|
||||
captureTest.each(["untruncated", "truncated"] as const)(
|
||||
|
||||
@@ -240,7 +240,6 @@ const verifyPortableCli = async (
|
||||
|
||||
cliTest.for([{ profile: "full" }, { profile: "compact" }] as const)(
|
||||
"shared public CLI/MCP matching retains sources, pages exact facts, and feeds selected dossier pairs directly to compare_functions ($profile)",
|
||||
{ timeout: 60000 },
|
||||
async ({ profile }, { cli }) => {
|
||||
const fixture = await createMatchingFixture();
|
||||
const { left, right, leftDetails, rightDetails, importedPath } = fixture;
|
||||
@@ -484,7 +483,6 @@ cliTest(
|
||||
retainedBefore.structuredContent,
|
||||
);
|
||||
},
|
||||
60000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -657,7 +655,6 @@ cliTest(
|
||||
code: "evidence_integrity_mismatch",
|
||||
});
|
||||
},
|
||||
60000,
|
||||
);
|
||||
|
||||
cliTest(
|
||||
@@ -693,12 +690,10 @@ cliTest(
|
||||
before.structuredContent,
|
||||
);
|
||||
},
|
||||
60000,
|
||||
);
|
||||
|
||||
cliTest.for([{ profile: "full" }, { profile: "compact" }] as const)(
|
||||
"ties byte qualifications to selected observations through paged and offline MCP ($profile)",
|
||||
{ timeout: 60000 },
|
||||
async ({ profile }) => {
|
||||
const left = nativeMatchingInventory("1", [
|
||||
{ address: "0x10", value: "left" },
|
||||
@@ -831,7 +826,6 @@ cliTest.for([{ profile: "full" }, { profile: "compact" }] as const)(
|
||||
|
||||
cliTest(
|
||||
"bounds byte-source pages and recovers an oversized source",
|
||||
{ timeout: 60000 },
|
||||
async () => {
|
||||
const left = nativeMatchingInventory("1", [
|
||||
{ address: "0x10", value: "left" },
|
||||
@@ -940,7 +934,6 @@ cliTest(
|
||||
|
||||
cliTest(
|
||||
"oversized inline matching Evidence points back to the caller's original record",
|
||||
{ timeout: 60000 },
|
||||
async () => {
|
||||
const left = nativeMatchingInventory("1", [
|
||||
{ address: "0x10", value: "left" },
|
||||
|
||||
@@ -306,7 +306,7 @@ it("pages original trace-scoped facts after source deletion without conflating s
|
||||
}),
|
||||
),
|
||||
).toMatchObject({ error: { code: "invalid_request" } });
|
||||
}, 60_000);
|
||||
});
|
||||
|
||||
runtimeTest.runIf(!hasMemoryBound && runtimeSupported)(
|
||||
"refuses qlog when this runtime cannot enforce a decoder memory bound",
|
||||
@@ -417,7 +417,7 @@ it("runs built CLI and real stdio SDK with exact evidence parity, selection, ret
|
||||
error: { code: "invalid_request" },
|
||||
});
|
||||
expect(JSON.stringify(invalid)).not.toContain("mysecret");
|
||||
}, 60_000);
|
||||
});
|
||||
|
||||
it("fails whole-capture validation before selection and survives malformed, unsupported and oversized qlog", async () => {
|
||||
const root = await createTestTempDirectory("rea-qlog-errors-");
|
||||
@@ -524,7 +524,7 @@ it("fails whole-capture validation before selection and survives malformed, unsu
|
||||
await writeFile(path, qlog([event]));
|
||||
await client.ping();
|
||||
await expectRecoveredCapture(call, path);
|
||||
}, 60_000);
|
||||
});
|
||||
|
||||
runtimeTest.skipIf(
|
||||
process.versions.bun !== undefined || !hasMemoryBound || !runtimeSupported,
|
||||
@@ -566,5 +566,4 @@ runtimeTest.skipIf(
|
||||
await client.ping();
|
||||
await expectRecoveredCapture(call, path);
|
||||
},
|
||||
60_000,
|
||||
);
|
||||
Loaded 100 of 278 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user