mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-15 03:21:58 +00:00
941723b17c
- 身份与工具:登录页建第一个管理员(认人接口的 401 说明能不能建);搭建者有只读的人和组名录,选人给候选并核对名字;授权三行带标题;端点请求头名校验(空名、非法名存不进、发不出时说清原因);写入能力在工具页试运行一律演练、不发送,HTTP 状态照实说成败;写记忆不算只读、查询能力只能选同一端点上的只读能力;审批与遮罩的说法和实际规则一致;开登录时不要署名、导入和发布记登录的人;使用者不显示推演等只给搭建者的操作,403 按是否开登录说话;登录页只认一次人 - 流程与实例:图里用到的岗位(派给谁、超时升级给谁、发送确认派给谁)全部派生、没绑人的发布时报错;写外部系统的参数按能力声明的类型收拢后再算哈希和发送,收不成就不发;发起人的实例页只看这一步的状态,处理人才给待办卡;会签进度带登录核实和时间,升级后照实写规则;实例状态写流程的结论(已退回、未确认、等待核实写入结果),核实生效后不再挂失败原因;流程应用首页不派生最近封存运行的结果块,看板没数据时是安静的空态;样例⑩的金额带类型和下限、待办标题带金额,表单上下限前后端一起生效 - 看板与证据:定时任务模板加 ISO 周、上一 ISO 周、本月、上月;出处链穿过原样解析查询结果的整形节点,追不到原始数据的照实说停在哪里,样例⑨改用 cell();应用首页和版本历史都能做成应用;指标块单位不重复;版本列表带退役说明;定时任务页头跟着刷新;删视图要确认、新视图能起名;编辑器属性用中文名、术语带解释 - 指标出具(用户 2026-10-15 拍板):契约只写「指标来自」、上游没有报告撰写节点、成果里没有模型写的话时按指标出具——必需指标齐、指标输入追到原始数据、成果字段里的数回指得上才完整出具;受管级要求每个指标静态地追到原始数据(governed.metric_untraced);出具横幅和应用印章写明按指标 - 受管工作流降为已发布只给管理员(Q8 顺延,服务端同样拦);工作流接口带当前发布版的级别,画布上改过之后也认得出受管工作流
45 lines
2.2 KiB
Python
45 lines
2.2 KiB
Python
"""组件目录(app/apps/catalog.py)的 props 写给人看的中文名。
|
|
|
|
- 每个组件的每一项 props 都有 title,而且是中文:应用编辑的属性面板按它写属性名,不露 label、chart、sort 这些键名
|
|
- 枚举都有 x-enum-labels,和 enum 一一对应(同表单 agentlab.form/1 的写法),选项不露 line / bar
|
|
- title、description、x-enum-labels 只是注解:校验照旧,取值不对的照样报 app.props_invalid
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
|
|
from jsonschema import Draft202012Validator
|
|
|
|
from app.apps.catalog import BY_NAME, COMPONENTS, catalog_payload
|
|
|
|
_CJK = re.compile(r"[㐀-鿿]")
|
|
|
|
|
|
def test_every_prop_has_a_chinese_title():
|
|
missing = [(c["name"], key) for c in COMPONENTS for key, prop in c["props"]["properties"].items()
|
|
if not (isinstance(prop.get("title"), str) and _CJK.search(prop["title"]))]
|
|
assert missing == []
|
|
# 接口交出去的就是这一份
|
|
assert catalog_payload()["components"][0]["props"]["properties"]["title"]["title"] == "标题"
|
|
|
|
|
|
def test_enums_have_labels_in_the_same_order():
|
|
enums = [(c["name"], key, prop) for c in COMPONENTS for key, prop in c["props"]["properties"].items() if "enum" in prop]
|
|
assert enums, "目录里应当有枚举属性"
|
|
for name, key, prop in enums:
|
|
labels = prop.get("x-enum-labels")
|
|
assert isinstance(labels, list) and len(labels) == len(prop["enum"]), (name, key)
|
|
assert all(isinstance(t, str) and _CJK.search(t) for t in labels), (name, key)
|
|
assert BY_NAME["series"]["props"]["properties"]["chart"]["x-enum-labels"] == ["折线图", "柱状图"]
|
|
|
|
|
|
def test_annotations_do_not_change_validation():
|
|
schema = BY_NAME["notice"]["props"]
|
|
assert not list(Draft202012Validator(schema).iter_errors({"text": "说明", "tone": "warn"}))
|
|
errors = list(Draft202012Validator(schema).iter_errors({"tone": "提醒"}))
|
|
assert [list(e.absolute_path) for e in errors] == [["tone"]]
|
|
table = BY_NAME["table"]["props"]
|
|
assert not list(Draft202012Validator(table).iter_errors({"title": "门店", "sort": "-gmv", "limit": 20}))
|
|
assert list(Draft202012Validator(table).iter_errors({"limit": 0}))
|
|
assert list(Draft202012Validator(table).iter_errors({"unknown": 1}))
|