Enhance Exercise Retrieval and Path Handling Logic
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 48s
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 1m23s
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 48s
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 1m23s
- Introduced new functions for handling exercise visibility and retrieval based on progression graph context, including `fetch_exercise_rows_by_ids_for_graph`. - Updated `_load_supplemental_exercise_rows` to incorporate graph visibility rules, improving the accuracy of exercise retrieval. - Enhanced `_run_path_step_retrieval` to utilize preloaded supplemental exercise rows, optimizing performance and clarity in path step processing. - Added `exercise_title_equivalent_to_stage_goal` function to improve title matching against learning goals, enhancing exercise relevance. - Updated tests to validate new retrieval logic and title equivalence functionality, ensuring robustness in exercise selection processes.
This commit is contained in:
1 parent
ad051c015f
commit
ca2adbd55e
8 files changed
+500
-81
No files matched your search
@@ -18,7 +18,7 @@ class _FakeCur:
|
||||
return []
|
||||
|
||||
|
||||
def test_supplemental_boost_uses_retrieval_boost_not_slot_pins():
|
||||
def test_supplemental_boost_includes_slot_assignments_and_retrieval_boost():
|
||||
body = ProgressionPathSuggestRequest(
|
||||
query="Mawashi Geri Progression",
|
||||
slot_assignments=[
|
||||
@@ -27,7 +27,7 @@ def test_supplemental_boost_uses_retrieval_boost_not_slot_pins():
|
||||
retrieval_boost_exercise_ids=[42, 7],
|
||||
)
|
||||
ids = _supplemental_exercise_ids_from_body(_FakeCur(), body)
|
||||
assert 99 not in ids
|
||||
assert 99 in ids
|
||||
assert 42 in ids
|
||||
assert 7 in ids
|
||||
|
||||
|
||||
@@ -340,6 +340,32 @@ def test_technique_scope_rejects_kumite_when_only_stage_goal_mentions_mawashi():
|
||||
)
|
||||
|
||||
|
||||
def test_title_equivalent_to_stage_goal():
|
||||
from planning_exercise_semantics import exercise_title_equivalent_to_stage_goal
|
||||
|
||||
assert exercise_title_equivalent_to_stage_goal(
|
||||
"Hüftmobilität für Mae Geri",
|
||||
"Hüftmobilität für Mae Geri",
|
||||
)
|
||||
assert exercise_title_equivalent_to_stage_goal(
|
||||
"Hüftmobilität Mae Geri",
|
||||
"Hüftmobilität für Mae Geri",
|
||||
)
|
||||
assert not exercise_title_equivalent_to_stage_goal("Kumite", "Hüftmobilität für Mae Geri")
|
||||
|
||||
|
||||
def test_stage_fit_passes_for_title_equivalent_despite_missing_path_technique():
|
||||
stage_goal = "Koordination Absprung ohne Kick"
|
||||
assert exercise_passes_stage_fit(
|
||||
learning_goal=stage_goal,
|
||||
title=stage_goal,
|
||||
summary="",
|
||||
goal="",
|
||||
path_primary_topic="mawashi geri",
|
||||
path_technique_excludes=["kumite"],
|
||||
)
|
||||
|
||||
|
||||
def test_pick_roadmap_relaxed_with_path_primary_when_strict_fails():
|
||||
"""Bestehende Graph-Übungen: relaxed Gate auch bei gesetztem path_primary_topic."""
|
||||
stage_goal = "Hüftmobilität für Mawashi Geri"
|
||||
|
||||
Reference in new issue
Block a user