# API contract and behavior lab

Requires Python 3.10+, standard library only. Run in this folder.

```bash
python pipeline_demo.py
python generate_openapi.py implementation.baseline.json openapi.rebuilt.json
python run_checks.py --inventory
python run_checks.py --template fixtures/error_as_200.json submission.json --as-of 2026-09-12
python run_checks.py --check fixtures/error_as_200.json submission.json
```

Between the last two commands, fill the state, complete typed issues, pointers, rationale, minimal repair and review trigger. STRUCTURE_PASS_SEMANTICS_UNREVIEWED proves shape/binding only. Output files are not overwritten; choose fresh names for repeated generation.

policy.json supplies rules; contracts.json supplies public requests and expectations. Full tables, mappings, sources and assessments are in resources. Read baseline and authorization_removed as worked cases, error_as_200 as guided diagnosis, and transfer_patch independently. Other mutations exercise diagnosis. Supply your own transfer decision and preserve inputs.

pipeline_demo actually runs the Python model, not ASP.NET, an HTTP port or real token validation. Select an input/case with --fixture and --case. Altered candidate metadata really changes model behavior. Distinguish copied historical fixture captures from a fresh run. Injected timeout outcomes do not measure a real 100 ms deadline; no background service ran. aspnetcore_reference.cs contains excerpts for a separately prepared project, not a buildable project. The example date is historical; use the actual date for current claims and retain expired states.
