53 lines
2.0 KiB
Python
53 lines
2.0 KiB
Python
|
|
"""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"] == []
|