Enhance Planning Context with Progression Gap Snapshot and Start/Target Analysis
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 42s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 35s
Test Suite / playwright-tests (push) Successful in 1m13s
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 42s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 35s
Test Suite / playwright-tests (push) Successful in 1m13s
- Introduced `build_progression_gap_snapshot` function to create a compact roadmap context for gap exercises, integrating start situation, target state, and stage specifications. - Updated `build_gap_fill_goal_text` to include roadmap snapshot details, enhancing the context for AI-generated exercises. - Enhanced `ProgressionPathSuggestRequest` and related components to support new structured inputs for start/target analysis, improving user experience and AI suggestions. - Incremented application version to 0.8.212 to reflect these changes.
This commit is contained in:
1 parent
fad1058d54
commit
f2650dac57
11 files changed
+505
-25
No files matched your search
@@ -1,5 +1,6 @@
|
||||
"""Tests Planungs-KI Phase D — planning_context für suggestExerciseAi."""
|
||||
from planning_exercise_form_context import (
|
||||
build_progression_gap_snapshot,
|
||||
build_progression_path_gap_planning_context,
|
||||
planning_context_prompt_variables,
|
||||
sanitize_planning_context_for_ai,
|
||||
@@ -44,3 +45,36 @@ def test_build_progression_path_gap_context():
|
||||
def test_sanitize_truncates_long_strings():
|
||||
ctx = sanitize_planning_context_for_ai({"goal_query": "x" * 900})
|
||||
assert len(ctx["goal_query"]) <= 800
|
||||
|
||||
|
||||
def test_build_progression_gap_snapshot_includes_start_target_and_stage():
|
||||
snap = build_progression_gap_snapshot(
|
||||
goal_analysis={
|
||||
"primary_topic": "Kumite Beinarbeit",
|
||||
"start_assumption": "gleichförmige Steppbewegung",
|
||||
"target_state": "explosiver Angriff mit Ausweichen",
|
||||
"success_criteria": ["nachvollziehbarer Übergang"],
|
||||
},
|
||||
resolved_structured={"roadmap_notes": "Kindergruppe"},
|
||||
stage_spec={
|
||||
"learning_goal": "variable Rhythmen",
|
||||
"load_profile": ["timing", "distanz"],
|
||||
"success_criteria": ["Reaktion unter Druck"],
|
||||
"anti_patterns": ["statisches Stehen"],
|
||||
},
|
||||
semantic_brief={"must_phrases": ["Beinarbeit"], "development_arc": ["grundlage", "anwendung"]},
|
||||
)
|
||||
assert snap["start_situation"] == "gleichförmige Steppbewegung"
|
||||
assert snap["stage_learning_goal"] == "variable Rhythmen"
|
||||
assert "timing" in snap["stage_load_profile"]
|
||||
assert snap["roadmap_notes"] == "Kindergruppe"
|
||||
|
||||
|
||||
def test_gap_planning_context_carries_snapshot_fields():
|
||||
ctx = build_progression_path_gap_planning_context(
|
||||
goal_query="Kumite Beinarbeit",
|
||||
goal_analysis={"start_assumption": "Start", "target_state": "Ziel"},
|
||||
stage_spec={"learning_goal": "Stufenziel", "load_profile": ["koordination"]},
|
||||
)
|
||||
assert ctx["start_situation"] == "Start"
|
||||
assert ctx["stage_learning_goal"] == "Stufenziel"
|
||||
Reference in new issue
Block a user