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

- 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:
Lars committed 2026-06-11 12:20:41 +02:00
1 parent b464047c3a
commit ad051c015f
6 files changed
+133 -38

No files matched your search

+12 -18
View File
@@ -712,19 +712,17 @@ export function draftSiblingEdgePairs(draft) {
return pairs
}
/** Bereits zugeordnete Bibliotheks-Übungen für Re-Match (Pins). */
export function slotsToSlotAssignments(draft) {
return (draft.slots || [])
.filter((slot) => slot.primary?.kind === 'library' && slot.primary.exerciseId != null)
.map((slot) => ({
exercise_id: slot.primary.exerciseId,
variant_id: slot.primary.variantId || null,
title: slot.primary.exerciseTitle || null,
is_ai_proposal: false,
roadmap_major_step_index: slot.majorStepIndex,
roadmap_phase: slot.phase || null,
roadmap_learning_goal: slot.learning_goal || null,
}))
/** Bereits zugeordnete Bibliotheks-Übungen — nur Retriever-Boost, kein Pinning. */
export function draftRetrievalBoostExerciseIds(draft) {
const ids = new Set()
for (const slot of draft.slots || []) {
const p = slot.primary
if (p?.kind === 'library' && p.exerciseId != null) ids.add(p.exerciseId)
for (const sib of slot.siblings || []) {
if (sib.kind === 'library' && sib.exerciseId != null) ids.add(sib.exerciseId)
}
}
return [...ids]
}
export function slotsToEvaluateSteps(draft) {
@@ -804,11 +802,7 @@ export function applyMatchStepsToSlots(draft, apiSteps) {
for (let i = 0; i < nextSlots.length; i += 1) {
if (!touchedMajors.has(i)) {
const keep =
nextSlots[i].primary?.kind === 'library' && nextSlots[i].primary.exerciseId != null
if (!keep) {
nextSlots[i].primary = emptySlotExercise()
}
nextSlots[i].primary = emptySlotExercise()
}
}