merge: 并入同事的场外申购/推广/行情/NL2SQL 线(11 提交、334 文件)

冲突仅 3 个文件,全部取并集(双方都没有需要丢弃的改动):
- app/main.py:import 双方路由(我方 knowledge_management + 同事的 offsite_fund/
  promotion_material);include_router 段本已自动合并
- app/service/agent/bootstrap.py:import 与工具注册均取并集
  (query_customer_profile + query_financial_data 都注册)
- tests/integration/test_config_release_mysql.py:outbox 清理同时保留
  架构师的 event_type 限定(防误删其它域 outbox 行)与同事新增的 peer_release_id

同事这轮带入:11 个 alembic 迁移(建 offsite_* / promotion_* 等表)、
场外申购与推广素材 Agent、financial NL2SQL 工具。
注意:本库尚无 offsite_*/promotion_* 表,跑相关测试前需要执行 alembic upgrade。

边界核对:同事的场外代码未写入场内交易表(fin_sim_order/fin_capital_flow/fin_cash_ledger),
符合 AGENTS.md 规则 8。
This commit is contained in:
qyqy
2026-09-11 18:56:26 +08:00
118 changed files with 18967 additions and 191 deletions
@@ -0,0 +1,10 @@
from app.service.agent.bootstrap import get_agent_factory
def test_financial_nl2sql_tool_is_registered_as_read_only() -> None:
factory = get_agent_factory()
tool = factory._tool_executor.registry.get("query_financial_data")
assert tool.read_only is True
assert tool.required_permission == "financial:nl2sql:read"
assert "operator" in tool.allowed_roles
assert "advisor" in tool.allowed_roles