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.

fuobe eval: the evaluation harness from the CLI, with its server and token

Claude557a5211bfe4
diff --git a/bin/lib/cli.mjs b/bin/lib/cli.mjs
index 07e2bc3a..4c5e07d4 100644
--- a/bin/lib/cli.mjs
+++ b/bin/lib/cli.mjs
@@ -96,7 +96,8 @@ export async function main(argv, io) {
}
try {
- const { values, positionals } = parseArgs(rest, cmd.options ?? {}, name);
+ // A passthrough command (eval) parses its own arguments.
+ const { values, positionals } = cmd.passthrough ? { values: {}, positionals: rest } : parseArgs(rest, cmd.options ?? {}, name);
if (values.help) {
print(commandHelp(name));
return EXIT.ok;
diff --git a/bin/lib/commands.mjs b/bin/lib/commands.mjs
index ebb6345d..20bf8e2e 100644
--- a/bin/lib/commands.mjs
+++ b/bin/lib/commands.mjs
@@ -740,9 +740,22 @@ async function mcp(ctx) {
* @property {Record<string, OptionSpec>} [options]
* @property {string[]} [examples]
* @property {true} [ownConfig] reads the saved config itself (login, logout), so a broken one doesn't stop it
+ * @property {true} [passthrough] takes its arguments as they are (eval hands them to the harness's own parser)
* @property {(ctx: any) => Promise<number | void>} run
*/
+// ---------------------------------------------------------------------------
+// eval
+
+/** The evaluation harness (scripts/eval), which lives in the Fuobe checkout next to this CLI. */
+async function evalHarness(ctx) {
+ const entry = new URL("../../scripts/eval/eval.mjs", import.meta.url);
+ if (!fs.existsSync(entry)) throw new ApiError("fuobe eval runs from a Fuobe checkout: scripts/eval isn't next to this CLI (clone the repo and run it there).");
+ const { main: harness } = await import(entry.href);
+ const env = { ...ctx.io.env, ...(ctx.target.url && !ctx.io.env.FUOBE_URL && { FUOBE_URL: ctx.target.url }), ...(ctx.target.token && !ctx.io.env.FUOBE_TOKEN && { FUOBE_TOKEN: ctx.target.token }) };
+ return harness(ctx.positionals, { stdout: ctx.io.stdout, stderr: ctx.io.stderr, env, fetch: ctx.io.fetch });
+}
+
/** @type {Record<string, Command>} */
export const COMMANDS = {
login: {
@@ -872,6 +885,13 @@ export const COMMANDS = {
examples: ["fuobe mcp", "fuobe mcp --json"],
run: mcp,
},
+ eval: {
+ summary: "Measure Fuobe Originals: run a suite, score, review blind, compare runs",
+ usage: "fuobe eval <run|report|review|compare|promote|history|validate|setup> [options] (from a Fuobe checkout)",
+ examples: ["fuobe eval run --suite selftest --engine demo", "fuobe eval run --suite soul --engine open --looks v1-general --variants recipe,prompt-only", "fuobe eval compare latest~1 latest --fail-on clip --threshold 1"],
+ passthrough: true,
+ run: evalHarness,
+ },
};
/** Other names people type. */
diff --git a/docs/cli.md b/docs/cli.md
index a020673c..0fff1a23 100644
--- a/docs/cli.md
+++ b/docs/cli.md
@@ -227,6 +227,20 @@ Desktop, Cursor, Codex…) take the server entry it prints on stderr (`fuobe mcp
The agent then has `search_models`, `estimate_cost`, `generate`, `check_generations`, the studio
tools and Fuobe's skills as prompts.
+### `fuobe eval` — measure the Fuobe Originals
+
+From a Fuobe checkout, `fuobe eval <command>` is the evaluation harness (`pnpm eval:<command>`), run
+against the same server and token as the other commands:
+
+```bash
+fuobe eval run --suite selftest --engine demo # a free self-test of the harness
+fuobe eval run --suite soul --engine open --looks v1-general --variants recipe,prompt-only
+fuobe eval compare latest~1 latest --fail-on clip --threshold 1 # exit 1 on a regression
+```
+
+See [`scripts/eval/README.md`](../scripts/eval/README.md) for the suites, metrics, blind review and
+the promote rule.
+
## Skills for other agents
Fuobe's skills are [Agent Skills](https://agentskills.io/specification), so the open `skills` CLI
diff --git a/tests/eval-harness.test.ts b/tests/eval-harness.test.ts
index 94dc6327..6b319646 100644
--- a/tests/eval-harness.test.ts
+++ b/tests/eval-harness.test.ts
@@ -395,6 +395,16 @@ describe("report, blind review, compare and promote", () => {
expect(unknown.stderr).toMatch(/Unknown metric “smell”/);
});
+ it("fuobe eval hands its arguments to the harness, with the CLI's server and token", async () => {
+ const { main } = (await import("../bin/lib/cli.mjs")) as { main: (argv: string[], io: object) => Promise<number> };
+ const out = sink();
+ const err = sink();
+ const io = { stdout: out.stream, stderr: err.stream, env: { ...process.env, FUOBE_EVAL_RESULTS: results, FUOBE_CONFIG: path.join(dir, "no-config.json") }, cwd: process.cwd(), home: dir, fetch, columns: 100, stdinIsTTY: false, stderrIsTTY: false, now: Date.now, sleep: async () => {}, onInterrupt: () => () => {}, ask: async () => "", readStdin: async () => "" };
+ expect(await main(["eval", "compare", "fake-open-1", "fake-open-3", "--fail-on", "clip", "--threshold", "0.5"], io)).toBe(1);
+ expect(out.text()).toMatch(/Regressions:/);
+ expect(await main(["eval", "history", "--suite", "soul", "--json"], io)).toBe(0);
+ });
+
it("history lists runs, newest first", async () => {
const h = await cli(["history", "--json"]);
const doc = JSON.parse(h.stdout);