Implement Stage Learning Goal Features in Planning Exercise
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m13s
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 43s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m13s
- Added `semantic_brief_for_stage` function to enhance semantic briefs with stage learning goals for improved roadmap matching. - Introduced `exercise_passes_stage_learning_goal_gate` to validate exercises against stage learning goals, enhancing relevance checks. - Updated path retrieval and scoring logic to incorporate stage learning goals, allowing for more nuanced exercise selection. - Enhanced UI to indicate weak matches with stage learning goals, improving user feedback on exercise relevance. - Incremented application version to reflect these updates.
This commit is contained in:
1 parent
48d51c07c5
commit
18547613ea
8 files changed
+339
-44
No files matched your search
@@ -38,6 +38,7 @@ from planning_exercise_semantics import (
|
||||
exercise_passes_path_semantic_gate,
|
||||
pick_best_path_hit,
|
||||
resolve_semantic_skill_weights,
|
||||
semantic_brief_for_stage,
|
||||
step_phase_for_index,
|
||||
step_retrieval_query,
|
||||
try_enrich_semantic_brief_with_llm,
|
||||
@@ -183,8 +184,16 @@ def _pick_best_path_hit(
|
||||
used_exercise_ids: Set[int],
|
||||
*,
|
||||
semantic_brief: Optional[PlanningSemanticBrief] = None,
|
||||
stage_learning_goal: Optional[str] = None,
|
||||
roadmap_stage_match: bool = False,
|
||||
) -> Optional[Dict[str, Any]]:
|
||||
return pick_best_path_hit(hits, used_exercise_ids, semantic_brief=semantic_brief)
|
||||
return pick_best_path_hit(
|
||||
hits,
|
||||
used_exercise_ids,
|
||||
semantic_brief=semantic_brief,
|
||||
stage_learning_goal=stage_learning_goal,
|
||||
roadmap_stage_match=roadmap_stage_match,
|
||||
)
|
||||
|
||||
|
||||
def _build_path_target_profile(
|
||||
@@ -282,6 +291,7 @@ def _run_path_step_retrieval(
|
||||
step_query_override: Optional[str] = None,
|
||||
step_phase_override: Optional[str] = None,
|
||||
step_target_profile_override: Optional[PlanningTargetProfile] = None,
|
||||
stage_learning_goal: Optional[str] = None,
|
||||
) -> Tuple[List[Dict[str, Any]], PlanningTargetProfile, Dict[str, Any], str]:
|
||||
step_query = step_query_override or step_retrieval_query(
|
||||
semantic_brief, goal_query, step_index, max_steps
|
||||
@@ -317,6 +327,8 @@ def _run_path_step_retrieval(
|
||||
"retrieval_query": step_query,
|
||||
"path_step_phase": step_phase_override
|
||||
or step_phase_for_index(semantic_brief, step_index, max_steps),
|
||||
"stage_learning_goal": (stage_learning_goal or "").strip() or None,
|
||||
"roadmap_stage_match": bool((stage_learning_goal or "").strip()),
|
||||
}
|
||||
pack = apply_progression_context_to_pack(
|
||||
cur,
|
||||
@@ -556,6 +568,12 @@ def _build_steps_roadmap_first(
|
||||
major_step=major,
|
||||
)
|
||||
step_kind = resolve_step_exercise_kind_filter(stage_spec, body.exercise_kind_any)
|
||||
stage_goal = (stage_spec.learning_goal or "").strip()
|
||||
stage_brief = semantic_brief_for_stage(
|
||||
semantic_brief,
|
||||
learning_goal=stage_goal,
|
||||
phase=major.phase if major else None,
|
||||
)
|
||||
|
||||
hits, _, _, _ = _run_path_step_retrieval(
|
||||
cur,
|
||||
@@ -569,36 +587,22 @@ def _build_steps_roadmap_first(
|
||||
progression_graph_id=body.progression_graph_id,
|
||||
include_llm_intent=body.include_llm_intent and step_index == 0,
|
||||
exercise_kind_any=step_kind,
|
||||
semantic_brief=semantic_brief,
|
||||
semantic_brief=stage_brief,
|
||||
path_target_profile=path_target_profile,
|
||||
path_intent=path_intent,
|
||||
step_query_override=step_query,
|
||||
step_phase_override=major.phase if major else None,
|
||||
step_target_profile_override=step_target,
|
||||
stage_learning_goal=stage_goal or None,
|
||||
)
|
||||
|
||||
hit = _pick_best_path_hit(hits, used, semantic_brief=semantic_brief)
|
||||
if not hit and step_query != goal_query:
|
||||
hits, _, _, _ = _run_path_step_retrieval(
|
||||
cur,
|
||||
tenant=tenant,
|
||||
goal_query=goal_query,
|
||||
step_index=step_index,
|
||||
max_steps=max_steps,
|
||||
planned_ids=planned_ids,
|
||||
anchor_id=anchor_id,
|
||||
anchor_variant_id=anchor_variant_id,
|
||||
progression_graph_id=body.progression_graph_id,
|
||||
include_llm_intent=False,
|
||||
exercise_kind_any=step_kind,
|
||||
semantic_brief=semantic_brief,
|
||||
path_target_profile=path_target_profile,
|
||||
path_intent=path_intent,
|
||||
step_query_override=goal_query,
|
||||
step_phase_override=major.phase if major else None,
|
||||
step_target_profile_override=step_target,
|
||||
)
|
||||
hit = _pick_best_path_hit(hits, used, semantic_brief=semantic_brief)
|
||||
hit = _pick_best_path_hit(
|
||||
hits,
|
||||
used,
|
||||
semantic_brief=stage_brief,
|
||||
stage_learning_goal=stage_goal or None,
|
||||
roadmap_stage_match=True,
|
||||
)
|
||||
|
||||
if not hit:
|
||||
unfilled.append((step_index, stage_spec))
|
||||
|
||||
Reference in new issue
Block a user