18 Learning
Stage 8: every lesson becomes a rule or an instruction version
18.1 What is recorded
| Record | Where | Written by |
|---|---|---|
| the iteration: class, layer, remedy, counts before and after | ai-query annotations, POST :5113/api/annotations |
op pdai:cure_learn |
| structural fault cases | ai-query annotations | pdai-audit --emit-annotations |
| overlay versions and rejected candidates | instruction version tree | ocr_runner.cure_learn --apply |
| model A/B evidence | pdai/skills/pipeline/pdai-cure/model_evidence.jsonl |
every cure_learn run |
| validator false positives, checked against the facsimile | <data>/quality/text_validity/adjudications.jsonl |
pdai-validity --adjudicate |
| the case of the collection | pdai/docs/cure/case-<collection>.qmd |
by hand |
The annotation’s target names the instructable that must learn the lesson: normalizer:<c>, dtd:<c>, css:<c>, reocr:<c>, or ocr-base:<c> for prompt faults. This follows the targets of the fault-dossier bridge (schema_audit.learn_bridge).
18.2 Rules
- A lesson is an audit rule, a normalizer rule, a layer assignment, an overlay version or an adjudication. A page XML edited by hand is not a lesson; the next production run would reproduce the defect.
- An adjudication records that a flag is a validator false positive for the page’s current XML. It is limited to zone and partial codes (
FN-IN-BODY,BODY-IN-FN,FN-PARTIAL,FN-MISSING,TXT-GAP,SEG-ORDER); text loss cannot be adjudicated away. - An A/B run whose sample already scores the maximum records
improved: false. Such a run is not evidence for or against a model. - Golden queries on the repaired pages are the acceptance criteria for query use.
18.3 Model role
learning-text (kimi-k2.7-code:cloud, fallback gemini-3.8-flash) writes goal, metric and promotion text in the Partitur ocr-instruction-learning-agent. The promotion decision is the metric threshold, not a model judgement.