graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
feat(evals): add inspectable long-horizon showcase
justrach7ee2d95b5354
diff --git a/evals/long_horizon/README.md b/evals/long_horizon/README.mdindex 3146e818..d978048d 100644--- a/evals/long_horizon/README.md+++ b/evals/long_horizon/README.md@@ -12,6 +12,34 @@ requires coordinated edits, projected-state reasoning, rollback semantics,compatibility, tests, and verification. New environments should test a distinctsystems behavior rather than merely making this fixture larger.+## Inspect one eval in 60 seconds++The showcase path makes the environment concrete without calling a provider or+leaving a workspace behind. It prints the seeded repository, the exact task an+agent receives, the unfinished baseline score, and every verifier row after the+bundled reference patch:++```sh+python3 evals/long_horizon/run.py --showcase --seed 469+```++The condensed scorecard is:++```text+ledger-batch-v1 / seed 469+Fixture accounts: cedar=105, ember=220, fjord=120, grove=210+Generated repository: 14 files across ledgercore/ and tests/+Agent task: implement atomic idempotent batch transfers across the model,+ service, repository state, and stable JSON API+Unfinished baseline: 2/10 checks, score=0.160 (expected failure)+Reference solution: 10/10 checks; deterministic reward floor=0.900+Model quality may add at most 0.050, only after this complete pass.+```++The full output includes the generated `TASK.md` and names all ten external+checks, so a reviewer can see both what the agent must coordinate and what+actually determines reward.+## Run```shdiff --git a/evals/long_horizon/run.py b/evals/long_horizon/run.pyindex 057575a8..036c3856 100755--- a/evals/long_horizon/run.py+++ b/evals/long_horizon/run.py@@ -230,6 +230,50 @@ def self_test(seed: int) -> None:print(f"self-test ok: baseline rejected, reference accepted, tampering rejected (seed {seed})")+def showcase(seed: int) -> None:+ """Print one generated task and its externally verified reward path."""+ with tempfile.TemporaryDirectory(prefix="graff-long-horizon-showcase-") as raw:+ workspace = Path(raw)+ materialize(workspace, seed)+ seed_data = json.loads((workspace / ".eval-seed.json").read_text(encoding="utf-8"))+ paths = sorted(+ str(path.relative_to(workspace))+ for path in workspace.rglob("*")+ if path.is_file()+ )+ baseline = grade(workspace, seed)++ print(f"{ENVIRONMENT_ID} / seed {seed}")+ balances = ", ".join(+ f"{account}={balance}"+ for account, balance in seed_data["balances"].items()+ )+ print(f"Fixture accounts: {balances}")+ print("\nGenerated repository:")+ for relative in paths:+ print(f" {relative}")+ print("\nAgent task (TASK.md):")+ for line in (workspace / "TASK.md").read_text(encoding="utf-8").splitlines():+ print(f" {line}")+ print(+ f"\nUnfinished baseline: {baseline['passed']}/{baseline['total']} checks, "+ f"score={baseline['score']:.3f} (expected failure)"+ )++ apply_reference(workspace)+ solved = grade(workspace, seed)+ if not solved["deterministic_pass"]:+ raise SystemExit("showcase failed: bundled reference solution did not pass")+ print("\nExternal verifier after the bundled reference patch:")+ for result in solved["checks"]:+ print(f" [PASS] {result['name']}")+ print(+ f"Reference solution: {solved['passed']}/{solved['total']} checks; "+ "deterministic reward floor=0.900"+ )+ print("Model quality may add at most 0.050, only after this complete pass.")++def main() -> None:parser = argparse.ArgumentParser(description=__doc__)parser.add_argument("--harness", default="graff-dev")@@ -239,11 +283,16 @@ def main() -> None:parser.add_argument("--timeout", type=int, default=1800)parser.add_argument("--judge-command", help="external JSON-in/JSON-out maintainability judge")parser.add_argument("--keep", action="store_true")- parser.add_argument("--self-test", action="store_true")+ mode = parser.add_mutually_exclusive_group()+ mode.add_argument("--self-test", action="store_true")+ mode.add_argument("--showcase", action="store_true")args = parser.parse_args()if args.self_test:self_test(args.seed)return+ if args.showcase:+ showcase(args.seed)+ returnRESULTS.mkdir(parents=True, exist_ok=True)output = RESULTS / f"run-{time.strftime('%Y%m%d-%H%M%S')}.jsonl"diff --git a/evals/long_horizon/test_eval.py b/evals/long_horizon/test_eval.pyindex 87dbef6b..fcf9512c 100644--- a/evals/long_horizon/test_eval.py+++ b/evals/long_horizon/test_eval.py@@ -1,11 +1,13 @@import tempfileimport unittest+from contextlib import redirect_stdout+from io import StringIOfrom pathlib import Pathfrom environment import materializefrom grader import gradefrom reference import apply_reference-from run import final_reward+from run import final_reward, showcaseclass EnvironmentTests(unittest.TestCase):@@ -37,6 +39,17 @@ class EnvironmentTests(unittest.TestCase):self.assertLessEqual(fail_reward, 0.8)self.assertGreaterEqual(pass_reward, 0.9)+ def test_showcase_exposes_task_and_external_scorecard(self):+ output = StringIO()+ with redirect_stdout(output):+ showcase(469)+ rendered = output.getvalue()+ self.assertIn("ledger-batch-v1 / seed 469", rendered)+ self.assertIn("Agent task (TASK.md):", rendered)+ self.assertIn("Unfinished baseline:", rendered)+ self.assertIn("[PASS] atomic-failures", rendered)+ self.assertIn("deterministic reward floor=0.900", rendered)+if __name__ == "__main__":unittest.main()