Handbook
Example — contracts and schemas
Inspect contract.json fields for a catalog task and run the repo maintenance gate locally.
Updated
Use case
Inspect contract.json fields for a catalog task and run the repo maintenance gate locally.
What it demonstrates
load_contract_specfor schema shapes.audit_contract_docs.pyas the human/schema hygiene check.
Source
examples/contracts/load_contract_spec.py
Commands
PYTHONPATH=src python3 examples/contracts/load_contract_spec.py
python3 scripts/generate_contract_sidecars.py
python3 scripts/audit_contract_docs.py --strict
Expected output
- Script prints
pw_chunk_classifyandv1(or your chosen task). - Audit exits 0 when sidecars and Markdown pass.
Failure modes
unknown task— typo intask_id/ version.- Audit failures — follow messages; often missing headings or examples in
contract.md.