# Pre-Nov-29 Audit of the "Hard to Vary" v0 Rubric & `HTV-Unseen-v1` Benchmark

This folder contains the full uncontaminated benchmark, reproducible code, raw open-weight model rollouts (`1,620` calls at temperature `0`), blind independent recompute, and compiled LaTeX preprint backing [What failed before running v0 of the "hard to vary" test](/what-failed-before-hard-to-vary-v0/) and [Can "hard to vary" be scored?](/can-hard-to-vary-be-scored/).

**Strict uncontamination:** No language model was ever called on [`items-v0.csv`](/files/hard-to-vary/items-v0.csv) or [`key-v0.csv`](/files/hard-to-vary/key-v0.csv). Part A analyzes those 60 items purely deterministically in Python; all LLM scoring ran exclusively on the disjoint 180-item `HTV-Unseen-v1` set (`inputs/htv_unseen_blind.csv`).

---

## Quickstart: Verify & Extend in 3 Commands

```bash
cd public/research/hard-to-vary-audit

# 1. Run unit tests for Krippendorff alpha / Gwet AC2 / bootstrap / stuffing helpers
python3 code/test_ordinal_agreement_and_gaming.py

# 2. Reproduce Part B (and verify all SHA-256 digests + 1,620 raw rollout parses)
python3 independent/recompute.py

# 3. Score any OpenAI-compatible local or frontier endpoint on HTV-Unseen-v1
python3 code/eval_endpoint.py --base-url http://127.0.0.1:18089/v1 --model my-model --protocol P_v01_decoupled
```

(`independent/recompute.py` requires `numpy`, `scipy`, and `scikit-learn`; Part A reads `/files/hard-to-vary/{items-v0.csv,key-v0.csv}` automatically when run from a checkout of the blog repository.)

---

## Easy Access Points to Extend or Falsify This Work

1. **Test counterfactual tag-to-score decoupling (`P_v01_decoupled`) on your own model:**
   `code/eval_endpoint.py` includes `P_v01_decoupled`, which asks a judge strictly for `Opposite: [YES|NO]`, `Cause: [BOUND|FREE]`, and `Extra: [FREE|BOUND|NONE]` and computes the 1–5 score deterministically in Python (`deterministic_v01_score()`). Run it against any OpenAI-compatible server (local `llama-server`, `vLLM`, or API) without touching `items-v0.csv`.
2. **Test whether frontier judges suffer from `Score: 3` collapse on `HTV-Unseen-v1`:**
   Run `code/eval_endpoint.py --protocol P_v0` on larger open (`32B–70B+`) or frontier models and compare `pair_tight_gt_easy` and `inflation_stuffed_minus_easy` using `code/score_htv_unseen.py`.
3. **Compare single-item vs paired contrastive evaluation:**
   Human raters see both explanations of each phenomenon side-by-side on one sheet, whereas LLMs scored one item per context. Wrapping `(tight_short, easy_long)` or `(tight_short, specificity_stuffed)` from `inputs/htv_unseen_v1.json` into a blind A/B swap prompt tests how much `Score: 3` collapse disappears under direct pairwise comparison.
4. **Add harder natural or domain-specific length-reversed pairs (`v0.1`):**
   `inputs/htv_unseen_v1.json` contains 36 phenomena across 6 domains (`astro_optics`, `fluid_thermal`, `ecology_cells`, `epidemiology_toxins`, `materials_chem`, `markets_auctions`). Appending natural pre-print vs post-hoc abstracts with matched or reversed length tests whether surface-feature LOPO stays near 50% on real scientific prose.

---

## Manifest

- `preprint.pdf` / `preprint.tex` — Full LaTeX preprint with tables, Vector/TikZ diagrams, rollout examples, and `v0.1` design.
- `PLAN.md`, `PLAN.v2.md`, `PLAN.v3.md`, `RESULT.md`, `INPUTS_sha256.txt` — Pre-registered plan, score-blind runtime amendments, complete empirical report, and pinned input digests.
- `inputs/htv_unseen_blind.csv` — Blind evaluation sheet (`180` items = `36` phenomena × `5` arms: `tight_short`, `easy_long`, `specificity_stuffed`, `postulate_law`, `opposite_compatible`).
- `inputs/htv_unseen_key.csv` & `inputs/htv_unseen_v1.json` — Ground-truth arm keys, word counts, and domains.
- `code/ordinal_agreement_and_gaming.py` & `code/test_ordinal_agreement_and_gaming.py` — Standalone reusable implementation of Krippendorff ordinal alpha, Gwet AC2 (quadratic weights), cluster bootstraps, pair accuracy (`ties=miss`), and gaming tests.
- `code/audit_v0_design.py`, `code/prompts.py`, `code/score_htv_unseen.py`, `code/eval_endpoint.py` — Part A audit, prompt templates, Part B aggregator, and drop-in OpenAI-compatible evaluator.
- `out/partA_v0_audit.json`, `out/partB_unseen_summary.json`, `out/model_pins.json`, `out/rollouts_*.jsonl` — Full aggregate results, model SHAs, and all `1,620` raw model completions.
- `independent/recompute.py`, `independent/RECOMPUTED.json`, `independent/REVIEW.md` — Clean-room blind independent statistical verification matching all `147/147` deterministic metrics within `2.78e-17`.
