feat(skill-learning): gate publish on replay confidence

This commit is contained in:
2026-06-08 13:36:55 +08:00
parent 64d789a3d0
commit b9171998b9
2 changed files with 83 additions and 1 deletions

View File

@ -337,6 +337,14 @@ class SkillLearningPipelineService:
eval_report = self.get_eval_report(draft.skill_name, draft.draft_id)
if eval_report is not None and eval_report.status != "skipped_provider_unavailable" and not eval_report.passed:
raise ValueError("Draft eval report did not pass")
if eval_report is not None and eval_report.mode == "replay":
if eval_report.confidence == "low":
raise ValueError("Draft replay eval has low confidence and requires revision before publish")
if eval_report.blocked_coverage >= 1.0:
raise ValueError("Draft replay eval blocked all important tool calls")
preservation = eval_report.preservation_report or {}
if preservation.get("passed") is False:
raise ValueError("Draft preservation check did not pass")
def _mark_candidate_by_draft(
self,