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

- 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:
Lars committed 2026-06-11 12:33:02 +02:00
1 parent ad051c015f
commit ca2adbd55e
8 files changed
+500 -81

No files matched your search

+7
View File
@@ -435,7 +435,14 @@ def detect_off_topic_steps(
for idx, step in enumerate(steps):
if step.get("is_ai_proposal") or step.get("exercise_id") is None:
continue
stage_goal_early = (step.get("roadmap_learning_goal") or "").strip()
bundle = _load_exercise_text_bundle(cur, int(step["exercise_id"]))
from planning_exercise_semantics import exercise_title_equivalent_to_stage_goal
if stage_goal_early and exercise_title_equivalent_to_stage_goal(
bundle["title"], stage_goal_early
):
continue
blob = _blob_from_fields(
bundle["title"],
bundle["summary"],