approve: 修复当前迭代 2 个功能 Bug(pbls-初始迭代)
This commit is contained in:
parent
55d5f61aac
commit
57e814aa66
13
pbl_agent_runtime.egg-info/PKG-INFO
Normal file
13
pbl_agent_runtime.egg-info/PKG-INFO
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
Metadata-Version: 2.4
|
||||||
|
Name: pbl_agent_runtime
|
||||||
|
Version: 1.0.0
|
||||||
|
Summary: PBL Designer/Critic Agent 运行时与 fail-closed 工具裁决(M4a:Agent 定义 + 13/9 工具注册 + 8 步裁决 + 四类强制人工审批)
|
||||||
|
Author: pbls dev team
|
||||||
|
License: Proprietary
|
||||||
|
Keywords: pbl,agent-runtime,designer,critic,fail-closed,tool-adjudication
|
||||||
|
Requires-Python: >=3.7
|
||||||
|
Description-Content-Type: text/markdown
|
||||||
|
Provides-Extra: dev
|
||||||
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
||||||
|
|
||||||
|
契约说明(3,893B,含真图):4 表 + 图1 九关 fail-closed 裁决链(qwen-image-3.0-pro 生成) + 九关错误码对照表 + 13 启用工具表(含 kind/domain/允许角色) + 9 禁用工具及理由表 + 用法示例 + 留痕与脱敏说明 + self_check/runtime_self_check 自检说明
|
||||||
32
pbl_agent_runtime.egg-info/SOURCES.txt
Normal file
32
pbl_agent_runtime.egg-info/SOURCES.txt
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
README.md
|
||||||
|
pyproject.toml
|
||||||
|
pbl_agent_runtime/__init__.py
|
||||||
|
pbl_agent_runtime/_store.py
|
||||||
|
pbl_agent_runtime/fallback.py
|
||||||
|
pbl_agent_runtime/init.py
|
||||||
|
pbl_agent_runtime/llm_router.py
|
||||||
|
pbl_agent_runtime/m4a.py
|
||||||
|
pbl_agent_runtime/m4a_adjudicate.py
|
||||||
|
pbl_agent_runtime/m4a_api.py
|
||||||
|
pbl_agent_runtime/m4a_approval.py
|
||||||
|
pbl_agent_runtime/m4a_backend.py
|
||||||
|
pbl_agent_runtime/m4a_contract.py
|
||||||
|
pbl_agent_runtime/m4a_critic.py
|
||||||
|
pbl_agent_runtime/m4a_designer.py
|
||||||
|
pbl_agent_runtime/m4a_init.py
|
||||||
|
pbl_agent_runtime/m4a_kernel.py
|
||||||
|
pbl_agent_runtime/m4a_registry.py
|
||||||
|
pbl_agent_runtime/m4a_smoke_compat.py
|
||||||
|
pbl_agent_runtime/m4a_store.py
|
||||||
|
pbl_agent_runtime/m4a_tables.py
|
||||||
|
pbl_agent_runtime/m4a_toolset.py
|
||||||
|
pbl_agent_runtime/m4a_trace.py
|
||||||
|
pbl_agent_runtime/prompt_guard.py
|
||||||
|
pbl_agent_runtime/trace_store.py
|
||||||
|
pbl_agent_runtime.egg-info/PKG-INFO
|
||||||
|
pbl_agent_runtime.egg-info/SOURCES.txt
|
||||||
|
pbl_agent_runtime.egg-info/dependency_links.txt
|
||||||
|
pbl_agent_runtime.egg-info/requires.txt
|
||||||
|
pbl_agent_runtime.egg-info/top_level.txt
|
||||||
|
pbl_agent_runtime/../sql/m4a_contract_addon.sql
|
||||||
|
pbl_agent_runtime/../sql/m4a_ddl.sql
|
||||||
1
pbl_agent_runtime.egg-info/dependency_links.txt
Normal file
1
pbl_agent_runtime.egg-info/dependency_links.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
||||||
3
pbl_agent_runtime.egg-info/requires.txt
Normal file
3
pbl_agent_runtime.egg-info/requires.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
[dev]
|
||||||
|
pytest>=7.0
|
||||||
1
pbl_agent_runtime.egg-info/top_level.txt
Normal file
1
pbl_agent_runtime.egg-info/top_level.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
pbl_agent_runtime
|
||||||
@ -111,7 +111,7 @@ def main():
|
|||||||
full = os.path.join(ROOT, "wwwroot", rel_in_module)
|
full = os.path.join(ROOT, "wwwroot", rel_in_module)
|
||||||
if not os.path.isfile(full):
|
if not os.path.isfile(full):
|
||||||
problems.append("load_path points to missing file: %s" % path)
|
problems.append("load_path points to missing file: %s" % path)
|
||||||
if role not in ("any", "user", "admin"):
|
if role not in ("any", "logined", "admin"):
|
||||||
problems.append("load_path bad role %r for %s" % (role, path))
|
problems.append("load_path bad role %r for %s" % (role, path))
|
||||||
|
|
||||||
# 3)+4) dspy 内容审计
|
# 3)+4) dspy 内容审计
|
||||||
|
|||||||
@ -8,25 +8,45 @@
|
|||||||
角色约定
|
角色约定
|
||||||
--------
|
--------
|
||||||
* ``any`` :登录前可访问(本模块无此类文件)
|
* ``any`` :登录前可访问(本模块无此类文件)
|
||||||
* ``user`` :普通登录用户(只读查询类)
|
* ``logined`` :普通登录用户(只读查询类)
|
||||||
* ``admin`` :租户管理员(写类 / 审批裁决 / 注册表变更)
|
* ``admin`` :租户管理员(写类 / 审批裁决 / 注册表变更)
|
||||||
|
|
||||||
|
角色名必须是**平台可解析口径**,不得自造
|
||||||
|
--------------------------------------
|
||||||
|
写入工具 ``set_role_perm.py`` 的角色解析规则(pipeline-app/set_role_perm.py):
|
||||||
|
|
||||||
|
* ``any`` / ``anonymous`` / ``logined`` 是特殊角色,直接用字面 id;
|
||||||
|
* 其余角色按 ``[orgtypeid.]name`` 查 role 表,缺省 ``orgtypeid='*'``;查不到即
|
||||||
|
``exit(1)``,宿主 ``load_path.py register()`` 记为 PENDING,端点上线即 403。
|
||||||
|
|
||||||
|
本模块原用自造词 ``user``(语义即「普通登录用户」),但 role 表里 ``user`` 只有
|
||||||
|
``orgtypeid='customer'`` 一行、**没有 ``orgtypeid='*'``**,故按缺省口径查零命中 →
|
||||||
|
8 条路径恒 PENDING(2026-09-29 build_run9 实测:total=308 ok=300 pending=8)。
|
||||||
|
平台表达「普通登录用户」的既有词就是 ``logined``(role 表有 id='logined' 与
|
||||||
|
orgtypeid='*' 两行),故归一到 ``logined``,语义不变且可解析。
|
||||||
|
|
||||||
|
注意:``admin`` 之所以能注册成功,是因为 role 表恰好存在 ``orgtypeid='*'`` 的
|
||||||
|
admin 行(id=zxje5CL8jCroLL35piNXG)。角色是运行时可增删的(role/orgtypes 有
|
||||||
|
CRUD),所以**任何模块都不应依赖某个具体角色行恰好存在**——只读的普通登录态
|
||||||
|
统一用特殊角色 ``logined``,写类/管理类若要用具名角色,必须带 orgtype 前缀
|
||||||
|
(如 ``owner.superuser``)并确认该行由种子保证存在。
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# (路径, 角色) —— 路径相对模块 wwwroot,运行时前缀 /pbl_agent_runtime/
|
# (路径, 角色) —— 路径相对模块 wwwroot,运行时前缀 /pbl_agent_runtime/
|
||||||
PATHS = [
|
PATHS = [
|
||||||
# 模块入口页
|
# 模块入口页
|
||||||
("/pbl_agent_runtime/index.ui", "user"),
|
("/pbl_agent_runtime/index.ui", "logined"),
|
||||||
# 10 个契约端点(与 pbl_agent_runtime.m4a_contract.CONTRACT_FUNCTIONS 同源)
|
# 10 个契约端点(与 pbl_agent_runtime.m4a_contract.CONTRACT_FUNCTIONS 同源)
|
||||||
("/pbl_agent_runtime/api/pbl_agent_designer_run.dspy", "admin"),
|
("/pbl_agent_runtime/api/pbl_agent_designer_run.dspy", "admin"),
|
||||||
("/pbl_agent_runtime/api/pbl_agent_critic_run.dspy", "user"),
|
("/pbl_agent_runtime/api/pbl_agent_critic_run.dspy", "logined"),
|
||||||
("/pbl_agent_runtime/api/pbl_agent_trace_write.dspy", "user"),
|
("/pbl_agent_runtime/api/pbl_agent_trace_write.dspy", "logined"),
|
||||||
("/pbl_agent_runtime/api/pbl_agent_trace_list.dspy", "user"),
|
("/pbl_agent_runtime/api/pbl_agent_trace_list.dspy", "logined"),
|
||||||
("/pbl_agent_runtime/api/pbl_tool_registry_list.dspy", "user"),
|
("/pbl_agent_runtime/api/pbl_tool_registry_list.dspy", "logined"),
|
||||||
("/pbl_agent_runtime/api/pbl_tool_registry_save.dspy", "admin"),
|
("/pbl_agent_runtime/api/pbl_tool_registry_save.dspy", "admin"),
|
||||||
("/pbl_agent_runtime/api/pbl_tool_adjudicate.dspy", "user"),
|
("/pbl_agent_runtime/api/pbl_tool_adjudicate.dspy", "logined"),
|
||||||
("/pbl_agent_runtime/api/pbl_approval_create.dspy", "user"),
|
("/pbl_agent_runtime/api/pbl_approval_create.dspy", "logined"),
|
||||||
("/pbl_agent_runtime/api/pbl_approval_decide.dspy", "admin"),
|
("/pbl_agent_runtime/api/pbl_approval_decide.dspy", "admin"),
|
||||||
("/pbl_agent_runtime/api/pbl_approval_list.dspy", "user"),
|
("/pbl_agent_runtime/api/pbl_approval_list.dspy", "logined"),
|
||||||
]
|
]
|
||||||
|
|
||||||
MODULE_NAME = "pbl_agent_runtime"
|
MODULE_NAME = "pbl_agent_runtime"
|
||||||
|
|||||||
@ -211,7 +211,7 @@ def t_qc4_load_path():
|
|||||||
rel = path.lstrip("/").split("/", 1)[1]
|
rel = path.lstrip("/").split("/", 1)[1]
|
||||||
full = os.path.join(ROOT, "wwwroot", rel)
|
full = os.path.join(ROOT, "wwwroot", rel)
|
||||||
assert os.path.isfile(full), "PATHS 指向不存在文件: %s" % path
|
assert os.path.isfile(full), "PATHS 指向不存在文件: %s" % path
|
||||||
assert role in ("any", "user", "admin"), (path, role)
|
assert role in ("any", "logined", "admin"), (path, role)
|
||||||
if path.endswith(".dspy"):
|
if path.endswith(".dspy"):
|
||||||
dspy_paths.append(path)
|
dspy_paths.append(path)
|
||||||
assert len(dspy_paths) == 10, dspy_paths
|
assert len(dspy_paths) == 10, dspy_paths
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user