From 1055c859a0ead0421dd5fb263aeed8c5ecd3f010 Mon Sep 17 00:00:00 2001 From: 732642856 <732642856@qq.com> Date: Mon, 20 Jul 2026 16:05:25 +0800 Subject: [PATCH] feat: route health real case e2e contexts --- ...e_e2e_health_route_summary_2026_07_20.json | 20 +++++++++++++++++++ scripts/unified_consultation_orchestrator.py | 10 ++++++++++ .../test_unified_consultation_orchestrator.py | 10 ++++++++++ 3 files changed, 40 insertions(+) create mode 100644 artifacts/real_case_site_e2e_summary/real_case_website_e2e_health_route_summary_2026_07_20.json diff --git a/artifacts/real_case_site_e2e_summary/real_case_website_e2e_health_route_summary_2026_07_20.json b/artifacts/real_case_site_e2e_summary/real_case_website_e2e_health_route_summary_2026_07_20.json new file mode 100644 index 00000000..6cb3b1e1 --- /dev/null +++ b/artifacts/real_case_site_e2e_summary/real_case_website_e2e_health_route_summary_2026_07_20.json @@ -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 +} diff --git a/scripts/unified_consultation_orchestrator.py b/scripts/unified_consultation_orchestrator.py index e462cb6f..ea5d5d7e 100644 --- a/scripts/unified_consultation_orchestrator.py +++ b/scripts/unified_consultation_orchestrator.py @@ -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"] diff --git a/tests/test_unified_consultation_orchestrator.py b/tests/test_unified_consultation_orchestrator.py index 865bec22..28f7a157 100644 --- a/tests/test_unified_consultation_orchestrator.py +++ b/tests/test_unified_consultation_orchestrator.py @@ -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"])