Repository navigation
Done
Labels
Description
Outcome
The benchmark did not produce a result. The run failed at the first step, so there is nothing to compare.
- Task: none. The task picker returned
null, so no title, domain, description or criteria exist. - Timing: not measured for either approach. The decomposed program's final status is
failed: task picker returned null. - Decomposition attempts: none, because the workflow returned before reaching that phase.
- Grading, single-call solution, decomposed source and decomposed solution: all empty. Nothing was generated.
Environment problems
- Typecheck not run:
node rig.ts --typecheckfailed withnpm error code DEPTH_ZERO_SELF_SIGNED_CERT. The CLI tried to fetchtypescriptthroughpackagefeedproxy.microsoft.io, and the certificate was rejected as self-signed. The skill directory has nonode_modules. A retry withNODE_OPTIONS=--use-system-cafailed the same way. - Execution: I ran the program once with
--server, as required. It exited with code 0. Stdout was{"status":"failed: task picker returned null"}and stderr was empty. - Cause not established: the picker call returned
null, but nothing in the captured output says why, and I did not debug further or re-run, as instructed.
Verdict
No winner. Neither approach ran, so there is nothing to compare.
Benchmark program (Step 1)
import { agent, workflow, s, repair, configureAgent, copilotEngine } from "rig";
configureAgent(copilotEngine());
const DEADLINE = Date.now() + 25 * 60_000;
const SKILL_DIR = "/home/runner/work/rig/rig/.github/skills/rig";
const remaining = () => DEADLINE - Date.now();
const SKELETON = `import { agent, workflow, s } from "rig";
// Agent role: <role>
const analyze = agent({ model: "small", instructions: "...", output: s.string });
// Workflow role: combines the agents' outputs into the final solution
export default workflow({
meta: { name: "decomposed-solution", description: "..." },
body: async ({ call }) => {
const analysis = await call(analyze, "...");
return { solution: analysis ?? "" };
},
});`;
const CONTRACT = `Rules for the rig program (you have no access to documentation, follow exactly):
- Import only from "rig". Use agent, workflow, s.
- Root takes no required input and is exported via \`export default\` without being invoked.
- A workflow() spec accepts only meta, an optional input, and body. It has NO output or execute field; the final { solution } object is simply what body returns.
- An agent() root instead declares output: s.object({ solution: s.string }).
- Use at least two agents, each preceded by a \`// Agent role: ...\` comment; choose model "small" for simple sub-steps and "medium" or "large" for harder ones. The workflow must have a \`// Workflow role: ...\` comment and combine the agents' outputs rather than one agent solving everything.
- Use output: s.string for every agent whose result is source text or free-form solution; do not wrap large solutions in object schemas.
- Call agents with \`await call(agentName, "prompt string")\`; the result may be null.
- Required skeleton (abridged to one agent; yours needs at least two):
${SKELETON}
Return ONLY the complete TypeScript source, no Markdown fences and no commentary.`;
// Agent role: pick a benchmark task
const picker = agent({
model: "small",
maxTurns: 2,
addons: [repair()],
instructions:
"Pick one concrete, complicated task a person or team might face in a single day that would naturally benefit from being split across sub-agents running different models: multi-source research and synthesis, a multi-file coding task with design/implementation/review phases, a structured report combining independent analyses, or a multi-step data transformation pipeline. It must be self-contained (no external files or live web) and gradeable. Vary the domain; seed for variety: " +
String(Date.now() % 9973) +
". Return title, domain, description, and 3-6 concrete checkable success criteria.",
output: s.object({
title: s.string,
domain: s.string,
description: s.string,
criteria: s.array(s.string),
}),
});
// Agent role: solve the whole task alone in one turn
const solver = agent({
model: "medium",
maxTurns: 1,
instructions:
"Solve the entire task yourself in a single response, addressing every success criterion. No delegation, no tools. Return the complete solution verbatim (Markdown code fences allowed).",
output: s.string,
});
// Agent role: write the decomposed rig program
const writer = agent({
model: "medium",
maxTurns: 1,
instructions: "You write self-contained rig TypeScript programs that split a task across several agents.\n" + CONTRACT,
output: s.string,
});
// Agent role: fix a rig program from captured errors
const fixer = agent({
model: "medium",
maxTurns: 1,
instructions:
"You fix rig TypeScript programs. Fix precisely what the error names while preserving what already worked; do not make unrelated edits. If told there is no source to fix, generate the complete program from the task and skeleton.\n" + CONTRACT,
output: s.string,
});
// Agent role: grade both solutions
const grader = agent({
model: "large",
maxTurns: 1,
instructions:
"Score each solution 0-10 on how completely and correctly it satisfies the success criteria. Judge only on correctness and completeness of content, not on length or on which approach produced it. Pick winner single-call, decomposed, or tie and explain the comparison.",
output: s.object({
singleScore: s.number,
decomposedScore: s.number,
winner: s.enum("single-call", "decomposed", "tie"),
rationale: s.string,
}),
});
type Run = { code: number | null; stdout: string; stderr: string; timedOut: boolean };
async function runCli(source: string, flag: string, limitMs: number): Promise<Run> {
const { spawn } = await import("node:child_process");
return new Promise<Run>((resolve) => {
const child = spawn("node", ["rig.ts", flag], { cwd: SKILL_DIR, stdio: ["pipe", "pipe", "pipe"] });
let stdout = "";
let stderr = "";
let timedOut = false;
const timer = setTimeout(() => {
timedOut = true;
child.kill("SIGKILL");
}, limitMs);
child.stdout.on("data", (d: Buffer) => (stdout += d.toString()));
child.stderr.on("data", (d: Buffer) => (stderr += d.toString()));
child.on("error", (e: Error) => {
clearTimeout(timer);
resolve({ code: -1, stdout, stderr: stderr + String(e), timedOut });
});
child.on("close", (code: number | null) => {
clearTimeout(timer);
resolve({ code, stdout, stderr, timedOut });
});
child.stdin.on("error", () => {});
child.stdin.end(source);
});
}
function clean(src: string | null): string {
if (!src) return "";
const m = src.match(/```(?:ts|typescript)?\n([\s\S]*?)```/);
return (m ? m[1] : src).trim();
}
type Attempt = { attempt: number; generation: string; typecheck: string; execute: string; error: string };
// Workflow role: pick task, solve both ways, grade, return the report
export default workflow({
meta: { name: "decomposition-benchmark", description: "Compare single-call vs decomposed solving" },
body: async ({ call }) => {
const task = await call(picker, "Pick the benchmark task.");
if (!task) return { status: "failed: task picker returned null" };
const taskText = `Title: ${task.title}\nDomain: ${task.domain}\nDescription: ${task.description}\nSuccess criteria:\n${task.criteria.map((c: string, i: number) => `${i + 1}. ${c}`).join("\n")}`;
const t0 = Date.now();
const single = await call(solver, taskText);
const singleMs = Date.now() - t0;
const t1 = Date.now();
const attempts: Attempt[] = [];
let source = "";
let solution = "";
let status = "fail";
let prevError = "";
for (let n = 1; n <= 2; n++) {
if (remaining() < 3 * 60_000) break;
const rec: Attempt = { attempt: n, generation: "", typecheck: "skipped", execute: "skipped", error: "" };
attempts.push(rec);
let gen: string | null;
if (n === 1) {
gen = await call(writer, `Write the rig program for this task:\n${taskText}`);
} else if (source) {
gen = await call(fixer, `Task:\n${taskText}\n\nCurrent source:\n${source}\n\nExact captured error:\n${prevError}\n\nSkeleton:\n${SKELETON}\n\nFix precisely what the error names, preserving what already worked.`);
} else {
gen = await call(fixer, `There is no source to fix; the first attempt produced nothing. Generate the complete program from the original task and skeleton.\n\nTask:\n${taskText}\n\nSkeleton:\n${SKELETON}`);
}
const src = clean(gen);
if (!src) {
rec.generation = "empty";
rec.error = "writer returned null or whitespace-only source";
prevError = rec.error;
continue;
}
rec.generation = "ok";
source = src;
const tc = await runCli(src, "--typecheck", Math.min(2 * 60_000, Math.max(remaining(), 1000)));
if (tc.code !== 0) {
rec.typecheck = tc.timedOut ? "timeout" : "fail";
rec.error = `${tc.stdout}\n${tc.stderr}`.trim();
prevError = rec.error;
continue;
}
rec.typecheck = "pass";
if (remaining() < 60_000) {
rec.execute = "skipped (time budget)";
break;
}
const ex = await runCli(src, "--server", Math.min(5 * 60_000, Math.max(remaining(), 1000)));
if (ex.code !== 0 || ex.timedOut) {
rec.execute = ex.timedOut ? "timeout" : "fail";
rec.error = `${ex.stdout}\n${ex.stderr}`.trim();
prevError = rec.error;
continue;
}
let parsed: unknown = null;
try {
parsed = JSON.parse(ex.stdout.trim());
} catch {
parsed = null;
}
const sol = parsed && typeof parsed === "object" ? (parsed as { solution?: unknown }).solution : undefined;
if (typeof sol === "string" && sol.trim()) {
rec.execute = "pass";
solution = sol;
status = "pass";
break;
}
rec.execute = "fail";
rec.error = `stdout was not JSON with a non-empty solution string:\n${ex.stdout}\n${ex.stderr}`.trim();
prevError = rec.error;
}
const decomposedMs = Date.now() - t1;
const decomposedForGrade = solution || "(decomposition produced no solution)";
const singleForGrade = single || "(single-call produced no solution)";
const grade = await call(
grader,
`${taskText}\n\n=== SOLUTION A (single-call) ===\n${singleForGrade}\n\n=== SOLUTION B (decomposed) ===\n${decomposedForGrade}\n\nIn the output, singleScore is for A and decomposedScore is for B.`,
);
return { task, singleMs, decomposedMs, singleSolution: single ?? "", decomposedSolution: solution, attempts, status, decomposedSource: source, grade };
},
});Captured typecheck output (failed to run)
Typecheck failed for <stdin>.
npm error code DEPTH_ZERO_SELF_SIGNED_CERT
npm error errno DEPTH_ZERO_SELF_SIGNED_CERT
npm error request to (packagefeedproxy.microsoft.io/redacted) failed, reason: self-signed certificate; if the root CA is installed locally, try running Node.js with --use-system-ca
Captured run output
stdout: {"status":"failed: task picker returned null"}
stderr: (empty)
Verdict: no winner. The task picker returned null, so neither approach ran.
Generated by Daily Rig Decomposition Benchmark · copilot · auto · ~37 AIC · ⌖ ~1 AIC · ⊞ 4K · ◷
- expires on Nov 30, 2026, 1:05 PM UTC
Reacted by Copilot
Activity