Enhance Progression Path Suggestion with Retrieval Boost and Slot Assignment Logic
Deploy Development / deploy (push) Successful in 44s
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 1m14s
Deploy Development / deploy (push) Successful in 44s
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 1m14s
- Added `preserve_slot_assignments` and `retrieval_boost_exercise_ids` to `ProgressionPathSuggestRequest` for improved handling of exercise suggestions. - Refactored `_supplemental_exercise_ids_from_body` to incorporate retrieval boost exercise IDs, ensuring they are prioritized over slot assignments. - Updated `_build_steps_roadmap_first` to conditionally preserve slot assignments based on the new flag. - Enhanced tests to validate the new retrieval boost logic and its integration with existing slot assignment handling.
This commit is contained in:
1 parent
b464047c3a
commit
ad051c015f
6 files changed
+133
-38
No files matched your search
@@ -1,12 +1,37 @@
|
||||
"""Tests Planungs-KI Phase C3/E/F — Pfad-Vorschläge."""
|
||||
from planning_exercise_path_builder import (
|
||||
EvaluateStepPayload,
|
||||
ProgressionPathSuggestRequest,
|
||||
_annotate_roadmap_step,
|
||||
_hit_to_path_step,
|
||||
_pick_best_path_hit,
|
||||
_supplemental_exercise_ids_from_body,
|
||||
)
|
||||
from planning_progression_roadmap import MajorStep, StageSpecArtifact
|
||||
|
||||
|
||||
class _FakeCur:
|
||||
def execute(self, *_args, **_kwargs):
|
||||
return None
|
||||
|
||||
def fetchall(self):
|
||||
return []
|
||||
|
||||
|
||||
def test_supplemental_boost_uses_retrieval_boost_not_slot_pins():
|
||||
body = ProgressionPathSuggestRequest(
|
||||
query="Mawashi Geri Progression",
|
||||
slot_assignments=[
|
||||
EvaluateStepPayload(exercise_id=99, roadmap_major_step_index=0),
|
||||
],
|
||||
retrieval_boost_exercise_ids=[42, 7],
|
||||
)
|
||||
ids = _supplemental_exercise_ids_from_body(_FakeCur(), body)
|
||||
assert 99 not in ids
|
||||
assert 42 in ids
|
||||
assert 7 in ids
|
||||
|
||||
|
||||
def test_pick_next_path_hit_skips_used():
|
||||
hits = [{"id": 1, "title": "A", "semantic_score": 0.2}, {"id": 2, "title": "B", "semantic_score": 0.2}, {"id": 3, "title": "C", "semantic_score": 0.2}]
|
||||
assert _pick_best_path_hit(hits, {1})["id"] == 2
|
||||
|
||||
Reference in new issue
Block a user