Refactor Roadmap Step Annotation and Slot Assignment Logic
Deploy Development / deploy (push) Successful in 49s
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 1m12s

- Updated `_annotate_roadmap_step` to change the condition for setting `slot_status` based on `roadmap_match_source`, improving clarity in slot assignment handling.
- Removed the `_try_reconcile_slot_assignment` function to streamline the slot assignment process, as its logic is now integrated into the main flow.
- Enhanced `_match_roadmap_slot` to conditionally preserve slot assignments based on exercise ID, ensuring better handling of existing assignments.
- Improved the handling of semantic scores in `rank_visible_library_hits` to prioritize the best semantic fit, enhancing exercise retrieval accuracy.
- Added tests to validate the new logic for title equivalence and semantic scoring, ensuring robustness in exercise selection processes.
This commit is contained in:
Lars committed 2026-06-11 12:45:53 +02:00
1 parent ca2adbd55e
commit b2fbf6b4af
5 files changed
+91 -129

No files matched your search

-7
View File
@@ -435,14 +435,7 @@ 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"],