feat(cli): --frame-check accepts a severity/seek/tol spec

The pipeline already carried FrameCheckOptions; only the flag was
boolean, which meant a pipeline caller tuning severity or seek points
would have them silently dropped — the two sides only agreed because
today's caller happens to match the defaults. Bare --frame-check keeps
the defaults; the value form mirrors --caption-zone's grammar, freezing
the contract before a release pins it.
This commit is contained in:
Miguel Angel Simon Sierra
2026-07-10 18:04:09 -04:00
parent 67cdf0fdb7
commit 659cb6a236
3 changed files with 76 additions and 22 deletions
+16
View File
@@ -1112,6 +1112,22 @@ describe("check pipeline", () => {
});
});
describe("frame-check flag grammar", () => {
it("keeps bare --frame-check on defaults and parses the value form", async () => {
const { parseFrameCheck } = await import("./check.js");
expect(parseFrameCheck(undefined)).toBeUndefined();
expect(parseFrameCheck(true)).toEqual({});
expect(parseFrameCheck("")).toEqual({});
expect(parseFrameCheck("severity=error;seek=.25,.75;tol=4")).toEqual({
severity: "error",
seek: [0.25, 0.75],
tol: 4,
});
expect(() => parseFrameCheck("bogus=1")).toThrow("Invalid --frame-check");
expect(() => parseFrameCheck("tol=-2")).toThrow("Invalid --frame-check");
});
});
describe("contrast persistence", () => {
it("demotes a single-sample contrast failure to warning but gates held failures", async () => {
const driver = fakeDriver({