refactor(tools): remove arbitrary workflow ceilings

This commit is contained in:
morluto
2026-09-29 17:36:26 +08:00
parent 6c68ff565f
commit 5f73cb061b
28 changed files with 184 additions and 195 deletions
@@ -27,7 +27,7 @@ it("reads local source maps as part of static artifact analysis", async () => {
);
});
it("does not follow symlinks and analyzes text beyond the former file-size cap", async () => {
it("does not follow symlinks and analyzes each local source file", async () => {
const root = await fixtureDirectory();
const outside = await createTestTempDirectory("rea-javascript-outside-");
const outsideFile = join(outside, "secret.js");
@@ -37,22 +37,27 @@ it("does not follow symlinks and analyzes text beyond the former file-size cap",
);
await symlink(outsideFile, join(root, "escape.js"));
const baseline = await reconstructJavaScriptArtifact({ input_path: root });
const oversizedSource = `// ${"private-marker-".repeat(600_000)}\nfetch("https://inside.invalid");\n`;
await writeFile(join(root, "oversized.js"), oversizedSource);
const additionalSource = Array.from(
{ length: 1_000 },
(_value, index) => `export const value${String(index)} = ${String(index)};`,
).join("\n");
await writeFile(join(root, "additional.js"), additionalSource);
const result = await reconstructJavaScriptArtifact({ input_path: root });
const encoded = JSON.stringify(result);
expect(result.statistics.text_bytes_read).toBeGreaterThan(8 * 1024 * 1024);
expect(result.graph.coverage).toMatchObject({
status: "complete",
truncated: false,
});
expect(result.statistics.parsed_javascript_files).toBe(
baseline.statistics.parsed_javascript_files + 1,
);
expect(result.statistics.text_bytes_read).toBe(
baseline.statistics.text_bytes_read + Buffer.byteLength(additionalSource),
);
expect(encoded).not.toContain(outsideFile);
expect(encoded).not.toContain("outside-secret.invalid");
expect(result.statistics.visited_ast_nodes).toBeGreaterThan(
baseline.statistics.visited_ast_nodes,
);
});
it("keeps malformed JavaScript, package metadata, and source maps as explicit unknowns", async () => {