bohrin
Check the grader of an RL coding environment before you train on it.
In a coding environment, a grader decides whether each submission solved the task, and it is the only thing the model learns from. If it pays for code that does not do the work, the model learns to not do the work.
Bohrin gives you the submissions a correct grader must reject — each one wrong by construction — and scores how many your grader caught.
Install
$ pip install bohrin
Use
from bohrin.ir.task import Task
from bohrin.mutate.battery import battery
from bohrin.scoring.coverage import Attempt, coverage_score
reference = "def add(a, b):\n return a + b\n"
task = Task(id="add", prompt="Write add(a, b) that returns the sum.", reference=reference)
def my_grader(task, submission):
# A common weak shape: checks that the function exists and runs, not what it returns.
namespace = {}
try:
exec(submission, namespace)
namespace["add"](2, 3)
return True
except Exception:
return False
attempts = [
Attempt(task.id, candidate, accepted=my_grader(task, candidate.payload)) for candidate in battery(task).candidates
]
print(coverage_score(attempts))
COVERAGE SCORE: 75 / 100 95% CI 30–95 3 of 4 caught categories: 4 of 5 (battery 1)
That grader rejects an empty submission, a truncated reply and a constant, and pays for the
reference with every function body replaced by pass — it runs, so the grader never notices it
returns nothing.
What is tried
| Category | Submissions |
|---|---|
empty_and_echo |
an empty submission, the task prompt echoed back, a refusal |
wrong_answer |
a constant (0, None, [] …), the reference with every function body emptied |
malformed_output |
a repetition loop, and a reply cut off inside unclosed markup |
denial |
an explicit denial of the declared answer |
multiple_answers |
several answers at once, the declared one among them |
A submission is called wrong only when that is established without asking your grader. One that cannot be shown to be wrong — a refusal on a task with no declared answer, say — is a lead: tried and shown to you, never counted. See docs/SPEC.md for the exact rules.
License
Metadata
Release files for bohrin 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bohrin-0.3.0.tar.gz | 55.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bohrin-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 103.9 kB
Release files / bohrin-0.3.0.tar.gz
| Download URL | bohrin-0.3.0.tar.gz |
|---|---|
| Size | 55.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1647842a7b9e432e32747f0e39467f58afcc0c7c45e88935266e475aa584a068
|
|
BLAKE2b-256 checksum How to use checksums |
4a00b5de135e463db05190c11549da3123ffc59877f7465ba339d7db7841f4c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / bohrin-0.3.0-py3-none-any.whl
| Download URL | bohrin-0.3.0-py3-none-any.whl |
|---|---|
| Size | 48.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f9cf3b046841ced8ba9c6fb967b0695a85d9134dcb81138a2c92149e4b4c77c5
|
|
BLAKE2b-256 checksum How to use checksums |
30d4615c004139eff8fce11f3d55f83ff587ee5c1abb145db823feea516ccd5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency log