Project-2 baseline
This commit is contained in:
@@ -151,6 +151,25 @@ def _scan_stream_json(stream_path: Path) -> set[str]:
|
||||
return found
|
||||
|
||||
|
||||
def resolve_capture_dir(reference_run_dir: Path | str) -> Path:
|
||||
"""The directory whose ``agent/trajectory.json`` is the run's captured transcript.
|
||||
|
||||
``reference-runs/<run>/agent/`` is gitignored, so a checkout carries no
|
||||
trajectory there; the stored atomic regrade at
|
||||
``rubric-regrades/<run>/agent/trajectory.json`` is the same transcript
|
||||
(copy-reference-run files the replay trial verbatim). Prefer the run's own
|
||||
copy, fall back to the stored regrade's, and return the run dir itself when
|
||||
neither exists so callers report the canonical path.
|
||||
"""
|
||||
ref = Path(reference_run_dir)
|
||||
if (ref / "agent" / "trajectory.json").exists():
|
||||
return ref
|
||||
stored = ref.parent.parent / "rubric-regrades" / ref.name
|
||||
if (stored / "agent" / "trajectory.json").exists():
|
||||
return stored
|
||||
return ref
|
||||
|
||||
|
||||
def captured_mutating_tools(reference_run_dir: Path | str) -> set[str]:
|
||||
"""Return the file-mutating tool names found in a captured run's transcript.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user