Gate completed checkpoints through 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:37:08 +02:00
parent b5155c702f
commit 1ce291d652
5 changed files with 56 additions and 7 deletions
@@ -76,6 +76,31 @@ def test_failed_iteration_builds_train_only_sampling_for_next_checkpoint(tmp_pat
assert command[command.index("--output-dir") + 1].endswith("failure-driven-training")
def test_dry_run_can_gate_existing_checkpoint_without_training(tmp_path: Path) -> None:
audit = tmp_path / "audit.json"
audit.write_text(json.dumps({
"status": "needs_human_review", "failures": [],
"manifest_immutable": True, "spatial_leakage_status": "ok",
}))
result = subprocess.run(
[
sys.executable, str(SCRIPT),
"--initial-model", str(tmp_path / "candidate.pt"),
"--train-yaml", str(tmp_path / "dataset.yaml"),
"--train-summary", str(tmp_path / "train-summary.json"),
"--dataset-audit", str(audit),
"--calibration-summary", str(tmp_path / "cal.json"),
"--test-summary", str(tmp_path / "test.json"),
"--background-summary", str(tmp_path / "background.json"),
"--corpus-manifest", str(tmp_path / "manifest.json"),
"--output-dir", str(tmp_path / "output"),
"--evaluate-initial-model", "--dry-run",
], capture_output=True, text=True, check=False,
)
assert result.returncode == 0
assert json.loads(result.stdout) == {"training_command": None, "evaluate_existing": True}
def test_loop_refuses_failed_dataset_audit(tmp_path: Path) -> None:
audit = tmp_path / "audit.json"
audit.write_text(json.dumps({"status": "needs_attention", "low_variance_positive_tile_count": 4}))