fix(core,figma-skill): address PR feedback — regex key escaping, no-shell psnr probe

- motionContextToDocs: escape regex metacharacters in arrayAfterKey /
  scalarAfterKey key interpolation (safe today for \\w+ keys; now safe for
  any future caller), and document balancedBlock's no-strings invariant.
- verify-motion.mjs: execSync shell string -> spawnSync with array args
  (JSON.stringify is not shell escaping); verifier re-calibrated unchanged
  (faithful render still PASS at min 20.30dB).
- command-failure-tracking: rebase folded the group-delegation skip into
  upstream's recursive wrapCommand (HF#2033) — leaf commands now assert
  their own flag tables, so `figma component --namee` is rejected at the
  leaf while `--name` passes the group; heuristic invariant documented.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Vance Ingalls
2026-07-09 00:51:35 -07:00
co-authored by Claude Fable 5
parent a2243f7586
commit 3d59dcc694
3 changed files with 16 additions and 7 deletions
+4 -3
View File
@@ -21,7 +21,7 @@
* frame. Measure it from the render (the card's left/top edge + scaled
* size), don't guess: a wrong crop reads as motion divergence.
*/
import { execFileSync, execSync } from "node:child_process";
import { execFileSync, spawnSync } from "node:child_process";
import { mkdtempSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
@@ -72,8 +72,9 @@ const frame = (src, t, vf, dst) => {
const diff = (a, b, dst) =>
execFileSync("ffmpeg", ["-y", "-v", "error", "-i", a, "-i", b, "-filter_complex", "blend=all_mode=difference", dst]);
const psnr = (a, b) => {
const err = execSync(`ffmpeg -i ${JSON.stringify(a)} -i ${JSON.stringify(b)} -lavfi psnr -f null - 2>&1`).toString();
const m = err.match(/average:([\d.]+|inf)/);
// spawnSync with array args (no shell): psnr stats land on stderr
const r = spawnSync("ffmpeg", ["-i", a, "-i", b, "-lavfi", "psnr", "-f", "null", "-"], { encoding: "utf8" });
const m = (r.stderr || "").match(/average:([\d.]+|inf)/);
return m ? (m[1] === "inf" ? 99 : Number(m[1])) : NaN;
};