FWeindel commited on
Commit
4649fba
·
verified ·
1 Parent(s): ae43da7

Add separate River and OT judge attempts with selectable voting

Browse files
calibforge_v1.1/README.md CHANGED
@@ -2,7 +2,7 @@
2
 
3
  `tasks.parquet` contains all **5,431 upstream CalibForge tasks**, with recalibrated resource requirements, automatic repairs and leak-repair changes where applied.
4
 
5
- `results.parquet` has one row per task and one column per check. Check cells contain a `status` and `details` explaining findings or failures. Skipped checks and evaluations use `not_run`, with the reason in `details`. Checks with automatic or LLM repair also have a `repaired` field (`true`/`false` when recorded). Each judge criterion has its own column containing nested JSON, keyed by judge model. Each attempt has its own `status` and `details`. Original resource requirements are in `original_resources` inside the JSON stored in `resources_recommended.details`, where recorded.
6
 
7
  Internet access was unspecified in upstream `task.toml`, we now set it to offline (`allow_internet = false`). Cached images are in [calibforge_v1.1/cached_images/](https://huggingface.co/datasets/FWeindel/validated-tasks/tree/main/calibforge_v1.1/cached_images), and shared offline runtimes are in [runtimes/](https://huggingface.co/datasets/FWeindel/validated-tasks/tree/main/runtimes). The runtimes cache interpreters, packages and dependencies that `setup_files/setup.sh`, `tests/setup.sh` or `tests/test.sh` would otherwise install each time a task runs. 47 tasks failed Docker-to-Apptainer conversion and have no cached image.
8
 
@@ -62,12 +62,29 @@ All **5,431 tasks** are checked for setup problems, verifier behaviour and leaka
62
 
63
  ## LLM-as-a-judge results
64
 
65
- This table covers the **5,097 tasks kept after the rule-based checks**. A task is clean when it passes all eight criteria for that judge. An “only” column means that one criterion fails and the other seven pass. Tasks that fail several criteria have their own column, so each task is counted once per judge.
66
 
67
- | Judge | Clean | Only ANSWER-LEAK fails | Only INSTR-AMBIGUOUS fails | Only INSTR-ENV-MISMATCH fails | Only INSTR-VERIFIER-CONTRADICTION fails | Only INSTR-VERIFIER-UNSTATED-REQUIREMENT fails | Only TASK-TRIVIAL fails | Only VERIFIER-ACCEPTS-INCOMPLETE fails | Only VERIFIER-ACCEPTS-SHORTCUTS fails | Multiple criteria fail |
68
- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
69
- | Qwen3.8-27B | 1,565 | 59 | 44 | 86 | 63 | 26 | 6 | 559 | 508 | 2,181 |
70
- | GLM-5.3-Flash | 1,303 | 106 | 52 | 104 | 77 | 66 | 3 | 513 | 301 | 2,572 |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
  ## Pass@4 results
73
 
@@ -84,7 +101,7 @@ This table covers the **5,097 tasks kept after the rule-based checks**. A task i
84
 
85
  Install `pyarrow`, then put `filter_tasks.py`, `tasks.parquet` and `results.parquet` in the same directory. The script first applies the rule-based checks above. Warnings are kept, while tasks with a failed or unfinished required check are removed. `--out` names the output folder, e.g. `--out validated` saves tasks in `validated/`.
86
 
87
- To also filter by LLM judge, use `--judge qwen` or `--judge glm`. By default, tasks with any failed criterion or missing verdict for that judge are removed. Use `--allow-fail CRITERION` to allow a named criterion to fail. Repeat `--allow-fail` to allow multiple criteria to fail.
88
 
89
  To also filter by pass@4, use `--passk-model qwen` (Qwen3.5-35B-A3B) or `--passk-model glm` (GLM-5.3-Flash), with `--successes` followed by the counts to keep, from 0 to 4. This uses the selected four-attempt batch and excludes missing or incomplete evaluations. Completed resource-limit failures count toward 0/4. You can combine this with judge filtering.
90
 
@@ -95,6 +112,15 @@ python filter_tasks.py --out validated
95
  # Also require all Qwen judge criteria to pass
96
  python filter_tasks.py --judge qwen --out clean-qwen
97
 
 
 
 
 
 
 
 
 
 
98
  # Allow this GLM criterion to fail, all other criteria must pass
99
  python filter_tasks.py --judge glm \
100
  --allow-fail VERIFIER-ACCEPTS-INCOMPLETE --out glm-with-incomplete
@@ -123,6 +149,18 @@ Available criteria, with explanations in the [rubric](https://github.com/MLI-lab
123
  - `VERIFIER-ACCEPTS-INCOMPLETE`
124
  - `VERIFIER-ACCEPTS-SHORTCUTS`
125
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  ## Experiment 1: rubric filtering and RL performance
127
 
128
  River’s `VERIFIER-TOO-WEAK` combined incomplete solutions, where the agent still does part of the work, with shortcuts that bypass it. We split these into `VERIFIER-ACCEPTS-INCOMPLETE` and `VERIFIER-ACCEPTS-SHORTCUTS`.
@@ -134,7 +172,7 @@ River’s `VERIFIER-TOO-WEAK` combined incomplete solutions, where the agent sti
134
  - **Clean + shortcuts-only performs worse than clean**, suggesting filtering with an LLM judge can help.
135
  - **Clean + incomplete-only performs better than clean**, suggesting rubric criteria have different effects on RL performance.
136
 
137
- **Setup:** generate three datasets for RL, clean, clean + incomplete-only, and clean + shortcuts-only.
138
 
139
  ```bash
140
  # Qwen: clean 1,565, clean + incomplete-only 2,124, clean + shortcuts-only 2,073
 
2
 
3
  `tasks.parquet` contains all **5,431 upstream CalibForge tasks**, with recalibrated resource requirements, automatic repairs and leak-repair changes where applied.
4
 
5
+ `results.parquet` has one row per task and one column per check. Check cells contain a `status` and `details` explaining findings or failures. Skipped checks and evaluations use `not_run`, with the reason in `details`. Checks with automatic or LLM repair also have a `repaired` field (`true`/`false` when recorded). Each judge criterion has its own column containing nested JSON, keyed by judge model. Each attempt has its own `status` and `details`. OT-next criteria keep their original column names; River columns start with `river__`. The `reviews` list stores attempts 1 and 2 separately, with missing reviews explicit. Filtering reads these attempts using the selected rubric and vote mode; the cell’s summary status does not select an attempt. Original resource requirements are in `original_resources` inside the JSON stored in `resources_recommended.details`, where recorded.
6
 
7
  Internet access was unspecified in upstream `task.toml`, we now set it to offline (`allow_internet = false`). Cached images are in [calibforge_v1.1/cached_images/](https://huggingface.co/datasets/FWeindel/validated-tasks/tree/main/calibforge_v1.1/cached_images), and shared offline runtimes are in [runtimes/](https://huggingface.co/datasets/FWeindel/validated-tasks/tree/main/runtimes). The runtimes cache interpreters, packages and dependencies that `setup_files/setup.sh`, `tests/setup.sh` or `tests/test.sh` would otherwise install each time a task runs. 47 tasks failed Docker-to-Apptainer conversion and have no cached image.
8
 
 
62
 
63
  ## LLM-as-a-judge results
64
 
65
+ This table covers the **5,097 tasks kept after the rule-based checks**. It uses the OT-next rubric and the first attempt (the filtering defaults). A task is clean when it passes all eight criteria for that judge. An “only” column means that one criterion fails and the other seven pass. Tasks that fail several criteria, or still need a verdict, have their own columns, so each task is counted once per judge.
66
 
67
+ | Judge | Clean | Only ANSWER-LEAK fails | Only INSTR-AMBIGUOUS fails | Only INSTR-ENV-MISMATCH fails | Only INSTR-VERIFIER-CONTRADICTION fails | Only INSTR-VERIFIER-UNSTATED-REQUIREMENT fails | Only TASK-TRIVIAL fails | Only VERIFIER-ACCEPTS-INCOMPLETE fails | Only VERIFIER-ACCEPTS-SHORTCUTS fails | Multiple criteria fail | Missing / incomplete verdicts |
68
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
69
+ | Qwen3.8-27B | 1,565 | 59 | 44 | 86 | 63 | 26 | 6 | 559 | 508 | 2,181 | 0 |
70
+ | GLM-5.3-Flash | 1,303 | 106 | 52 | 104 | 77 | 66 | 3 | 513 | 301 | 2,572 | 0 |
71
+
72
+ ### Rubric and vote choices
73
+
74
+ The repeated-review experiment covers **5,008 tasks**. 2 River first-attempt reviews are still awaiting successful retries. Four tasks have since had Dockerfile changes: their old River reviews and OT repeat are retained as historical evidence but excluded from filtering; their corrected, previously published OT first reviews remain available. Other previously published OT first reviews are preserved, but tasks without a second review cannot pass majority filtering. The repeat experiment used task copies before the release’s resource/offline-setting updates and canonical instruction suffix; these differences are recorded rather than claimed as new validation. The two OT Qwen passes also retain the previously accepted wording difference in `INSTR-VERIFIER-UNSTATED-REQUIREMENT`. See [judge provenance](judge-provenance.json) for coverage and the rubric hashes.
75
+
76
+ | Rubric | Judge | Vote | Clean | Failed criteria | Missing, stale or tied |
77
+ | --- | --- | --- | --- | --- | --- |
78
+ | ot_next_rubric | qwen | first | 1,565 | 3,532 | 0 |
79
+ | ot_next_rubric | qwen | majority | 1,040 | 1,372 | 2,685 |
80
+ | ot_next_rubric | glm | first | 1,303 | 3,794 | 0 |
81
+ | ot_next_rubric | glm | majority | 844 | 1,709 | 2,544 |
82
+ | river | qwen | first | 2,708 | 2,288 | 101 |
83
+ | river | qwen | majority | 2,164 | 1,031 | 1,902 |
84
+ | river | glm | first | 2,060 | 2,936 | 101 |
85
+ | river | glm | majority | 1,564 | 1,395 | 2,138 |
86
+
87
+ Votes are per criterion and per model. Majority requires every expected attempt; a tie or an incomplete attempt excludes the task. A failed retry is not a vote. Review attempts retain their original task and rubric hashes. Reviews of substantively changed task files are not used to filter the current release.
88
 
89
  ## Pass@4 results
90
 
 
101
 
102
  Install `pyarrow`, then put `filter_tasks.py`, `tasks.parquet` and `results.parquet` in the same directory. The script first applies the rule-based checks above. Warnings are kept, while tasks with a failed or unfinished required check are removed. `--out` names the output folder, e.g. `--out validated` saves tasks in `validated/`.
103
 
104
+ To also filter by LLM judge, use `--judge qwen` or `--judge glm`. Omitting the new flags means `--rubric ot_next_rubric --vote first`: use only attempt 1. Choose `--rubric river` for River’s seven criteria, or `--rubric ot_next_rubric` for our eight criteria. Choose `--vote majority` for a strict majority across attempts of the selected model, separately for each criterion. Ties, missing expected attempts and stale reviews exclude the task; models and rubrics are never pooled. Tasks with a failed selected criterion or missing verdict for that judge are removed. Use `--allow-fail CRITERION` to allow a named criterion to fail. Repeat `--allow-fail` to allow multiple criteria to fail.
105
 
106
  To also filter by pass@4, use `--passk-model qwen` (Qwen3.5-35B-A3B) or `--passk-model glm` (GLM-5.3-Flash), with `--successes` followed by the counts to keep, from 0 to 4. This uses the selected four-attempt batch and excludes missing or incomplete evaluations. Completed resource-limit failures count toward 0/4. You can combine this with judge filtering.
107
 
 
112
  # Also require all Qwen judge criteria to pass
113
  python filter_tasks.py --judge qwen --out clean-qwen
114
 
115
+ # River rubric, first attempt
116
+ python filter_tasks.py --judge qwen --rubric river --out river-qwen
117
+
118
+ # River rubric, majority vote across GLM attempts
119
+ python filter_tasks.py --judge glm --rubric river --vote majority --out river-glm-majority
120
+
121
+ # OT-next rubric, majority vote across Qwen attempts
122
+ python filter_tasks.py --judge qwen --vote majority --out ot-qwen-majority
123
+
124
  # Allow this GLM criterion to fail, all other criteria must pass
125
  python filter_tasks.py --judge glm \
126
  --allow-fail VERIFIER-ACCEPTS-INCOMPLETE --out glm-with-incomplete
 
149
  - `VERIFIER-ACCEPTS-INCOMPLETE`
150
  - `VERIFIER-ACCEPTS-SHORTCUTS`
151
 
152
+ River criteria ([rubric](https://github.com/MLI-lab/OT-next-data/blob/main/validation/rubrics/alternatives/rubric_river/rubric.toml)):
153
+
154
+ - `VERIFIER-TOO-WEAK`
155
+ - `INSTR-VERIFIER-MISMATCH`
156
+ - `INSTR-ENV-MISMATCH`
157
+ - `ANSWER-LEAK`
158
+ - `INSTR-AMBIGUOUS`
159
+ - `TASK-TRIVIAL`
160
+ - `OTHER`
161
+
162
+ Shared criterion names still refer to separate reviews in each rubric. River columns use the `river__` prefix in `results.parquet`; `--criteria` and `--allow-fail` use the unprefixed criterion name.
163
+
164
  ## Experiment 1: rubric filtering and RL performance
165
 
166
  River’s `VERIFIER-TOO-WEAK` combined incomplete solutions, where the agent still does part of the work, with shortcuts that bypass it. We split these into `VERIFIER-ACCEPTS-INCOMPLETE` and `VERIFIER-ACCEPTS-SHORTCUTS`.
 
172
  - **Clean + shortcuts-only performs worse than clean**, suggesting filtering with an LLM judge can help.
173
  - **Clean + incomplete-only performs better than clean**, suggesting rubric criteria have different effects on RL performance.
174
 
175
+ **Setup:** generate three datasets for RL, clean, clean + incomplete-only, and clean + shortcuts-only. These groups require the OT-next rubric; the commands below use its first attempt. Add `--vote majority` to use the repeated reviews instead.
176
 
177
  ```bash
178
  # Qwen: clean 1,565, clean + incomplete-only 2,124, clean + shortcuts-only 2,073
calibforge_v1.1/filter_tasks.py CHANGED
@@ -30,6 +30,12 @@ JUDGE_CRITERIA = (
30
  'INSTR-VERIFIER-CONTRADICTION', 'INSTR-VERIFIER-UNSTATED-REQUIREMENT',
31
  'TASK-TRIVIAL', 'VERIFIER-ACCEPTS-INCOMPLETE', 'VERIFIER-ACCEPTS-SHORTCUTS',
32
  )
 
 
 
 
 
 
33
  JUDGES = {'qwen': 'Qwen/Qwen3.8-27B', 'glm': 'zai-org/GLM-5.3-Flash'}
34
  PASSK_MODELS = {'qwen': 'passk_target', 'glm': 'passk_teacher'}
35
  ACCEPTED = {'pass', 'warning', 'not_applicable'}
@@ -49,34 +55,93 @@ def baseline_issues(row, checks=REQUIRED_CHECKS):
49
  if status(row.get(key)) not in ACCEPTED}
50
 
51
 
52
- def judge_statuses(cell):
53
- """Read per-judge JSON cells and legacy maps without changing review selection."""
54
  if isinstance(cell, str):
55
- cell = json.loads(cell)
 
 
 
56
  if not isinstance(cell, dict):
57
  return {}
58
  old = cell.get('verdicts', cell.get('status'))
59
  if isinstance(old, (dict, list)):
60
- return dict(old)
61
- return {model: [r['status'] for r in value['reviews']] if 'reviews' in value
62
- else [value['status']]
63
  for model, value in cell.items()
64
  if isinstance(value, dict) and 'status' in value}
65
 
66
 
67
- def judge_failures(row, judge, criteria=JUDGE_CRITERIA):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  """Return failed criteria, or None when any required review is unresolved.
69
 
70
- If several reviews exist, any fail counts as a fail. Unknown/missing verdicts
71
- exclude the task even when another review passed. Other models never vote.
 
72
  """
 
73
  failed = set()
74
  for criterion in criteria:
75
- cell = row.get(criterion) or {}
76
- reviews = judge_statuses(cell).get(JUDGES.get(judge, judge), [])
77
- if not reviews or any(v not in ACCEPTED | {'fail'} for v in reviews):
 
78
  return None
79
- if 'fail' in reviews:
80
  failed.add(criterion)
81
  return failed
82
 
@@ -112,9 +177,10 @@ def validate_passk_filter(model, successes):
112
  raise ValueError('--successes must contain integers from 0 to 4')
113
 
114
 
115
- def select(rows, judge=None, allow_fail=(), criteria=JUDGE_CRITERIA,
116
- passk_model=None, successes=None):
117
  validate_passk_filter(passk_model, successes)
 
118
  allowed = set(allow_fail)
119
  if allowed - set(criteria):
120
  raise ValueError('Allowed failure must be one of the selected judge criteria')
@@ -130,7 +196,7 @@ def select(rows, judge=None, allow_fail=(), criteria=JUDGE_CRITERIA,
130
  reasons['validation_failed' if 'fail' in issues.values() else 'validation_incomplete'] += 1
131
  continue
132
  if judge:
133
- failures = judge_failures(row, judge, criteria)
134
  if failures is None:
135
  reasons['judge_incomplete'] += 1
136
  continue
@@ -183,11 +249,14 @@ def subset_metadata(metadata, ids):
183
 
184
 
185
  def export(tasks, results, out, judge=None, allow_fail=(), experiment2=False,
186
- criteria=JUDGE_CRITERIA, passk_model=None, successes=None):
187
  import pyarrow as pa
188
  import pyarrow.parquet as pq
189
  tasks, results, out = Path(tasks), Path(results), Path(out)
190
  validate_passk_filter(passk_model, successes)
 
 
 
191
  if experiment2 and (not judge or allow_fail):
192
  raise ValueError('--experiment-1 requires --judge and cannot use --allow-fail')
193
  if allow_fail and not judge:
@@ -198,16 +267,17 @@ def export(tasks, results, out, judge=None, allow_fail=(), experiment2=False,
198
  absent = set(REQUIRED_CHECKS) - set(table.column_names)
199
  if absent:
200
  raise ValueError('Missing required validation columns: ' + ', '.join(sorted(absent)))
201
- if judge and set(criteria) - set(table.column_names):
202
- raise ValueError('Unknown judge criteria: ' + ', '.join(sorted(set(criteria) - set(table.column_names))))
 
203
  rows = table.to_pylist()
204
  if judge:
205
- available = {model for row in rows for criterion in criteria
206
  for model in judge_statuses(row.get(criterion))}
207
  if JUDGES.get(judge, judge) not in available:
208
  raise ValueError('No verdicts for judge ' + judge + '; available: ' + ', '.join(sorted(available)))
209
  variants = EXPERIMENT if experiment2 else {'selected': set(allow_fail)}
210
- groups = {name: select(rows, judge, allowed, criteria, passk_model, successes)
211
  for name, allowed in variants.items()}
212
  source = pq.ParquetFile(tasks)
213
  schemas, writers, paths = {}, {}, {}
@@ -254,6 +324,9 @@ def export(tasks, results, out, judge=None, allow_fail=(), experiment2=False,
254
  summary = {'inputs': {'tasks': file_identity(tasks), 'results': file_identity(results)},
255
  'judge': JUDGES.get(judge, judge), 'validation_checks': list(REQUIRED_CHECKS),
256
  'judge_criteria': list(criteria) if judge else [],
 
 
 
257
  'passk_filter': {'model': passk_model, 'column': PASSK_MODELS[passk_model],
258
  'k': 4, 'successes': sorted(set(successes))} if passk_model else None,
259
  'warnings_retained': True, 'incomplete_excluded': True, 'groups': {}}
@@ -274,10 +347,14 @@ def main():
274
  parser.add_argument('--tasks', type=Path, default=Path('tasks.parquet'))
275
  parser.add_argument('--results', type=Path, default=Path('results.parquet'))
276
  parser.add_argument('--judge', help='qwen, glm, or exact model ID; omitted = validation only')
 
 
 
 
277
  parser.add_argument('--allow-fail', action='append', default=[], metavar='CRITERION',
278
  help='Allow this judge criterion to fail; all others must pass (repeatable)')
279
- parser.add_argument('--criteria', nargs='+', default=JUDGE_CRITERIA,
280
- help='Judge criteria to enforce; default = all eight adjusted-rubric criteria')
281
  parser.add_argument('--experiment-1', '--experiment-2', dest='experiment_2', action='store_true',
282
  help='Export all three Experiment 1 groups')
283
  parser.add_argument('--passk-model', choices=PASSK_MODELS,
@@ -288,10 +365,11 @@ def main():
288
  args = parser.parse_args()
289
  try:
290
  validate_passk_filter(args.passk_model, args.successes)
 
 
 
291
  except ValueError as exc:
292
  parser.error(str(exc))
293
- summary = export(args.tasks, args.results, args.out, args.judge, args.allow_fail,
294
- args.experiment_2, args.criteria, args.passk_model, args.successes)
295
  print(json.dumps({k: v['tasks'] for k, v in summary['groups'].items()}, indent=2))
296
 
297
 
 
30
  'INSTR-VERIFIER-CONTRADICTION', 'INSTR-VERIFIER-UNSTATED-REQUIREMENT',
31
  'TASK-TRIVIAL', 'VERIFIER-ACCEPTS-INCOMPLETE', 'VERIFIER-ACCEPTS-SHORTCUTS',
32
  )
33
+ RIVER_CRITERIA = (
34
+ 'VERIFIER-TOO-WEAK', 'INSTR-VERIFIER-MISMATCH', 'INSTR-ENV-MISMATCH',
35
+ 'ANSWER-LEAK', 'INSTR-AMBIGUOUS', 'TASK-TRIVIAL', 'OTHER',
36
+ )
37
+ RUBRICS = {'ot_next_rubric': JUDGE_CRITERIA, 'river': RIVER_CRITERIA}
38
+ VOTES = ('first', 'majority')
39
  JUDGES = {'qwen': 'Qwen/Qwen3.8-27B', 'glm': 'zai-org/GLM-5.3-Flash'}
40
  PASSK_MODELS = {'qwen': 'passk_target', 'glm': 'passk_teacher'}
41
  ACCEPTED = {'pass', 'warning', 'not_applicable'}
 
55
  if status(row.get(key)) not in ACCEPTED}
56
 
57
 
58
+ def judge_records(cell):
59
+ """Read model records, retaining attempt order and provenance."""
60
  if isinstance(cell, str):
61
+ try:
62
+ cell = json.loads(cell)
63
+ except ValueError:
64
+ return {}
65
  if not isinstance(cell, dict):
66
  return {}
67
  old = cell.get('verdicts', cell.get('status'))
68
  if isinstance(old, (dict, list)):
69
+ return {model: {'reviews': [{'status': s} for s in values]}
70
+ for model, values in dict(old).items()}
71
+ return {model: value
72
  for model, value in cell.items()
73
  if isinstance(value, dict) and 'status' in value}
74
 
75
 
76
+ def judge_statuses(cell):
77
+ return {model: [r.get('status') for r in value.get('reviews', [value])]
78
+ for model, value in judge_records(cell).items()}
79
+
80
+
81
+ def criterion_column(criterion, rubric='ot_next_rubric'):
82
+ return 'river__' + criterion if rubric == 'river' else criterion
83
+
84
+
85
+ def judge_options(criteria, rubric, vote):
86
+ if rubric not in RUBRICS:
87
+ raise ValueError('Unknown rubric: ' + str(rubric))
88
+ if vote not in VOTES:
89
+ raise ValueError('Unknown vote: ' + str(vote))
90
+ criteria = RUBRICS[rubric] if criteria is None else tuple(criteria)
91
+ if not criteria or set(criteria) - set(RUBRICS[rubric]):
92
+ raise ValueError('Criteria must belong to the selected rubric: ' + rubric)
93
+ return criteria
94
+
95
+
96
+ def review_outcome(value, vote):
97
+ reviews = value.get('reviews', [value])
98
+ if not isinstance(reviews, list) or not reviews or any(not isinstance(r, dict) for r in reviews):
99
+ return None
100
+ # Explicit attempt numbers prevent a missing first attempt from becoming attempt 2.
101
+ if any('attempt' in r for r in reviews):
102
+ numbers = [r.get('attempt') for r in reviews]
103
+ if any(type(n) is not int or n < 1 for n in numbers) or len(set(numbers)) != len(numbers):
104
+ return None
105
+ reviews = sorted(reviews, key=lambda r: r['attempt'])
106
+ if vote == 'first':
107
+ reviews = [r for r in reviews if r['attempt'] == 1]
108
+ elif [r['attempt'] for r in reviews] != list(range(1, len(reviews) + 1)):
109
+ return None
110
+ elif vote == 'first':
111
+ reviews = reviews[:1]
112
+ if not reviews:
113
+ return None
114
+ if vote == 'majority':
115
+ expected = value.get('expected_attempts', len(reviews))
116
+ if type(expected) is not int or expected < 1 or len(reviews) != expected:
117
+ return None
118
+ if any(r.get('applicable_to_release') is False for r in reviews):
119
+ return None
120
+ statuses = [r.get('status') for r in reviews]
121
+ if any(not isinstance(s, str) or s not in ACCEPTED | {'fail'} for s in statuses):
122
+ return None
123
+ failures = statuses.count('fail')
124
+ if failures * 2 == len(statuses):
125
+ return None # A tie is unresolved, including when a failure is allowed.
126
+ return 'fail' if failures * 2 > len(statuses) else 'pass'
127
+
128
+
129
+ def judge_failures(row, judge, criteria=None, *, rubric='ot_next_rubric', vote='first'):
130
  """Return failed criteria, or None when any required review is unresolved.
131
 
132
+ First uses attempt 1 only. Majority requires every expected attempt to be
133
+ resolved and a strict majority per criterion. Ties exclude the task.
134
+ Other models and rubrics never vote.
135
  """
136
+ criteria = judge_options(criteria, rubric, vote)
137
  failed = set()
138
  for criterion in criteria:
139
+ cell = row.get(criterion_column(criterion, rubric)) or {}
140
+ value = judge_records(cell).get(JUDGES.get(judge, judge), {})
141
+ outcome = review_outcome(value, vote)
142
+ if outcome is None:
143
  return None
144
+ if outcome == 'fail':
145
  failed.add(criterion)
146
  return failed
147
 
 
177
  raise ValueError('--successes must contain integers from 0 to 4')
178
 
179
 
180
+ def select(rows, judge=None, allow_fail=(), criteria=None,
181
+ passk_model=None, successes=None, *, rubric='ot_next_rubric', vote='first'):
182
  validate_passk_filter(passk_model, successes)
183
+ criteria = judge_options(criteria, rubric, vote)
184
  allowed = set(allow_fail)
185
  if allowed - set(criteria):
186
  raise ValueError('Allowed failure must be one of the selected judge criteria')
 
196
  reasons['validation_failed' if 'fail' in issues.values() else 'validation_incomplete'] += 1
197
  continue
198
  if judge:
199
+ failures = judge_failures(row, judge, criteria, rubric=rubric, vote=vote)
200
  if failures is None:
201
  reasons['judge_incomplete'] += 1
202
  continue
 
249
 
250
 
251
  def export(tasks, results, out, judge=None, allow_fail=(), experiment2=False,
252
+ criteria=None, passk_model=None, successes=None, *, rubric='ot_next_rubric', vote='first'):
253
  import pyarrow as pa
254
  import pyarrow.parquet as pq
255
  tasks, results, out = Path(tasks), Path(results), Path(out)
256
  validate_passk_filter(passk_model, successes)
257
+ criteria = judge_options(criteria, rubric, vote)
258
+ if experiment2 and rubric != 'ot_next_rubric':
259
+ raise ValueError('--experiment-1 requires --rubric ot_next_rubric (the split verifier criteria)')
260
  if experiment2 and (not judge or allow_fail):
261
  raise ValueError('--experiment-1 requires --judge and cannot use --allow-fail')
262
  if allow_fail and not judge:
 
267
  absent = set(REQUIRED_CHECKS) - set(table.column_names)
268
  if absent:
269
  raise ValueError('Missing required validation columns: ' + ', '.join(sorted(absent)))
270
+ columns = [criterion_column(c, rubric) for c in criteria]
271
+ if judge and set(columns) - set(table.column_names):
272
+ raise ValueError('Missing judge columns for ' + rubric + ': ' + ', '.join(sorted(set(columns) - set(table.column_names))))
273
  rows = table.to_pylist()
274
  if judge:
275
+ available = {model for row in rows for criterion in columns
276
  for model in judge_statuses(row.get(criterion))}
277
  if JUDGES.get(judge, judge) not in available:
278
  raise ValueError('No verdicts for judge ' + judge + '; available: ' + ', '.join(sorted(available)))
279
  variants = EXPERIMENT if experiment2 else {'selected': set(allow_fail)}
280
+ groups = {name: select(rows, judge, allowed, criteria, passk_model, successes, rubric=rubric, vote=vote)
281
  for name, allowed in variants.items()}
282
  source = pq.ParquetFile(tasks)
283
  schemas, writers, paths = {}, {}, {}
 
324
  summary = {'inputs': {'tasks': file_identity(tasks), 'results': file_identity(results)},
325
  'judge': JUDGES.get(judge, judge), 'validation_checks': list(REQUIRED_CHECKS),
326
  'judge_criteria': list(criteria) if judge else [],
327
+ 'judge_rubric': rubric if judge else None,
328
+ 'judge_vote': vote if judge else None,
329
+ 'judge_tie_policy': 'exclude' if judge and vote == 'majority' else None,
330
  'passk_filter': {'model': passk_model, 'column': PASSK_MODELS[passk_model],
331
  'k': 4, 'successes': sorted(set(successes))} if passk_model else None,
332
  'warnings_retained': True, 'incomplete_excluded': True, 'groups': {}}
 
347
  parser.add_argument('--tasks', type=Path, default=Path('tasks.parquet'))
348
  parser.add_argument('--results', type=Path, default=Path('results.parquet'))
349
  parser.add_argument('--judge', help='qwen, glm, or exact model ID; omitted = validation only')
350
+ parser.add_argument('--rubric', choices=RUBRICS, default='ot_next_rubric',
351
+ help='Judge rubric (default: ot_next_rubric)')
352
+ parser.add_argument('--vote', choices=VOTES, default='first',
353
+ help='Use first attempt or strict majority across attempts; ties excluded (default: first)')
354
  parser.add_argument('--allow-fail', action='append', default=[], metavar='CRITERION',
355
  help='Allow this judge criterion to fail; all others must pass (repeatable)')
356
+ parser.add_argument('--criteria', nargs='+',
357
+ help='Judge criteria to enforce; default = every criterion in the selected rubric')
358
  parser.add_argument('--experiment-1', '--experiment-2', dest='experiment_2', action='store_true',
359
  help='Export all three Experiment 1 groups')
360
  parser.add_argument('--passk-model', choices=PASSK_MODELS,
 
365
  args = parser.parse_args()
366
  try:
367
  validate_passk_filter(args.passk_model, args.successes)
368
+ summary = export(args.tasks, args.results, args.out, args.judge, args.allow_fail,
369
+ args.experiment_2, args.criteria, args.passk_model, args.successes,
370
+ rubric=args.rubric, vote=args.vote)
371
  except ValueError as exc:
372
  parser.error(str(exc))
 
 
373
  print(json.dumps({k: v['tasks'] for k, v in summary['groups'].items()}, indent=2))
374
 
375
 
calibforge_v1.1/judge-provenance.json ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "format": "calibforge-judge-provenance-v1",
3
+ "default_rubric": "ot_next_rubric",
4
+ "default_vote": "first",
5
+ "majority": {
6
+ "scope": "per criterion, across attempts of one selected model and rubric",
7
+ "expected_attempts": 2,
8
+ "tie": "exclude",
9
+ "missing_attempt": "exclude"
10
+ },
11
+ "cohort_tasks": 5008,
12
+ "available_reviews": {
13
+ "river/qwen38-27b/seed-42": 5007,
14
+ "river/qwen38-27b/seed-43": 5008,
15
+ "river/glm-5.3-flash/seed-42": 5007,
16
+ "river/glm-5.3-flash/seed-43": 5008,
17
+ "ot/qwen38-27b/historical": 5008,
18
+ "ot/qwen38-27b/seed-43": 5008,
19
+ "ot/glm-5.3-flash/historical": 5008,
20
+ "ot/glm-5.3-flash/seed-43": 5008
21
+ },
22
+ "rubric_sha256": {
23
+ "ot": "cf596a7e92f5ce88610c401c966034dd89db940149ae0aa57f469493a5081a1f",
24
+ "river": "f1dafd53d1aa8f05bab0e47ec34ec94058095aa5ab4ced5a88d43bcbebee2a87"
25
+ },
26
+ "OT_first": "Preserve the previously published OT review, including existing corrections. The original historical review is also retained when it differs.",
27
+ "OT_second_seed": 43,
28
+ "river_seeds": [
29
+ 42,
30
+ 43
31
+ ],
32
+ "task_compatibility": {
33
+ "counts": {
34
+ "compatible": 5004,
35
+ "changed_task_files": 4
36
+ },
37
+ "normalization": "Compare every file; normalize only the canonical instruction suffix and environment CPU, memory, storage and allow_internet settings. Preserve original judge hashes and record the release settings separately.",
38
+ "changed_tasks": {
39
+ "contrastive_solver-debugging_20260610_112157_001": {
40
+ "applicable_to_release": false,
41
+ "judge_content_sha256": "e6c0a044a221d6cd2cac20ac087e233418f81757c9d15b216d583f760f7bf33a",
42
+ "release_content_sha256": "ad03082fbe289674009adcdc88a0fdb76263a88437648f09f6944dd170733497",
43
+ "differences_beyond_release_metadata": [
44
+ "environment/Dockerfile"
45
+ ],
46
+ "judge_environment_settings": {
47
+ "cpus": 1,
48
+ "memory": "2G",
49
+ "storage": "10G"
50
+ },
51
+ "release_environment_settings": {
52
+ "cpus": 1,
53
+ "memory_mb": 2048,
54
+ "storage_mb": 3072,
55
+ "allow_internet": false
56
+ }
57
+ },
58
+ "contrastive_solver-machine-learning_20260601_053159_001": {
59
+ "applicable_to_release": false,
60
+ "judge_content_sha256": "3ba5634f3036f7938e3de717aa1a59d29379862ea2bcd0a89453ded50251fccc",
61
+ "release_content_sha256": "24f7905570371db2c8ea71d67fb2551cd3930db3ce98ac4a502b7eeae3f8b9e6",
62
+ "differences_beyond_release_metadata": [
63
+ "environment/Dockerfile"
64
+ ],
65
+ "judge_environment_settings": {
66
+ "cpus": 2,
67
+ "memory": "4G",
68
+ "storage": "10G"
69
+ },
70
+ "release_environment_settings": {
71
+ "cpus": 2,
72
+ "memory_mb": 8192,
73
+ "storage_mb": 3072,
74
+ "allow_internet": false
75
+ }
76
+ },
77
+ "contrastive_solver-machine-learning_20260604_003814_001": {
78
+ "applicable_to_release": false,
79
+ "judge_content_sha256": "be73cffe656f7bda7237d01caadfb990ccf3597af78967a0076e850b03ec3623",
80
+ "release_content_sha256": "12f6cb208b8e8f0de7d17b38e5f9237ec386c2c2f2d50536b5a3a73209c02b6d",
81
+ "differences_beyond_release_metadata": [
82
+ "environment/Dockerfile"
83
+ ],
84
+ "judge_environment_settings": {
85
+ "cpus": 2,
86
+ "memory": "4G",
87
+ "storage": "10G"
88
+ },
89
+ "release_environment_settings": {
90
+ "cpus": 2,
91
+ "memory": "4G",
92
+ "storage": "10G",
93
+ "allow_internet": false
94
+ }
95
+ },
96
+ "contrastive_solver-software-engineering_20260510_142854_008": {
97
+ "applicable_to_release": false,
98
+ "judge_content_sha256": "6cada115def80aa6b6ddf5a3af2f37c43cc6cfd74c43e691fe9e30f459b60ee0",
99
+ "release_content_sha256": "fbf7f9404c8ff973eb2f44608e600906f5f1fc4ffaae2f12da16d13b98a82c6d",
100
+ "differences_beyond_release_metadata": [
101
+ "environment/Dockerfile"
102
+ ],
103
+ "judge_environment_settings": {
104
+ "cpus": 2,
105
+ "memory": "4G",
106
+ "storage": "10G"
107
+ },
108
+ "release_environment_settings": {
109
+ "cpus": 1,
110
+ "memory_mb": 2048,
111
+ "storage_mb": 3072,
112
+ "allow_internet": false
113
+ }
114
+ }
115
+ }
116
+ },
117
+ "qwen_OT_wording_difference": {
118
+ "accepted_by_user": true,
119
+ "qwen_tasks_old_wording": 4560,
120
+ "qwen_tasks_current_wording": 448,
121
+ "criterion": "INSTR-VERIFIER-UNSTATED-REQUIREMENT",
122
+ "repeat": "current frozen rubric for all 5008 tasks"
123
+ },
124
+ "retry_winners": {}
125
+ }
calibforge_v1.1/results.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:3c8cbd9a7ac042e43985dccc8272a974cf5cb5b75f054c52b5f53bfb6ff90e9e
3
- size 29087862
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10352e83bfcd92aae367a17041acd1077bc642698641a47703cc086e8ad4f74b
3
+ size 60220718