MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / main

Function main

eval/hermetic/score.py:297–346  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

295
296
297def main() -> int:
298 ap = argparse.ArgumentParser()
299 ap.add_argument("--agent", choices=("claude", "codex"), default="claude")
300 ap.add_argument("--scenario", required=True, help="scenario JSON (one line)")
301 ap.add_argument("--claude-json", help="path to claude -p json result")
302 ap.add_argument("--codex-jsonl", help="path to codex exec --json output")
303 ap.add_argument("--config-dir", help="isolated CLAUDE_CONFIG_DIR")
304 ap.add_argument("--cwd", required=True, help="cwd the scenario ran in")
305 ap.add_argument(
306 "--verify-status",
307 type=int,
308 choices=(0, 1),
309 default=None,
310 help="exit status from the scenario verify_cmd (0=pass, 1=fail)",
311 )
312 ap.add_argument("--rep", type=int, default=1, help="corpus repetition index")
313 args = ap.parse_args()
314
315 scenario = load_scenario(args.scenario)
316 sid = None
317 transcript = None
318 td_tools: list[str] = []
319 native_tools: list[str] = []
320 commands: list[str] = []
321
322 if args.agent == "claude":
323 if not args.claude_json or not args.config_dir:
324 ap.error("--agent claude requires --claude-json and --config-dir")
325 sid = session_id_from_claude_json(Path(args.claude_json))
326 transcript = find_transcript(Path(args.config_dir), args.cwd, sid)
327 if transcript is not None:
328 td_tools, native_tools, commands = count_claude_tools(transcript)
329 else:
330 if not args.codex_jsonl:
331 ap.error("--agent codex requires --codex-jsonl")
332 transcript = Path(args.codex_jsonl)
333 td_tools, native_tools, commands = count_codex_tools(transcript)
334
335 result = evaluate_scenario(
336 scenario,
337 sid,
338 transcript,
339 td_tools,
340 native_tools,
341 commands,
342 verify_status=args.verify_status,
343 rep=args.rep,
344 )
345 print(json.dumps(result))
346 return 0
347
348
349if __name__ == "__main__":

Callers 1

score.pyFile · 0.70

Calls 7

find_transcriptFunction · 0.85
count_claude_toolsFunction · 0.85
count_codex_toolsFunction · 0.85
evaluate_scenarioFunction · 0.85
load_scenarioFunction · 0.70
errorMethod · 0.45

Tested by

no test coverage detected