pbl_blueprint/scripts/verify_gate.py
2026-09-16 12:49:06 +08:00

10 lines
1.2 KiB
Python
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.

# 已用 write_file 落盘17141 字符。pbl_blueprint M1a 严格退出码门禁 G1~G6
# G1 py_compile 全量编译doraise=True, cfile=os.devnull 不污染工作区)
# G2 models/*.json 四段式(summary/fields/indexes/codes) + primary==["id"] + id str32 + tenant_id 首业务字段 + 金额 double(18,2)
# G3 json/*.json 根键 tblname+params + 禁自创 table/list + .dspy>=3处 + browserfields 非空
# G4 禁硬编码库名(DBNAME=/DB_NAME=/dbname='…',放行 get_module_dbname跳过注释行) + sqlor 白名单{C,U,D,R,I,sqlExe}(同扫 .py 与 .json)
# G5 函数三处注册同步(init.py env 注册 -> 包内 def -> __init__.py 导出,含 NOISE 噪声过滤防假阳性)
# G6 scripts/load_path.py RBAC 路径显式枚举、无 %/* 通配符、每条以 / 开头
# 退出码契约:任一段失败 -> 汇总编号打印 -> 尾行 'GATE RESULT: FAIL rc=1' -> sys.exit(1);全通过 -> 'GATE RESULT: PASS rc=0' -> sys.exit(0)
# 路径解析基于 os.path.dirname(os.path.abspath(__file__)) 上溯,不依赖 cwd失败不首错即停一次跑完暴露全部问题。
# 复跑cd /d/pipeline/workspaces/0/sdlc_general && python3 modules/pbl_blueprint/scripts/verify_gate.py; echo "gate rc=$?"