eval: Track B repair metrics from transcripts, ajieval summary, authoring prompts

- native runs derive toolchain invocations, failed verifier/test cycles,
  first check and first public test from the transcript's shell commands
  (exit codes, per-language diagnostic patterns in the profiles)
- ajieval summary: shareable PASS/FAIL matrix per task, per-cell metrics
  (verified, first attempt, repair cycles, tool calls, time, unique
  bundle, context via tools, provider cached/uncached, classification,
  caught by) and aggregates by language and agent
- benchmark-authoring.md: owner's prompts for the benchmark author and
  the per-language reference implementers, order of work, re-gate rule,
  no commits to this repository between freeze and the 18th run, what
  comes back to the language developer
This commit is contained in:
dev committed 2026-10-04 18:03:27 +03:00
1 parent 8b7911669d
commit 93cf553a77
9 files changed
+298 -33

No files matched your search

+57
View File
@@ -78,3 +78,60 @@ def markdown(rows):
def print_report(paths, as_json=False):
rows = aggregate(load(paths))
print(json.dumps(rows, indent=2) if as_json else markdown(rows))
def _agent_key(r):
if r.get("track") == "B":
return (r["agent"].get("label") or "") + " " + r["agent"]["name"]
return (r["model"].get("class") or "") + " " + r["model"]["id"]
def summary(paths):
"""The shareable summary of an experiment (no task details beyond task
IDs): the PASS/FAIL matrix per task, per-cell metrics, and aggregates
by language and by agent/model."""
runs = load(paths)
langs = sorted({r["language"]["name"] for r in runs})
agents = sorted({_agent_key(r) for r in runs})
tasks = sorted({r["task"]["id"] for r in runs})
out = []
for t in tasks:
out.append(f"### {t}\n")
out.append("| agent | " + " | ".join(langs) + " |")
out.append("|---|" + "---|" * len(langs))
for a in agents:
cells = []
for lang in langs:
rs = [r for r in runs if r["task"]["id"] == t and r["language"]["name"] == lang and _agent_key(r) == a]
cells.append(" ".join("PASS" if r.get("accepted") else ("FAIL" if r.get("accepted") is False else "?") for r in rs) or "-")
out.append(f"| {a} | " + " | ".join(cells) + " |")
out.append("")
head = ["task", "language", "agent", "verified", "first attempt", "repair cycles", "tool calls", "seconds",
"unique bundle", "context via tools", "provider input cached/uncached", "classification", "caught by"]
out.append("### Cells\n")
out.append("| " + " | ".join(head) + " |")
out.append("|" + "---|" * len(head))
for r in sorted(runs, key=lambda r: (r["task"]["id"], r["language"]["name"], _agent_key(r))):
m = r["metrics"]
ctx = m.get("context") or {}
pin = ctx.get("provider_input_tokens") or {}
cyc = None if m.get("failed_verifier_cycles") is None else m["failed_verifier_cycles"] + (m.get("failed_test_cycles") or 0)
cl = r.get("classification") or {}
out.append("| " + " | ".join(str(x) for x in [
r["task"]["id"], r["language"]["name"], _agent_key(r), "PASS" if r.get("accepted") else "FAIL",
m.get("first_public_test_passed"), cyc, m.get("tool_calls"), m.get("elapsed_seconds"),
ctx.get("unique_reference_tokens"), ctx.get("cumulative_context_tokens"), f"{pin.get('cached')}/{pin.get('uncached')}",
cl.get("category", "-" if r.get("accepted") else "unclassified"), cl.get("caught_by") or "-"]) + " |")
out.append("")
for title, keyf in (("language", lambda r: r["language"]["name"]), ("agent", _agent_key)):
out.append(f"### By {title}\n")
out.append(f"| {title} | runs | accepted | VSR | mean repair cycles | mean tool calls | mean seconds | mean uncached input |")
out.append("|---|---|---|---|---|---|---|---|")
for k in sorted({keyf(r) for r in runs}):
rs = [r for r in runs if keyf(r) == k]
acc = sum(1 for r in rs if r.get("accepted"))
cyc = [r["metrics"]["failed_verifier_cycles"] + (r["metrics"].get("failed_test_cycles") or 0) for r in rs if r["metrics"].get("failed_verifier_cycles") is not None]
unc = [((r["metrics"].get("context") or {}).get("provider_input_tokens") or {}).get("uncached") for r in rs]
out.append(f"| {k} | {len(rs)} | {acc} | {round(acc / len(rs), 3)} | {mean(cyc)} | {mean([r['metrics'].get('tool_calls') for r in rs])} | {mean([r['metrics'].get('elapsed_seconds') for r in rs])} | {mean(unc)} |")
out.append("")
return "\n".join(out)