# Task 10 — Anomaly Report & Iteration Gate ## Goal Consolidate anomalies, refine rules/mappings/ontology, and gate the Phase 2↔3 loop. ## Input - `rejects/*.jsonl`, `manifest/unmatched.csv`, current rule/mapping/schema versions. ## Actions 1. Write `scripts/anomaly_report.py` → `manifest/anomaly_report.md`: counts by reason code × measurement type, top offending files, examples per class, reject-rate per fingerprint. 2. Triage each anomaly class: (a) true data anomaly — keep quarantined, document; (b) rule defect — fix `anomaly_rules.json` / mapping / token pattern; (c) ontology gap — escalate to Task 08. 3. If (b) or (c) occurred: bump versions and re-run Tasks 07→09 for affected types. 4. Repeat until: fingerprint mapping coverage 100%, reject classes are all category (a), reject rate stable between runs. ## Intermediate Result (done when) - `anomaly_report.md` final; every reject class documented as a true anomaly. - Canonical dataset frozen: `canonical/SNAPSHOT.md` written with versions + row counts. Phases 2↔3 complete.