# Python Evidence Evaluation Lab

By Chason Arthur
Revision 157.024
Published/updated 2026-11-04

## Start without installing dependencies

Extract this complete ZIP into a new folder. With Python 3 installed, run `python preview.py` from the extracted root. Open http://127.0.0.1:4210/. Stop with Ctrl+C. The prebuilt site is self-contained and makes no automatic external requests. Written reference links are optional. Do not open the files directly with file:// because workers and Wasm need HTTP.

## Run the native exercise

```sh
python -m venv .venv
# Activate .venv for your operating system, then:
python -m pip install -r requirements.txt
cd src/python
python -m unittest -v
python api.py
```

On Windows activate the environment with .venv\Scripts\Activate.ps1; on macOS/Linux use source .venv/bin/activate. After starting api.py, open http://127.0.0.1:4199/docs or POST /run with {"preset":"evidence","variant":"safe"}. Presets: evidence, injection, slow. Stop with Ctrl+C. The same engine is used by native Python and the browser; no external model is invoked.

## Expected result

The safeguarded evidence run matches all five expected fixture decisions. The slow run limits active tasks to two and cancels all five before returning. Active-at-finish is zero. These labels are regression cases, not an accuracy estimate.

## Scope

Actual Python runs in the open-source Pyodide runtime. Candidate answers and documents are deterministic fixtures; no live model is called. The exact policy validator is intentionally narrow and does not establish general factual accuracy or comprehensive prompt-injection resistance.

## Change and rebuild

Node/browser packages: `npm ci`, `npm run rebuild`, then `python preview.py`. Go: edit src/go, run its tests and `python rebuild_wasm.py` before refreshing source. Python: edit src/python/engine.py and run `python refresh_source.py`. Rebuild keeps the local preview and source viewer aligned. FILE_MANIFEST.json describes the initial extracted package, not later edits. The source-map and source viewer manifest record the exact teaching files. Update edition/date metadata before publishing an edited version.

## Extension

Add a new policy version and a fixture whose citation is valid but whose numerical claim is wrong. Make the evaluation fail before changing the validator. For live-model work, create a separate adapter and record provider usage rather than inventing token cost.

Original teaching code and lessons are MIT-licensed. See THIRD_PARTY_NOTICES.md and licenses/. The package starts no production API, model, payment, email or cloud service.
