Skip to main content

truereward-harwell

The recorded-state reader for truereward, over the Harwell engine.

It grades a change to a codebase that has no unit test suite. A case records what a job leaves behind when the code is right: the data sets, the spool files and the tables. Grading runs the same job against the changed codebase and compares what it left with that approved baseline.

  • A case is data. A directory with case.json, a start/ snapshot and an expected/ snapshot, validated against the JSON Schema shipped in the package. Every field a case reads is resolved to bytes when the case is recorded, so grading never opens the candidate's source to decide what is compared.
  • grade_case(case, codebase) runs the case twice in a contained run, compares the first end state with the baseline under the case's policy, and answers with a truereward.CaseResult. The two runs are compared with each other under the author's own mask, which answers the determinism check.
  • record.record(...) records a case: run the job, keep what it left as the approved baseline, freeze every field map.
  • selftest.run(...) asks whether a case set would catch a bug: the reference change must score 1.0, the unchanged codebase 0.0, and every seeded defect less than 1.0.

A task's test file:

from functools import partial
from pathlib import Path

import pytest
from truereward_harwell import cases, grade_case

CASES = Path(__file__).parent / "cases"


@pytest.mark.parametrize("case", cases(CASES), ids=lambda c: c.id)
def test_case(case, grade):
    grade(case, partial(grade_case, codebase="/grade"))

Run it with pytest -p truereward_harwell, which brings the truereward plugin with it.

Licensed under Apache-2.0.

Release files for truereward-harwell 0.2.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 truereward-harwell 0.2.0
File Size Uploaded
truereward_harwell-0.2.0.tar.gz 34.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for truereward-harwell 0.2.0
File Interpreter ABI Platform
truereward_harwell-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 73.6 kB

Release files / truereward_harwell-0.2.0.tar.gz

Download URL truereward_harwell-0.2.0.tar.gz
Size 34.6 kB
Tags Source
SHA-256 checksum
How to use checksums
18d88328f605eb447c985b617758bc326850bccae539f8e691e885733dba1e2e
BLAKE2b-256 checksum
How to use checksums
ad00c975b76e15cfe2daadebf597ddab6e8666882e60e0fc0c99331fb77bc0f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / truereward_harwell-0.2.0-py3-none-any.whl

Download URL truereward_harwell-0.2.0-py3-none-any.whl
Size 39.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2da604781cfa490e767ec253b02f548d4761056941d5a9e770d886eaee400bb
BLAKE2b-256 checksum
How to use checksums
924338d4745a38663ed0542576974e66b76eda82bd357d917d85e29ea20ed600
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.1

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