1) 客服 Agent 四份交付文档 + 构建脚手架:品牌由包装占位 XX科技 / 旧名 南方财富 统一为南方基金(热线 400-889-8899 / 官网 nffund.com),系统名改为「智能服务系统」; 同步追加 §0.4 修订记录行,工程记录行保留原占位字面以支撑硬编码扫描验收。 2) 开发文档:清理 28 份已作废/残留文档(14 份移出归档 + 14 份仓库副本), 新增《文档规整方案与开发前待决事项-2026-09-17》。 3) 客服agent 四份交付文档首次纳入本分支。
17 lines
851 B
Python
17 lines
851 B
Python
import ast
|
|
from pathlib import Path
|
|
|
|
|
|
def test_controllers_do_not_access_models_repositories_or_session_operations():
|
|
for path in Path("app/api/controllers").glob("*.py"):
|
|
tree = ast.parse(path.read_text(encoding="utf-8"))
|
|
for node in ast.walk(tree):
|
|
if isinstance(node, ast.ImportFrom):
|
|
assert not (node.module or "").startswith(("app.model", "app.repository")), path
|
|
if node.module == "sqlalchemy":
|
|
raise AssertionError(f"Controller imports SQL statements: {path}")
|
|
if isinstance(node, ast.Call) and isinstance(node.func, ast.Attribute):
|
|
target = node.func.value
|
|
if isinstance(target, ast.Name) and target.id == "session":
|
|
raise AssertionError(f"Controller operates on session: {path}:{node.lineno}")
|