Skip to content

Commit 76e78fb

Browse files
authored
Remove submission schema version field (#57)
* Clarify submission schema ownership * Remove submission schema version field * Simplify submission contract changes
1 parent b9741a3 commit 76e78fb

14 files changed

Lines changed: 66 additions & 79 deletions

‎CONTRIBUTING.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ The runner image bundles the `pred` binary, the agent stack (mini-swe-agent + Li
3434
and the problem-reductions source pinned at `v0.6.0`. Any LiteLLM-routable provider key
3535
works.
3636

37-
The **target library version is not hardcoded** — it tracks the benchmark. `PR_REF` selects
38-
a tag or commit of problem-reductions; the image records that commit and its matching
39-
`pred`. Pull the published image for that ref, or build it locally when unavailable:
37+
The official round is pinned to the exact tag and commit listed in the
38+
[README](README.md#current-benchmark-round). `PR_REF` selects the corresponding
39+
problem-reductions source when preparing an image; the runner records the resolved commit
40+
and its matching `pred`. Pull the published image for that ref, or build it locally when
41+
unavailable:
4042

4143
```bash
4244
make runner-pull PR_REF=v0.6.0
@@ -221,7 +223,7 @@ python -m benchmark.backend_score --local submissions/ results/scored/
221223

222224
For each `PENDING` submission it:
223225

224-
1. validates the current schema, pinned library commit, and clean-run status, then flips
226+
1. validates the current submission structure, pinned library commit, and clean-run status, then flips
225227
status `PENDING → RUNNING`,
226228
2. re-runs `benchmark/verify_submission.py` — which calls `verify()` on **every**
227229
certificate and re-derives the bundle from `pred`, so a fabricated or tampered

‎README.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ A benchmark that measures how efficiently AI models find bugs in reduction rules
44

55
The leaderboard is a static site (`site/`) published to **GitHub Pages**. Submitting uses a CLI (`python -m benchmark.submit`) that uploads your run to a private store; the maintainer re-verifies it with `pred` and publishes only the aggregate. See [CONTRIBUTING.md](CONTRIBUTING.md) to run and submit.
66

7+
## Current benchmark round
8+
9+
| Contract | Current value | Ownership |
10+
|---|---|---|
11+
| Submission format | [`benchmark/submission.schema.json`](benchmark/submission.schema.json) | The runner writes the current structure and the scorer parses that structure directly. The payload has no schema-version field. |
12+
| `problem-reductions` target | [`v0.6.0` / `aa2d1a10cffa434871d12a4d6f411147fb7e08a8`](https://github.com/CodingThrust/problem-reductions/commit/aa2d1a10cffa434871d12a4d6f411147fb7e08a8) | Every official result is verified against this exact commit. |
13+
| `pred` | `0.6.0` | The runner/scorer image supplies and verifies the matching binary. |
14+
15+
Do not hand-edit `library_commit` in `submission.json`. The runner records it; the intake
16+
client performs a structural courtesy check, and the private scorer is the authority for
17+
the current submission structure and round pin.
18+
719
## What this measures
820

921
A reduction rule maps problem A → problem B. A **bug** is a round-trip failure:

‎benchmark/backend_score.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525

2626
from benchmark.env_setup import pinned_commit
2727
from benchmark.submit import validate_submission
28+
from benchmark.submit_ledger import has_submit_ledger
2829
from benchmark.verify_submission import leaderboard_entry, score_submission
2930

3031
STATUS_SUFFIX = ".status.json"
31-
OFFICIAL_SCHEMA_VERSION = "2.1"
3232

3333

3434
class PermanentSubmissionError(ValueError):
@@ -180,18 +180,18 @@ def _validate_for_scoring(submission: object, *, official: bool,
180180
181181
Basic validation applies to local and production scoring so malformed input is a
182182
permanent per-object failure instead of an exception that jams the whole queue. The
183-
official gate additionally fixes the schema and target commit, and rejects partial runs
184-
from the public leaderboard. Test submissions may be partial because they never publish.
183+
official gate additionally requires the current ledger-backed structure and target
184+
commit, and rejects partial runs from the public leaderboard. Test submissions may be
185+
partial because they never publish.
185186
"""
186187
if not isinstance(submission, dict):
187188
raise PermanentSubmissionError("submission is not a JSON object")
188189

189190
problems = validate_submission(submission)
190191

191192
if official:
192-
if submission.get("schema_version") != OFFICIAL_SCHEMA_VERSION:
193-
problems.append(
194-
f"official submissions require schema_version {OFFICIAL_SCHEMA_VERSION}")
193+
if not has_submit_ledger(submission):
194+
problems.append("official submissions require submit_limit and submit_log")
195195
target_commit = expected_commit or pinned_commit()
196196
if submission.get("library_commit") != target_commit:
197197
problems.append(
@@ -320,7 +320,8 @@ def main() -> None:
320320
parser.add_argument("--repo-dir", default=None, help="problem-reductions repo (default: pred on PATH)")
321321
parser.add_argument(
322322
"--official", action="store_true",
323-
help="Require the current schema, pinned library commit, and a clean non-test run")
323+
help="Require the current submission structure, pinned library commit, and a clean "
324+
"non-test run")
324325
parser.add_argument(
325326
"--expected-commit", default=None,
326327
help="Override the official target commit (tests/operations; default: image pin)")

‎benchmark/results.schema.json‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
"type": "object",
77
"required": ["model", "library_commit", "bugs_found", "total_tokens_k", "efficiency_bugs_per_ktok", "rules_tested", "results"],
88
"properties": {
9-
"schema_version": {
10-
"type": ["string", "null"],
11-
"description": "Submission schema version carried through for private auditability"
12-
},
139
"model": {
1410
"type": "string",
1511
"description": "LiteLLM model name (e.g. 'anthropic/claude-sonnet-4-6')"

‎benchmark/run_submission.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
from benchmark.usage import Usage, usage_as_dict, usage_from_dict
4343
from benchmark.verify import count_bugs
4444

45-
SCHEMA_VERSION = "2.1"
4645
RUNNER_VERSION = "0.8.0"
4746
BACKENDS = ("mini-swe", "claude-code", "codex")
4847

@@ -89,7 +88,6 @@ def build_submission(
8988

9089
submit_attempts = submit_attempts or []
9190
envelope = {
92-
"schema_version": SCHEMA_VERSION,
9391
"model": model,
9492
"library_commit": library_commit,
9593
"bugs_found": bugs,

‎benchmark/submission.schema.json‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@
44
"title": "BenchmarkSubmission",
55
"description": "A self-describing, rankable whole-repository benchmark submission. The bounded submit ledger lets the backend rank and re-verify every claimed counterexample.",
66
"type": "object",
7-
"required": ["schema_version", "model", "library_commit", "bugs_found", "total_tokens_k", "rules_tested", "results", "submit_limit", "submit_log"],
7+
"required": ["model", "library_commit", "bugs_found", "total_tokens_k", "rules_tested", "results", "submit_limit", "submit_log"],
88
"properties": {
9-
"schema_version": {
10-
"type": "string",
11-
"description": "Submission schema version (e.g. '1.0')"
12-
},
139
"model": {
1410
"type": "string",
1511
"description": "LiteLLM model name (e.g. 'anthropic/claude-sonnet-4-6')"
@@ -75,7 +71,7 @@
7571
},
7672
"trajectory": {
7773
"type": "array",
78-
"description": "The agent's own message history for this rule. Schema 2.1 uses submit_log for provenance; legacy submissions use this trajectory.",
74+
"description": "The agent's own message history for this rule. Retained for historical data; current submissions use submit_log for provenance.",
7975
"items": {
8076
"type": "object",
8177
"properties": {
@@ -122,7 +118,7 @@
122118
"test": {"type": "boolean", "description": "When true, the backend scores and stores the submission privately but EXCLUDES it from the public leaderboard (for end-to-end tests). Set via `prb submit --test`."},
123119
"trajectory": {
124120
"type": "array",
125-
"description": "Envelope-level session trajectory for a whole-repo run, stored once instead of on every row. Schema 2.1 provenance comes from submit_log.",
121+
"description": "Envelope-level session trajectory for a whole-repo run, stored once instead of on every row. Current submissions use submit_log for provenance.",
126122
"items": {
127123
"type": "object",
128124
"properties": {

‎benchmark/submit.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
import urllib.request
3333
from pathlib import Path
3434

35-
from benchmark.submit_ledger import schema_requires_ledger, submit_ledger_error
35+
from benchmark.submit_ledger import submit_ledger_error
3636

37-
REQUIRED_ENVELOPE = ("schema_version", "model", "library_commit", "bugs_found",
38-
"total_tokens_k", "rules_tested", "results")
37+
REQUIRED_ENVELOPE = ("model", "library_commit", "bugs_found", "total_tokens_k",
38+
"rules_tested", "results")
3939

4040

4141
def load_submission(path: Path) -> dict:
@@ -111,7 +111,7 @@ def validate_submission(sub: dict) -> list[str]:
111111
rule = row.get("rule", "?")
112112
if not row.get("certificate"):
113113
problems.append(f"results[{i}] ({rule}): bug_found row has no certificate")
114-
if (not schema_requires_ledger(sub.get("schema_version"))
114+
if ("submit_log" not in sub
115115
and not row.get("trajectory") and not envelope_traj):
116116
problems.append(f"results[{i}] ({rule}): bug_found row has no trajectory "
117117
"(required as provenance — on the row or the envelope)")

‎benchmark/submit_ledger.py‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,14 @@
33

44
import json
55

6-
LEDGER_SCHEMA = (2, 1)
7-
8-
9-
def schema_requires_ledger(version) -> bool:
10-
try:
11-
parts = tuple(int(part) for part in str(version).split(".")[:2])
12-
except ValueError:
13-
return False
14-
return parts >= LEDGER_SCHEMA
15-
16-
176
def has_submit_ledger(submission: dict) -> bool:
187
return "submit_limit" in submission or "submit_log" in submission
198

209

2110
def submit_ledger_error(submission: dict) -> str | None:
2211
"""Return one structural error, or ``None`` for a valid/legacy submission."""
2312
if not has_submit_ledger(submission):
24-
return ("schema 2.1+ submission is missing submit_limit and submit_log"
25-
if schema_requires_ledger(submission.get("schema_version")) else None)
13+
return None
2614

2715
limit, log = submission.get("submit_limit"), submission.get("submit_log")
2816
if not isinstance(limit, int) or isinstance(limit, bool) or limit < 0:

‎benchmark/tests/test_backend_score.py‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def _traj(cert: dict) -> list[dict]:
2323
def _write_submission(subs_dir: Path, name: str, results, **over) -> Path:
2424
results = [{"tokens_k": 0, **row} for row in results]
2525
sub = {
26-
"schema_version": "2.0",
2726
"model": over.pop("model", "anthropic/test"),
2827
"library_commit": "deadbeef",
2928
"bugs_found": over.pop("bugs_found", 0),
@@ -161,18 +160,18 @@ def test_main_exits_zero_when_all_scored(self, tmp_path, monkeypatch):
161160
monkeypatch.setattr("sys.argv", ["backend_score", "--local", str(subs), str(results)])
162161
bs.main() # returns normally (no SystemExit) → exit 0
163162

164-
def test_official_gate_rejects_wrong_schema_commit_and_partial_run(self, tmp_path):
163+
def test_official_gate_rejects_missing_ledger_wrong_commit_and_partial_run(self, tmp_path):
165164
subs, results = tmp_path / "subs", tmp_path / "results"
166165
subs.mkdir()
167166
_write_submission(
168167
subs, "bad-round.json", [{"rule": "R", "result": "no_bug", "tokens_k": 0}],
169-
schema_version="2.0", library_commit="wrong", run_error="quota exhausted")
168+
library_commit="wrong", run_error="quota exhausted")
170169
summary = bs.process_local(
171170
str(subs), str(results), official=True, expected_commit="expected")
172171
assert summary[0]["status"] == "FAILED"
173172
assert summary[0]["retryable"] is False
174173
error = summary[0]["error"]
175-
assert "schema_version 2.1" in error
174+
assert "require submit_limit and submit_log" in error
176175
assert "library_commit" in error
177176
assert "partial run" in error
178177

@@ -181,7 +180,7 @@ def test_official_gate_accepts_current_clean_submission(self, tmp_path):
181180
subs.mkdir()
182181
_write_submission(
183182
subs, "ok.json", [{"rule": "R", "result": "no_bug", "tokens_k": 0}],
184-
schema_version="2.1", library_commit="expected", submit_limit=1,
183+
library_commit="expected", submit_limit=1,
185184
submit_log=[])
186185
summary = bs.process_local(
187186
str(subs), str(results), official=True, expected_commit="expected")
@@ -192,7 +191,7 @@ def test_official_test_submission_may_preserve_run_error(self, tmp_path):
192191
subs.mkdir()
193192
_write_submission(
194193
subs, "test.json", [{"rule": "R", "result": "no_bug", "tokens_k": 0}],
195-
schema_version="2.1", library_commit="expected", submit_limit=1,
194+
library_commit="expected", submit_limit=1,
196195
submit_log=[], test=True, run_error="intentional smoke failure")
197196
summary = bs.process_local(
198197
str(subs), str(results), official=True, expected_commit="expected")

‎benchmark/tests/test_docs.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import pytest
77
from pathlib import Path
88

9+
from benchmark.env_setup import PINNED_COMMIT, PINNED_PRED_VERSION
10+
911
pytestmark = pytest.mark.judgment
1012

1113
REPO_ROOT = Path(__file__).parent.parent.parent
@@ -41,6 +43,12 @@ def test_readme_has_metrics_section(self):
4143
t = _text(README)
4244
assert "bugs/ktok" in t or "bugs_per_ktok" in t
4345

46+
def test_readme_lists_current_round_contract(self):
47+
text = README.read_text(encoding="utf-8")
48+
assert PINNED_COMMIT in text
49+
assert f"`{PINNED_PRED_VERSION}`" in text
50+
assert "no schema-version field" in text.lower()
51+
4452

4553
class TestGuide:
4654
def test_guide_exists(self):

0 commit comments

Comments
 (0)