1) 客服 Agent 四份交付文档 + 构建脚手架:品牌由包装占位 XX科技 / 旧名 南方财富 统一为南方基金(热线 400-889-8899 / 官网 nffund.com),系统名改为「智能服务系统」; 同步追加 §0.4 修订记录行,工程记录行保留原占位字面以支撑硬编码扫描验收。 2) 开发文档:清理 28 份已作废/残留文档(14 份移出归档 + 14 份仓库副本), 新增《文档规整方案与开发前待决事项-2026-09-17》。 3) 客服agent 四份交付文档首次纳入本分支。
30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
"""RBAC 权限号段一致性(只读,不连库)。
|
|
|
|
规则与动机见 `tools/check_rbac_seed_consistency.py` 的模块说明:权限码的定义源是
|
|
`tools/seed_test_rbac.py` 的 `PERMISSIONS`,各 `grant_*.py` 只能补种子里缺的,
|
|
且 id 必须与种子逐条一致 —— 2026-09-12 曾因两套 id→code 映射并存,
|
|
让 `advisor` 角色在种子重建后静默拿到语义错误的权限。
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import importlib.util
|
|
from pathlib import Path
|
|
from types import ModuleType
|
|
|
|
PROJECT_ROOT = Path(__file__).resolve().parents[3]
|
|
|
|
|
|
def _load_tool_module() -> ModuleType:
|
|
path = PROJECT_ROOT / "tools" / "check_rbac_seed_consistency.py"
|
|
spec = importlib.util.spec_from_file_location("check_rbac_seed_consistency", path)
|
|
assert spec is not None and spec.loader is not None
|
|
module = importlib.util.module_from_spec(spec)
|
|
spec.loader.exec_module(module)
|
|
return module
|
|
|
|
|
|
def test_permission_ids_are_consistent_between_seed_and_grant_scripts() -> None:
|
|
problems = _load_tool_module().collect_findings()
|
|
assert problems == [], "权限号段不一致:\n" + "\n".join(problems)
|