Implement Pruning of Filled Steps from Roadmap Unfilled
Deploy Development / deploy (push) Successful in 41s
Test Suite / pytest-backend (push) Successful in 44s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 22s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m13s

- Introduced `_prune_filled_from_roadmap_unfilled` function to remove steps with filled exercises from the unfilled roadmap, preventing outdated references.
- Updated `_run_roadmap_rematch_loop` to incorporate the new pruning logic, ensuring only relevant unfilled steps are retained during rematching.
- Added tests for the pruning function to validate its behavior with various step scenarios.
- Bumped version to 0.8.232 to reflect the new functionality and improvements.
This commit is contained in:
Lars committed 2026-06-12 08:27:39 +02:00
1 parent 63c99b0ec5
commit a4e73c830f
3 files changed
+42 -2

No files matched your search

+28
View File
@@ -1518,6 +1518,31 @@ def _merge_rematch_unfilled(
return kept
def _prune_filled_from_roadmap_unfilled(
steps: Sequence[Mapping[str, Any]],
roadmap_unfilled: List[Tuple[int, StageSpecArtifact]],
) -> List[Tuple[int, StageSpecArtifact]]:
"""Entfernt Stufen mit Bibliotheks-Treffer — verhindert veraltete roadmap_unfilled-Hinweise."""
filled_majors: Set[int] = set()
for raw in steps:
if raw.get("exercise_id") is None:
continue
midx = raw.get("roadmap_major_step_index")
if midx is None:
continue
try:
filled_majors.add(int(midx))
except (TypeError, ValueError):
continue
if not filled_majors:
return roadmap_unfilled
return [
item
for item in roadmap_unfilled
if int(item[1].major_step_index) not in filled_majors
]
def _run_roadmap_rematch_loop(
cur,
*,
@@ -1683,6 +1708,7 @@ def _run_roadmap_rematch_loop(
current_stripped = prune_stripped_after_rematch(current_stripped, round_log)
roadmap_unfilled = _merge_rematch_unfilled(roadmap_unfilled, rematch_new_unfilled)
roadmap_unfilled = _prune_filled_from_roadmap_unfilled(steps, roadmap_unfilled)
use_initial_off_topic = False
off_topic_steps = detect_off_topic_steps(
@@ -1721,6 +1747,8 @@ def _run_roadmap_rematch_loop(
goal_query=goal_query,
)
roadmap_unfilled = _prune_filled_from_roadmap_unfilled(steps, roadmap_unfilled)
return (
steps,
rematch_log,