Fix remote training and model validation pipeline

This commit is contained in:
Курнат Андрей
2026-07-12 22:56:49 +03:00
parent 18936cf8b1
commit da53483164
22 changed files with 1691 additions and 246 deletions
+36
View File
@@ -48,6 +48,42 @@ def test_training_coordinator_preserves_boolean_resume_candidate_parameter(tmp_p
assert requested["job"]["parameters"] == {"resume_candidate": True}
def test_training_coordinator_reports_worker_identity_from_heartbeat(tmp_path) -> None:
coordinator = TrainingCoordinator(tmp_path)
heartbeat = coordinator.heartbeat(
{
"worker_id": "SEVENHILL:G:\\Repos\\TradeBot",
"name": "SEVENHILL",
"path": "G:\\Repos\\TradeBot",
}
)
assert heartbeat["worker"]["name"] == "SEVENHILL"
assert heartbeat["worker"]["path"] == "G:\\Repos\\TradeBot"
assert heartbeat["status"]["worker"] == heartbeat["worker"]
def test_training_coordinator_records_rejected_candidate_as_completed_training(tmp_path) -> None:
coordinator = TrainingCoordinator(tmp_path)
job = coordinator.request_retrain({"source": "android"})["job"]
coordinator.claim({"worker_id": "worker-1"})
completed = coordinator.complete(
job["id"],
{
"success": True,
"message": "training completed; candidate rejected by quality gate",
"summary": {"accepted": False, "reason": "candidate_failed_honest_validation"},
},
)
assert completed["job"]["status"] == "completed"
assert completed["job"]["phase"] == "completed"
assert completed["job"]["progress_percent"] == 100
assert completed["job"]["model_decision"] == "rejected"
def test_training_coordinator_accepts_chunked_artifact_upload(tmp_path) -> None:
coordinator = TrainingCoordinator(tmp_path)
job = coordinator.request_retrain({"source": "test"})["job"]