feat: route health real case e2e contexts
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"batch_max_items": 20,
|
||||
"batch_offset": 40,
|
||||
"boundary": "Health route smoke summary for public real-case E2E; product QA only, not medical or prediction proof.",
|
||||
"captured_count": 20,
|
||||
"core_status_counts": {
|
||||
"ready": 20
|
||||
},
|
||||
"created_at": "2026-07-20",
|
||||
"missing_route_layer_total": 0,
|
||||
"production_tuning_allowed": false,
|
||||
"route_counts": {
|
||||
"finance": 7,
|
||||
"health": 4,
|
||||
"relationship": 5,
|
||||
"timing": 4
|
||||
},
|
||||
"scope": "real_case_website_e2e_health_route_summary",
|
||||
"truth_matrix_allowed": false
|
||||
}
|
||||
@@ -118,6 +118,12 @@ class UnifiedConsultationOrchestrator:
|
||||
focus_techniques=["D2", "D11", "Dasha", "Shadbala", "Ashtakavarga"],
|
||||
display_label="finance",
|
||||
),
|
||||
"health": RouteDefinition(
|
||||
question_type="health",
|
||||
primary_theme="health",
|
||||
focus_techniques=["D1", "D6", "D8", "Dasha", "Shadbala", "non-medical boundary"],
|
||||
display_label="health",
|
||||
),
|
||||
"timing": RouteDefinition(
|
||||
question_type="timing",
|
||||
primary_theme="career",
|
||||
@@ -135,6 +141,7 @@ class UnifiedConsultationOrchestrator:
|
||||
"career": ["compute_chart", "run_rectification_gate", "run_thematic_report"],
|
||||
"relationship": ["compute_chart", "run_rectification_gate", "run_thematic_report"],
|
||||
"finance": ["compute_chart", "run_rectification_gate", "run_thematic_report"],
|
||||
"health": ["compute_chart", "run_rectification_gate", "run_thematic_report"],
|
||||
"timing": ["compute_chart", "run_rectification_gate", "run_muhurta_panchanga", "run_thematic_report"],
|
||||
"general": ["compute_chart", "run_rectification_gate", "run_thematic_report"],
|
||||
}
|
||||
@@ -172,6 +179,7 @@ class UnifiedConsultationOrchestrator:
|
||||
"career": ("career", "job", "work", "promotion", "business", "profession", "事业", "工作", "升职", "生意"),
|
||||
"relationship": ("marriage", "married", "wedding", "relationship", "love", "spouse", "partner", "divorce", "婚恋", "婚姻", "感情", "配偶", "恋爱", "结婚", "marry"),
|
||||
"finance": ("money", "wealth", "finance", "investment", "property", "income", "财务", "财富", "投资", "房产", "收入"),
|
||||
"health": ("health", "illness", "medical", "disease", "vitality", "健康", "疾病", "病", "体力", "医疗"),
|
||||
}
|
||||
first_hits: list[tuple[int, str]] = []
|
||||
for route_name, tokens in domain_tokens.items():
|
||||
@@ -195,6 +203,8 @@ class UnifiedConsultationOrchestrator:
|
||||
route = self._ROUTE_DEFINITIONS["relationship"]
|
||||
elif "wealth" in normalized_themes:
|
||||
route = self._ROUTE_DEFINITIONS["finance"]
|
||||
elif "health" in normalized_themes:
|
||||
route = self._ROUTE_DEFINITIONS["health"]
|
||||
else:
|
||||
route = self._ROUTE_DEFINITIONS["general"]
|
||||
|
||||
|
||||
@@ -19,6 +19,16 @@ def test_unified_consultation_orchestrator_normalizes_themes_and_route() -> None
|
||||
assert "D10" in route["focus_techniques"]
|
||||
|
||||
|
||||
def test_unified_consultation_orchestrator_routes_health_questions() -> None:
|
||||
orchestrator = UnifiedConsultationOrchestrator()
|
||||
themes = orchestrator.normalize_themes(["health"])
|
||||
route = orchestrator.resolve_route("健康 health risk should stay non-medical", themes)
|
||||
assert route["question_type"] == "health"
|
||||
assert route["primary_theme"] == "health"
|
||||
assert "D6" in route["focus_techniques"]
|
||||
assert "non-medical boundary" in route["focus_techniques"]
|
||||
|
||||
|
||||
def test_unified_consultation_orchestrator_exposes_surface_agnostic_contract() -> None:
|
||||
orchestrator = UnifiedConsultationOrchestrator()
|
||||
route = orchestrator.resolve_route("When will I marry?", ["marriage"])
|
||||
|
||||
Reference in New Issue
Block a user