bound the QA evidence overlay and fetch only what it draws

evidence_geojson emitted one feature per false positive, one per false negative
and two per match, with no limit. A regional check of 40k detections against 45k
reference footprints produced well over a hundred thousand features in a single
response, plus one warning string per unresolvable identifier. The endpoint the
entire review workflow depends on therefore failed exactly where review matters
most.

What to draw is now decided before any geometry is fetched, so the query work is
proportional to the result rather than to the size of the check — previously
130k geometries were resolved through an IN clause holding every identifier in
the check, to then discard most of them.

The budget is split between misses and false positives in proportion to their
populations with at least one of each, rather than by strict priority, which
would mean a check with 50.000 misses and three false positives never showed
one. Confirmations fill what remains, and a match is kept or dropped as a pair
because half a match is not reviewable evidence.

limit_evidence and evidence_role_counts are removed: plan_evidence supersedes
them, and helpers kept alive only by their own tests read like a contract.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Jens
2026-08-22 15:14:26 +02:00
co-authored by Claude Opus 5
parent 52c2bfd120
commit 5278fcd361
7 changed files with 412 additions and 64 deletions
+9
View File
@@ -1667,7 +1667,16 @@ export interface QualityEvidenceGeoJsonResponse {
candidate_dataset_id?: string | null
reference_dataset_id: string
analysis_run_id?: string | null
/**
* Features drawn. The overlay is capped so a regional check stays
* reviewable — misses and false positives first — while the counts in the
* quality check itself remain complete.
*/
feature_count: number
total_feature_count?: number | null
role_counts?: Record<string, number>
truncated?: boolean
limit?: number | null
warnings: string[]
geojson: GeoJSON.FeatureCollection
}