Add QA evidence map overlay
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled

This commit is contained in:
Codex
2026-06-25 03:17:49 +02:00
parent 7a54d01993
commit b9674a0e42
16 changed files with 778 additions and 4 deletions
+52
View File
@@ -1060,6 +1060,58 @@ Response:
}
```
### GET `/api/v1/projects/{project_id}/quality-checks/{quality_check_id}/evidence/geojson`
Returns a canonical envelope containing a read-only QA/QC evidence overlay for a
persisted quality check. The endpoint reads feature ids from
`quality_checks.findings_json.match_evidence`,
`false_positive_evidence` and `false_negative_evidence`, resolves them against
persisted candidate/reference geometries and returns a GeoJSON FeatureCollection.
Supported resolution paths:
- dataset QA candidate/reference geometries from `vector_features`;
- detection QA candidate geometries from persisted `detections`;
- segmentation QA candidate geometries from persisted `segmentations`;
- reference geometries from persisted `vector_features`.
Response:
```json
{
"data": {
"quality_check_id": "uuid",
"project_id": "uuid",
"candidate_dataset_id": "uuid-or-null",
"reference_dataset_id": "uuid",
"analysis_run_id": "uuid-or-null",
"feature_count": 4,
"warnings": [],
"geojson": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "match_candidate:feature-id",
"geometry": {},
"properties": {
"qa_evidence_role": "match_candidate",
"quality_check_id": "uuid",
"candidate_feature_id": "candidate-feature-id",
"reference_feature_id": "reference-feature-id",
"iou": 0.83
}
}
]
}
}
}
```
`qa_evidence_role` is one of `match_candidate`, `match_reference`,
`false_positive` or `false_negative`. Missing persisted feature ids are reported
in `warnings`; no fake geometries are produced.
## Exports
### POST `/api/v1/exports/geojson`
+36
View File
@@ -1,3 +1,39 @@
## Sprint 112 QA evidence map overlay (2026-06-25)
Changed:
- Added `QualityEvidenceService` to resolve persisted QA/QC evidence ids back to stored geometries.
- Added `GET /api/v1/projects/{project_id}/quality-checks/{quality_check_id}/evidence/geojson`.
- The endpoint returns a canonical envelope with `quality_check_id`, dataset/run provenance, warnings and a GeoJSON FeatureCollection.
- Evidence resolution supports candidate dataset `vector_features`, candidate persisted `detections`/`segmentations` for analysis-run QA, and reference `vector_features`.
- Added QA/QC panel actions to show selected or latest evidence on the Map workspace.
- Added a MapLibre QA evidence source/layers with distinct match candidate, match reference, false-positive and false-negative styling.
- Added map overlay loading/error/clear state and a compact legend.
- Updated `docs/API_CONTRACTS.md`, `frontend/README.md`, `CHANGELOG.md` and `docs/TODO.md`.
- Added regression coverage in `backend/tests/test_sprint112_qa_evidence_overlay.py`.
Validation:
- RED: `python -m pytest backend\tests\test_sprint112_qa_evidence_overlay.py -q` failed before implementation because `app.services.quality_evidence_service` did not exist.
- RED: after backend implementation, the same test failed until frontend `qaEvidenceData`/API wiring existed.
- `python -m pytest backend\tests\test_sprint112_qa_evidence_overlay.py -q` passed: 4 tests.
- `cd frontend && npm run typecheck` passed after making the MapLibre expression type explicit.
- `python -m pytest backend\tests\test_sprint112_qa_evidence_overlay.py backend\tests\test_qa_service.py backend\tests\test_sprint8c_detection_visualization_qa.py backend\tests\test_sprint9_segmentation_foundation.py -q` passed: 25 tests.
- `python -m compileall backend/app` passed.
- `cd backend && python -m pytest -q` passed: 356 tests.
- `cd frontend && npm run typecheck` passed.
- `cd frontend && npm run build` passed.
- `cd backend && python -m alembic heads` passed: `202606120900 (head)`.
- `cd backend && python -m alembic upgrade head --sql` passed.
- `bash -n scripts/live_migration_smoke.sh` passed.
- `bash scripts/run_readiness_check.sh` passed: 356 backend tests plus frontend typecheck/build.
Limitations:
- The overlay is generated read-only from existing persisted evidence and geometries; no new evidence table or migration was introduced.
- Missing evidence ids are reported as warnings and do not create fake geometries.
- No provider fetching, AI dependency, real model behavior or new product domain was added.
Next recommended pass:
- Add live browser validation for the QA evidence overlay against the deployed demo workflow, then consider a small export/handoff action for the evidence overlay GeoJSON.
## Sprint 111 QA feature evidence persistence (2026-06-25)
Changed:
+1
View File
@@ -378,3 +378,4 @@ This file now starts with the current implementation status. Older preparation/b
- [x] Add Map workspace QA/QC shortcut for saved derived selection datasets.
- [x] Add Map workspace QA/QC evidence drilldown handoff for saved selection comparisons.
- [x] Persist QA/QC feature-level evidence for matches, false positives and false negatives.
- [x] Render persisted QA/QC feature-level evidence as Map workspace overlays.