--- name: grader-audit description: Audit reinforcement-learning environments and evaluation graders for split leaks, oracle pass rates, grader crashes on malformed inputs, trivial-reply reward hacking, and (for Lean) vacuous statements and tactic floors. Use before trusting or ingesting an RL environment into a training mix or benchmark, or to generate a verifiable Grader Integrity Receipt JSON. --- # Grader Audit `scripts/grader_audit.py` audits RL environments and emits a structured JSON receipt (`schema_version: 1`). Standard library only (Python 3.9+). Run it from this skill's folder: ```bash # Audit a Harbor / Practice dataset (tasks.jsonl + tasks///) python3 scripts/grader_audit.py harbor /path/to/practice-environments --split eval --out audits.json # Audit a Lean Arena dataset (hf/data//.jsonl + arena/grade.py) python3 scripts/grader_audit.py lean /path/to/math --split eval --cheats --out lean_audits.json # Probe outbound DNS/TCP/UDP from inside an agent sandbox (exits 0 iff offline) python3 scripts/grader_audit.py net-probe --hosts github.com pypi.org 1.1.1.1 # Print a Markdown summary table from any receipt python3 scripts/grader_audit.py report audits.json ``` ## What `harbor` checks 1. **Split isolation (across all splits in `tasks.jsonl`):** - Unique task IDs (`duplicate_ids == 0`) - Disjoint `(env, seed)` pairs between `train` and `eval` - Disjoint full task payloads (`instruction.md` + all files under `environment/workdir/`) between `train` and `eval` 2. **Oracle validity (on `--split`, default `eval`):** - Runs `solution/oracle.py` in a fresh copy of `environment/workdir/` and verifies `tests/verify.py` exits `0` with `reward == 1.0`. 3. **Adversarial & trivial-reply robustness (on `--split`):** - Runs the real `tests/verify.py` CLI on missing file (`noop_missing`), malformed JSON (`{not valid json`), `{}` (`empty_object`), and sampled empty file, `"hello"`, `0`, `null`, `[]`. - Also tests `zero_schema_guess`: fills every top-level key referenced in `tests/checks.json` with `0`. - Verifies **zero crashes / infra errors** (exit code `0` and readable `reward.txt` on every bad input) and measures exact mean reward. An environment passes (`passed: true`) when `oracle_pass == eval_tasks`, `crashes == 0`, `trivial_nonzero == 0`, and `split_leaks == 0`. ## What `lean` checks 1. **One-tactic floor:** replaces every theorem proof with `first | grind | aesop | (simp; done) | omega | norm_num | nlinarith [sq_nonneg (1:ℝ)] | decide` in a batched Lean compile. 2. **Vacuity (`grind ⊢ False`):** replaces every theorem's conclusion with `False := by grind` to catch inconsistent hypotheses (preserving multi-line binders). 3. **Verifier cheat suite (`--cheats`):** runs `tools/verifier_cheats.py` (honest proof = `1.0`; `sorry`, `native_decide`, user axiom, weaker statement, changed definition = `0.0`). ## Reading receipts honestly - A passing receipt establishes **grader integrity and split isolation**: the reference solution scores 1.0, malformed/trivial inputs do not crash the grader or earn reward, and train/eval payloads do not overlap. - It does **not** establish that training on the environment improves a model, that tasks are free of domain-modelling simplifications, or that a benchmark is calibrated to human practitioners. Report those limits alongside any badge.