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
+17 -6
View File
@@ -5,6 +5,7 @@ import {
analysisProfilesEqual,
createAnalysisProfile,
} from "./analysisProfile.js";
import type { JsonValue } from "./jsonValue.js";
const PROVIDER = {
id: "fixture",
@@ -58,15 +59,25 @@ describe("analysis profile commitments", () => {
expect(analysisProfileSchema.parse(profile)).toEqual(profile);
});
it("rejects digest tampering and structurally unsafe parameters", () => {
it("accepts deep, large, and long-string profile parameters", () => {
let nested: JsonValue = "leaf";
for (let index = 0; index < 24; index += 1)
nested = { [`level-${String(index)}`]: nested };
const parameters = {
nested,
entries: Array.from({ length: 5_000 }, (_, index) => index),
long_value: "x".repeat(20 * 1024),
};
const profile = createAnalysisProfile(PROVIDER, parameters);
expect(analysisProfileSchema.parse(profile)).toEqual(profile);
});
it("rejects digest tampering", () => {
const profile = createAnalysisProfile(PROVIDER, { loader: "default" });
expect(() =>
analysisProfileSchema.parse({ ...profile, digest: "0".repeat(64) }),
).toThrow(/digest/u);
expect(() =>
createAnalysisProfile(PROVIDER, {
oversized: "x".repeat(65 * 1024),
}),
).toThrow(/structural limits/u);
});
});