Skip to main content

Harbor Rewardkit

Docs

The Harbor Rewardkit is a lightweight package to define and run verifiers. Rewardkit is designed to be used with the Harbor task format but you can use it on its own.

Installation

uv tool install harbor-rewardkit

Example: Programmatic criteria

# tests/check.py
from rewardkit import criteria

criteria.file_exists("output.txt")
criteria.file_contains("output.txt", "hello")

Example: scoring config for a dimension

Drop a reward.toml next to the checks to control how they score. [scoring] gates the group instead of averaging it, and weight sets its share of the dimension when the directory also holds judge tomls:

# tests/structure/reward.toml
weight = 2.0

[scoring]
aggregation = "all_pass"

Directories can be nested into larger groups. A non-root directory may use one [[reward]] table to aggregate its local checks, judges, and immediate child directories. Child directories default to equal weight; override them with a short inline map:

# tests/correctness/reward.toml
[[reward]]
aggregation = "weighted_mean"
weights = { files = 2.0, behavior = 1.0 }

At the tests root, named aggregations use the same syntax:

[[reward]]
name = "reward"
aggregation = "weighted_mean"
weights = { correctness = 2.0, quality = 1.0 }

Root-level judge TOMLs also remain valid when dimension directories exist. Each becomes a top-level score named after its filename stem and may be included in the root aggregation.

Example: LLM judge

# tests/quality.toml
[judge]
judge = "anthropic/claude-sonnet-4-6"
files = ["/app/main.py"]

[[criterion]]
description = "Is the code correct?"
type = "binary"

Example: Agent judge with an MCP server

Each [[judge.mcp_servers]] entry matches a Harbor task's [[environment.mcp_servers]]. Per-server allowed_tools lists the tools the judge may call; omit it to allow all of the server's tools. Codex does not support sse servers.

# tests/quality.toml
[judge]
judge = "claude-code"

[[judge.mcp_servers]]
name = "playwright"
transport = "stdio"
command = "npx"
args = ["@playwright/mcp@latest", "--headless", "--isolated"]
allowed_tools = ["navigate", "click"]

[[criterion]]
description = "Does the rendered page match the spec?"
type = "binary"

Usage

Add rewardkit to your test.sh file:

# tests/test.sh
uvx harbor-rewardkit@0.1 /tests

See the documentation and a full working example.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

harbor_rewardkit-0.2.0.tar.gz (40.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

harbor_rewardkit-0.2.0-py3-none-any.whl (57.7 kB view details)

Uploaded Python 3

File details

Details for the file harbor_rewardkit-0.2.0.tar.gz.

File metadata

  • Download URL: harbor_rewardkit-0.2.0.tar.gz
  • Upload date:
  • Size: 40.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for harbor_rewardkit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3e79b5cd00fc1b852963d6858ceedafd817081a907da69b8892a8d770f8a3a35
MD5 47f7174fa33da055b27d75d6bed18ee4
BLAKE2b-256 f9701e70173e730c08e13fb1e887fbd1c2706b3fdb55b84476c08dd9ab79cd49

See more details on using hashes here.

File details

Details for the file harbor_rewardkit-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: harbor_rewardkit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 57.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for harbor_rewardkit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be4f2c966943e9b443a203b49ce979f88dfef9ca3d9530f6ee0eee2e051ac5ca
MD5 1952c51f9e26e5f236103caa55b23dff
BLAKE2b-256 30397bbe09abe9b7f2feffaa13b41c7e11bd7da7d80c269864829e4820278362

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page