Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Eval: from-skill says a skill that runs in parts can't be measured, instead of scoring its first part

Claudebef8778eafa2
diff --git a/scripts/eval/lib/from-skill.mjs b/scripts/eval/lib/from-skill.mjs
index 03b25eb9..570eeba7 100644
--- a/scripts/eval/lib/from-skill.mjs
+++ b/scripts/eval/lib/from-skill.mjs
@@ -9,6 +9,8 @@ import { LOCAL_DIR } from "./paths.mjs";
const FIXTURE = { image: "fixtures/start-frame.png", video: "fixtures/walk-6s.mp4", audio: "fixtures/voice.wav" };
/** The case's input list per type (cases' `inputs`), and the body's token for its n-th file. */
const SLOT = { image: "images", video: "videos", audio: "audios" };
+/** A step reference (recipe version 2): a field that takes an earlier step's output, `{{steps.<key>.output}}`. */
+const STEP_REF = /\{\{\s*steps\./;
/** What a kind of result is measured by (no reference or prompt of its own: the words vary per skill). */
const METRICS_FOR = { image: ["aesthetic"], video: ["temporal"], audio: [] };
@@ -43,6 +45,9 @@ export function suiteFromSkill(view) {
const recipe = view?.recipe;
if (!recipe || !Array.isArray(recipe.steps)) throw new Error("That skill has no recipe to measure");
if (recipe.steps.some((s) => s.kind !== "generate")) throw new Error(`/${view.name} runs a studio tool: the harness measures skills made of generate steps`);
+ // A step that takes an earlier step's output by reference ({{steps.<key>.output}}, recipe version 2) makes the run go
+ // in parts: the run route answers with the first part's rows only, so the harness would measure the wrong result.
+ if (recipe.steps.some((s) => STEP_REF.test(JSON.stringify(s.request ?? {})))) throw new Error(`/${view.name} runs in parts (a step takes another's output by reference): the harness measures skills that run as one pipeline`);
if (!view.engines?.length) throw new Error(`/${view.name} doesn't run on this Fuobe${view.why ? `: ${view.why}` : ""}`);
const ends = leaves(recipe.steps);
const end = ends.at(-1);
diff --git a/tests/eval-from-skill.test.ts b/tests/eval-from-skill.test.ts
index 7bf2b846..6a371d6c 100644
--- a/tests/eval-from-skill.test.ts
+++ b/tests/eval-from-skill.test.ts
@@ -152,4 +152,12 @@ describe("pnpm eval:from-skill", () => {
expect(() => fromSkill.suiteFromSkill(view)).toThrow(/runs a studio tool/);
expect(() => fromSkill.suiteFromSkill({ ...view, engines: [], why: "It runs on cloud models, which aren't available here", recipe: lamp() })).toThrow(/doesn't run on this Fuobe: It runs on cloud models/);
});
+
+ it("refuses a skill that runs in parts (a step takes another's output by reference)", () => {
+ const parts = lamp();
+ const scene = { key: "scene", kind: "generate", request: { ...parts.steps[1].request, inputs: { images: ["{{steps.cutout.output}}"] } } };
+ const view = { name: "parts", title: "Parts", engines: ["cloud"], recipe: { ...parts, fuobeRecipe: 2, steps: [parts.steps[0], scene] } };
+ expect(() => fromSkill.suiteFromSkill(view)).toThrow(/runs in parts/);
+ expect(() => fromSkill.suiteFromSkill({ ...view, recipe: lamp() })).not.toThrow();
+ });
});