Implement Quick Evaluation and Quality Scoring for Path QA
Deploy Development / deploy (push) Successful in 40s
Test Suite / pytest-backend (push) Successful in 44s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m11s

- Added `_quick_evaluate_steps_qa` function to streamline path quality assessment without recursive API calls, enhancing performance for slot comparisons.
- Introduced `compute_deterministic_path_quality_score` to provide a heuristic quality score based on gaps and off-topic steps, improving evaluation accuracy.
- Updated `_run_unified_slot_improvement_review` to utilize the new quick evaluation method, optimizing the review process and integrating quality scoring.
- Enhanced `build_path_qa_summary` to include quality score calculations, ensuring comprehensive feedback on path evaluations.
- Refactored related functions for improved clarity and efficiency in handling path quality assessments.
This commit is contained in:
Lars committed 2026-06-13 10:27:07 +02:00
1 parent 85fccdd093
commit a1e4ad66df
4 files changed
+199 -35

No files matched your search

+32
View File
@@ -745,12 +745,44 @@ def build_path_qa_summary(
f"Schritt „{o.get('title')}“ passt nicht zum Pfad-Thema"
for o in off_topic
]
summary["quality_score"] = compute_deterministic_path_quality_score(
gaps=gaps,
off_topic_steps=off_topic,
steps=steps,
multistage_qa=multistage_qa,
)
return summary
def compute_deterministic_path_quality_score(
*,
gaps: Sequence[Mapping[str, Any]],
off_topic_steps: Sequence[Mapping[str, Any]],
steps: Optional[Sequence[Mapping[str, Any]]] = None,
multistage_qa: Optional[Mapping[str, Any]] = None,
) -> float:
"""Heuristische Pfad-QS ohne LLM — Basis für Slot-Vergleiche."""
score = 0.92
score -= 0.08 * len(off_topic_steps or [])
score -= 0.05 * len(gaps or [])
if steps:
empty = sum(
1
for s in steps
if isinstance(s, dict)
and s.get("exercise_id") is None
and not s.get("is_ai_proposal")
)
score -= 0.06 * empty
hint_count = int((multistage_qa or {}).get("optimization_hint_count") or 0)
score -= min(0.14, 0.02 * hint_count)
return max(0.35, min(0.98, round(score, 4)))
__all__ = [
"apply_llm_path_reorder",
"build_path_qa_summary",
"compute_deterministic_path_quality_score",
"detect_off_topic_steps",
"detect_path_gaps",
"is_roadmap_planned_neighbor_pair",