Harden split background promotion preflight
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled

This commit is contained in:
Codex
2026-07-11 00:25:34 +02:00
parent 46db53dff4
commit a499c5fbfa
5 changed files with 98 additions and 5 deletions
+5
View File
@@ -724,6 +724,11 @@ presence, required `pure_empty_negative` and `sparse_building_context`
background categories, Python/curl availability and the frontend API proxy
envelope without starting inference:
For older operator manifests that predate explicit `background_category`,
preflight uses the same fallback as the matrix runner: background samples with
`reference_feature_count == 0` are treated as `pure_empty_negative`, and
background samples with references are treated as `sparse_building_context`.
```bash
PROMOTION_POSITIVE_PORTFOLIO_PATH=/mnt/user/appdata/geointel/artifacts/detection-quality-matrix/multi-sample/aoi1024bg512r3e50-positive/multi_sample_quality_summary.json \
OPERATOR_SAMPLE_MANIFEST_PATH=storage/operator-data/operator_samples_manifest.json \
@@ -110,11 +110,24 @@ samples = payload.get("samples") or payload.get("items") or []
if not isinstance(samples, list) or not samples:
raise SystemExit(f"Operator sample manifest has no samples: {manifest_path}")
background_categories = {
str(sample.get("background_category") or "")
for sample in samples
if str(sample.get("sample_role") or "") == "background_candidate"
}
background_categories = set()
for sample in samples:
if str(sample.get("sample_role") or "") != "background_candidate":
continue
category = str(sample.get("background_category") or "").strip()
if not category:
try:
reference_feature_count = int(sample.get("reference_feature_count") or 0)
except (TypeError, ValueError):
reference_feature_count = 0
category = (
"pure_empty_negative"
if reference_feature_count == 0
else "sparse_building_context"
)
background_categories.add(category)
missing = {"pure_empty_negative", "sparse_building_context"} - background_categories
if missing:
raise SystemExit(