You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shared helpers already exist but are re-implemented across the tree:
sha256 / JSON digest: about 56 files define a private _sha256 / _json_sha256 / digest, although harness/record_io.py already has file_sha256 and canonical_json_sha256.
JSON read/write:_read_json / write_json / atomic_write are redefined in about 20 modules, plus 7 or more test files. harness/reporting/publication.py already has atomic_write, atomic_create and json_bytes.
Data-home resolution appears 6 times with different semantics. storage.py:18 expands and resolves the path. webmainbench_runner.py:571 and lexbench/report.py:25 do neither, and the latter runs at import time.
Three .env parsers disagree.trajectory_replay/catalog_runner.py:138 uses .strip("\"'"), which also strips mismatched quotes. The other two are public_webarena/config.py:12 and web_fetch/config.py.
Local-path redaction regexes are separate in anomaly_review.py:184, webmainbench_assembly.py:41, web_search/comparison.py:34 and webarena_report.py.
Proposal
One module per concern, reusing what exists: harness/record_io.py for hashing and JSON, harness/web_fetch/storage.data_home promoted to shared, one .env loader, and one redaction module.
Migrate callers in small per-package PRs.
Before swapping each copy, check its json.dumps options (sort_keys, separators, ensure_ascii), so that bound digests stay byte-identical.
Acceptance
No private re-implementations remain (enforced by a grep test or ruff TID251 banned-api).
Golden snapshots and every hash-bound receipt verify unchanged.
Activity
lanyue-llk commentedon Nov 3, 2026
Resolved by #136, #137. Remaining work is tracked in #150.