From 8466e3a71cdec7ffce1951f1f8299df487dd3c80 Mon Sep 17 00:00:00 2001 From: 732642856 <732642856@qq.com> Date: Mon, 29 Jun 2026 03:54:45 +0800 Subject: [PATCH] Land relationship narrative and dynamic hook workflow --- jyotish-app/export.js | 43 +++ jyotish-app/main.js | 129 ++++++- scripts/jyotish_api_server.py | 126 +++++++ scripts/jyotish_engine.py | 175 +++++++++- scripts/life_stage_hook.py | 156 +++++++++ tests/test_cli_smoke.py | 14 + .../test_mcp_strict_workflow_relationship.py | 316 +++++++++++++++++- 7 files changed, 946 insertions(+), 13 deletions(-) create mode 100644 scripts/life_stage_hook.py diff --git a/jyotish-app/export.js b/jyotish-app/export.js index 565d44f5..e033efbe 100644 --- a/jyotish-app/export.js +++ b/jyotish-app/export.js @@ -394,6 +394,7 @@ function _buildHTMLReport(chartData, extras) { const validation = extras.validation || {}; const audit = extras.audit || {}; const workflows = extras.workflows || chartData._client_workflows || {}; + const relationshipNarrative = extras.relationship_narrative || chartData?.ai_prompt_pack?.evidence_snapshot?.relationship_narrative || chartData?.relationship_narrative || null; const generatedAt = new Date().toLocaleString('zh-CN'); return ` @@ -463,6 +464,12 @@ function _buildHTMLReport(chartData, extras) { .relationship-list { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 9px; break-inside: avoid; } .relationship-list strong { color: var(--accent); } .relationship-list ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); } + .relationship-caution { + background: #fff8ed; border: 1px solid #f3d19c; border-left: 4px solid #c67a00; + border-radius: 6px; padding: 10px 12px; margin: 10px 0 12px; break-inside: avoid; + } + .relationship-caution strong { display: block; color: #7a4b00; margin-bottom: 4px; } + .relationship-caution span { display: block; color: #7a4b00; font-size: 12px; } .relationship-boundary { background: #fff8ed; border: 1px solid #ead7b8; border-radius: 6px; padding: 9px; margin-top: 8px; } .relationship-boundary span { display: block; color: var(--muted); font-size: 12px; } .calibration-status { @@ -582,6 +589,8 @@ function _buildHTMLReport(chartData, extras) { ` : '
当前导出未附带 Dasha 时间线。
'} + ${_relationshipStrictNarrativeSection(relationshipNarrative)} + ${_workflowReportSection(workflows)} ${_calibrationStatusSection(DASHA_SHADBALA_EXPORT_CALIBRATION_STATUS)} @@ -609,6 +618,40 @@ function _buildHTMLReport(chartData, extras) {