Unblock objective Belgian training loop
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-07-29 15:31:55 +02:00
parent a5980127b9
commit e8530ae476
5 changed files with 92 additions and 7 deletions
+18 -4
View File
@@ -29,6 +29,21 @@ def write_json(path: Path, value: dict[str, Any]) -> None:
temporary.replace(path)
def dataset_audit_failures(audit: dict[str, Any]) -> list[str]:
"""Return automated corpus blockers while leaving final human review deferred."""
failures = [str(item) for item in audit.get("failures") or []]
status = audit.get("status")
if status not in {"ok", "needs_human_review"}:
failures.append(f"unsupported audit status: {status}")
if audit.get("manifest_immutable") is not True:
failures.append("corpus manifest is not immutable")
if audit.get("spatial_leakage_status") != "ok":
failures.append("spatial leakage audit is not ok")
if int(audit.get("low_variance_positive_tile_count") or 0) != 0:
failures.append("dataset contains blank/low-variance positive tiles")
return failures
def select_calibration_threshold(report: dict[str, Any]) -> dict[str, Any]:
"""Choose a threshold without consulting test or background evidence."""
eligible = [item for item in report["sweeps"] if item["pure_empty_false_positives"] == 0]
@@ -161,10 +176,9 @@ def main() -> int:
if args.iterations < 1:
raise SystemExit("--iterations must be positive")
dataset_audit = json.loads(args.dataset_audit.read_text(encoding="utf-8"))
if dataset_audit.get("status") != "ok":
raise SystemExit(f"Dataset audit is not ok: {args.dataset_audit}")
if int(dataset_audit.get("low_variance_positive_tile_count") or 0) != 0:
raise SystemExit("Dataset audit contains blank/low-variance positive tiles")
audit_failures = dataset_audit_failures(dataset_audit)
if audit_failures:
raise SystemExit(f"Dataset audit is not eligible for training: {audit_failures}")
state_path = args.output_dir / "training-loop-state.json"
state: dict[str, Any] = {