Files
group_xinghuo_jinrong/docs/course/jinrong-module-analyst/modules/04-redlines.html
T
zhanghongyu_0626 4b8e11c9bd feat(threshold): Implement customer loss threshold configuration and notification system
- Added `ThresholdRepository` for managing customer loss threshold configurations and notifications.
- Introduced `threshold_service` to handle loss threshold alerts based on customer portfolio performance.
- Enhanced `customer_prompts` to include new intent for querying product net values.
- Updated `customer_service` to integrate new threshold alert functionality into existing workflows.
- Implemented `sanitize_postprocess` for improved compliance handling in customer interactions.
- Enhanced course documentation to reflect updates in advisor training modules and interactive elements.

This update significantly improves the customer experience by providing proactive loss threshold notifications and enhancing the overall service framework.
2026-09-10 10:57:40 +08:00

79 lines
4.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<section class="module" id="module-4">
<div class="module-inner">
<p class="eyebrow animate-in">模块 4 · 红线与排障</p>
<h1 class="module-title animate-in">问数只统计不处置<br>还有几个常见空结果坑</h1>
<p class="module-lead animate-in">
问数 Agent 能出表格和解读,但<strong>不能关预警、不能当投顾、不能改画像</strong>。
另外「消歧总空」「改占位 Chat 没用」是 vibe coder 高频踩坑——这模块专门讲清。
</p>
<div class="screen animate-in">
<h2>问数三条红线(合规 §4.3)</h2>
<div class="step-cards">
<div class="step-card">
<span class="step-num">①</span>
<p><strong>不处置预警</strong> — 不能调用 <code>POST /api/risk/alerts/{id}/handle</code>;台账只读统计。</p>
</div>
<div class="step-card">
<span class="step-num">②</span>
<p><strong>不当投顾</strong> — 输出带免责声明;禁止生成可执行买卖/处置指令。</p>
</div>
<div class="step-card">
<span class="step-num">③</span>
<p><strong>不改 L0/L1 画像</strong> — SQL 只读;customer 域仅 <code>self</code> 趋势统计,不下钻他人。</p>
</div>
</div>
<div class="callout callout-warning">
<strong>和风控对话线的区别:</strong> 风控 Chat 用 RISK_TOOL_REGISTRY 只读查台账;问数走 <code>/api/analyst/chat</code> + SQL 安全校验(sql_guard.py),<strong>不要</strong>混接口。
</div>
</div>
<div class="screen animate-in">
<h2>排障:消歧为什么总空?</h2>
<p>口径字典在 MySQL,<strong>本机须执行一次</strong> <code>scripts/agent/seed-analyst-metric-dict.sql</code>。没灌种子 → NL2SQL 消歧永远不命中,不是 LLM 「坏了」。</p>
<div class="translation-block">
<div class="translation-code">
<span class="translation-label">占位页 vs 真问数</span>
<pre><code><span class="code-line">AnalystChatShell → 占位 UI,未接问数 API</span>
<span class="code-line">AnalystQueryPage → POST /api/analyst/chat</span>
<span class="code-line">改 Shell 不会出 SQL 表格</span></code></pre>
</div>
<div class="translation-english">
<span class="translation-label">白话</span>
<div class="translation-lines">
<p class="tl">菜单里两个「分析」入口可能让人改错文件——问数逻辑在 NL→SQL 编排(<code>analyst_agent.py</code>) + 问数页。</p>
<p class="tl">Redis 问数缓存键含<strong>权限指纹</strong>,别只 hash SQL 字符串,否则可能串权。</p>
</div>
</div>
</div>
</div>
<div class="screen animate-in">
<div class="quiz-container" id="quiz-analyst-m4">
<div class="quiz-question-block"
data-correct="option-b"
data-explanation-right="对。问数线无 X-Agent-Type,走 get_platform_auth_context;加 analyst 头会走错栈。"
data-explanation-wrong="问数和 Chat 是两套鉴权,见总览模块 7 速查表。">
<h3 class="quiz-question">问数 401,AI 建议给 analyst.ts 加 X-Agent-Type: analyst,你怎么回?</h3>
<div class="quiz-options">
<button class="quiz-option" data-value="option-a" onclick="selectOption(this)">
<div class="quiz-option-radio"></div><span>好,和 Chat 统一</span>
</button>
<button class="quiz-option" data-value="option-b" onclick="selectOption(this)">
<div class="quiz-option-radio"></div><span>不对,问数不要 Agent 头,查 Bearer + 平台鉴权</span>
</button>
<button class="quiz-option" data-value="option-c" onclick="selectOption(this)">
<div class="quiz-option-radio"></div><span>去掉 JWT,全用 debug 头</span>
</button>
</div>
<div class="quiz-feedback"></div>
</div>
<button class="quiz-check-btn" onclick="checkQuiz('quiz-analyst-m4')">检查答案</button>
<button class="quiz-reset-btn" onclick="resetQuiz('quiz-analyst-m4')">重做</button>
</div>
<p class="module-footer-note">相关:NL→SQL 编排(<code>app/service/analyst_agent.py</code>) · SQL 安全校验(<code>app/service/analyst/sql_guard.py</code>)</p>
</div>
</div>
</section>