- Introduced `battery_report.json` for local data analysis, excluding it from the database. - Enhanced `AGENTS.md` to reflect updated test baseline with 795 passed tests. - Added new metrics for trade flow in `dict_service.py`, improving transaction data analysis. - Updated regex patterns in `guardrail.py` to better handle numeric extraction and prevent misinterpretation of tokens. - Expanded course modules with new content on FR-8/9/10 capabilities and L3 role management. - Improved concurrency handling in transaction processing to ensure accurate alert generation. This update enhances data analysis capabilities and improves the overall structure and clarity of course materials.
94 lines
5.7 KiB
HTML
94 lines
5.7 KiB
HTML
<section class="module" id="module-5">
|
||
<div class="module-inner">
|
||
<p class="eyebrow animate-in">模块 5 · FR-8/9/10</p>
|
||
<h1 class="module-title animate-in">集中度、超期升级<br>与代理人行为链</h1>
|
||
<p class="module-lead animate-in">
|
||
PRD v1.1 追加的三条能力(FR-8~10)已在 <code>merger</code> 落地。
|
||
指挥 AI 改代码时要分清:<strong>规则引擎 / cron 脚本负责「出单、升级」</strong>;<strong>对话 Tool 只读查库</strong>,不能替运维跑定时任务。
|
||
</p>
|
||
|
||
<div class="screen animate-in">
|
||
<h2>三条规则 · 各管什么</h2>
|
||
<div class="pattern-cards">
|
||
<div class="pattern-card">
|
||
<h3>FR-8 · RISK-006 集中度</h3>
|
||
<p>客户持仓 R4+R5 占比 ≥ 阈值 → 并入<strong>事件类</strong>预警聚合(同客户同日一张事件单)。演示 A-10。</p>
|
||
</div>
|
||
<div class="pattern-card">
|
||
<h3>FR-9 · RISK-007 超期升级</h3>
|
||
<p><code>pending_review</code> 超阈值未处置 → 超期升级 cron(<code>escalation_scan.py</code>)写 payload 分级 · <strong>status 不变</strong>。</p>
|
||
</div>
|
||
<div class="pattern-card">
|
||
<h3>FR-10 · RISK-008 行为链</h3>
|
||
<p>代理人 A/B/C 条件命中 → 按 <code>actor_id</code> 维度出单;明细仅 officer/manager 可见。演示 A-12。</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="screen animate-in">
|
||
<h2>数据流:引擎出单 vs Chat 只读查</h2>
|
||
<div class="flow-animation" data-steps='[
|
||
{"highlight":"flow-fr-1","label":"事件线:simulate/trade 或 cron → risk_engine / escalation / behavior_scan → 写 risk_alert"},
|
||
{"highlight":"flow-fr-2","label":"对话线:X-Agent-Type: risk → tool_service → query_overdue_alerts / query_agent_behavior","packet":true,"from":"1","to":"2"},
|
||
{"highlight":"flow-fr-3","label":"FR-8 集中度:customer_context Tool 读 core_ro.concentration_profile(与 RISK-006 同源)","packet":true,"from":"2","to":"3"},
|
||
{"highlight":"flow-fr-1","label":"Chat 不能调用 escalation_scan.py;只能查库里已有超期单","packet":true,"from":"3","to":"1"}
|
||
]'>
|
||
<div class="flow-actors">
|
||
<div class="flow-actor" id="flow-fr-1"><span class="flow-actor-icon">⚙</span><span>引擎 / cron</span></div>
|
||
<div class="flow-actor" id="flow-fr-2"><span class="flow-actor-icon">💬</span><span>风控 Chat Tool</span></div>
|
||
<div class="flow-actor" id="flow-fr-3"><span class="flow-actor-icon">🗄</span><span>risk_alert 表</span></div>
|
||
</div>
|
||
<p class="flow-step-label">点击「下一步」</p>
|
||
<div class="flow-controls">
|
||
<button class="btn flow-next-btn">下一步</button>
|
||
<button class="btn flow-reset-btn">重来</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="screen animate-in">
|
||
<div class="translation-block">
|
||
<div class="translation-code">
|
||
<span class="translation-label">对话 Tool · 超期查询(chat_tools.py)</span>
|
||
<pre><code><span class="code-line"><span class="code-comment"># query_overdue_alerts — 只读 FR-9 入口</span></span>
|
||
<span class="code-line"><span class="code-comment"># query_agent_behavior — 只读 FR-10 入口</span></span>
|
||
<span class="code-line"><span class="code-comment"># 无 Tool 封装 escalation_scan / agent_behavior_scan</span></span></code></pre>
|
||
</div>
|
||
<div class="translation-english">
|
||
<span class="translation-label">白话</span>
|
||
<div class="translation-lines">
|
||
<p class="tl">想让超期单「升级」→ 运维跑 <code>scripts/cron/escalation_scan.py</code>,不是改 prompt。</p>
|
||
<p class="tl">想让行为链出单 → 先积累 audit 痕迹,再跑 <code>agent_behavior_scan.py</code>。</p>
|
||
<p class="tl">Chat 里问「有哪些超期单」→ <code>query_overdue_alerts</code> 查现有数据即可。</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="quiz-container" id="quiz-risk-m5">
|
||
<div class="quiz-question-block"
|
||
data-correct="option-b"
|
||
data-explanation-right="对。FR-9 升级改 payload 等级,status 仍为 pending_review;处置仍走 handle REST。"
|
||
data-explanation-wrong="超期升级不是自动 closed,也不改 handler_result。">
|
||
<h3 class="quiz-question">FR-9 超期升级后,预警单的 status 会怎样?</h3>
|
||
<div class="quiz-options">
|
||
<button class="quiz-option" data-value="option-a" onclick="selectOption(this)">
|
||
<div class="quiz-option-radio"></div><span>自动变为 closed</span>
|
||
</button>
|
||
<button class="quiz-option" data-value="option-b" onclick="selectOption(this)">
|
||
<div class="quiz-option-radio"></div><span>仍为 pending_review,payload 承载升级级别</span>
|
||
</button>
|
||
<button class="quiz-option" data-value="option-c" onclick="selectOption(this)">
|
||
<div class="quiz-option-radio"></div><span>Chat Tool 直接改 status</span>
|
||
</button>
|
||
</div>
|
||
<div class="quiz-feedback"></div>
|
||
</div>
|
||
<button class="quiz-check-btn" onclick="checkQuiz('quiz-risk-m5')">检查答案</button>
|
||
<button class="quiz-reset-btn" onclick="resetQuiz('quiz-risk-m5')">重做</button>
|
||
</div>
|
||
|
||
<p class="module-footer-note">相关文件:规则引擎(<code>risk_engine.py</code>)· 超期升级服务(<code>escalation_service.py</code>)· 代理人行为链服务(<code>agent_behavior_service.py</code>)· 风控对话 Tool(<code>chat_tools.py</code>)</p>
|
||
</div>
|
||
</div>
|
||
</section>
|