doe/legal-consent-sweep · Harbor HubAbout
A complete acquisition consent workstream with a populated legal data room, simulated correspondence, reference solution and separate verifier
harbor run -d doe/legal-consent-sweep@1harbor download doe/legal-consent-sweep@1Details
- Tasks
- 1
- Version
- 1.0.0
- Revision
- 1
- Published
- Oct 7, 2026
- Visibility
- Public
- Authors
- DOE
- Content hash
9
mean_score mean of score (partial credit)
10 pass_rate mean of reward (1 only if every critical criterion passes)11 mean_reward_deterministic mean of reward_deterministic (deterministic critical criteria only)12 n_valid, n_invalid n_invalid includes n_null13"""14import argparse15import json16from pathlib import Path171819def num(row: dict, key: str):20 v = row.get(key)21 return float(v) if isinstance(v, (int, float)) and not isinstance(v, bool) else None222324def valid(row) -> bool:25 if not isinstance(row, dict) or num(row, "reward") is None or num(row, "score") is None:26 return False27 return num(row, "reward_valid") != 0 and num(row, "score_valid") != 0282930def compute(rows: list) -> dict:31 ok = [r for r in rows if valid(r)]32 def mean(k):33 vals = [num(r, k) for r in ok if num(r, k) is not None] # graders older than 2026.09 lack reward_deterministic34 return round(sum(vals) / len(vals), 4) if vals else None3536 out = {"mean_score": mean("score"), "pass_rate": mean("reward"),37 "mean_reward_deterministic": mean("reward_deterministic"), "n_valid": len(ok),38 "n_invalid": len(rows) - len(ok), "n_null": sum(r is None for r in rows)}39 return {k: v for k, v in out.items() if v is not None} # no valid trials: the means are absent, never 0404142def main(input_path: Path, output_path: Path) -> None:43 rows = [json.loads(line) for line in input_path.read_text().splitlines() if line.strip()]44 output_path.write_text(json.dumps(compute(rows)))454647if __name__ == "__main__":48 p = argparse.ArgumentParser()49 p.add_argument("-i", "--input-path", type=Path, required=True, help="rewards JSONL, one reward.json object or null per line")50 p.add_argument("-o", "--output-path", type=Path, required=True, help="metric JSON output")51 a = p.parse_args()52 main(a.input_path, a.output_path)