shinkan-jinkendo/backend/tests/test_planning_exercise_path_qa.py
Lars c6b8c396ad
All checks were successful
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 40s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m14s
Enhance Planning Exercise Retrieval and Suggestion with Semantic Features
- Introduced new functions to load exercise goals and variant names in chunks, improving data retrieval efficiency.
- Integrated semantic scoring into the ranking logic, allowing for more nuanced exercise suggestions based on semantic relevance.
- Updated the planning exercise suggestion process to include semantic brief handling, enriching the context for exercise recommendations.
- Adjusted the retrieval phase to incorporate dynamic retrieval weights based on semantic strength, enhancing the overall suggestion accuracy.
- Incremented version to 0.8.186 and updated changelog to reflect these significant enhancements in planning AI functionality.
2026-05-23 12:02:57 +02:00

17 lines
581 B
Python

"""Tests Planungs-KI Phase E — Pfad-QA."""
from planning_exercise_path_builder import _pick_best_path_hit
def test_pick_best_path_hit_prefers_semantic_score():
hits = [
{"id": 1, "title": "Mawashi", "score": 0.9, "semantic_score": 0.1},
{"id": 2, "title": "Mae Geri", "score": 0.75, "semantic_score": 0.85},
]
chosen = _pick_best_path_hit(hits, set())
assert chosen["id"] == 2
def test_pick_best_path_hit_skips_used():
hits = [{"id": 1, "title": "A", "score": 0.5, "semantic_score": 0.5}]
assert _pick_best_path_hit(hits, {1}) is None