# Codex Module Contract — QA/QC Foundation Build deterministic QA/QC using fixture GeoJSON files before real AI integration. ## Input - predicted polygon layer - reference polygon layer - IoU threshold, default 0.5 ## Required Metrics - true positives - false positives - false negatives - precision - recall - f1 - mean_iou for matched pairs ## Required Outputs - summary metrics JSON - matched pairs list - false positives GeoJSON - false negatives GeoJSON ## Required Backend - QA service with pure functions - API endpoint to run QA for two stored layers or fixture mode - persisted quality_check record ## Required Frontend - QA run form - threshold input - metrics cards - map layers for FP/FN - explanation of IoU threshold ## Required Tests - golden fixture test with deterministic counts - zero denominator test - invalid geometry test ## Forbidden - presenting confidence as accuracy - changing IoU formula - computing area in EPSG:4326 degrees