Enhance Path Exclusion Logic and Semantic Brief Enrichment
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Has been cancelled
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Has been cancelled
- Introduced `resolve_path_anti_patterns` to improve handling of path exclusions based on explicit negations and semantic briefs. - Updated `enrich_brief_with_path_constraints` to incorporate path-specific exclusions into semantic briefs, enhancing exercise relevance. - Modified roadmap step annotation to allow for anti-pattern overrides, improving flexibility in exercise selection. - Enhanced tests to validate new path exclusion features and ensure correct functionality against learning goals. - Incremented application version to reflect these updates.
This commit is contained in:
1 parent
07e147bc76
commit
3c12363b8f
6 files changed
+270
-18
No files matched your search
@@ -847,12 +847,24 @@ def build_stage_specs(
|
||||
major_steps: Sequence[MajorStep],
|
||||
*,
|
||||
goal_analysis: GoalAnalysisArtifact,
|
||||
goal_query: str = "",
|
||||
semantic_brief: Optional[PlanningSemanticBrief] = None,
|
||||
) -> List[StageSpecArtifact]:
|
||||
"""Phase C — Stufenspezifikation je Major Step (heuristisch)."""
|
||||
from planning_exercise_semantics import resolve_path_anti_patterns
|
||||
|
||||
topic = goal_analysis.primary_topic or "Technik"
|
||||
path_anti = resolve_path_anti_patterns(goal_query, semantic_brief=semantic_brief)
|
||||
specs: List[StageSpecArtifact] = []
|
||||
for step in major_steps:
|
||||
phase = (step.phase or "vertiefung").lower()
|
||||
anti = [
|
||||
"reine Kraftübung ohne Technikbezug",
|
||||
f"andere Technik als {topic}" if topic else "themenfremde Übung",
|
||||
]
|
||||
for item in path_anti:
|
||||
if item not in anti:
|
||||
anti.append(item)
|
||||
specs.append(
|
||||
StageSpecArtifact(
|
||||
major_step_index=step.index,
|
||||
@@ -863,10 +875,7 @@ def build_stage_specs(
|
||||
f"Bezug zu {topic}",
|
||||
f"Phase {phase} erkennbar im Übungsziel",
|
||||
],
|
||||
anti_patterns=[
|
||||
"reine Kraftübung ohne Technikbezug",
|
||||
f"andere Technik als {topic}" if topic else "themenfremde Übung",
|
||||
],
|
||||
anti_patterns=anti[:14],
|
||||
)
|
||||
)
|
||||
return specs
|
||||
@@ -927,14 +936,24 @@ def roadmap_context_from_override(
|
||||
)
|
||||
)
|
||||
if not all(s.exercise_type for s in stage_specs):
|
||||
rebuilt = build_stage_specs(majors, goal_analysis=goal_analysis)
|
||||
rebuilt = build_stage_specs(
|
||||
majors,
|
||||
goal_analysis=goal_analysis,
|
||||
goal_query=goal_query.strip(),
|
||||
semantic_brief=semantic_brief,
|
||||
)
|
||||
for i, spec in enumerate(stage_specs):
|
||||
if not spec.exercise_type:
|
||||
spec.exercise_type = rebuilt[i].exercise_type
|
||||
if not spec.load_profile:
|
||||
spec.load_profile = list(rebuilt[i].load_profile)
|
||||
else:
|
||||
stage_specs = build_stage_specs(majors, goal_analysis=goal_analysis)
|
||||
stage_specs = build_stage_specs(
|
||||
majors,
|
||||
goal_analysis=goal_analysis,
|
||||
goal_query=goal_query.strip(),
|
||||
semantic_brief=semantic_brief,
|
||||
)
|
||||
|
||||
return ProgressionRoadmapContext(
|
||||
goal_query=goal_query.strip(),
|
||||
@@ -1103,7 +1122,12 @@ def run_progression_roadmap_pipeline(
|
||||
)
|
||||
ctx.roadmap = roadmap
|
||||
|
||||
stage_specs = build_stage_specs(roadmap.major_steps, goal_analysis=goal_analysis)
|
||||
stage_specs = build_stage_specs(
|
||||
roadmap.major_steps,
|
||||
goal_analysis=goal_analysis,
|
||||
goal_query=goal_query,
|
||||
semantic_brief=brief,
|
||||
)
|
||||
if include_llm_roadmap and cur is not None:
|
||||
llm_specs, spec_ok = try_llm_stage_specs(
|
||||
cur,
|
||||
|
||||
Reference in new issue
Block a user