Enhance Planning AI with Roadmap-First Architecture and New Features
Deploy Development / deploy (push) Successful in 49s
Test Suite / pytest-backend (push) Failing after 43s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 15s
Test Suite / k6 /health Baseline (push) Successful in 44s
Test Suite / playwright-tests (push) Successful in 1m15s

- Introduced a roadmap-first approach for the planning AI, allowing for a structured progression graph that aligns with the overall project roadmap.
- Added new functionality to strip off-topic steps from exercise paths, improving the relevance of generated exercise suggestions.
- Implemented a detailed goal text generation for AI proposals, enhancing the context provided for new exercises.
- Updated the ExerciseProgressionPathBuilder component to support new features, including roadmap previews and improved focus area handling.
- Incremented application version to 0.8.205 and updated database schema version to 20260606086 to reflect these changes.
This commit is contained in:
Lars committed 2026-06-08 08:10:53 +02:00
1 parent a9a6153ed5
commit dd0fae4bf5
20 files changed
+1491 -94

No files matched your search

@@ -1,6 +1,6 @@
"""Tests Planungs-KI Phase E3 — Lücken-Angebote und Off-Topic."""
from planning_exercise_path_ai_fill import collect_gap_fill_specs
from planning_exercise_path_qa import parse_llm_suggested_new_exercises
from planning_exercise_path_ai_fill import build_gap_fill_goal_text, collect_gap_fill_specs
from planning_exercise_path_qa import parse_llm_suggested_new_exercises, strip_off_topic_steps_from_path
from planning_exercise_semantics import build_semantic_brief
@@ -62,3 +62,32 @@ def test_collect_gap_fill_specs_off_topic_and_unfilled():
off = next(s for s in specs if s["source"] == "off_topic")
assert off["replace_step_index"] == 2
assert off["insert_after_index"] == 1
def test_strip_off_topic_steps_from_path():
steps = [
{"exercise_id": 1, "title": "A"},
{"exercise_id": 2, "title": "B"},
{"exercise_id": 3, "title": "One Leg Squat"},
{"exercise_id": 4, "title": "D"},
]
off_topic = [{"step_index": 2, "title": "One Leg Squat", "exercise_id": 3}]
out, removed = strip_off_topic_steps_from_path(steps, off_topic)
assert len(out) == 3
assert len(removed) == 1
assert removed[0]["removed_title"] == "One Leg Squat"
assert [s["exercise_id"] for s in out] == [1, 2, 4]
def test_build_gap_fill_goal_text_includes_topic():
brief = build_semantic_brief("Mae Geri Perfektion")
text = build_gap_fill_goal_text(
goal_query="Mae Geri Perfektion",
brief=brief,
spec={"phase": "anwendung", "rationale": "Fehlt Kombinationstraining"},
step_a={"title": "Kihon"},
step_b={"title": "Kumite"},
)
assert "Mae Geri" in text or "mae geri" in text.lower()
assert "anwendung" in text
assert "Kihon" in text
@@ -0,0 +1,52 @@
"""Tests Planungs-KI Phase F — Progressions-Roadmap Pipeline."""
from planning_progression_roadmap import (
PROMPT_SLUG_GOAL_ANALYSIS,
PROMPT_SLUG_ROADMAP,
PROMPT_SLUG_STAGE_SPEC,
build_goal_analysis,
consolidate_micro_to_major,
develop_micro_objectives,
progression_roadmap_to_api_dict,
run_progression_roadmap_pipeline,
)
from planning_exercise_semantics import build_semantic_brief
def test_run_progression_roadmap_pipeline_major_step_count():
ctx = run_progression_roadmap_pipeline(
"Von Erlernen bis zur Perfektion des Fußtritts Mae Geri",
max_steps=5,
)
assert ctx.roadmap is not None
assert len(ctx.roadmap.major_steps) == 5
assert len(ctx.roadmap.micro_objectives) >= 6
assert len(ctx.stage_specs) == 5
assert ctx.goal_analysis is not None
assert "Mae" in ctx.goal_analysis.primary_topic or "mae" in ctx.goal_analysis.primary_topic.lower()
def test_consolidate_micro_to_major_reduces_count():
brief = build_semantic_brief("Mae Geri")
ga = build_goal_analysis("Mae Geri Perfektion", brief)
micro = develop_micro_objectives(brief, goal_analysis=ga, min_count=8)
majors, notes = consolidate_micro_to_major(micro, max_steps=5)
assert len(majors) == 5
if len(micro) > 5:
assert notes
assert all(m.learning_goal for m in majors)
def test_major_steps_have_learning_goals():
ctx = run_progression_roadmap_pipeline("Mae Geri Grundlagen", max_steps=3)
for step in ctx.roadmap.major_steps:
assert step.learning_goal.strip()
assert step.consolidates
def test_api_dict_exposes_prompt_slug_catalog():
ctx = run_progression_roadmap_pipeline("Mae Geri", max_steps=3, include_llm_roadmap=False)
api = progression_roadmap_to_api_dict(ctx)
assert api["prompt_slug_catalog"]["goal_analysis"] == PROMPT_SLUG_GOAL_ANALYSIS
assert api["prompt_slug_catalog"]["roadmap"] == PROMPT_SLUG_ROADMAP
assert api["prompt_slug_catalog"]["stage_spec"] == PROMPT_SLUG_STAGE_SPEC
assert api["prompt_slugs"] == []