fix(ai): bind model scope to immutable geometry
GeoIntel release gates / Compile, test, contracts and builds (push) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (push) Canceled after 0s

This commit is contained in:
Jens
2026-08-09 10:54:52 +02:00
parent f41392a415
commit b76cd1837b
19 changed files with 431 additions and 58 deletions
+26 -2
View File
@@ -121,8 +121,13 @@ Environment variables:
- `YOLO_REQUIRE_CUDA` (set to `true` on the production server; inference then
fails closed when CUDA is unavailable or `YOLO_DEVICE` selects CPU)
- `YOLO_MODEL_CLASSES` (the active promoted detector is `building` only)
- `YOLO_ENFORCE_VALIDATION_SCOPE` and `YOLO_VALIDATED_AREA_NAMES` (production
rejects inference when the raster is not bound to a persisted validated Area)
- `YOLO_ENFORCE_VALIDATION_SCOPE` (keep `true` in production)
- `YOLO_VALIDATION_SCOPE_MANIFEST_PATH` and
`YOLO_VALIDATION_SCOPE_MANIFEST_SHA256` (production accepts inference only
when the exact active model bytes match the manifest and the complete
persisted Dataset AOI is covered by its valid EPSG:4326 geometry)
- `YOLO_VALIDATED_AREA_NAMES` is deprecated display metadata and never grants
inference access
- `YOLO_IMAGE_SIZE`
- `YOLO_MAX_TILES`
- `YOLO_MAX_DETECTIONS`
@@ -136,6 +141,25 @@ the upstream default would cap recall before QA/QC begins. Operators may lower
the value for small rasters or raise it for dense urban tiles after reviewing
runtime and false-positive behavior.
Create a new immutable scope artifact whenever either the model bytes or the
governed validation boundary changes:
```bash
python /app/scripts/build_model_validation_scope_manifest.py \
--model /app/models/active-building.pt \
--model-id yolo-configured \
--scope-geojson /app/storage/operator-data/geographic-scopes/kempen-transport-region/kempen_transport_region_boundary_YYYY-MM-DD.geojson \
--scope-key kempen-transport-region \
--authority "Digitaal Vlaanderen VRBG/Refgem" \
--snapshot-date YYYY-MM-DD \
--output /app/storage/operator-data/model-validation-scopes/active-building-model.json
```
The command refuses to overwrite an existing manifest and prints the checksum
for `YOLO_VALIDATION_SCOPE_MANIFEST_SHA256`. Area names are intentionally not
part of this decision: they are mutable presentation text, not accuracy or
authorization evidence.
After YOLO boxes are georeferenced, configured-YOLO runs apply a GeoIntel
cross-tile duplicate suppression pass before persistence. Candidates are grouped
by canonical class and sorted by confidence; lower-confidence same-class
+28
View File
@@ -12444,3 +12444,31 @@ Open:
`not_evaluable` without governed evidence. Phase 4 remains **in progress**,
Phase 5 remains **not ready**, and promotion/training feedback from protected
data is not authorized.
## 2026-08-09 - Model accuracy boundary and truthful evidence labels
### Changed
- Replaced the configured-YOLO Area-name substring gate with a fail-closed,
checksum-bound validation-scope manifest. The exact model SHA-256 must match
and the immutable EPSG:4326 scope geometry must cover the complete persisted
Dataset AOI. Renaming an Area can no longer widen model applicability.
- Added an operator tool that builds the model-bound manifest from exact model
bytes and governed scope GeoJSON without overwriting prior evidence.
- Corrected the detection UI: legacy Mol/Kempen profile scores are now labelled
historical calibration context, spatial independence is explicitly unproven,
and no profile is marked approved or promotion-ready.
### Verified
- Targeted backend/UI contract selection: 34 passed.
- `git diff --check`: passed before the documentation update; final check is
part of the handoff verification.
### Remaining limitations
- The current active model is still not nationally validated. A new governed
corpus, independent spatial split, representative human review and immutable
product benchmark remain required before any production-accuracy claim.
- Every deployed model asset needs its own generated scope manifest and exact
configured manifest checksum before enforced inference is available.
+4 -2
View File
@@ -1115,8 +1115,10 @@ This file now starts with the current implementation status. Older preparation/b
112 Ruff findings and add real frontend lint.
- [ ] P2-02: fix CRS ingest, metre buffering and Area geometry/CRS updates;
auditably quarantine or repair the four legacy Geel detections.
- [ ] P2-03: isolate coverage by source/theme/layer/zone, make official source
identity server-attested and replace mutable-name legal/model scope checks.
- [ ] P2-03: isolate coverage by source/theme/layer/zone and make official
source identity server-attested. The mutable-name YOLO scope bypass is fixed
with a model/checksum-bound geometry manifest; equivalent legal-scope checks
still require the same review.
- [ ] P2-04: make derived persistence transactional, require complete
RunManifest hashes and expose every fallback/persistence failure.
- [ ] P2-05: remove every protected-test feedback path, introduce a test vault