eval: evaluator environment, evaluator.log, ajieval evaluate
The evaluator now receives AJIEVAL_LANGUAGE, AJIEVAL_TOOLCHAIN_PATH and AJIEVAL_TOOLCHAIN_DIRS (the toolchain exactly as the agent's sandbox had it), its full output is saved as evaluator.log in the run directory, and ajieval evaluate runs an evaluator on any workspace exactly as the harness does. harness.md documents what a sandboxing evaluator should do (bind the toolchain dirs, private CARGO_HOME + --offline, build without the agent's target/ and caches, report infrastructure failures distinctly).
This commit is contained in:
1 parent
93cf553a77
commit
2ee1ff192f
27 files changed
+91
-7
No files matched your search
@@ -94,6 +94,17 @@ def cmd_matrix(a):
|
||||
report.print_report([out])
|
||||
|
||||
|
||||
def cmd_evaluate(a):
|
||||
"""Runs an evaluator on a workspace exactly as the harness does (same
|
||||
arguments and environment), to debug evaluator integration without an
|
||||
agent run."""
|
||||
from . import task as task_mod
|
||||
t = task_mod.Task(a.task)
|
||||
lim = t.limits
|
||||
verdict = record.evaluate(shlex.split(a.evaluator), os.path.realpath(a.workspace), a.language, t.dir, lim["command_timeout"] * 4, a.log)
|
||||
print(json.dumps(verdict, indent=2))
|
||||
|
||||
|
||||
def cmd_freeze(a):
|
||||
path, frozen = freeze.write(a.plan, a.order_seed)
|
||||
print(json.dumps({"freeze": path, "cells": len(frozen["order"]), "order_seed": frozen["order_seed"], "aji_commit": frozen["state"]["aji_commit"]}))
|
||||
@@ -161,6 +172,14 @@ def main(argv=None):
|
||||
m.add_argument("plan")
|
||||
m.set_defaults(fn=cmd_matrix)
|
||||
|
||||
ev = sub.add_parser("evaluate", help="run an evaluator on a workspace exactly as the harness does")
|
||||
ev.add_argument("--task", required=True)
|
||||
ev.add_argument("--language", required=True, choices=languages.available())
|
||||
ev.add_argument("--workspace", required=True)
|
||||
ev.add_argument("--evaluator", required=True)
|
||||
ev.add_argument("--log", help="write the evaluator's full stdout/stderr here")
|
||||
ev.set_defaults(fn=cmd_evaluate)
|
||||
|
||||
fz = sub.add_parser("freeze", help="freeze a plan: record its state and a random cell order")
|
||||
fz.add_argument("plan")
|
||||
fz.add_argument("--order-seed", type=int)
|
||||
|
||||
Reference in new issue
Block a user