Add Structured Roadmap Inputs and Enhance Goal Analysis Features
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 43s
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 1m14s

- Introduced `RoadmapStructuredInput` to encapsulate structured inputs for start situation, target state, and roadmap notes.
- Updated `ProgressionPathSuggestRequest` to include new fields for structured roadmap inputs.
- Implemented parsing logic for goal queries to extract start and target states, enhancing the goal analysis process.
- Enhanced `build_goal_analysis` to utilize structured inputs, improving the clarity and relevance of generated goals.
- Updated the `ExerciseProgressionPathBuilder` component to support new structured input fields, enhancing user experience.
- Incremented application version to 0.8.210 to reflect these changes.
This commit is contained in:
Lars committed 2026-06-09 11:10:46 +02:00
1 parent 87f258be38
commit 9dd44ce3ca
5 files changed
+428 -18

No files matched your search

@@ -4,11 +4,13 @@ from planning_progression_roadmap import (
PROMPT_SLUG_ROADMAP,
PROMPT_SLUG_STAGE_SPEC,
MajorStep,
RoadmapStructuredInput,
StageSpecArtifact,
build_goal_analysis,
build_roadmap_unfilled_gap_specs,
consolidate_micro_to_major,
develop_micro_objectives,
parse_start_target_from_goal_query,
progression_roadmap_to_api_dict,
resolve_step_exercise_kind_filter,
run_progression_roadmap_pipeline,
@@ -20,6 +22,11 @@ from planning_progression_roadmap import (
)
from planning_exercise_semantics import build_semantic_brief
KUMITE_GOAL = (
"Kumite Beinarbeit von einer gleichartigen Steppbewegung bis zur dynamischen "
"unvorhersehbaren Bewegung mit explosivartigem Angriff und ausweichen"
)
def test_run_progression_roadmap_pipeline_major_step_count():
ctx = run_progression_roadmap_pipeline(
@@ -134,3 +141,54 @@ def test_api_dict_exposes_prompt_slug_catalog():
assert api["prompt_slug_catalog"]["roadmap"] == PROMPT_SLUG_ROADMAP
assert api["prompt_slug_catalog"]["stage_spec"] == PROMPT_SLUG_STAGE_SPEC
assert api["prompt_slugs"] == []
def test_parse_start_target_kumite_beinarbeit():
start, target = parse_start_target_from_goal_query(KUMITE_GOAL)
assert start is not None
assert "Steppbewegung" in start
assert target is not None
assert "dynamischen" in target
assert "Angriff" in target
def test_build_goal_analysis_uses_parsed_start_target():
brief = build_semantic_brief(KUMITE_GOAL)
ga = build_goal_analysis(KUMITE_GOAL, brief)
assert "Kumite Beinarbeit" in ga.primary_topic
assert "Steppbewegung" in ga.start_assumption
assert "dynamischen" in ga.target_state
assert "Voraussetzungen der Zielgruppe werden im Progressionsgraphen nicht analysiert" not in ga.start_assumption
def test_build_goal_analysis_structured_fields_override():
brief = build_semantic_brief("Kumite Beinarbeit")
structured = RoadmapStructuredInput(
start_situation="statische Vorwärtsbewegung im Partnerdrill",
target_state="explosiver Gegenangriff nach unvorhersehbarer Beinarbeit",
roadmap_notes="Kindergruppe 10–12 Jahre",
)
ga = build_goal_analysis("Kumite Beinarbeit", brief, structured=structured)
assert ga.start_assumption == structured.start_situation
assert ga.target_state == structured.target_state
assert any("Kindergruppe" in c for c in ga.success_criteria)
def test_develop_micro_objectives_start_target_kumite():
brief = build_semantic_brief(KUMITE_GOAL)
ga = build_goal_analysis(KUMITE_GOAL, brief)
micro = develop_micro_objectives(brief, goal_analysis=ga, min_count=6)
titles = [m.title for m in micro]
assert any("Ausgang" in t for t in titles)
assert any("Ziel" in t for t in titles)
assert not any("Einstieg und Orientierung zum Thema" in t for t in titles)
def test_pipeline_kumite_major_steps_not_generic_templates():
ctx = run_progression_roadmap_pipeline(KUMITE_GOAL, max_steps=5, include_llm_roadmap=False)
goals = [s.learning_goal for s in ctx.roadmap.major_steps]
joined = " ".join(goals).lower()
assert "kumite beinarbeit" in joined
assert "steppbewegung" in joined or "ausgang" in joined
assert "dynamisch" in joined or "ziel" in joined
assert not any(g == "Grundstellung und Basisbewegung" for g in goals)