ajieval native: Codex, Claude Code and OpenCode in bubblewrap with a shared network (backend only matters), a fresh HOME holding only the credential file and a harness-written minimal config (no user skills, MCP, memory, agents, plugins, global instructions), /work, read-only /docs and toolchain; evaluator and Aji repository invisible. Codex: workspace-write sandbox (shell without network), web search and product features off. Claude Code: tools Bash/Read/Edit/Write, strict MCP, slash commands off. OpenCode: pure, no MCP, webfetch/websearch/task off. Record aji-eval-native/1: CLI version, requested/transcript model, effort, account mode, config, command line, times, transcript, usage (normalized), patch, final repository, verdict. Gate on dev-echo (Aji/AIR) accepted for all three: codex 0.160.0 + gpt-6.1-sol (high), Claude Code 2.1.288 + claude-opus-5-5 (high), OpenCode 1.18.34 + zai-coding-plan/glm-5.3-flash. Protocol §39b and plan: Track B first (E-N0 done, E-N 18 runs), Track A after analysis.
70 lines
3.2 KiB
Python
70 lines
3.2 KiB
Python
"""Aggregates run records into the protocol's headline numbers (§13, §15,
|
|
§16, §17): Verified Success Rate, repair cycles to an accepted solution,
|
|
context consumed and expected cost per correct solution."""
|
|
|
|
import glob
|
|
import json
|
|
import os
|
|
import statistics
|
|
|
|
from . import util
|
|
|
|
|
|
def load(paths):
|
|
runs = []
|
|
for p in paths:
|
|
for f in [p] if p.endswith("run.json") else glob.glob(os.path.join(p, "**", "run.json"), recursive=True):
|
|
if "/superseded/" in f:
|
|
continue
|
|
runs.append(util.read_json(f))
|
|
return runs
|
|
|
|
|
|
def mean(xs):
|
|
xs = [x for x in xs if x is not None]
|
|
return round(statistics.mean(xs), 2) if xs else None
|
|
|
|
|
|
def aggregate(runs):
|
|
cells = {}
|
|
for r in runs:
|
|
if r.get("track") == "B":
|
|
a = r["agent"]
|
|
key = (r["task"]["id"], r["language"]["name"], "B:" + (a.get("label") or a["name"]), a["name"] + ":" + a["model"])
|
|
else:
|
|
key = (r["task"]["id"], r["language"]["name"], r["model"].get("class") or "-", r["model"]["id"])
|
|
cells.setdefault(key, []).append(r)
|
|
rows = []
|
|
for (task, lang, cls, model), rs in sorted(cells.items()):
|
|
acc = [r for r in rs if r.get("accepted")]
|
|
costs = [r.get("cost_usd") for r in rs]
|
|
total_cost = None if any(c is None for c in costs) else round(sum(costs), 4)
|
|
rows.append({
|
|
"task": task, "language": lang, "class": cls, "model": model,
|
|
"runs": len(rs), "accepted": len(acc),
|
|
"verified_success_rate": round(len(acc) / len(rs), 3),
|
|
"repair_cycles_accepted": mean([r["metrics"]["failed_verifier_cycles"] + r["metrics"]["failed_test_cycles"] for r in acc if r["metrics"].get("failed_verifier_cycles") is not None]),
|
|
"context_tokens_mean": mean([r["metrics"].get("input_tokens") for r in rs]),
|
|
"output_tokens_mean": mean([r["metrics"].get("output_tokens") for r in rs]),
|
|
"tool_calls_mean": mean([r["metrics"]["tool_calls"] for r in rs]),
|
|
"first_check_accepted": sum(1 for r in rs if r["metrics"].get("first_check_accepted") or r["metrics"].get("first_build_accepted")),
|
|
"cost_total_usd": total_cost,
|
|
"cost_per_correct_usd": None if total_cost is None or not acc else round(total_cost / len(acc), 4),
|
|
"unclassified_failures": sum(1 for r in rs if r.get("accepted") is False and not r.get("classification")),
|
|
"terminations": sorted({r["metrics"]["termination"] for r in rs}),
|
|
})
|
|
return rows
|
|
|
|
|
|
def markdown(rows):
|
|
head = ["task", "language", "class", "model", "runs", "accepted", "VSR", "repair cycles (accepted)", "context tokens", "cost/correct USD", "unclassified failures"]
|
|
out = ["| " + " | ".join(head) + " |", "|" + "---|" * len(head)]
|
|
for r in rows:
|
|
out.append("| " + " | ".join(str(x) for x in [r["task"], r["language"], r["class"], r["model"], r["runs"], r["accepted"], r["verified_success_rate"], r["repair_cycles_accepted"], r["context_tokens_mean"], r["cost_per_correct_usd"], r["unclassified_failures"]]) + " |")
|
|
return "\n".join(out)
|
|
|
|
|
|
def print_report(paths, as_json=False):
|
|
rows = aggregate(load(paths))
|
|
print(json.dumps(rows, indent=2) if as_json else markdown(rows))
|