From 770440a885db06d54f11419b0b475ba3bcb9d38c Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 15 Sep 2026 00:13:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(core):=20RoleSpec.deliverable=5Ftypes?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=90=88=E6=B3=95=E4=BA=A4=E4=BB=98=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=A3=B0=E6=98=8E+deliverable=5Ftype=E7=A0=81?= =?UTF-8?q?=E8=A1=A8=E6=89=A9=E5=85=8514=E9=A1=B9+pipeline=5Fdeliverables.?= =?UTF-8?q?files=5Fjson=E6=9C=AC=E4=BD=93=E6=96=87=E4=BB=B6=E6=B8=85?= =?UTF-8?q?=E5=8D=95=E5=88=97=E2=80=94=E2=80=94=E9=85=8D=E5=A5=97service?= =?UTF-8?q?=E4=BA=A4=E4=BB=98=E4=BB=B6=E7=B1=BB=E5=9E=8B=E5=AE=88=E5=8D=AB?= =?UTF-8?q?(2026-09-14=20pbls:=E9=9C=80=E6=B1=82=E4=BA=A4=E4=BB=98?= =?UTF-8?q?=E8=A2=ABLLM=E7=85=A7=E6=8A=84=E7=A4=BA=E4=BE=8B=E6=A0=87?= =?UTF-8?q?=E6=88=90design=5Fdoc,=E6=96=87=E4=BB=B6=E5=90=8D-XI6...=5Fdesi?= =?UTF-8?q?gn=5Fdoc.md);deliverable=E6=8A=80=E8=83=BD=E8=A1=A5=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E7=B1=BB=E5=9E=8B=E8=A1=A8=E4=B8=8E=E6=9C=AC=E4=BD=93?= =?UTF-8?q?vs=E6=91=98=E8=A6=81=E8=AF=AD=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init/data.json | 56 +++++++++++++++++++ models/pipeline_deliverables.json | 1 + pipeline_core/ability.py | 6 ++ .../sdlc_general/common/deliverable/SKILL.md | 19 +++++++ 4 files changed, 82 insertions(+) diff --git a/init/data.json b/init/data.json index 7db1106..7e24e78 100644 --- a/init/data.json +++ b/init/data.json @@ -165,6 +165,62 @@ { "k": "test-report", "v": "测试报告" + }, + { + "k": "requirement_spec", + "v": "需求规格" + }, + { + "k": "design_doc", + "v": "设计文档" + }, + { + "k": "code_files", + "v": "代码文件" + }, + { + "k": "deploy_doc", + "v": "部署文档" + }, + { + "k": "deploy_evidence", + "v": "部署证据" + }, + { + "k": "deploy_config", + "v": "部署配置" + }, + { + "k": "release_notes", + "v": "发布说明" + }, + { + "k": "test_report", + "v": "测试报告" + }, + { + "k": "test_docs", + "v": "测试文档" + }, + { + "k": "test_plan", + "v": "测试计划" + }, + { + "k": "pm_review", + "v": "PM审核记录" + }, + { + "k": "qc_review", + "v": "QC审查记录" + }, + { + "k": "retrospective", + "v": "项目复盘报告" + }, + { + "k": "human_task", + "v": "人类任务结果" } ] }, diff --git a/models/pipeline_deliverables.json b/models/pipeline_deliverables.json index 119569e..342b1f6 100644 --- a/models/pipeline_deliverables.json +++ b/models/pipeline_deliverables.json @@ -16,6 +16,7 @@ {"name": "repo_name", "title": "目标仓库别名", "type": "str", "length": 100}, {"name": "target_path", "title": "仓库内相对路径", "type": "str", "length": 500}, {"name": "file_path", "title": "本地存储路径", "type": "str", "length": 500}, + {"name": "files_json", "title": "本体文件清单(JSON数组,工作空间相对路径)", "type": "text"}, {"name": "content", "title": "交付件内容", "type": "longtext"}, {"name": "quality_score", "title": "质量评分(0-100)", "type": "int", "nullable": "no", "default": "80"}, {"name": "review_status", "title": "评审状态", "type": "str", "length": 20, "nullable": "no", "default": "'pending'"}, diff --git a/pipeline_core/ability.py b/pipeline_core/ability.py index 1a74204..b6cdfaf 100644 --- a/pipeline_core/ability.py +++ b/pipeline_core/ability.py @@ -34,6 +34,12 @@ class RoleSpec: model_name: str = "" # 角色专属模型(空 = 继承产线) task_title: str = "" # 该角色作为自动派生下一任务时的标题后缀 tools: List[str] = field(default_factory=list) # 工具白名单(空 = 产线全部工具) + deliverable_types: List[str] = field(default_factory=list) + # ↑ 该角色 deliver 的合法交付件类型(规范名,如 requirement→["requirement_spec"])。 + # 引擎在 deliver 拦截处校验:非法类型拒绝并返回合法清单(可行动报错); + # 空列表 = 产线未声明 → 不校验(逃逸阀,与 create_task 角色守卫同模式)。 + # 2026-09-14 pbls 实测:工具描述示例值 "design_doc" 被 requirement 角色 LLM 照抄, + # 引擎零校验照单全收 → 需求交付件被命名成 -XI6..._design_doc.md(类型错+文件名以'-'开头)。 @dataclass diff --git a/skills_library/pipelines/sdlc_general/common/deliverable/SKILL.md b/skills_library/pipelines/sdlc_general/common/deliverable/SKILL.md index 117f7ae..89113a7 100644 --- a/skills_library/pipelines/sdlc_general/common/deliverable/SKILL.md +++ b/skills_library/pipelines/sdlc_general/common/deliverable/SKILL.md @@ -66,6 +66,25 @@ tools: [submit_deliverable, approve_deliverable, reject_deliverable, reopen_deli `submit_deliverable` / `approve_deliverable` / `reject_deliverable` / `reopen_deliverable` / `list_deliverables` / `set_deliverable_state`(通用 CAS 兜底)。 +## 七.5、角色 → 合法交付件类型(deliverable_type 守卫,2026-09-14 起) + +引擎在角色 agent `deliver` 时校验 deliverable_type 必须属于本角色声明的合法清单, +非法值拒绝并回填合法清单(角色重交);工具 schema 里只展示本角色合法值。 + +| 角色 | 合法 deliverable_type | +|---|---| +| agent.requirement | requirement_spec | +| agent.design | design_doc | +| agent.develop | code_files | +| agent.deploy_test | deploy_doc / deploy_evidence / deploy_config | +| agent.test | test_report / test_docs / test_plan | +| agent.deploy_prod | deploy_doc / deploy_evidence / release_notes | +| agent.pm / agent.qc | (系统写入:pm_review / qc_review / retrospective) | + +**交付件本体 vs 摘要**:`deliver` 的 result 是摘要/索引(落库 content + deliverables/{role}/ 快照), +本体是 write_file 写好的 docs/ 编号树文档与 apps/、modules/ 代码。引擎自动采集本体文件清单 +(files_json 列),PM/QC 审核输入随附清单并强制逐个 read_file 本体后判定,禁止只看摘要放行。 + ## 八、分层覆盖 本 skill 是 **SDLC 产线默认**状态机;项目可用**同名 deliverable skill** 覆盖评审流程。