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:
1 parent
8b7911669d
commit
93cf553a77
9 files changed
+298
-33
No files matched your search
@@ -20,42 +20,118 @@ Rules:
|
||||
|
||||
Reference writers can run through the harness itself, which gives them exactly the participants' environment: `ajieval native` with the task, the language and generous limits. The runs live in the private repository, and their records are not shared with the language developer.
|
||||
|
||||
## Brief for the benchmark author
|
||||
## Order
|
||||
|
||||
> You are designing a private held-out benchmark for comparing AI agents writing systems software in three languages: Aji/AIR, Rust and Zig. You have no role in Aji language design and must not optimize tasks for Aji.
|
||||
```text
|
||||
benchmark author (clean session)
|
||||
↓
|
||||
tasks and evaluators frozen
|
||||
↓
|
||||
Rust reference Zig reference Aji/AIR reference (three separate clean sessions)
|
||||
↓
|
||||
all PASS
|
||||
↓
|
||||
owner reviews metadata only
|
||||
↓
|
||||
ajieval freeze (smoke plan)
|
||||
↓
|
||||
18 native runs in frozen order
|
||||
```
|
||||
|
||||
If a reference writer finds a real ambiguity or an evaluator defect, the benchmark author may correct the task. Its version and hash then change, and all three references must pass the gate again. After the final freeze nothing is corrected until the 18th run.
|
||||
|
||||
## Prompt: benchmark author (owner's text)
|
||||
|
||||
> You are an independent benchmark author.
|
||||
>
|
||||
> Create two benchmark tasks:
|
||||
> You are NOT an Aji language designer. Do not optimize tasks for Aji or for any specific programming language.
|
||||
>
|
||||
> 1. A memory-safety-heavy streaming/binary-processing systems task.
|
||||
> 2. A concurrency-heavy bounded-processing task.
|
||||
> You are working in a private benchmark repository. Do not expose hidden task details, evaluator logic, hidden tests, reference solutions, or mutations outside this repository.
|
||||
>
|
||||
> The tasks must belong to these broad families, but must NOT reproduce public examples such as a simple length-prefixed frame decoder, append-only log, basic producer/consumer pipeline, or simple fan-out example.
|
||||
> Read the benchmark-authoring requirements provided in the repository and create exactly two held-out systems-programming tasks:
|
||||
>
|
||||
> For each task produce:
|
||||
> 1. one memory-safety-heavy streaming/binary-processing task;
|
||||
> 2. one concurrency-heavy bounded-processing task.
|
||||
>
|
||||
> - a language-neutral task statement;
|
||||
> The tasks must test the same broad capability families described by the benchmark protocol, but MUST NOT reproduce public example tasks, public Aji conformance programs, or task structures already documented in the Aji repository.
|
||||
>
|
||||
> For each task create:
|
||||
>
|
||||
> - language-neutral task statement;
|
||||
> - deterministic acceptance criteria;
|
||||
> - public tests;
|
||||
> - private hidden tests;
|
||||
> - fuzz/property tests where applicable;
|
||||
> - resource limits;
|
||||
> - a machine evaluator implementing `CMD WORKSPACE LANGUAGE TASK_DIR` and returning the required JSON verdict;
|
||||
> - a task manifest containing version and hashes;
|
||||
> - reviewer notes explaining possible ambiguities;
|
||||
> - no reference to Aji-specific constructs in the task statement.
|
||||
> - hidden tests;
|
||||
> - fuzz/property tests where useful;
|
||||
> - explicit memory/resource limits;
|
||||
> - evaluator implementing the repository evaluator contract;
|
||||
> - task manifest and hashes;
|
||||
> - reviewer notes listing ambiguities considered and how they were resolved.
|
||||
>
|
||||
> Requirements:
|
||||
> Constraints:
|
||||
>
|
||||
> - Rust, Zig and Aji/AIR must all be capable of solving the task.
|
||||
> - More than one implementation strategy must be valid.
|
||||
> - Hidden tests must test only stated requirements.
|
||||
> - Do not introduce arbitrary requirements that favor one language.
|
||||
> - Include malformed/error cases.
|
||||
> - The concurrency task must exercise boundedness, ownership/lifetime of work, termination and at least one failure/cancellation scenario.
|
||||
> - The memory task must exercise incremental input, malformed data, integer/bounds edge cases and constrained memory.
|
||||
> - Avoid task structures already described in public Aji documentation.
|
||||
> - Do not reveal the hidden tests or concrete hidden task design outside this private benchmark repository.
|
||||
> - Hidden tests may test only requirements stated in the task.
|
||||
> - Do not reference Aji-specific features in the task statement.
|
||||
> - Do not inspect the Aji implementation repository.
|
||||
> - Do not design tests around known Aji verifier behavior.
|
||||
> - Do not simplify the task because one language makes a requirement difficult.
|
||||
> - Avoid accidental dependence on wall-clock timing.
|
||||
> - Concurrency behavior must be tested using deterministic histories/schedules where possible.
|
||||
> - Fail malformed input safely rather than relying on crashes.
|
||||
> - Keep evaluator behavior deterministic.
|
||||
>
|
||||
> Task directory and evaluator format: see `harness.md` (task directory, evaluator contract). Each language gets a starter workspace with a README describing the program's interface and a public test command. The Aji/AIR workspace describes the entry point and the `aji run` invocation (grants, inputs), the way `docs/evaluation/dev-tasks/dev-echo/lang/aji_air/README.md` does.
|
||||
> Before freezing a task, review it as if you were implementing it independently in Rust, Zig and an unfamiliar third systems language.
|
||||
>
|
||||
> Do not write reference solutions.
|
||||
>
|
||||
> When both tasks and evaluators are complete, freeze them and output only an internal readiness report containing task IDs, versions, hashes, evaluator hashes and review status.
|
||||
|
||||
The author needs the task directory format and the evaluator contract from [`harness.md`](harness.md). A copy of those two sections, placed in the private repository, is enough. Each language gets a starter workspace with a README describing the program's interface and a public test command. For Aji/AIR the README gives the entry point and the `aji run` invocation (grants, inputs), as in `dev-tasks/dev-echo/lang/aji_air/README.md`.
|
||||
|
||||
## Prompt: reference implementer (owner's text; one clean session per language)
|
||||
|
||||
> You are an independent benchmark reference implementer for <LANGUAGE>.
|
||||
>
|
||||
> You did not design these benchmark tasks and must not modify the task statement, evaluator, public tests or hidden tests.
|
||||
>
|
||||
> For each private benchmark task:
|
||||
>
|
||||
> 1. read only the task statement and the documentation made available to your environment;
|
||||
> 2. implement a correct solution in <LANGUAGE>;
|
||||
> 3. run the public checks available to you;
|
||||
> 4. submit the implementation to the benchmark evaluator;
|
||||
> 5. repair only the implementation if evaluation fails because of implementation defects.
|
||||
>
|
||||
> You MUST NOT:
|
||||
>
|
||||
> - modify the evaluator;
|
||||
> - weaken tests;
|
||||
> - inspect evaluator implementation or hidden test data unless the benchmark harness explicitly exposes a diagnostic intended for participants;
|
||||
> - use another language's reference implementation;
|
||||
> - access the Aji development repository;
|
||||
> - search the internet;
|
||||
> - add assumptions not present in the task.
|
||||
>
|
||||
> For Aji/AIR specifically:
|
||||
> - use only the frozen Agent Reference Bundle mounted by the harness;
|
||||
> - treat verifier diagnostics as part of the normal development interface;
|
||||
> - do not request language changes.
|
||||
>
|
||||
> For Rust and Zig:
|
||||
> - use only the frozen local documentation and pinned toolchain provided by the harness.
|
||||
>
|
||||
> A reference is accepted only when the frozen evaluator accepts it under the declared resource limits.
|
||||
>
|
||||
> After acceptance output only:
|
||||
> - task ID;
|
||||
> - language;
|
||||
> - evaluator verdict;
|
||||
> - implementation hash;
|
||||
> - toolchain version;
|
||||
> - number of compile/verify/test cycles.
|
||||
>
|
||||
> Do not describe hidden evaluator behavior.
|
||||
|
||||
## Gate E-G (before the 18 runs)
|
||||
|
||||
@@ -79,3 +155,15 @@ Rust/Zig toolchains + docs frozen
|
||||
```
|
||||
|
||||
`ajieval freeze PLAN.json` records the frozen state and a random cell order. `ajieval matrix PLAN.json` refuses to run if anything changed. Observations during the runs go to `ajieval journal PLAN.json "…"` and are acted on only after the last run.
|
||||
|
||||
The freeze binds the commit of the whole Aji repository, since the Aji binary, the bundle and the harness live there. **No commit is made to this repository between `ajieval freeze` and the 18th run**, not even to documentation.
|
||||
|
||||
## What comes back to the language developer
|
||||
|
||||
Only `ajieval summary RUNS_DIR`:
|
||||
|
||||
- the PASS/FAIL matrix per task (agents × languages);
|
||||
- per cell: verified success, first-attempt success, repair cycles, tool calls, wall time, unique bundle tokens, context returned by tools, provider input cached/uncached, failure classification and where the failure was caught;
|
||||
- aggregates by language and by agent.
|
||||
|
||||
It contains task IDs and numbers, never task statements, hidden tests or evaluator details. Failures are classified (`ajieval classify`) before the summary is shared.
|
||||
@@ -212,8 +212,16 @@ The gap between provider input and cumulative context is history resending, most
|
||||
python3 -m ajieval freeze PLAN.json # PLAN.freeze.json: frozen state + random cell order
|
||||
python3 -m ajieval matrix PLAN.json # verifies the freeze, runs cells sequentially in frozen order
|
||||
python3 -m ajieval journal PLAN.json "observation" [--run RUN_ID]
|
||||
python3 -m ajieval summary RUNS_DIR # shareable: PASS/FAIL matrix, per-cell metrics, aggregates
|
||||
```
|
||||
|
||||
In Track B the repair metrics are derived from the transcript's shell commands, with their exit codes and outputs:
|
||||
|
||||
- a command is a toolchain invocation if it contains a verifier, compiler or test command of the language profile, or the task's public test command;
|
||||
- a failing invocation whose output carries the language's diagnostic pattern is a failed verifier cycle;
|
||||
- any other failing invocation with a test is a failed test cycle;
|
||||
- first-attempt success is the outcome of the first public test.
|
||||
|
||||
The freeze records:
|
||||
|
||||
- the Aji commit (the repository must be clean), the `aji` binary and the bundle hash;
|
||||
|
||||
@@ -177,6 +177,10 @@ def main(argv=None):
|
||||
rp.add_argument("--json", action="store_true")
|
||||
rp.set_defaults(fn=lambda a: report.print_report(a.paths, a.json))
|
||||
|
||||
sm = sub.add_parser("summary", help="shareable summary: PASS/FAIL matrix, per-cell metrics, aggregates by language and agent")
|
||||
sm.add_argument("paths", nargs="+")
|
||||
sm.set_defaults(fn=lambda a: print(report.summary(a.paths)))
|
||||
|
||||
c = sub.add_parser("classify", help="record the primary failure category of a run (protocol §27)")
|
||||
c.add_argument("run")
|
||||
c.add_argument("category", choices=CATEGORIES)
|
||||
|
||||
@@ -28,6 +28,7 @@ networkless.
|
||||
import datetime
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -289,6 +290,74 @@ def sandbox_argv(workspace, home, binds, path_dirs, docs, env):
|
||||
return a
|
||||
|
||||
|
||||
def command_events(agent_name, transcript_path):
|
||||
"""(command, exit code, output) for every shell command in a transcript."""
|
||||
out = []
|
||||
pending = {}
|
||||
for line in open(transcript_path, encoding="utf-8", errors="replace"):
|
||||
line = line.strip()
|
||||
if not line.startswith("{"):
|
||||
continue
|
||||
try:
|
||||
e = json.loads(line)
|
||||
except json.JSONDecodeError:
|
||||
continue
|
||||
if agent_name == "codex":
|
||||
item = e.get("item") or {}
|
||||
if e.get("type") == "item.completed" and item.get("type") == "command_execution":
|
||||
out.append((item.get("command") or "", item.get("exit_code"), item.get("aggregated_output") or ""))
|
||||
elif agent_name == "claude":
|
||||
msg = e.get("message") or {}
|
||||
for b in msg.get("content", []) if isinstance(msg.get("content"), list) else []:
|
||||
if b.get("type") == "tool_use" and b.get("name") == "Bash":
|
||||
pending[b.get("id")] = (b.get("input") or {}).get("command", "")
|
||||
elif b.get("type") == "tool_result" and b.get("tool_use_id") in pending:
|
||||
c = b.get("content")
|
||||
text = c if isinstance(c, str) else "\n".join(x.get("text", "") for x in (c or []) if isinstance(x, dict))
|
||||
m = re.match(r"Exit code (\d+)", text)
|
||||
code = int(m.group(1)) if m else (1 if b.get("is_error") else 0)
|
||||
out.append((pending.pop(b.get("tool_use_id")), code, text))
|
||||
elif agent_name == "opencode":
|
||||
part = e.get("part") or {}
|
||||
if e.get("type") == "tool_use" and part.get("tool") == "bash":
|
||||
st = part.get("state") or {}
|
||||
meta = st.get("metadata") or {}
|
||||
out.append(((st.get("input") or {}).get("command", ""), meta.get("exit"), st.get("output") or meta.get("output") or ""))
|
||||
return out
|
||||
|
||||
|
||||
def cycles(profile, test_command, commands):
|
||||
"""Repair-loop metrics (protocol §14, §15) derived from shell commands.
|
||||
A command counts as a toolchain invocation if it contains a verifier,
|
||||
compiler or test command of the language profile, or the task's public
|
||||
test command. A failing invocation whose output carries a diagnostic of
|
||||
the language is a failed verifier cycle; any other failing invocation
|
||||
with a test is a failed test cycle."""
|
||||
pat = re.compile(profile.get("diagnostic_pattern") or "$^")
|
||||
cls = profile.get("classify", {})
|
||||
checks = [p for k in ("check", "build") for p in cls.get(k, [])]
|
||||
tests = list(cls.get("test", [])) + ([test_command] if test_command else [])
|
||||
m = {"toolchain_invocations": 0, "failed_verifier_cycles": 0, "failed_test_cycles": 0,
|
||||
"first_check_accepted": None, "first_public_test_passed": None}
|
||||
for cmd, code, output in commands:
|
||||
has_check = any(p in cmd for p in checks)
|
||||
has_test = any(p in cmd for p in tests)
|
||||
if not (has_check or has_test):
|
||||
continue
|
||||
m["toolchain_invocations"] += 1
|
||||
diag = bool(pat.search(output or ""))
|
||||
failed = code not in (0, None) or diag
|
||||
if has_check and m["first_check_accepted"] is None:
|
||||
m["first_check_accepted"] = not diag and code in (0, None)
|
||||
if has_test and test_command and test_command in cmd and m["first_public_test_passed"] is None:
|
||||
m["first_public_test_passed"] = not failed
|
||||
if failed and diag:
|
||||
m["failed_verifier_cycles"] += 1
|
||||
elif failed and has_test:
|
||||
m["failed_test_cycles"] += 1
|
||||
return m
|
||||
|
||||
|
||||
def normalize_usage(u):
|
||||
"""Input (including cached), output and cached-input tokens from the
|
||||
differently named usage fields of the CLIs; None when not reported."""
|
||||
@@ -383,6 +452,7 @@ def run_native(task_dir, lang_name, agent_name, model, out_dir, effort=None, see
|
||||
facts = ag.parse(transcript)
|
||||
tokens = normalize_usage(facts.get("usage") or {})
|
||||
ctx = context.metrics(context.tool_events_native(agent_name, transcript), message, docs, tokens)
|
||||
cyc = cycles(profile, lang.get("test"), command_events(agent_name, transcript))
|
||||
with open(os.path.join(run_dir, "patch.diff"), "w") as f:
|
||||
f.write(diff_tree(pristine, workspace))
|
||||
verdict = record.evaluate(evaluator, workspace, lang_name, task.dir, lim["command_timeout"] * 4) if evaluator else None
|
||||
@@ -408,8 +478,11 @@ def run_native(task_dir, lang_name, agent_name, model, out_dir, effort=None, see
|
||||
"seed": seed,
|
||||
"metrics": {"elapsed_seconds": elapsed, "exit_code": code, "termination": termination, "tool_calls": facts.get("tool_calls"),
|
||||
"usage": facts.get("usage"), "agent_facts": {k: v for k, v in facts.items() if k not in ("usage", "tool_calls", "model")},
|
||||
"input_tokens": tokens["input"], "output_tokens": tokens["output"], "cached_input_tokens": tokens["cached_input"], "context": ctx, "failed_verifier_cycles": None, "failed_test_cycles": None,
|
||||
"first_check_accepted": None, "first_build_accepted": None},
|
||||
"input_tokens": tokens["input"], "output_tokens": tokens["output"], "cached_input_tokens": tokens["cached_input"], "context": ctx,
|
||||
"toolchain_invocations": cyc["toolchain_invocations"],
|
||||
"failed_verifier_cycles": cyc["failed_verifier_cycles"], "failed_test_cycles": cyc["failed_test_cycles"],
|
||||
"first_check_accepted": cyc["first_check_accepted"], "first_build_accepted": None,
|
||||
"first_public_test_passed": cyc["first_public_test_passed"], "cycles_source": "derived from transcript"},
|
||||
"transcript": "transcript.jsonl",
|
||||
"patch": "patch.diff",
|
||||
"final_repository": {"path": "workspace", "files": record.file_hashes(workspace)},
|
||||
|
||||
@@ -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)
|
||||
@@ -2,11 +2,32 @@
|
||||
"name": "aji_air",
|
||||
"display": "Aji (condition Aji/AIR: text AIR format 0)",
|
||||
"toolchain": {
|
||||
"binaries": ["${REPO}/zig-out/bin/aji"],
|
||||
"version": [["${REPO}/zig-out/bin/aji", "features"]]
|
||||
"binaries": [
|
||||
"${REPO}/zig-out/bin/aji"
|
||||
],
|
||||
"version": [
|
||||
[
|
||||
"${REPO}/zig-out/bin/aji",
|
||||
"features"
|
||||
]
|
||||
]
|
||||
},
|
||||
"docs": {"env": "AJI_EVAL_AJI_DOCS", "default": "${REPO}/zig-out/agent/reference-bundle.md"},
|
||||
"source_extensions": [".air"],
|
||||
"docs": {
|
||||
"env": "AJI_EVAL_AJI_DOCS",
|
||||
"default": "${REPO}/zig-out/agent/reference-bundle.md"
|
||||
},
|
||||
"source_extensions": [
|
||||
".air"
|
||||
],
|
||||
"instructions": "Language: Aji, written directly as text AIR format 0 (`.air` files).\nToolchain: `aji check FILE.air` verifies a module and prints diagnostics as JSON lines; `aji run [--grant P=KIND[:SCOPE]]... [--stdin TEXT] FILE.air` verifies and runs `@main` in the deterministic profile and prints one JSON run record; `aji features` lists the supported AIR features; `aji --help` lists all commands.\nDocumentation: the Aji Agent Reference Bundle is in /docs (read-only). It is the complete reference for writing AIR.",
|
||||
"classify": {"check": ["aji check"], "build": [], "test": ["aji run"]}
|
||||
"classify": {
|
||||
"check": [
|
||||
"aji check"
|
||||
],
|
||||
"build": [],
|
||||
"test": [
|
||||
"aji run"
|
||||
]
|
||||
},
|
||||
"diagnostic_pattern": "\"severity\":\"error\""
|
||||
}
|
||||
@@ -43,5 +43,6 @@
|
||||
"cargo test",
|
||||
"cargo run"
|
||||
]
|
||||
}
|
||||
},
|
||||
"diagnostic_pattern": "(?m)^error(\\[E\\d+\\])?:"
|
||||
}
|
||||
@@ -37,5 +37,6 @@
|
||||
"zig build run",
|
||||
"zig run"
|
||||
]
|
||||
}
|
||||
},
|
||||
"diagnostic_pattern": ": error: "
|
||||
}
|
||||
@@ -247,3 +247,15 @@ class NativeTest(unittest.TestCase):
|
||||
self.assertEqual(native.normalize_usage({"input_tokens": 100, "cached_input_tokens": 60, "output_tokens": 5}), {"input": 100, "output": 5, "cached_input": 60})
|
||||
self.assertEqual(native.normalize_usage({"input_tokens": 10, "cache_read_input_tokens": 60, "cache_creation_input_tokens": 30, "output_tokens": 5}), {"input": 100, "output": 5, "cached_input": 60})
|
||||
self.assertEqual(native.normalize_usage({"input": 40, "cache_read": 60, "cache_creation": 0, "output": 5})["input"], 100)
|
||||
|
||||
|
||||
class CyclesTest(unittest.TestCase):
|
||||
def test_repair_cycles_from_commands(self):
|
||||
from ajieval import native
|
||||
prof = languages.load("aji_air")
|
||||
cmds = [("cat README.md", 0, "x"), ("aji check main.air", 1, '{"code":"E0001","severity":"error"}'),
|
||||
("aji check main.air && sh test.sh", 1, "FAIL: unexpected"), ("aji check main.air && sh test.sh", 0, "PASS")]
|
||||
m = native.cycles(prof, "sh test.sh", cmds)
|
||||
self.assertEqual((m["toolchain_invocations"], m["failed_verifier_cycles"], m["failed_test_cycles"]), (3, 1, 1))
|
||||
self.assertFalse(m["first_check_accepted"])
|
||||
self.assertFalse(m["first_public_test_passed"])
|
||||
Reference in new issue
Block a user