test(qa): align AI oracles with fixtures and honor QA_OUT_DIR (#686)

The ocr oracle demanded six pangram words when ocr-clean.png prints five; the ocr-pdf oracle expected a searchable PDF when the tool's contract is text extraction; media-30s.mp4 was eight seconds long. Fix all three, regenerate tool-contract.json from current schemas, record the new fixture in the manifest, and add a QA_OUT_DIR override so parallel machines stop clobbering each other's lane output. Fixes #677.
This commit is contained in:
SnapOtter
2026-07-30 10:32:07 +08:00
committed by GitHub
parent 142aeaf9c5
commit 6c2fa307f4
7 changed files with 28 additions and 23 deletions
@@ -570,17 +570,6 @@ export function expectJapaneseScript(text: string, minimumChars = 4): void {
);
}
/** PDF OCR: a real PDF that now carries a selectable text layer. */
export function expectSearchablePdf(output: Buffer): void {
assertOracle(output.subarray(0, 5).toString("latin1") === "%PDF-", "artifact is not a PDF");
assertOracle(output.length > 1000, "PDF artifact is implausibly small");
const body = output.toString("latin1");
assertOracle(
body.includes("/Font") || body.includes("BT\n") || body.includes("Tj"),
"PDF carries no text-drawing operators, so no OCR layer was added",
);
}
/** Animated cut-outs must stay animated: a single-frame result is a regression. */
export async function expectAnimatedFrames(output: Buffer, minimumFrames = 2): Promise<void> {
const meta = await sharp(output, { pages: -1 }).metadata();