Enhance Path Quality Assessment and Slot Management Features
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 44s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m13s

- Added new functions for computing assignment quality scores and counting step assignment statistics, improving the evaluation of steps in path quality assessments.
- Updated existing methods to incorporate the new scoring logic, enhancing the robustness of path evaluations.
- Introduced UI components in the frontend to display detailed quality assessment results, including handling of split dimensions in path evaluations.
- Enhanced tests to cover new functionalities and ensure accuracy in quality scoring and slot management processes.
This commit is contained in:
Lars committed 2026-06-13 17:13:35 +02:00
1 parent 7265cd5a01
commit 313d613b7c
8 files changed
+427 -55

No files matched your search

+21 -4
View File
@@ -2208,6 +2208,7 @@ def _run_evaluate_only_path_qa(
reorder_notes=[],
roadmap_qa_mode=roadmap_qa_mode,
multistage_qa=multistage_qa,
steps=steps,
)
return {
"path_qa": path_qa,
@@ -2500,6 +2501,7 @@ def _quick_evaluate_steps_qa(
llm_applied=False,
roadmap_qa_mode="roadmap_first_lite" if roadmap_first else None,
multistage_qa=multistage_qa,
steps=steps_list,
)
if path_qa.get("quality_score") is None:
path_qa["quality_score"] = compute_deterministic_path_quality_score(
@@ -3072,6 +3074,7 @@ def _suggestion_as_slot_diff(entry: Mapping[str, Any]) -> Dict[str, Any]:
_SLOT_FIT_POOR_THRESHOLD = 0.30
_SLOT_FIT_GOOD_THRESHOLD = 0.50
def _off_topic_semantic_scores_by_slot(
@@ -3152,9 +3155,18 @@ def _slot_auto_select_library(
return False
if proposed_slot_score is None:
return False
if baseline_slot_score is None:
return True
return float(proposed_slot_score) > float(baseline_slot_score) + 0.001
effective_baseline = float(baseline_slot_score) if baseline_slot_score is not None else 0.0
if float(proposed_slot_score) <= effective_baseline + 0.001:
return False
# Leerer Slot: Bibliothek nur vorauswählen, wenn Stufen-Fit klar ausreicht.
if baseline_exercise_id is None:
return float(proposed_slot_score) >= _SLOT_FIT_GOOD_THRESHOLD
return True
def _slot_auto_select_ai(*, library_auto_select: bool, has_ai: bool) -> bool:
"""KI-Vorschlag vorauswählen, wenn angeboten und Bibliothek nicht klar besser."""
return bool(has_ai and not library_auto_select)
def _build_unified_slot_review_entry(
@@ -3391,10 +3403,14 @@ def _build_unified_slot_review_entry(
)
gap_fill_offers.append(slot_offer)
if slot_offer:
ai_auto = _slot_auto_select_ai(
library_auto_select=bool(library_alt and library_alt.get("auto_select")),
has_ai=True,
)
ai_alt = {
"title_hint": slot_offer.get("title_hint") or f"Slot {major_idx + 1}",
"gap_offer": slot_offer,
"auto_select": False,
"auto_select": ai_auto,
}
return {
@@ -4312,6 +4328,7 @@ def suggest_progression_path(
reorder_notes=reorder_notes,
roadmap_qa_mode=roadmap_qa_mode,
multistage_qa=multistage_qa,
steps=steps,
)
if rematch_log:
path_qa["rematch_applied"] = True