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 response | Contract | Purpose | Decision |
|---|---|---|---|
| Valid JSON with irrelevant catalog advice | Pass | Fail | Block |
| Helpful return advice in plain text | Fail | Pass | Block |
| Plain text claiming a completed refund | Fail | Fail | Block |
| Valid JSON with supported return advice | Pass | Pass | Eligible |
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 demoOpen 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.