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
@@ -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(