Rules & Purpose Lab

A practical teaching lab

Rules &
Purpose Lab

Did the system obey the rule?
Did the result fulfill its purpose?

Explore how deterministic testing and AI evaluation contribute different evidence to a release decision.

Python 3.11+. No API key needed for the workshop.

One customer request

Four responses. Different evidence.

“My unused desk lamp arrived 10 days ago. I would like to return it. What should I do?”

The policy allows an unused-product return request within 30 days. Support needs the order number. The assistant can draft advice, but cannot process a refund.

Candidate responseContractPurposeDecision
Valid JSON with irrelevant catalog advicePassFailBlock
Helpful return advice in plain textFailPassBlock
Plain text claiming a completed refundFailFailBlock
Valid JSON with supported return advicePassPassEligible

AI-assisted authored teaching examples, not measured model performance. Eligible applies to the evaluated scenario and criteria, not production deployment.

Run the example

git clone https://github.com/bg-playground/rules-and-purpose-lab.git
cd rules-and-purpose-lab
python -m rules_purpose demo

Open reports/latest/report.md. The report connects each requirement, response, check, and assessment to its decision. The demo deliberately includes bad responses, so a successful run can report Block.

On Windows, use py instead of python if that is how Python is installed.

Inspect an example report