Skip to main content

bohrin

CI License

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

Apache-2.0.

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)

Source distribution for bohrin 0.3.0
File Size Uploaded
bohrin-0.3.0.tar.gz 55.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bohrin 0.3.0
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

1.5.0

2 release files

1.4.0

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page