From c81f68b59225d0acd34acbc419e408125fa51e36 Mon Sep 17 00:00:00 2001 From: Vance Ingalls Date: Tue, 4 Aug 2026 02:29:19 -0700 Subject: [PATCH] test(producer): treat an all-literal probe argv as taking no input CI runs the PR merged with main, so it saw a caller my branch predated: `spawnSync("ffprobe", ["-version"])` in engine/src/utils/ffprobe.test.ts. That is a capability check with no runtime path, so there is nothing to terminate, but the unclassified guard flagged it as a caller it could not parse. An argv whose entries are all string literals carries no input by construction. Those are dropped before the check; an argv with a bare identifier still has to be understood, verified by adding one and watching the guard fail. Co-Authored-By: Claude Opus 5 (1M context) --- .../producer/src/utils/ffprobeArgvContract.test.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/producer/src/utils/ffprobeArgvContract.test.ts b/packages/producer/src/utils/ffprobeArgvContract.test.ts index 3613eb780..5b2c1387b 100644 --- a/packages/producer/src/utils/ffprobeArgvContract.test.ts +++ b/packages/producer/src/utils/ffprobeArgvContract.test.ts @@ -77,7 +77,17 @@ function mentionsProbe(src: string): boolean { // Comments and doc prose describing a spawn are not a spawn: // `tts.test.mjs` explains `ffprobeDuration's spawnSync("ffprobe", ...) call` // in a comment and was reported as an unclassified caller. - const code = src.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/[^\n]*/g, ""); + // A probe spawned with an all-literal argv takes no runtime input, so + // there is nothing to terminate: `spawnSync("ffprobe", ["-version"])` is a + // capability check, not a file probe. Dropping those before the test keeps + // them out of the unclassified list without weakening it — an argv carrying + // a bare identifier (a path) still has to be understood. + const NO_INPUT_PROBE = + /(?:spawn|spawnSync|execFile\w*|exec)\s*\(\s*["'`]ff(?:probe|mpeg)["'`]\s*,\s*\[\s*(?:"[^"]*"\s*,?\s*)+\]/g; + const code = src + .replace(/\/\*[\s\S]*?\*\//g, "") + .replace(/\/\/[^\n]*/g, "") + .replace(NO_INPUT_PROBE, ""); return /(?:spawn|spawnSync|execFile\w*|exec)\s*\(\s*[^,)]*(?:ffprobe|ffProbe|probeBin|probePath)/i.test( code, );