Gate completed checkpoints through training loop
This commit is contained in:
@@ -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}))
|
||||
|
||||
Reference in New Issue
Block a user