From 03d12ac8a6b272df3700e81289605156967fba5f Mon Sep 17 00:00:00 2001 From: ciel111 Date: Thu, 16 Jul 2026 19:14:04 +0800 Subject: [PATCH 01/13] #AI commit# Loop added in design-to-development stage --- .../agents/development/java-code-developer.md | 137 +++++++++++++----- .../config/dev-flow-checklists/stage-hooks.md | 17 +++ .../dev-flow-checklists/start-development.md | 9 ++ 3 files changed, 128 insertions(+), 35 deletions(-) diff --git a/.claude/agents/development/java-code-developer.md b/.claude/agents/development/java-code-developer.md index e49ec3ea..bf11d6d2 100644 --- a/.claude/agents/development/java-code-developer.md +++ b/.claude/agents/development/java-code-developer.md @@ -2,10 +2,16 @@ name: java-code-developer type: development description: Java后端开发专家,专注于Spring Boot应用开发,生成高质量的Java代码 -version: 4.8 +version: 4.9 author: DevSyncAgent Team -last_updated: 2026-07-15 +last_updated: 2026-07-16 changelog: + v4.9 - 2026-07-16 + - 🆕 配合 dev-flow Stage 3 内嵌「设计-开发协调循环」--开发过程中遇设计阻塞时返回 design_block_report JSON(code_complete+design_block_issues),主会话协调 des-xxx patch_mode 修补后重启本 Agent + - 🔄 第0.6步响应码预检查泛化为多 category 设计可开发性检测(response_code/api_endpoint/data_model/business_logic/config) + - 🛡️ 废止原第0.6步「询问用户补充响应码定义」模式(subagent 无法与用户交互),统一走 design_block_issues 返回供主会话协调 + - 🛡️ 新增末尾 design_block_report JSON 返回规范(复用 go-code-review 末尾 JSON 块模式,供主会话解析) + - 🛡️ 强化已有产物覆盖继续模式(收到【已有产物路径】时用 Edit 覆盖已生成代码,不从头重建) v4.8 - 2026-07-15 - 🐛 修复 frontmatter YAML 解析失败导致 agent 无法被 Claude Code 加载:v4.7 changelog 条目半角冒号 -> 全角冒号 v4.7 - 2026-07-02 @@ -510,53 +516,73 @@ git pull --- -### 第0.6步:设计文档响应码预检查 ⭐v3.5新增 +### 第0.6步:设计文档可开发性预检查 ⭐v4.9 重构(原响应码预检查泛化) -**目的**:在开始生成代码前,验证设计文档是否包含必要的响应码定义 +**目的**:在开始生成代码前,检测设计文档是否存在影响开发的设计缺失,产出 `design_block_issues` 供 dev-flow 主会话协调 des-xxx patch_mode 修补。**废止原 v3.5「询问用户补充」模式**(本 Agent 作为 subagent 无法与用户交互)。 + +**检查维度(多 category)**: + +| category | 检查内容 | 缺失判定 | +|---|---|---| +| response_code | 接口响应码定义(设计文档章节/api-spec.yaml) | 含 API 接口但无响应码定义 | +| api_endpoint | API 端点定义(路径/方法/参数) | 含 API 功能但端点未定义 | +| data_model | 数据模型/表结构 | 涉及数据持久化但无表结构 | +| business_logic | 核心业务规则/流程 | 关键业务流程未描述 | +| config | 配置项/环境变量 | 涉及外部依赖但配置未定义 | **检查逻辑**: ``` -IF 设计文档包含"接口设计"或"响应码规范"章节 THEN - 提取响应码定义(优先YAML格式,其次表格格式) - 记录到上下文变量 RESPONSE_CODES_DEFINED - 输出:"✅ 检测到响应码定义:[列出定义]" -ELSE IF 存在 api-spec.yaml THEN - 读取api-spec.yaml中的响应码定义 - 记录到上下文变量 RESPONSE_CODES_DEFINED - 输出:"✅ 从api-spec.yaml读取响应码定义:[列出定义]" -ELSE - 输出:"⚠️ 未检测到响应码定义" - 询问用户:"设计文档中未找到响应码定义。请确认: - 1. 本功能是否需要API接口? - 2. 如果需要,响应码如何定义? - - 使用项目默认(0=成功,其他=失败) - - 或提供具体响应码定义" - - 等待用户确认后,记录到 RESPONSE_CODES_DEFINED - - IF 用户选择跳过 OR 非API场景 THEN - 设置上下文变量 SKIP_RESPONSE_CODE_CHECK = true - END IF +design_block_issues = [] +FOR each category IN [response_code, api_endpoint, data_model, business_logic, config]: + IF 本功能涉及该 category AND 设计文档缺失该 category 的必要定义 THEN + design_block_issues.append({ + id: "DB-{序号}", + category: category, + location: "设计文档 §{对应章节}", + description: "{缺失内容描述}", + suggestion: "{修补建议}", + severity: "critical" | "high", + touches_api: (category IN [response_code, api_endpoint]) + }) +END FOR + +# response_code 兼容旧逻辑:优先设计文档章节,次选 api-spec.yaml +IF design_block_issues 无 response_code 类 AND (设计文档章节 OR api-spec.yaml) 含响应码定义 THEN + 记录到 RESPONSE_CODES_DEFINED(供第1步生成代码使用,原逻辑不变) +END IF +``` + +**决策**: +``` +IF design_block_issues 含 critical: + -> 不强行生成代码,置 code_complete=false,返回 design_block_issues + -> 主会话将调 des-xxx patch_mode 修补后重启本 Agent(注入【已有产物路径】覆盖继续) +ELIF design_block_issues 仅有 high: + -> 可降级处理:按现有降级逻辑生成代码,code_complete 视生成完成情况置 true,high 项记入 design_block_issues 供主会话知会 +ELSE: + -> 正常生成代码,完成后置 code_complete=true,design_block_issues=[] END IF ``` **输出格式**: ```markdown -## 响应码预检查报告 +## 设计可开发性预检查报告 -| 检查项 | 结果 | 定义内容 | -|:------:|:----:|---------| -| 设计文档章节 | ✅/❌ | - | -| api-spec.yaml | ✅/❌ | - | -| 用户确认 | ✅/❌ | - | +| category | 结果 | 说明 | +|:---:|:---:|---| +| response_code | ✅/❌ | - | +| api_endpoint | ✅/❌ | - | +| data_model | ✅/❌ | - | +| business_logic | ✅/❌ | - | +| config | ✅/❌ | - | -**响应码定义**: -- 成功:code=0 -- 失败:code=404,500 +**预检查结论**:通过 / 降级继续 / 阻塞(critical 项 N 个) -**预检查结论**:通过/跳过/失败 +**design_block_issues**:见末尾 design_block_report JSON 块 ``` +> ⚠️ 本步骤不再「询问用户」。所有设计缺失统一记入 design_block_issues,由主会话协调 des-xxx 修补或用户介入。code_complete 与 design_block_issues 的最终值在末尾 design_block_report JSON 块统一返回(见文末「design_block_report 返回规范」)。 + --- ### 第1步:分析设计文档 @@ -1019,6 +1045,47 @@ Feature文件:docs/{branch}/features/{name}.feature 如果推断的路径不存在,在"下一步建议"中提示用户手动指定。 +### design_block_report 返回规范(v4.9 新增,配合 dev-flow Stage 3 协调循环) + +本 Agent 作为 dev-flow Stage 3 subagent 运行时,**必须在返回文本末尾追加 design_block_report JSON 块**,供主会话解析决策(是否收敛/是否调 des-xxx 修补/是否上传石墨)。 + +**返回格式**(严格用 ```json 代码块包裹,置于返回文本最末尾): + +```json +{ + "code_complete": true, + "design_block_issues": [], + "progress_note": "代码开发完成,已生成 Entity/Service/Controller" +} +``` + +**字段语义**: + +| 字段 | 类型 | 语义 | +|---|---|---| +| code_complete | bool | true=代码开发完成(主会话进入收敛流程:审查设计修改+上传石墨);false=遇设计阻塞无法继续(主会话调 des-xxx patch_mode 修补后重启本 Agent) | +| design_block_issues | array | 设计阻塞清单(空数组=无阻塞)。每项含 id/category/location/description/suggestion/severity/touches_api | +| progress_note | string | 进度说明(已生成什么、阻塞在哪) | + +**design_block_issues 单项 schema**: +```json +{ + "id": "DB-001", + "category": "response_code|api_endpoint|data_model|business_logic|config", + "location": "设计文档 §2.3 接口设计", + "description": "响应码未定义", + "suggestion": "补充 code=0成功 / code=404未找到", + "severity": "critical|high|medium", + "touches_api": true +} +``` + +**两种返回场景**: +- 代码完成:`code_complete=true`,`design_block_issues=[]`(或含降级处理的 high 项供知会) +- 设计阻塞:`code_complete=false`,`design_block_issues=[critical/high 项]`,不强行生成不完整代码 + +**与已有产物覆盖**:主会话修补设计后重启本 Agent 时,注入【已有产物路径】,本 Agent 用 Edit 覆盖已生成代码继续,不从头重建。 + ### 协议执行 在完成代码开发后,**输出**以下完整格式: diff --git a/.claude/config/dev-flow-checklists/stage-hooks.md b/.claude/config/dev-flow-checklists/stage-hooks.md index 99f1d802..85287b5e 100644 --- a/.claude/config/dev-flow-checklists/stage-hooks.md +++ b/.claude/config/dev-flow-checklists/stage-hooks.md @@ -636,6 +636,14 @@ WHILE cycle_count < MAX_CYCLES: 9. 🛡️ BIZ API同步(版本模式):调用 mcp__biz-sync__biz_sync_session(biz_api_url=biz_api_url, biz_task_id=biz_task_id, content="{stage_name}完成", stage={stage_name}, progress={progress}) ⚠️ 使用safe_biz_sync包装器(失败时自动记录save_pending_item,不打扰用户) 10. 将 stage 追加到 versions.json 该需求的 stageHistory 数组 + 10.5 ⚠️ 阶段执行记录(仅 stage ∈ {0,1,1.1,2,2.1})⭐v4.12: + 在 context.md 的 `## 📊 阶段执行记录(需求/设计相位)` 表格写入/替换当前 stage 一行(仅记终态,不记待执行/执行中): + - 替换语义:若该 stage 已有行,先移除旧行(保持每 stage 至多一行,兼容回滚后重跑/失败后重试) + - 状态:IF skipDecisions[{stage}] 含 "skipped" THEN "跳过" ELSE "成功" + - 产出物:从本阶段已知路径填——Stage0=澄清纪要路径(若 subagent 落盘了纪要,否则"-");Stage1=requirement_doc_path;Stage1.1="-"(不产新文件,仅检视并可能 Edit 修改 Stage1 的需求文档,优化情况记备注);Stage2=design_doc_path(split 多文档用";"分隔);Stage2.1=接口文档路径(api_md_path,若 Stage2-Hook 生成了接口文档则填路径否则"-";设计文档优化记备注不记产出物)。注:Stage0/1/2 版本模式不可跳过必执行;1.1/2.1 跳过时 Stage1/2-Hook 仍会执行,故 2.1 跳过仍可能产出接口文档,产出物按"是否生成接口文档"判定,不按"是否跳过"判定 + - 完成时间:当前 ISO 8601 + - 备注:IF stage IN {1.1,2.1} THEN:IF skipDecisions[{stage}] 含 "skipped" THEN "阶段跳过" ELIF rechckDecisions[{stage}]="applied" THEN "已应用N项优化,{需求/设计}文档已更新" ELIF rechckDecisions[{stage}]="skipped" THEN "检视完成,未采纳优化" ELSE "-";若同时有 Hook 子动作失败转待补录,追加失败摘要;ELIF 本阶段 Hook(Stage1-Hook/Stage2-Hook)有子动作失败转待补录(DPMS同步/石墨上传/SDL/接口文档生成等),填失败摘要(如"DPMS同步失败已转待补录");若中间步骤失败被判定为阶段失败,状态改"失败"且备注填失败步骤;ELSE "-" + - 原子写入:Read context.md -> 更新表格 -> Write 整文件(单次 Write 即原子,与 frontmatter 状态保持一致) 11. 推进到 STAGE_ORDER 下一项 END FOR @@ -1440,6 +1448,15 @@ END IF **强制恢复流程**: 1. **不回退产物**:保留已生成的文档(stageHistory记录哪些阶段已完成) 2. **更新状态**:将 currentStage 和 stageHistory 保持不变(记录失败位置) +2.5 ⚠️ 阶段执行记录(仅 stage ∈ {0,1,1.1,2,2.1})⭐v4.12: + 在 context.md `## 📊 阶段执行记录(需求/设计相位)` 表格写入/替换当前 stage 一行: + - 状态:"失败" + - 产出物:已生成的填路径,未生成填"-" + - 完成时间:当前 ISO 8601 + - 备注:失败原因(如"subagent执行失败:{错误摘要}"或中间步骤失败"DPMS同步失败/接口文档生成失败"等) + - 替换语义:若该 stage 已有行先移除旧行 + - 原子写入:Read context.md -> 更新表格 -> Write 整文件 + - 注:若用户随后选"重试"并成功,步骤10.5 会以"成功"行替换本"失败"行,表格只留终态 3. **重试决策**: IF 该阶段连续失败 < 3次 THEN AskUserQuestion("Stage {stage}执行失败,如何处理?", diff --git a/.claude/config/dev-flow-checklists/start-development.md b/.claude/config/dev-flow-checklists/start-development.md index 9f60535e..5fbd3f02 100644 --- a/.claude/config/dev-flow-checklists/start-development.md +++ b/.claude/config/dev-flow-checklists/start-development.md @@ -424,6 +424,15 @@ updatedAt: "{ISO 8601时间}" # 任务上下文 +## 📊 阶段执行记录(需求/设计相位) + +> 仅记录需求相位(Stage 0/1/1.1)与设计相位(Stage 2/2.1)的终态(成功/跳过/失败),其余阶段不记。 +> 每 stage 至多一行;写入前若该 stage 已有行则先替换旧行(兼容"失败后重试成功")。 +> 写入规则与点位见 `stage-hooks.md` 步骤10.5(成功/跳过)与强制恢复流程步骤2.5(失败)。 + +| 阶段 | 名称 | 状态 | 产出物 | 完成时间 | 备注 | +|------|------|------|--------|----------|------| + ## 📋 任务基本信息 **任务名称**: {task_name} -- Gitee From 31222dc1d6fea3c1c3c7c548771dc636a748aeef Mon Sep 17 00:00:00 2001 From: ciel111 Date: Thu, 16 Jul 2026 19:14:04 +0800 Subject: [PATCH 02/13] #AI commit# add stage record --- .../agents/development/java-code-developer.md | 137 +++++++++++++----- .../config/dev-flow-checklists/stage-hooks.md | 17 +++ .../dev-flow-checklists/start-development.md | 9 ++ 3 files changed, 128 insertions(+), 35 deletions(-) diff --git a/.claude/agents/development/java-code-developer.md b/.claude/agents/development/java-code-developer.md index e49ec3ea..bf11d6d2 100644 --- a/.claude/agents/development/java-code-developer.md +++ b/.claude/agents/development/java-code-developer.md @@ -2,10 +2,16 @@ name: java-code-developer type: development description: Java后端开发专家,专注于Spring Boot应用开发,生成高质量的Java代码 -version: 4.8 +version: 4.9 author: DevSyncAgent Team -last_updated: 2026-07-15 +last_updated: 2026-07-16 changelog: + v4.9 - 2026-07-16 + - 🆕 配合 dev-flow Stage 3 内嵌「设计-开发协调循环」--开发过程中遇设计阻塞时返回 design_block_report JSON(code_complete+design_block_issues),主会话协调 des-xxx patch_mode 修补后重启本 Agent + - 🔄 第0.6步响应码预检查泛化为多 category 设计可开发性检测(response_code/api_endpoint/data_model/business_logic/config) + - 🛡️ 废止原第0.6步「询问用户补充响应码定义」模式(subagent 无法与用户交互),统一走 design_block_issues 返回供主会话协调 + - 🛡️ 新增末尾 design_block_report JSON 返回规范(复用 go-code-review 末尾 JSON 块模式,供主会话解析) + - 🛡️ 强化已有产物覆盖继续模式(收到【已有产物路径】时用 Edit 覆盖已生成代码,不从头重建) v4.8 - 2026-07-15 - 🐛 修复 frontmatter YAML 解析失败导致 agent 无法被 Claude Code 加载:v4.7 changelog 条目半角冒号 -> 全角冒号 v4.7 - 2026-07-02 @@ -510,53 +516,73 @@ git pull --- -### 第0.6步:设计文档响应码预检查 ⭐v3.5新增 +### 第0.6步:设计文档可开发性预检查 ⭐v4.9 重构(原响应码预检查泛化) -**目的**:在开始生成代码前,验证设计文档是否包含必要的响应码定义 +**目的**:在开始生成代码前,检测设计文档是否存在影响开发的设计缺失,产出 `design_block_issues` 供 dev-flow 主会话协调 des-xxx patch_mode 修补。**废止原 v3.5「询问用户补充」模式**(本 Agent 作为 subagent 无法与用户交互)。 + +**检查维度(多 category)**: + +| category | 检查内容 | 缺失判定 | +|---|---|---| +| response_code | 接口响应码定义(设计文档章节/api-spec.yaml) | 含 API 接口但无响应码定义 | +| api_endpoint | API 端点定义(路径/方法/参数) | 含 API 功能但端点未定义 | +| data_model | 数据模型/表结构 | 涉及数据持久化但无表结构 | +| business_logic | 核心业务规则/流程 | 关键业务流程未描述 | +| config | 配置项/环境变量 | 涉及外部依赖但配置未定义 | **检查逻辑**: ``` -IF 设计文档包含"接口设计"或"响应码规范"章节 THEN - 提取响应码定义(优先YAML格式,其次表格格式) - 记录到上下文变量 RESPONSE_CODES_DEFINED - 输出:"✅ 检测到响应码定义:[列出定义]" -ELSE IF 存在 api-spec.yaml THEN - 读取api-spec.yaml中的响应码定义 - 记录到上下文变量 RESPONSE_CODES_DEFINED - 输出:"✅ 从api-spec.yaml读取响应码定义:[列出定义]" -ELSE - 输出:"⚠️ 未检测到响应码定义" - 询问用户:"设计文档中未找到响应码定义。请确认: - 1. 本功能是否需要API接口? - 2. 如果需要,响应码如何定义? - - 使用项目默认(0=成功,其他=失败) - - 或提供具体响应码定义" - - 等待用户确认后,记录到 RESPONSE_CODES_DEFINED - - IF 用户选择跳过 OR 非API场景 THEN - 设置上下文变量 SKIP_RESPONSE_CODE_CHECK = true - END IF +design_block_issues = [] +FOR each category IN [response_code, api_endpoint, data_model, business_logic, config]: + IF 本功能涉及该 category AND 设计文档缺失该 category 的必要定义 THEN + design_block_issues.append({ + id: "DB-{序号}", + category: category, + location: "设计文档 §{对应章节}", + description: "{缺失内容描述}", + suggestion: "{修补建议}", + severity: "critical" | "high", + touches_api: (category IN [response_code, api_endpoint]) + }) +END FOR + +# response_code 兼容旧逻辑:优先设计文档章节,次选 api-spec.yaml +IF design_block_issues 无 response_code 类 AND (设计文档章节 OR api-spec.yaml) 含响应码定义 THEN + 记录到 RESPONSE_CODES_DEFINED(供第1步生成代码使用,原逻辑不变) +END IF +``` + +**决策**: +``` +IF design_block_issues 含 critical: + -> 不强行生成代码,置 code_complete=false,返回 design_block_issues + -> 主会话将调 des-xxx patch_mode 修补后重启本 Agent(注入【已有产物路径】覆盖继续) +ELIF design_block_issues 仅有 high: + -> 可降级处理:按现有降级逻辑生成代码,code_complete 视生成完成情况置 true,high 项记入 design_block_issues 供主会话知会 +ELSE: + -> 正常生成代码,完成后置 code_complete=true,design_block_issues=[] END IF ``` **输出格式**: ```markdown -## 响应码预检查报告 +## 设计可开发性预检查报告 -| 检查项 | 结果 | 定义内容 | -|:------:|:----:|---------| -| 设计文档章节 | ✅/❌ | - | -| api-spec.yaml | ✅/❌ | - | -| 用户确认 | ✅/❌ | - | +| category | 结果 | 说明 | +|:---:|:---:|---| +| response_code | ✅/❌ | - | +| api_endpoint | ✅/❌ | - | +| data_model | ✅/❌ | - | +| business_logic | ✅/❌ | - | +| config | ✅/❌ | - | -**响应码定义**: -- 成功:code=0 -- 失败:code=404,500 +**预检查结论**:通过 / 降级继续 / 阻塞(critical 项 N 个) -**预检查结论**:通过/跳过/失败 +**design_block_issues**:见末尾 design_block_report JSON 块 ``` +> ⚠️ 本步骤不再「询问用户」。所有设计缺失统一记入 design_block_issues,由主会话协调 des-xxx 修补或用户介入。code_complete 与 design_block_issues 的最终值在末尾 design_block_report JSON 块统一返回(见文末「design_block_report 返回规范」)。 + --- ### 第1步:分析设计文档 @@ -1019,6 +1045,47 @@ Feature文件:docs/{branch}/features/{name}.feature 如果推断的路径不存在,在"下一步建议"中提示用户手动指定。 +### design_block_report 返回规范(v4.9 新增,配合 dev-flow Stage 3 协调循环) + +本 Agent 作为 dev-flow Stage 3 subagent 运行时,**必须在返回文本末尾追加 design_block_report JSON 块**,供主会话解析决策(是否收敛/是否调 des-xxx 修补/是否上传石墨)。 + +**返回格式**(严格用 ```json 代码块包裹,置于返回文本最末尾): + +```json +{ + "code_complete": true, + "design_block_issues": [], + "progress_note": "代码开发完成,已生成 Entity/Service/Controller" +} +``` + +**字段语义**: + +| 字段 | 类型 | 语义 | +|---|---|---| +| code_complete | bool | true=代码开发完成(主会话进入收敛流程:审查设计修改+上传石墨);false=遇设计阻塞无法继续(主会话调 des-xxx patch_mode 修补后重启本 Agent) | +| design_block_issues | array | 设计阻塞清单(空数组=无阻塞)。每项含 id/category/location/description/suggestion/severity/touches_api | +| progress_note | string | 进度说明(已生成什么、阻塞在哪) | + +**design_block_issues 单项 schema**: +```json +{ + "id": "DB-001", + "category": "response_code|api_endpoint|data_model|business_logic|config", + "location": "设计文档 §2.3 接口设计", + "description": "响应码未定义", + "suggestion": "补充 code=0成功 / code=404未找到", + "severity": "critical|high|medium", + "touches_api": true +} +``` + +**两种返回场景**: +- 代码完成:`code_complete=true`,`design_block_issues=[]`(或含降级处理的 high 项供知会) +- 设计阻塞:`code_complete=false`,`design_block_issues=[critical/high 项]`,不强行生成不完整代码 + +**与已有产物覆盖**:主会话修补设计后重启本 Agent 时,注入【已有产物路径】,本 Agent 用 Edit 覆盖已生成代码继续,不从头重建。 + ### 协议执行 在完成代码开发后,**输出**以下完整格式: diff --git a/.claude/config/dev-flow-checklists/stage-hooks.md b/.claude/config/dev-flow-checklists/stage-hooks.md index 99f1d802..85287b5e 100644 --- a/.claude/config/dev-flow-checklists/stage-hooks.md +++ b/.claude/config/dev-flow-checklists/stage-hooks.md @@ -636,6 +636,14 @@ WHILE cycle_count < MAX_CYCLES: 9. 🛡️ BIZ API同步(版本模式):调用 mcp__biz-sync__biz_sync_session(biz_api_url=biz_api_url, biz_task_id=biz_task_id, content="{stage_name}完成", stage={stage_name}, progress={progress}) ⚠️ 使用safe_biz_sync包装器(失败时自动记录save_pending_item,不打扰用户) 10. 将 stage 追加到 versions.json 该需求的 stageHistory 数组 + 10.5 ⚠️ 阶段执行记录(仅 stage ∈ {0,1,1.1,2,2.1})⭐v4.12: + 在 context.md 的 `## 📊 阶段执行记录(需求/设计相位)` 表格写入/替换当前 stage 一行(仅记终态,不记待执行/执行中): + - 替换语义:若该 stage 已有行,先移除旧行(保持每 stage 至多一行,兼容回滚后重跑/失败后重试) + - 状态:IF skipDecisions[{stage}] 含 "skipped" THEN "跳过" ELSE "成功" + - 产出物:从本阶段已知路径填——Stage0=澄清纪要路径(若 subagent 落盘了纪要,否则"-");Stage1=requirement_doc_path;Stage1.1="-"(不产新文件,仅检视并可能 Edit 修改 Stage1 的需求文档,优化情况记备注);Stage2=design_doc_path(split 多文档用";"分隔);Stage2.1=接口文档路径(api_md_path,若 Stage2-Hook 生成了接口文档则填路径否则"-";设计文档优化记备注不记产出物)。注:Stage0/1/2 版本模式不可跳过必执行;1.1/2.1 跳过时 Stage1/2-Hook 仍会执行,故 2.1 跳过仍可能产出接口文档,产出物按"是否生成接口文档"判定,不按"是否跳过"判定 + - 完成时间:当前 ISO 8601 + - 备注:IF stage IN {1.1,2.1} THEN:IF skipDecisions[{stage}] 含 "skipped" THEN "阶段跳过" ELIF rechckDecisions[{stage}]="applied" THEN "已应用N项优化,{需求/设计}文档已更新" ELIF rechckDecisions[{stage}]="skipped" THEN "检视完成,未采纳优化" ELSE "-";若同时有 Hook 子动作失败转待补录,追加失败摘要;ELIF 本阶段 Hook(Stage1-Hook/Stage2-Hook)有子动作失败转待补录(DPMS同步/石墨上传/SDL/接口文档生成等),填失败摘要(如"DPMS同步失败已转待补录");若中间步骤失败被判定为阶段失败,状态改"失败"且备注填失败步骤;ELSE "-" + - 原子写入:Read context.md -> 更新表格 -> Write 整文件(单次 Write 即原子,与 frontmatter 状态保持一致) 11. 推进到 STAGE_ORDER 下一项 END FOR @@ -1440,6 +1448,15 @@ END IF **强制恢复流程**: 1. **不回退产物**:保留已生成的文档(stageHistory记录哪些阶段已完成) 2. **更新状态**:将 currentStage 和 stageHistory 保持不变(记录失败位置) +2.5 ⚠️ 阶段执行记录(仅 stage ∈ {0,1,1.1,2,2.1})⭐v4.12: + 在 context.md `## 📊 阶段执行记录(需求/设计相位)` 表格写入/替换当前 stage 一行: + - 状态:"失败" + - 产出物:已生成的填路径,未生成填"-" + - 完成时间:当前 ISO 8601 + - 备注:失败原因(如"subagent执行失败:{错误摘要}"或中间步骤失败"DPMS同步失败/接口文档生成失败"等) + - 替换语义:若该 stage 已有行先移除旧行 + - 原子写入:Read context.md -> 更新表格 -> Write 整文件 + - 注:若用户随后选"重试"并成功,步骤10.5 会以"成功"行替换本"失败"行,表格只留终态 3. **重试决策**: IF 该阶段连续失败 < 3次 THEN AskUserQuestion("Stage {stage}执行失败,如何处理?", diff --git a/.claude/config/dev-flow-checklists/start-development.md b/.claude/config/dev-flow-checklists/start-development.md index 9f60535e..5fbd3f02 100644 --- a/.claude/config/dev-flow-checklists/start-development.md +++ b/.claude/config/dev-flow-checklists/start-development.md @@ -424,6 +424,15 @@ updatedAt: "{ISO 8601时间}" # 任务上下文 +## 📊 阶段执行记录(需求/设计相位) + +> 仅记录需求相位(Stage 0/1/1.1)与设计相位(Stage 2/2.1)的终态(成功/跳过/失败),其余阶段不记。 +> 每 stage 至多一行;写入前若该 stage 已有行则先替换旧行(兼容"失败后重试成功")。 +> 写入规则与点位见 `stage-hooks.md` 步骤10.5(成功/跳过)与强制恢复流程步骤2.5(失败)。 + +| 阶段 | 名称 | 状态 | 产出物 | 完成时间 | 备注 | +|------|------|------|--------|----------|------| + ## 📋 任务基本信息 **任务名称**: {task_name} -- Gitee From ba9361156ea902ebf0d52e34ced34d1fa612d6f3 Mon Sep 17 00:00:00 2001 From: ciel111 Date: Thu, 16 Jul 2026 20:24:24 +0800 Subject: [PATCH 03/13] #AI commit# Loop added in design-to-development stage --- .claude/agents/design/des-enhance-feature.md | 52 ++++++- .claude/agents/design/des-fix-bug.md | 52 ++++++- .claude/agents/design/des-integrate.md | 52 ++++++- .claude/agents/design/des-new-feature.md | 52 ++++++- .claude/agents/design/des-optimize.md | 52 ++++++- .claude/agents/design/des-refactor.md | 52 ++++++- .../development/frontend-code-developer.md | 116 ++++++++++++++- .../agents/development/go-code-developer.md | 137 +++++++++++++----- .../development/python-code-developer.md | 137 +++++++++++++----- .../development/typescript-code-developer.md | 125 ++++++++++++++-- .../development/web-frontend-developer.md | 116 ++++++++++++++- 11 files changed, 843 insertions(+), 100 deletions(-) diff --git a/.claude/agents/design/des-enhance-feature.md b/.claude/agents/design/des-enhance-feature.md index fa3ef0a4..75b15390 100644 --- a/.claude/agents/design/des-enhance-feature.md +++ b/.claude/agents/design/des-enhance-feature.md @@ -2,10 +2,13 @@ name: des-enhance-feature type: design description: 功能增强设计专家,为现有模块设计兼容的扩展方案 -version: 4.9 +version: 4.10 author: DevSyncAgent Team -last_updated: 2026-07-06 +last_updated: 2026-07-16 changelog: + v4.10 - 2026-07-16 + - 🆕 新增 patch_mode 增量修补模式(配合 dev-flow Stage 3 设计-开发协调循环)--按开发 Agent 返回的 design_block_issues 清单用 Edit 精准修补设计文档对应章节,不重新生成全文,输出改动摘要 JSON(含 touches_api 标记) + - 🛡️ patch_mode 仅修改 issues 指向的章节,保护已检视通过的内容不被破坏 v4.9 - 2026-07-13 - 🆕 历史决策沉淀机制(配合"需求交互降本+全流程上下文提质"方案) · 设计文档生成后提炼设计决策点为 clarification 记忆类型,沉淀到 memory/topics/clarifications.md @@ -65,6 +68,51 @@ changelog: 根据需求文档,为现有功能模块的增强设计技术方案,保证兼容性。 +## 🔧 patch_mode(增量修补模式)⭐v4.10 新增 + +**触发条件**:prompt 含 `【patch_mode】:true` 时进入本模式(由 dev-flow Stage 3 协调循环主会话调用,传入 design_block_issues 清单)。 + +**与全量生成模式的区别**: +- 全量模式(默认):根据需求文档从零生成完整设计文档 +- patch_mode:**不重新生成全文**,仅按 issues 清单用 Edit 精准修改对应章节,保护已检视通过的内容 + +**输入**: +- `design_doc_path`:原设计文档路径(已存在,需在其上增量修改) +- `design_block_issues`:开发 Agent 返回的设计阻塞清单,每项含 id/category/location/description/suggestion/severity/touches_api + +**执行流程**: +``` +1. 读取原设计文档(design_doc_path),解析章节结构 +2. FOR each issue IN design_block_issues: + 按 issue.location 定位章节 + 按 issue.suggestion 用 Edit 工具修改该章节(仅改该章节,不动无关内容) + 记录改动摘要:{issue_id, location, what_changed, touches_api} + END FOR +3. 输出改动摘要 JSON(供主会话记入 design_changes_log) +``` + +**输出格式**(末尾 ```json 块): +```json +{ + "patch_applied": true, + "changes": [ + { + "issue_id": "DB-001", + "location": "§2.3 接口设计", + "what_changed": "补充响应码定义:code=0成功 / code=404未找到", + "touches_api": true + } + ], + "summary": "共修补 N 个 issue,涉及 M 个章节" +} +``` + +**约束**: +- ✅ 仅用 Edit 修改 issues 指向的章节 +- ❌ 禁止重新生成全文(破坏已检视内容) +- ❌ 禁止修改 issues 未指向的章节 +- ✅ 若 issue.location 无法定位,记入 changes 的 what_changed 为"定位失败,需人工",不阻塞 + ## 输入 - `docs/{branch}/requirements/{需求名}_需求.md`:需求文档(包含基础模块分析) diff --git a/.claude/agents/design/des-fix-bug.md b/.claude/agents/design/des-fix-bug.md index 8cccbb6f..19f88baf 100644 --- a/.claude/agents/design/des-fix-bug.md +++ b/.claude/agents/design/des-fix-bug.md @@ -2,10 +2,13 @@ name: des-fix-bug type: design description: Bug修复方案设计专家,根据问题分析报告生成完整的修复方案(+Web Search) -version: 4.9 +version: 4.10 author: DevSyncAgent Team -last_updated: 2026-07-06 +last_updated: 2026-07-16 changelog: + v4.10 - 2026-07-16 + - 🆕 新增 patch_mode 增量修补模式(配合 dev-flow Stage 3 设计-开发协调循环)--按开发 Agent 返回的 design_block_issues 清单用 Edit 精准修补设计文档对应章节,不重新生成全文,输出改动摘要 JSON(含 touches_api 标记) + - 🛡️ patch_mode 仅修改 issues 指向的章节,保护已检视通过的内容不被破坏 v4.9 - 2026-07-13 - 🆕 历史决策沉淀机制(配合"需求交互降本+全流程上下文提质"方案) · 设计文档生成后提炼设计决策点为 clarification 记忆类型,沉淀到 memory/topics/clarifications.md @@ -134,6 +137,51 @@ END --- +## 🔧 patch_mode(增量修补模式)⭐v4.10 新增 + +**触发条件**:prompt 含 `【patch_mode】:true` 时进入本模式(由 dev-flow Stage 3 协调循环主会话调用,传入 design_block_issues 清单)。 + +**与全量生成模式的区别**: +- 全量模式(默认):根据需求文档从零生成完整设计文档 +- patch_mode:**不重新生成全文**,仅按 issues 清单用 Edit 精准修改对应章节,保护已检视通过的内容 + +**输入**: +- `design_doc_path`:原设计文档路径(已存在,需在其上增量修改) +- `design_block_issues`:开发 Agent 返回的设计阻塞清单,每项含 id/category/location/description/suggestion/severity/touches_api + +**执行流程**: +``` +1. 读取原设计文档(design_doc_path),解析章节结构 +2. FOR each issue IN design_block_issues: + 按 issue.location 定位章节 + 按 issue.suggestion 用 Edit 工具修改该章节(仅改该章节,不动无关内容) + 记录改动摘要:{issue_id, location, what_changed, touches_api} + END FOR +3. 输出改动摘要 JSON(供主会话记入 design_changes_log) +``` + +**输出格式**(末尾 ```json 块): +```json +{ + "patch_applied": true, + "changes": [ + { + "issue_id": "DB-001", + "location": "§2.3 接口设计", + "what_changed": "补充响应码定义:code=0成功 / code=404未找到", + "touches_api": true + } + ], + "summary": "共修补 N 个 issue,涉及 M 个章节" +} +``` + +**约束**: +- ✅ 仅用 Edit 修改 issues 指向的章节 +- ❌ 禁止重新生成全文(破坏已检视内容) +- ❌ 禁止修改 issues 未指向的章节 +- ✅ 若 issue.location 无法定位,记入 changes 的 what_changed 为"定位失败,需人工",不阻塞 + ## 输入 - `docs/{branch}/requirements/{需求名}_需求.md`:问题分析报告(包含根因分析) diff --git a/.claude/agents/design/des-integrate.md b/.claude/agents/design/des-integrate.md index 5a584f62..b08c712b 100644 --- a/.claude/agents/design/des-integrate.md +++ b/.claude/agents/design/des-integrate.md @@ -2,10 +2,13 @@ name: des-integrate type: design description: 系统集成方案设计专家,设计第三方系统集成方案(+集成风险深度思考+Web Search) -version: 4.9 +version: 4.10 author: DevSyncAgent Team -last_updated: 2026-07-06 +last_updated: 2026-07-16 changelog: + v4.10 - 2026-07-16 + - 🆕 新增 patch_mode 增量修补模式(配合 dev-flow Stage 3 设计-开发协调循环)--按开发 Agent 返回的 design_block_issues 清单用 Edit 精准修补设计文档对应章节,不重新生成全文,输出改动摘要 JSON(含 touches_api 标记) + - 🛡️ patch_mode 仅修改 issues 指向的章节,保护已检视通过的内容不被破坏 v4.9 - 2026-07-13 - 🆕 历史决策沉淀机制(配合"需求交互降本+全流程上下文提质"方案) · 设计文档生成后提炼设计决策点为 clarification 记忆类型,沉淀到 memory/topics/clarifications.md @@ -73,6 +76,51 @@ changelog: 根据集成需求分析,设计完整的集成方案,包括集成模式、数据映射、容错机制。 +## 🔧 patch_mode(增量修补模式)⭐v4.10 新增 + +**触发条件**:prompt 含 `【patch_mode】:true` 时进入本模式(由 dev-flow Stage 3 协调循环主会话调用,传入 design_block_issues 清单)。 + +**与全量生成模式的区别**: +- 全量模式(默认):根据需求文档从零生成完整设计文档 +- patch_mode:**不重新生成全文**,仅按 issues 清单用 Edit 精准修改对应章节,保护已检视通过的内容 + +**输入**: +- `design_doc_path`:原设计文档路径(已存在,需在其上增量修改) +- `design_block_issues`:开发 Agent 返回的设计阻塞清单,每项含 id/category/location/description/suggestion/severity/touches_api + +**执行流程**: +``` +1. 读取原设计文档(design_doc_path),解析章节结构 +2. FOR each issue IN design_block_issues: + 按 issue.location 定位章节 + 按 issue.suggestion 用 Edit 工具修改该章节(仅改该章节,不动无关内容) + 记录改动摘要:{issue_id, location, what_changed, touches_api} + END FOR +3. 输出改动摘要 JSON(供主会话记入 design_changes_log) +``` + +**输出格式**(末尾 ```json 块): +```json +{ + "patch_applied": true, + "changes": [ + { + "issue_id": "DB-001", + "location": "§2.3 接口设计", + "what_changed": "补充响应码定义:code=0成功 / code=404未找到", + "touches_api": true + } + ], + "summary": "共修补 N 个 issue,涉及 M 个章节" +} +``` + +**约束**: +- ✅ 仅用 Edit 修改 issues 指向的章节 +- ❌ 禁止重新生成全文(破坏已检视内容) +- ❌ 禁止修改 issues 未指向的章节 +- ✅ 若 issue.location 无法定位,记入 changes 的 what_changed 为"定位失败,需人工",不阻塞 + ## 输入 - `docs/{branch}/requirements/{集成名}_需求.md`:集成需求分析(包含目标系统分析、集成模式设计) diff --git a/.claude/agents/design/des-new-feature.md b/.claude/agents/design/des-new-feature.md index 14935529..f026008b 100644 --- a/.claude/agents/design/des-new-feature.md +++ b/.claude/agents/design/des-new-feature.md @@ -2,10 +2,13 @@ name: des-new-feature type: design description: 新增功能设计专家,为全新模块设计完整的技术方案 -version: 4.9 +version: 4.10 author: DevSyncAgent Team -last_updated: 2026-07-06 +last_updated: 2026-07-16 changelog: + v4.10 - 2026-07-16 + - 🆕 新增 patch_mode 增量修补模式(配合 dev-flow Stage 3 设计-开发协调循环)--按开发 Agent 返回的 design_block_issues 清单用 Edit 精准修补设计文档对应章节,不重新生成全文,输出改动摘要 JSON(含 touches_api 标记) + - 🛡️ patch_mode 仅修改 issues 指向的章节,保护已检视通过的内容不被破坏 v4.9 - 2026-07-13 - 🆕 历史决策沉淀机制(配合"需求交互降本+全流程上下文提质"方案) · 设计文档生成后提炼设计决策点为 clarification 记忆类型,沉淀到 memory/topics/clarifications.md @@ -65,6 +68,51 @@ changelog: 根据需求文档,为全新功能模块设计技术方案,从零开始设计数据模型和接口。 +## 🔧 patch_mode(增量修补模式)⭐v4.10 新增 + +**触发条件**:prompt 含 `【patch_mode】:true` 时进入本模式(由 dev-flow Stage 3 协调循环主会话调用,传入 design_block_issues 清单)。 + +**与全量生成模式的区别**: +- 全量模式(默认):根据需求文档从零生成完整设计文档 +- patch_mode:**不重新生成全文**,仅按 issues 清单用 Edit 精准修改对应章节,保护已检视通过的内容 + +**输入**: +- `design_doc_path`:原设计文档路径(已存在,需在其上增量修改) +- `design_block_issues`:开发 Agent 返回的设计阻塞清单,每项含 id/category/location/description/suggestion/severity/touches_api + +**执行流程**: +``` +1. 读取原设计文档(design_doc_path),解析章节结构 +2. FOR each issue IN design_block_issues: + 按 issue.location 定位章节 + 按 issue.suggestion 用 Edit 工具修改该章节(仅改该章节,不动无关内容) + 记录改动摘要:{issue_id, location, what_changed, touches_api} + END FOR +3. 输出改动摘要 JSON(供主会话记入 design_changes_log) +``` + +**输出格式**(末尾 ```json 块): +```json +{ + "patch_applied": true, + "changes": [ + { + "issue_id": "DB-001", + "location": "§2.3 接口设计", + "what_changed": "补充响应码定义:code=0成功 / code=404未找到", + "touches_api": true + } + ], + "summary": "共修补 N 个 issue,涉及 M 个章节" +} +``` + +**约束**: +- ✅ 仅用 Edit 修改 issues 指向的章节 +- ❌ 禁止重新生成全文(破坏已检视内容) +- ❌ 禁止修改 issues 未指向的章节 +- ✅ 若 issue.location 无法定位,记入 changes 的 what_changed 为"定位失败,需人工",不阻塞 + ## 输入 - `docs/{branch}/requirements/{需求名}_需求.md`:需求文档 diff --git a/.claude/agents/design/des-optimize.md b/.claude/agents/design/des-optimize.md index 381c1f67..3ccb318e 100644 --- a/.claude/agents/design/des-optimize.md +++ b/.claude/agents/design/des-optimize.md @@ -2,10 +2,13 @@ name: des-optimize type: design description: 优化方案设计专家,设计性能/运维/代码优化方案,不涉及架构重构 -version: 4.9 +version: 4.10 author: DevSyncAgent Team -last_updated: 2026-07-06 +last_updated: 2026-07-16 changelog: + v4.10 - 2026-07-16 + - 🆕 新增 patch_mode 增量修补模式(配合 dev-flow Stage 3 设计-开发协调循环)--按开发 Agent 返回的 design_block_issues 清单用 Edit 精准修补设计文档对应章节,不重新生成全文,输出改动摘要 JSON(含 touches_api 标记) + - 🛡️ patch_mode 仅修改 issues 指向的章节,保护已检视通过的内容不被破坏 v4.9 - 2026-07-13 - 🆕 历史决策沉淀机制(配合"需求交互降本+全流程上下文提质"方案) · 设计文档生成后提炼设计决策点为 clarification 记忆类型,沉淀到 memory/topics/clarifications.md @@ -63,6 +66,51 @@ changelog: 根据优化需求分析,设计优化方案,不改变系统架构。 +## 🔧 patch_mode(增量修补模式)⭐v4.10 新增 + +**触发条件**:prompt 含 `【patch_mode】:true` 时进入本模式(由 dev-flow Stage 3 协调循环主会话调用,传入 design_block_issues 清单)。 + +**与全量生成模式的区别**: +- 全量模式(默认):根据需求文档从零生成完整设计文档 +- patch_mode:**不重新生成全文**,仅按 issues 清单用 Edit 精准修改对应章节,保护已检视通过的内容 + +**输入**: +- `design_doc_path`:原设计文档路径(已存在,需在其上增量修改) +- `design_block_issues`:开发 Agent 返回的设计阻塞清单,每项含 id/category/location/description/suggestion/severity/touches_api + +**执行流程**: +``` +1. 读取原设计文档(design_doc_path),解析章节结构 +2. FOR each issue IN design_block_issues: + 按 issue.location 定位章节 + 按 issue.suggestion 用 Edit 工具修改该章节(仅改该章节,不动无关内容) + 记录改动摘要:{issue_id, location, what_changed, touches_api} + END FOR +3. 输出改动摘要 JSON(供主会话记入 design_changes_log) +``` + +**输出格式**(末尾 ```json 块): +```json +{ + "patch_applied": true, + "changes": [ + { + "issue_id": "DB-001", + "location": "§2.3 接口设计", + "what_changed": "补充响应码定义:code=0成功 / code=404未找到", + "touches_api": true + } + ], + "summary": "共修补 N 个 issue,涉及 M 个章节" +} +``` + +**约束**: +- ✅ 仅用 Edit 修改 issues 指向的章节 +- ❌ 禁止重新生成全文(破坏已检视内容) +- ❌ 禁止修改 issues 未指向的章节 +- ✅ 若 issue.location 无法定位,记入 changes 的 what_changed 为"定位失败,需人工",不阻塞 + ## 输入 - `docs/{branch}/requirements/{优化名}_需求.md`:优化需求文档(包含当前状态分析、优化目标) diff --git a/.claude/agents/design/des-refactor.md b/.claude/agents/design/des-refactor.md index 12dca579..2dc7896a 100644 --- a/.claude/agents/design/des-refactor.md +++ b/.claude/agents/design/des-refactor.md @@ -2,10 +2,13 @@ name: des-refactor type: design description: 重构方案设计专家,设计架构级重构方案(+影响分析深度思考) -version: 4.9 +version: 4.10 author: DevSyncAgent Team -last_updated: 2026-07-06 +last_updated: 2026-07-16 changelog: + v4.10 - 2026-07-16 + - 🆕 新增 patch_mode 增量修补模式(配合 dev-flow Stage 3 设计-开发协调循环)--按开发 Agent 返回的 design_block_issues 清单用 Edit 精准修补设计文档对应章节,不重新生成全文,输出改动摘要 JSON(含 touches_api 标记) + - 🛡️ patch_mode 仅修改 issues 指向的章节,保护已检视通过的内容不被破坏 v4.9 - 2026-07-13 - 🆕 历史决策沉淀机制(配合"需求交互降本+全流程上下文提质"方案) · 设计文档生成后提炼设计决策点为 clarification 记忆类型,沉淀到 memory/topics/clarifications.md @@ -67,6 +70,51 @@ changelog: 根据重构需求分析,设计架构级重构方案。 +## 🔧 patch_mode(增量修补模式)⭐v4.10 新增 + +**触发条件**:prompt 含 `【patch_mode】:true` 时进入本模式(由 dev-flow Stage 3 协调循环主会话调用,传入 design_block_issues 清单)。 + +**与全量生成模式的区别**: +- 全量模式(默认):根据需求文档从零生成完整设计文档 +- patch_mode:**不重新生成全文**,仅按 issues 清单用 Edit 精准修改对应章节,保护已检视通过的内容 + +**输入**: +- `design_doc_path`:原设计文档路径(已存在,需在其上增量修改) +- `design_block_issues`:开发 Agent 返回的设计阻塞清单,每项含 id/category/location/description/suggestion/severity/touches_api + +**执行流程**: +``` +1. 读取原设计文档(design_doc_path),解析章节结构 +2. FOR each issue IN design_block_issues: + 按 issue.location 定位章节 + 按 issue.suggestion 用 Edit 工具修改该章节(仅改该章节,不动无关内容) + 记录改动摘要:{issue_id, location, what_changed, touches_api} + END FOR +3. 输出改动摘要 JSON(供主会话记入 design_changes_log) +``` + +**输出格式**(末尾 ```json 块): +```json +{ + "patch_applied": true, + "changes": [ + { + "issue_id": "DB-001", + "location": "§2.3 接口设计", + "what_changed": "补充响应码定义:code=0成功 / code=404未找到", + "touches_api": true + } + ], + "summary": "共修补 N 个 issue,涉及 M 个章节" +} +``` + +**约束**: +- ✅ 仅用 Edit 修改 issues 指向的章节 +- ❌ 禁止重新生成全文(破坏已检视内容) +- ❌ 禁止修改 issues 未指向的章节 +- ✅ 若 issue.location 无法定位,记入 changes 的 what_changed 为"定位失败,需人工",不阻塞 + ## 输入 - `docs/{branch}/requirements/{重构名}_需求.md`:重构需求分析(包含技术债务清单、收益评估) diff --git a/.claude/agents/development/frontend-code-developer.md b/.claude/agents/development/frontend-code-developer.md index a90edd65..f7f142db 100644 --- a/.claude/agents/development/frontend-code-developer.md +++ b/.claude/agents/development/frontend-code-developer.md @@ -2,10 +2,16 @@ name: frontend-code-developer type: development description: 前端开发Agent,对接前端智能研发平台实现自动化代码生成 -version: 4.6 +version: 4.7 author: DevSyncAgent Team -last_updated: 2026-06-01 +last_updated: 2026-07-16 changelog: + v4.7 - 2026-07-16 + - 🆕 配合 dev-flow Stage 3 内嵌「设计-开发协调循环」--开发过程中遇设计阻塞时返回 design_block_report JSON(code_complete+design_block_issues),主会话协调 des-xxx patch_mode 修补后重启本 Agent + - 🆕 新增第0.6步「设计文档可开发性预检查」(前端 category:api_endpoint/component_design/state_management/interaction/config),检测设计缺失产出 design_block_issues + - 🛡️ 本 Agent 作为 subagent 无法与用户交互,设计缺失统一走 design_block_issues 返回供主会话协调 + - 🛡️ 新增末尾 design_block_report JSON 返回规范(复用 go-code-review 末尾 JSON 块模式,供主会话解析) + - 🛡️ 强化已有产物覆盖继续模式(收到【已有产物路径】时用 Edit 覆盖已生成代码,不从头重建) v4.6 - 2026-06-08 - 🆕 激活条件增加项目前端代码仓库存在性检测(功能属性+项目属性联合判断) - 🆕 新增纯后端项目排除条件:无前端代码仓库时不触发 @@ -203,6 +209,71 @@ git branch --show-current --- +### 第0.6步:设计文档可开发性预检查 ⭐v4.7 新增(前端 category) + +**目的**:在开始生成代码前,检测设计文档是否存在影响开发的设计缺失,产出 `design_block_issues` 供 dev-flow 主会话协调 des-xxx patch_mode 修补。**本 Agent 作为 subagent 无法与用户交互**,所有缺失统一记入 design_block_issues 返回。 + +**检查维度(多 category,前端关注项)**: + +| category | 检查内容 | 缺失判定 | +|---|---|---| +| api_endpoint | Web API 端点定义(路径/方法/请求响应结构) | 含接口调用但端点未定义 | +| component_design | 组件结构/页面布局/组件拆分 | 涉及页面渲染但无组件设计 | +| state_management | 状态管理/数据流(Redux/Pinia/Context) | 涉及跨组件状态但无状态设计 | +| interaction | 交互流程/事件处理/表单校验 | 关键交互未描述 | +| config | 配置项/环境变量/构建配置 | 涉及外部依赖但配置未定义 | + +**检查逻辑**: +``` +design_block_issues = [] +FOR each category IN [api_endpoint, component_design, state_management, interaction, config]: + IF 本功能涉及该 category AND 设计文档缺失该 category 的必要定义 THEN + design_block_issues.append({ + id: "DB-{序号}", + category: category, + location: "设计文档 §{对应章节}", + description: "{缺失内容描述}", + suggestion: "{修补建议}", + severity: "critical" | "high", + touches_api: (category IN [api_endpoint]) + }) +END FOR + +``` + +**决策**: +``` +IF design_block_issues 含 critical: + -> 不强行生成代码,置 code_complete=false,返回 design_block_issues + -> 主会话将调 des-xxx patch_mode 修补后重启本 Agent(注入【已有产物路径】覆盖继续) +ELIF design_block_issues 仅有 high: + -> 可降级处理:按现有降级逻辑生成代码,code_complete 视生成完成情况置 true,high 项记入 design_block_issues 供主会话知会 +ELSE: + -> 正常生成代码,完成后置 code_complete=true,design_block_issues=[] +END IF +``` + +**输出格式**: +```markdown +## 设计可开发性预检查报告 + +| category | 结果 | 说明 | +|:---:|:---:|---| +| api_endpoint | ✅/❌ | - | +| component_design | ✅/❌ | - | +| state_management | ✅/❌ | - | +| interaction | ✅/❌ | - | +| config | ✅/❌ | - | + +**预检查结论**:通过 / 降级继续 / 阻塞(critical 项 N 个) + +**design_block_issues**:见末尾 design_block_report JSON 块 +``` + +> ⚠️ 本步骤不「询问用户」。所有设计缺失统一记入 design_block_issues,由主会话协调 des-xxx 修补或用户介入。code_complete 与 design_block_issues 的最终值在末尾 design_block_report JSON 块统一返回(见文末「design_block_report 返回规范」)。 + +--- + ### 第1步:读取设计文档 **目标**:提取设计文档内容,构建任务提示词 @@ -590,6 +661,47 @@ export FRONTEND_PLATFORM_TOKEN="your-new-token" **默认行为**:任务完成(成功或失败)后执行 +### design_block_report 返回规范(v4.7 新增,配合 dev-flow Stage 3 协调循环) + +本 Agent 作为 dev-flow Stage 3 subagent 运行时,**必须在返回文本末尾追加 design_block_report JSON 块**,供主会话解析决策(是否收敛/是否调 des-xxx 修补/是否上传石墨)。 + +**返回格式**(严格用 ```json 代码块包裹,置于返回文本最末尾): + +```json +{ + "code_complete": true, + "design_block_issues": [], + "progress_note": "代码开发完成,已生成 Component/Service/Store" +} +``` + +**字段语义**: + +| 字段 | 类型 | 语义 | +|---|---|---| +| code_complete | bool | true=代码开发完成(主会话进入收敛流程:审查设计修改+上传石墨);false=遇设计阻塞无法继续(主会话调 des-xxx patch_mode 修补后重启本 Agent) | +| design_block_issues | array | 设计阻塞清单(空数组=无阻塞)。每项含 id/category/location/description/suggestion/severity/touches_api | +| progress_note | string | 进度说明(已生成什么、阻塞在哪) | + +**design_block_issues 单项 schema**: +```json +{ + "id": "DB-001", + "category": "api_endpoint|component_design|state_management|interaction|config", + "location": "设计文档 §3.2 组件设计", + "description": "组件结构未定义", + "suggestion": "补充页面组件拆分与布局", + "severity": "critical|high|medium", + "touches_api": true +} +``` + +**两种返回场景**: +- 代码完成:`code_complete=true`,`design_block_issues=[]`(或含降级处理的 high 项供知会) +- 设计阻塞:`code_complete=false`,`design_block_issues=[critical/high 项]`,不强行生成不完整代码 + +**与已有产物覆盖**:主会话修补设计后重启本 Agent 时,注入【已有产物路径】,本 Agent 用 Edit 覆盖已生成代码继续,不从头重建。 + ### 协议执行 ```markdown diff --git a/.claude/agents/development/go-code-developer.md b/.claude/agents/development/go-code-developer.md index 9b448c08..dbecaf66 100644 --- a/.claude/agents/development/go-code-developer.md +++ b/.claude/agents/development/go-code-developer.md @@ -2,10 +2,16 @@ name: go-code-developer type: development description: Go后端开发专家,专注于Gin/Echo应用开发,生成高质量的Go代码 -version: 4.7 +version: 4.8 author: DevSyncAgent Team -last_updated: 2026-07-08 +last_updated: 2026-07-16 changelog: + v4.8 - 2026-07-16 + - 🆕 配合 dev-flow Stage 3 内嵌「设计-开发协调循环」--开发过程中遇设计阻塞时返回 design_block_report JSON(code_complete+design_block_issues),主会话协调 des-xxx patch_mode 修补后重启本 Agent + - 🔄 第0.6步响应码预检查泛化为多 category 设计可开发性检测(response_code/api_endpoint/data_model/business_logic/config) + - 🛡️ 废止原第0.6步「询问用户补充响应码定义」模式(subagent 无法与用户交互),统一走 design_block_issues 返回供主会话协调 + - 🛡️ 新增末尾 design_block_report JSON 返回规范(复用 go-code-review 末尾 JSON 块模式,供主会话解析) + - 🛡️ 强化已有产物覆盖继续模式(收到【已有产物路径】时用 Edit 覆盖已生成代码,不从头重建) v4.7 - 2026-07-08 - 🆕 末尾追加 Gene 召回机制段落(方案 D++++++ §14.7 + §13.4) · 生成代码前:调用 clawrelay-api /gep/recall 召回匹配 Gene 策略,注入 GEP-INJECT 标记 @@ -310,53 +316,73 @@ git pull --- -### 第0.6步:设计文档响应码预检查 ⭐v3.5新增 +### 第0.6步:设计文档可开发性预检查 ⭐v4.8 重构(原响应码预检查泛化) -**目的**:在开始生成代码前,验证设计文档是否包含必要的响应码定义 +**目的**:在开始生成代码前,检测设计文档是否存在影响开发的设计缺失,产出 `design_block_issues` 供 dev-flow 主会话协调 des-xxx patch_mode 修补。**废止原 v3.5「询问用户补充」模式**(本 Agent 作为 subagent 无法与用户交互)。 + +**检查维度(多 category)**: + +| category | 检查内容 | 缺失判定 | +|---|---|---| +| response_code | 接口响应码定义(设计文档章节/api-spec.yaml) | 含 API 接口但无响应码定义 | +| api_endpoint | API 端点定义(路径/方法/参数) | 含 API 功能但端点未定义 | +| data_model | 数据模型/表结构 | 涉及数据持久化但无表结构 | +| business_logic | 核心业务规则/流程 | 关键业务流程未描述 | +| config | 配置项/环境变量 | 涉及外部依赖但配置未定义 | **检查逻辑**: ``` -IF 设计文档包含"接口设计"或"响应码规范"章节 THEN - 提取响应码定义(优先YAML格式,其次表格格式) - 记录到上下文变量 RESPONSE_CODES_DEFINED - 输出:"✅ 检测到响应码定义:[列出定义]" -ELSE IF 存在 api-spec.yaml THEN - 读取api-spec.yaml中的响应码定义 - 记录到上下文变量 RESPONSE_CODES_DEFINED - 输出:"✅ 从api-spec.yaml读取响应码定义:[列出定义]" -ELSE - 输出:"⚠️ 未检测到响应码定义" - 询问用户:"设计文档中未找到响应码定义。请确认: - 1. 本功能是否需要API接口? - 2. 如果需要,响应码如何定义? - - 使用项目默认(0=成功,其他=失败) - - 或提供具体响应码定义" - - 等待用户确认后,记录到 RESPONSE_CODES_DEFINED - - IF 用户选择跳过 OR 非API场景 THEN - 设置上下文变量 SKIP_RESPONSE_CODE_CHECK = true - END IF +design_block_issues = [] +FOR each category IN [response_code, api_endpoint, data_model, business_logic, config]: + IF 本功能涉及该 category AND 设计文档缺失该 category 的必要定义 THEN + design_block_issues.append({ + id: "DB-{序号}", + category: category, + location: "设计文档 §{对应章节}", + description: "{缺失内容描述}", + suggestion: "{修补建议}", + severity: "critical" | "high", + touches_api: (category IN [response_code, api_endpoint]) + }) +END FOR + +# response_code 兼容旧逻辑:优先设计文档章节,次选 api-spec.yaml +IF design_block_issues 无 response_code 类 AND (设计文档章节 OR api-spec.yaml) 含响应码定义 THEN + 记录到 RESPONSE_CODES_DEFINED(供第1步生成代码使用,原逻辑不变) +END IF +``` + +**决策**: +``` +IF design_block_issues 含 critical: + -> 不强行生成代码,置 code_complete=false,返回 design_block_issues + -> 主会话将调 des-xxx patch_mode 修补后重启本 Agent(注入【已有产物路径】覆盖继续) +ELIF design_block_issues 仅有 high: + -> 可降级处理:按现有降级逻辑生成代码,code_complete 视生成完成情况置 true,high 项记入 design_block_issues 供主会话知会 +ELSE: + -> 正常生成代码,完成后置 code_complete=true,design_block_issues=[] END IF ``` **输出格式**: ```markdown -## 响应码预检查报告 +## 设计可开发性预检查报告 -| 检查项 | 结果 | 定义内容 | -|:------:|:----:|---------| -| 设计文档章节 | ✅/❌ | - | -| api-spec.yaml | ✅/❌ | - | -| 用户确认 | ✅/❌ | - | +| category | 结果 | 说明 | +|:---:|:---:|---| +| response_code | ✅/❌ | - | +| api_endpoint | ✅/❌ | - | +| data_model | ✅/❌ | - | +| business_logic | ✅/❌ | - | +| config | ✅/❌ | - | -**响应码定义**: -- 成功:code=0 -- 失败:code=404,500 +**预检查结论**:通过 / 降级继续 / 阻塞(critical 项 N 个) -**预检查结论**:通过/跳过/失败 +**design_block_issues**:见末尾 design_block_report JSON 块 ``` +> ⚠️ 本步骤不再「询问用户」。所有设计缺失统一记入 design_block_issues,由主会话协调 des-xxx 修补或用户介入。code_complete 与 design_block_issues 的最终值在末尾 design_block_report JSON 块统一返回(见文末「design_block_report 返回规范」)。 + --- ### 第1步:分析设计文档 @@ -1212,6 +1238,47 @@ Feature文件:docs/{branch}/features/{name}.feature 如果推断的路径不存在,在"下一步建议"中提示用户手动指定。 +### design_block_report 返回规范(v4.8 新增,配合 dev-flow Stage 3 协调循环) + +本 Agent 作为 dev-flow Stage 3 subagent 运行时,**必须在返回文本末尾追加 design_block_report JSON 块**,供主会话解析决策(是否收敛/是否调 des-xxx 修补/是否上传石墨)。 + +**返回格式**(严格用 ```json 代码块包裹,置于返回文本最末尾): + +```json +{ + "code_complete": true, + "design_block_issues": [], + "progress_note": "代码开发完成,已生成 Entity/Service/Controller" +} +``` + +**字段语义**: + +| 字段 | 类型 | 语义 | +|---|---|---| +| code_complete | bool | true=代码开发完成(主会话进入收敛流程:审查设计修改+上传石墨);false=遇设计阻塞无法继续(主会话调 des-xxx patch_mode 修补后重启本 Agent) | +| design_block_issues | array | 设计阻塞清单(空数组=无阻塞)。每项含 id/category/location/description/suggestion/severity/touches_api | +| progress_note | string | 进度说明(已生成什么、阻塞在哪) | + +**design_block_issues 单项 schema**: +```json +{ + "id": "DB-001", + "category": "response_code|api_endpoint|data_model|business_logic|config", + "location": "设计文档 §2.3 接口设计", + "description": "响应码未定义", + "suggestion": "补充 code=0成功 / code=404未找到", + "severity": "critical|high|medium", + "touches_api": true +} +``` + +**两种返回场景**: +- 代码完成:`code_complete=true`,`design_block_issues=[]`(或含降级处理的 high 项供知会) +- 设计阻塞:`code_complete=false`,`design_block_issues=[critical/high 项]`,不强行生成不完整代码 + +**与已有产物覆盖**:主会话修补设计后重启本 Agent 时,注入【已有产物路径】,本 Agent 用 Edit 覆盖已生成代码继续,不从头重建。 + ### 协议执行 在完成代码开发后,**输出**以下完整格式: diff --git a/.claude/agents/development/python-code-developer.md b/.claude/agents/development/python-code-developer.md index e6a97c38..fd241ff3 100644 --- a/.claude/agents/development/python-code-developer.md +++ b/.claude/agents/development/python-code-developer.md @@ -2,10 +2,16 @@ name: python-code-developer type: development description: Python后端开发专家,专注于FastAPI/Django应用开发,生成高质量的Python代码 -version: 4.8 +version: 4.9 author: DevSyncAgent Team -last_updated: 2026-07-15 +last_updated: 2026-07-16 changelog: + v4.9 - 2026-07-16 + - 🆕 配合 dev-flow Stage 3 内嵌「设计-开发协调循环」--开发过程中遇设计阻塞时返回 design_block_report JSON(code_complete+design_block_issues),主会话协调 des-xxx patch_mode 修补后重启本 Agent + - 🔄 第0.6步响应码预检查泛化为多 category 设计可开发性检测(response_code/api_endpoint/data_model/business_logic/config) + - 🛡️ 废止原第0.6步「询问用户补充响应码定义」模式(subagent 无法与用户交互),统一走 design_block_issues 返回供主会话协调 + - 🛡️ 新增末尾 design_block_report JSON 返回规范(复用 go-code-review 末尾 JSON 块模式,供主会话解析) + - 🛡️ 强化已有产物覆盖继续模式(收到【已有产物路径】时用 Edit 覆盖已生成代码,不从头重建) v4.8 - 2026-07-15 - 🐛 修复 frontmatter YAML 解析失败导致 agent 无法被 Claude Code 加载:v4.7 changelog 条目半角冒号 -> 全角冒号 v4.7 - 2026-07-02 @@ -517,53 +523,73 @@ git pull --- -### 第0.6步:设计文档响应码预检查 ⭐v3.5新增 +### 第0.6步:设计文档可开发性预检查 ⭐v4.9 重构(原响应码预检查泛化) -**目的**:在开始生成代码前,验证设计文档是否包含必要的响应码定义 +**目的**:在开始生成代码前,检测设计文档是否存在影响开发的设计缺失,产出 `design_block_issues` 供 dev-flow 主会话协调 des-xxx patch_mode 修补。**废止原 v3.5「询问用户补充」模式**(本 Agent 作为 subagent 无法与用户交互)。 + +**检查维度(多 category)**: + +| category | 检查内容 | 缺失判定 | +|---|---|---| +| response_code | 接口响应码定义(设计文档章节/api-spec.yaml) | 含 API 接口但无响应码定义 | +| api_endpoint | API 端点定义(路径/方法/参数) | 含 API 功能但端点未定义 | +| data_model | 数据模型/表结构 | 涉及数据持久化但无表结构 | +| business_logic | 核心业务规则/流程 | 关键业务流程未描述 | +| config | 配置项/环境变量 | 涉及外部依赖但配置未定义 | **检查逻辑**: ``` -IF 设计文档包含"接口设计"或"响应码规范"章节 THEN - 提取响应码定义(优先YAML格式,其次表格格式) - 记录到上下文变量 RESPONSE_CODES_DEFINED - 输出:"✅ 检测到响应码定义:[列出定义]" -ELSE IF 存在 api-spec.yaml THEN - 读取api-spec.yaml中的响应码定义 - 记录到上下文变量 RESPONSE_CODES_DEFINED - 输出:"✅ 从api-spec.yaml读取响应码定义:[列出定义]" -ELSE - 输出:"⚠️ 未检测到响应码定义" - 询问用户:"设计文档中未找到响应码定义。请确认: - 1. 本功能是否需要API接口? - 2. 如果需要,响应码如何定义? - - 使用项目默认(0=成功,其他=失败) - - 或提供具体响应码定义" - - 等待用户确认后,记录到 RESPONSE_CODES_DEFINED - - IF 用户选择跳过 OR 非API场景 THEN - 设置上下文变量 SKIP_RESPONSE_CODE_CHECK = true - END IF +design_block_issues = [] +FOR each category IN [response_code, api_endpoint, data_model, business_logic, config]: + IF 本功能涉及该 category AND 设计文档缺失该 category 的必要定义 THEN + design_block_issues.append({ + id: "DB-{序号}", + category: category, + location: "设计文档 §{对应章节}", + description: "{缺失内容描述}", + suggestion: "{修补建议}", + severity: "critical" | "high", + touches_api: (category IN [response_code, api_endpoint]) + }) +END FOR + +# response_code 兼容旧逻辑:优先设计文档章节,次选 api-spec.yaml +IF design_block_issues 无 response_code 类 AND (设计文档章节 OR api-spec.yaml) 含响应码定义 THEN + 记录到 RESPONSE_CODES_DEFINED(供第1步生成代码使用,原逻辑不变) +END IF +``` + +**决策**: +``` +IF design_block_issues 含 critical: + -> 不强行生成代码,置 code_complete=false,返回 design_block_issues + -> 主会话将调 des-xxx patch_mode 修补后重启本 Agent(注入【已有产物路径】覆盖继续) +ELIF design_block_issues 仅有 high: + -> 可降级处理:按现有降级逻辑生成代码,code_complete 视生成完成情况置 true,high 项记入 design_block_issues 供主会话知会 +ELSE: + -> 正常生成代码,完成后置 code_complete=true,design_block_issues=[] END IF ``` **输出格式**: ```markdown -## 响应码预检查报告 +## 设计可开发性预检查报告 -| 检查项 | 结果 | 定义内容 | -|:------:|:----:|---------| -| 设计文档章节 | ✅/❌ | - | -| api-spec.yaml | ✅/❌ | - | -| 用户确认 | ✅/❌ | - | +| category | 结果 | 说明 | +|:---:|:---:|---| +| response_code | ✅/❌ | - | +| api_endpoint | ✅/❌ | - | +| data_model | ✅/❌ | - | +| business_logic | ✅/❌ | - | +| config | ✅/❌ | - | -**响应码定义**: -- 成功:code=0 -- 失败:code=404,500 +**预检查结论**:通过 / 降级继续 / 阻塞(critical 项 N 个) -**预检查结论**:通过/跳过/失败 +**design_block_issues**:见末尾 design_block_report JSON 块 ``` +> ⚠️ 本步骤不再「询问用户」。所有设计缺失统一记入 design_block_issues,由主会话协调 des-xxx 修补或用户介入。code_complete 与 design_block_issues 的最终值在末尾 design_block_report JSON 块统一返回(见文末「design_block_report 返回规范」)。 + --- ### 第1步:分析设计文档 @@ -1025,6 +1051,47 @@ Feature文件:docs/{branch}/features/{name}.feature 如果推断的路径不存在,在"下一步建议"中提示用户手动指定。 +### design_block_report 返回规范(v4.9 新增,配合 dev-flow Stage 3 协调循环) + +本 Agent 作为 dev-flow Stage 3 subagent 运行时,**必须在返回文本末尾追加 design_block_report JSON 块**,供主会话解析决策(是否收敛/是否调 des-xxx 修补/是否上传石墨)。 + +**返回格式**(严格用 ```json 代码块包裹,置于返回文本最末尾): + +```json +{ + "code_complete": true, + "design_block_issues": [], + "progress_note": "代码开发完成,已生成 Entity/Service/Controller" +} +``` + +**字段语义**: + +| 字段 | 类型 | 语义 | +|---|---|---| +| code_complete | bool | true=代码开发完成(主会话进入收敛流程:审查设计修改+上传石墨);false=遇设计阻塞无法继续(主会话调 des-xxx patch_mode 修补后重启本 Agent) | +| design_block_issues | array | 设计阻塞清单(空数组=无阻塞)。每项含 id/category/location/description/suggestion/severity/touches_api | +| progress_note | string | 进度说明(已生成什么、阻塞在哪) | + +**design_block_issues 单项 schema**: +```json +{ + "id": "DB-001", + "category": "response_code|api_endpoint|data_model|business_logic|config", + "location": "设计文档 §2.3 接口设计", + "description": "响应码未定义", + "suggestion": "补充 code=0成功 / code=404未找到", + "severity": "critical|high|medium", + "touches_api": true +} +``` + +**两种返回场景**: +- 代码完成:`code_complete=true`,`design_block_issues=[]`(或含降级处理的 high 项供知会) +- 设计阻塞:`code_complete=false`,`design_block_issues=[critical/high 项]`,不强行生成不完整代码 + +**与已有产物覆盖**:主会话修补设计后重启本 Agent 时,注入【已有产物路径】,本 Agent 用 Edit 覆盖已生成代码继续,不从头重建。 + ### 协议执行 在完成代码开发后,**输出**以下完整格式: diff --git a/.claude/agents/development/typescript-code-developer.md b/.claude/agents/development/typescript-code-developer.md index ac333799..257b3aa2 100644 --- a/.claude/agents/development/typescript-code-developer.md +++ b/.claude/agents/development/typescript-code-developer.md @@ -2,10 +2,16 @@ name: typescript-code-developer type: development description: TypeScript后端开发专家,专注于NestJS应用开发,生成高质量的TypeScript代码 -version: 4.8 +version: 4.9 author: DevSyncAgent Team -last_updated: 2026-07-15 +last_updated: 2026-07-16 changelog: + v4.9 - 2026-07-16 + - 🆕 配合 dev-flow Stage 3 内嵌「设计-开发协调循环」--开发过程中遇设计阻塞时返回 design_block_report JSON(code_complete+design_block_issues),主会话协调 des-xxx patch_mode 修补后重启本 Agent + - 🔄 第0.6步响应码预检查泛化为多 category 设计可开发性检测(response_code/api_endpoint/data_model/business_logic/config) + - 🛡️ 废止原第0.6步「询问用户补充响应码定义」模式(subagent 无法与用户交互),统一走 design_block_issues 返回供主会话协调 + - 🛡️ 新增末尾 design_block_report JSON 返回规范(复用 go-code-review 末尾 JSON 块模式,供主会话解析) + - 🛡️ 强化已有产物覆盖继续模式(收到【已有产物路径】时用 Edit 覆盖已生成代码,不从头重建) v4.8 - 2026-07-15 - 🐛 修复 frontmatter YAML 解析失败导致 agent 无法被 Claude Code 加载:v4.7 changelog 条目半角冒号 -> 全角冒号 v4.7 - 2026-07-02 @@ -365,25 +371,73 @@ git pull --- -### 第0.6步:设计文档响应码预检查 +### 第0.6步:设计文档可开发性预检查 ⭐v4.9 重构(原响应码预检查泛化) -**目的**:在开始生成代码前,验证设计文档是否包含必要的响应码定义 +**目的**:在开始生成代码前,检测设计文档是否存在影响开发的设计缺失,产出 `design_block_issues` 供 dev-flow 主会话协调 des-xxx patch_mode 修补。**废止原 v3.5「询问用户补充」模式**(本 Agent 作为 subagent 无法与用户交互)。 + +**检查维度(多 category)**: + +| category | 检查内容 | 缺失判定 | +|---|---|---| +| response_code | 接口响应码定义(设计文档章节/api-spec.yaml) | 含 API 接口但无响应码定义 | +| api_endpoint | API 端点定义(路径/方法/参数) | 含 API 功能但端点未定义 | +| data_model | 数据模型/表结构 | 涉及数据持久化但无表结构 | +| business_logic | 核心业务规则/流程 | 关键业务流程未描述 | +| config | 配置项/环境变量 | 涉及外部依赖但配置未定义 | **检查逻辑**: ``` -IF 设计文档包含"接口设计"或"响应码规范"章节 THEN - 提取响应码定义 - 记录到上下文变量 RESPONSE_CODES_DEFINED - 输出:"✅ 检测到响应码定义:[列出定义]" -ELSE IF 存在 api-spec.yaml THEN - 读取api-spec.yaml中的响应码定义 - 记录到上下文变量 RESPONSE_CODES_DEFINED -ELSE - 输出:"⚠️ 未检测到响应码定义" - 询问用户确认 +design_block_issues = [] +FOR each category IN [response_code, api_endpoint, data_model, business_logic, config]: + IF 本功能涉及该 category AND 设计文档缺失该 category 的必要定义 THEN + design_block_issues.append({ + id: "DB-{序号}", + category: category, + location: "设计文档 §{对应章节}", + description: "{缺失内容描述}", + suggestion: "{修补建议}", + severity: "critical" | "high", + touches_api: (category IN [response_code, api_endpoint]) + }) +END FOR + +# response_code 兼容旧逻辑:优先设计文档章节,次选 api-spec.yaml +IF design_block_issues 无 response_code 类 AND (设计文档章节 OR api-spec.yaml) 含响应码定义 THEN + 记录到 RESPONSE_CODES_DEFINED(供第1步生成代码使用,原逻辑不变) +END IF +``` + +**决策**: +``` +IF design_block_issues 含 critical: + -> 不强行生成代码,置 code_complete=false,返回 design_block_issues + -> 主会话将调 des-xxx patch_mode 修补后重启本 Agent(注入【已有产物路径】覆盖继续) +ELIF design_block_issues 仅有 high: + -> 可降级处理:按现有降级逻辑生成代码,code_complete 视生成完成情况置 true,high 项记入 design_block_issues 供主会话知会 +ELSE: + -> 正常生成代码,完成后置 code_complete=true,design_block_issues=[] END IF ``` +**输出格式**: +```markdown +## 设计可开发性预检查报告 + +| category | 结果 | 说明 | +|:---:|:---:|---| +| response_code | ✅/❌ | - | +| api_endpoint | ✅/❌ | - | +| data_model | ✅/❌ | - | +| business_logic | ✅/❌ | - | +| config | ✅/❌ | - | + +**预检查结论**:通过 / 降级继续 / 阻塞(critical 项 N 个) + +**design_block_issues**:见末尾 design_block_report JSON 块 +``` + +> ⚠️ 本步骤不再「询问用户」。所有设计缺失统一记入 design_block_issues,由主会话协调 des-xxx 修补或用户介入。code_complete 与 design_block_issues 的最终值在末尾 design_block_report JSON 块统一返回(见文末「design_block_report 返回规范」)。 + --- ### 第1步:分析设计文档 @@ -965,6 +1019,49 @@ describe('{EntityName}Controller (e2e)', () => { --- +## design_block_report 返回规范(v4.9 新增,配合 dev-flow Stage 3 协调循环) + +本 Agent 作为 dev-flow Stage 3 subagent 运行时,**必须在返回文本末尾追加 design_block_report JSON 块**,供主会话解析决策(是否收敛/是否调 des-xxx 修补/是否上传石墨)。 + +**返回格式**(严格用 ```json 代码块包裹,置于返回文本最末尾): + +```json +{ + "code_complete": true, + "design_block_issues": [], + "progress_note": "代码开发完成,已生成 Entity/Service/Controller" +} +``` + +**字段语义**: + +| 字段 | 类型 | 语义 | +|---|---|---| +| code_complete | bool | true=代码开发完成(主会话进入收敛流程:审查设计修改+上传石墨);false=遇设计阻塞无法继续(主会话调 des-xxx patch_mode 修补后重启本 Agent) | +| design_block_issues | array | 设计阻塞清单(空数组=无阻塞)。每项含 id/category/location/description/suggestion/severity/touches_api | +| progress_note | string | 进度说明(已生成什么、阻塞在哪) | + +**design_block_issues 单项 schema**: +```json +{ + "id": "DB-001", + "category": "response_code|api_endpoint|data_model|business_logic|config", + "location": "设计文档 §2.3 接口设计", + "description": "响应码未定义", + "suggestion": "补充 code=0成功 / code=404未找到", + "severity": "critical|high|medium", + "touches_api": true +} +``` + +**两种返回场景**: +- 代码完成:`code_complete=true`,`design_block_issues=[]`(或含降级处理的 high 项供知会) +- 设计阻塞:`code_complete=false`,`design_block_issues=[critical/high 项]`,不强行生成不完整代码 + +**与已有产物覆盖**:主会话修补设计后重启本 Agent 时,注入【已有产物路径】,本 Agent 用 Edit 覆盖已生成代码继续,不从头重建。 + +--- + ## 下一步建议 代码开发完成后,建议执行以下测试流程: diff --git a/.claude/agents/development/web-frontend-developer.md b/.claude/agents/development/web-frontend-developer.md index c68d878d..e3bbad88 100644 --- a/.claude/agents/development/web-frontend-developer.md +++ b/.claude/agents/development/web-frontend-developer.md @@ -2,10 +2,16 @@ name: web-frontend-developer type: development description: 前端项目开发专家,支持React/Vue项目的本地代码生成,遵循现有代码规范 -version: 4.6 +version: 4.7 author: DevSyncAgent Team -last_updated: 2026-06-01 +last_updated: 2026-07-16 changelog: + v4.7 - 2026-07-16 + - 🆕 配合 dev-flow Stage 3 内嵌「设计-开发协调循环」--开发过程中遇设计阻塞时返回 design_block_report JSON(code_complete+design_block_issues),主会话协调 des-xxx patch_mode 修补后重启本 Agent + - 🆕 新增第0.6步「设计文档可开发性预检查」(前端 category:api_endpoint/component_design/state_management/interaction/config),检测设计缺失产出 design_block_issues + - 🛡️ 本 Agent 作为 subagent 无法与用户交互,设计缺失统一走 design_block_issues 返回供主会话协调 + - 🛡️ 新增末尾 design_block_report JSON 返回规范(复用 go-code-review 末尾 JSON 块模式,供主会话解析) + - 🛡️ 强化已有产物覆盖继续模式(收到【已有产物路径】时用 Edit 覆盖已生成代码,不从头重建) v4.6 - 2026-06-01 - 🔄 概念对齐:{功能名}统一为{需求名},与需求/设计阶段保持一致 v1.2 - 2026-05-27 @@ -190,6 +196,71 @@ echo "✅ 框架检测完成: $FRAMEWORK, UI库: $UI_LIBRARY, 状态管理: $STA --- +### 第0.6步:设计文档可开发性预检查 ⭐v4.7 新增(前端 category) + +**目的**:在开始生成代码前,检测设计文档是否存在影响开发的设计缺失,产出 `design_block_issues` 供 dev-flow 主会话协调 des-xxx patch_mode 修补。**本 Agent 作为 subagent 无法与用户交互**,所有缺失统一记入 design_block_issues 返回。 + +**检查维度(多 category,前端关注项)**: + +| category | 检查内容 | 缺失判定 | +|---|---|---| +| api_endpoint | Web API 端点定义(路径/方法/请求响应结构) | 含接口调用但端点未定义 | +| component_design | 组件结构/页面布局/组件拆分 | 涉及页面渲染但无组件设计 | +| state_management | 状态管理/数据流(Redux/Pinia/Context) | 涉及跨组件状态但无状态设计 | +| interaction | 交互流程/事件处理/表单校验 | 关键交互未描述 | +| config | 配置项/环境变量/构建配置 | 涉及外部依赖但配置未定义 | + +**检查逻辑**: +``` +design_block_issues = [] +FOR each category IN [api_endpoint, component_design, state_management, interaction, config]: + IF 本功能涉及该 category AND 设计文档缺失该 category 的必要定义 THEN + design_block_issues.append({ + id: "DB-{序号}", + category: category, + location: "设计文档 §{对应章节}", + description: "{缺失内容描述}", + suggestion: "{修补建议}", + severity: "critical" | "high", + touches_api: (category IN [api_endpoint]) + }) +END FOR + +``` + +**决策**: +``` +IF design_block_issues 含 critical: + -> 不强行生成代码,置 code_complete=false,返回 design_block_issues + -> 主会话将调 des-xxx patch_mode 修补后重启本 Agent(注入【已有产物路径】覆盖继续) +ELIF design_block_issues 仅有 high: + -> 可降级处理:按现有降级逻辑生成代码,code_complete 视生成完成情况置 true,high 项记入 design_block_issues 供主会话知会 +ELSE: + -> 正常生成代码,完成后置 code_complete=true,design_block_issues=[] +END IF +``` + +**输出格式**: +```markdown +## 设计可开发性预检查报告 + +| category | 结果 | 说明 | +|:---:|:---:|---| +| api_endpoint | ✅/❌ | - | +| component_design | ✅/❌ | - | +| state_management | ✅/❌ | - | +| interaction | ✅/❌ | - | +| config | ✅/❌ | - | + +**预检查结论**:通过 / 降级继续 / 阻塞(critical 项 N 个) + +**design_block_issues**:见末尾 design_block_report JSON 块 +``` + +> ⚠️ 本步骤不「询问用户」。所有设计缺失统一记入 design_block_issues,由主会话协调 des-xxx 修补或用户介入。code_complete 与 design_block_issues 的最终值在末尾 design_block_report JSON 块统一返回(见文末「design_block_report 返回规范」)。 + +--- + ### 第1步:读取设计文档 **目标**:从设计文档中提取前端开发所需的信息 @@ -643,6 +714,47 @@ fi **默认行为**:代码生成完成且编译验证通过后执行 +### design_block_report 返回规范(v4.7 新增,配合 dev-flow Stage 3 协调循环) + +本 Agent 作为 dev-flow Stage 3 subagent 运行时,**必须在返回文本末尾追加 design_block_report JSON 块**,供主会话解析决策(是否收敛/是否调 des-xxx 修补/是否上传石墨)。 + +**返回格式**(严格用 ```json 代码块包裹,置于返回文本最末尾): + +```json +{ + "code_complete": true, + "design_block_issues": [], + "progress_note": "代码开发完成,已生成 Component/Service/Store" +} +``` + +**字段语义**: + +| 字段 | 类型 | 语义 | +|---|---|---| +| code_complete | bool | true=代码开发完成(主会话进入收敛流程:审查设计修改+上传石墨);false=遇设计阻塞无法继续(主会话调 des-xxx patch_mode 修补后重启本 Agent) | +| design_block_issues | array | 设计阻塞清单(空数组=无阻塞)。每项含 id/category/location/description/suggestion/severity/touches_api | +| progress_note | string | 进度说明(已生成什么、阻塞在哪) | + +**design_block_issues 单项 schema**: +```json +{ + "id": "DB-001", + "category": "api_endpoint|component_design|state_management|interaction|config", + "location": "设计文档 §3.2 组件设计", + "description": "组件结构未定义", + "suggestion": "补充页面组件拆分与布局", + "severity": "critical|high|medium", + "touches_api": true +} +``` + +**两种返回场景**: +- 代码完成:`code_complete=true`,`design_block_issues=[]`(或含降级处理的 high 项供知会) +- 设计阻塞:`code_complete=false`,`design_block_issues=[critical/high 项]`,不强行生成不完整代码 + +**与已有产物覆盖**:主会话修补设计后重启本 Agent 时,注入【已有产物路径】,本 Agent 用 Edit 覆盖已生成代码继续,不从头重建。 + ### 协议执行 ```markdown -- Gitee From 458aee4ed685d77abbd85cb18ef8f0f8e15c8d32 Mon Sep 17 00:00:00 2001 From: ciel111 Date: Thu, 16 Jul 2026 20:31:36 +0800 Subject: [PATCH 04/13] #AI commit# Align the number of stages --- .claude/commands/dev-flow.md | 2 +- .../config/dev-flow-checklists/stage-hooks.md | 6 +- .../dev-flow-checklists/standalone-mode.md | 2 +- .version-lock.json | 89 ++++++++++--------- 4 files changed, 50 insertions(+), 49 deletions(-) diff --git a/.claude/commands/dev-flow.md b/.claude/commands/dev-flow.md index a34d13fe..89e99200 100644 --- a/.claude/commands/dev-flow.md +++ b/.claude/commands/dev-flow.md @@ -946,7 +946,7 @@ Skill(version-change-order-generator, args={"versionPlanId": selected_id}) **概要**:幂等性检查→关联需求前置→启动确认→P0-P7前置步骤→并行启动(步骤A-F)→逐阶段Subagent启动(步骤E)。 -#### 17阶段推进与阶段后置动作 +#### 21阶段推进与阶段后置动作 > ⚠️ **详细执行流程已外置,禁止凭记忆执行!** > 执行此操作前,**必须** Read 以下清单文件后按步骤执行: diff --git a/.claude/config/dev-flow-checklists/stage-hooks.md b/.claude/config/dev-flow-checklists/stage-hooks.md index 85287b5e..4a0a86a2 100644 --- a/.claude/config/dev-flow-checklists/stage-hooks.md +++ b/.claude/config/dev-flow-checklists/stage-hooks.md @@ -1,10 +1,10 @@ -# 18阶段推进与后置动作指引 +# 21阶段推进与后置动作指引 -> 来源:dev-flow.md "17阶段有序推进规则" + "逐阶段执行流程" + "阶段Prompt构造规则" + "阶段后置动作映射表" + "阶段后置动作执行指引"章节 +> 来源:dev-flow.md "21阶段有序推进规则" + "逐阶段执行流程" + "阶段Prompt构造规则" + "阶段后置动作映射表" + "阶段后置动作执行指引"章节 > v4.9 G4 新增:Stage 3.5 插件开发迭代评估循环(仅 dev_target=Agent/Skill/Command 触发) > 用途:执行版本模式逐阶段推进时必须Read本文件,按步骤逐项执行 -## 18阶段有序推进规则 +## 21阶段有序推进规则 ``` STAGE_ORDER = [0, 1, 1.1, 1.2, 1.6, 2, 2.1, 2.2, 3, 3.1, 3.2, 3.5, 4, 5, 5.5, 6, 6.1, 7, 8, 9, 10] diff --git a/.claude/config/dev-flow-checklists/standalone-mode.md b/.claude/config/dev-flow-checklists/standalone-mode.md index 663e767e..e6ec1e2b 100644 --- a/.claude/config/dev-flow-checklists/standalone-mode.md +++ b/.claude/config/dev-flow-checklists/standalone-mode.md @@ -346,7 +346,7 @@ P7. 知识库构建(可跳过): #### STAGE_ORDER逐阶段控制 -与版本模式相同(STAGE_ORDER = [0, 1, 1.1, 1.2, 1.6, 2, 2.1, 2.2, 3, 3.1, 3.2, 3.5, 4, 5, 5.5, 6, 6.1, 7, 8, 9]),差异如下: +需求级阶段与版本模式相同(STAGE_ORDER = [0, 1, 1.1, 1.2, 1.6, 2, 2.1, 2.2, 3, 3.1, 3.2, 3.5, 4, 5, 5.5, 6, 6.1, 7, 8, 9],共 20 项);版本模式额外含版本级 stage 10(版本级回归测试,Stage 9 通过后 GOTO 触发,共 21 项),单需求模式无 stage 10。差异如下: | 项目 | 版本模式 | 单需求模式 | |------|---------|----------| diff --git a/.version-lock.json b/.version-lock.json index 67966c45..a06ba5ac 100644 --- a/.version-lock.json +++ b/.version-lock.json @@ -1,6 +1,6 @@ { "schema_version": "3.0", - "current_version": "4.9", + "current_version": "4.10", "release_date": "2026-07-16", "status": "development", "agents": { @@ -68,32 +68,32 @@ "last_modified": "2025-01-12" }, "des-enhance-feature": { - "version": "4.9", - "last_modified": "2026-07-06" + "version": "4.10", + "last_modified": "2026-07-16" }, "des-fix-bug": { - "version": "4.9", - "last_modified": "2026-07-06" + "version": "4.10", + "last_modified": "2026-07-16" }, "des-integrate": { - "version": "4.9", - "last_modified": "2026-07-06" + "version": "4.10", + "last_modified": "2026-07-16" }, "des-new-feature": { - "version": "4.9", - "last_modified": "2026-07-06" + "version": "4.10", + "last_modified": "2026-07-16" }, "des-optimize": { - "version": "4.9", - "last_modified": "2026-07-06" + "version": "4.10", + "last_modified": "2026-07-16" }, "des-recheck-orchestrator": { "version": "4.8", "last_modified": "2026-06-23" }, "des-refactor": { - "version": "4.9", - "last_modified": "2026-07-06" + "version": "4.10", + "last_modified": "2026-07-16" } }, "development": { @@ -102,40 +102,40 @@ "last_modified": "2026-06-01" }, "frontend-code-developer": { - "version": "4.6", - "last_modified": "2026-06-01" + "version": "4.7", + "last_modified": "2026-07-16" }, "go-code-developer": { - "version": "4.7", - "last_modified": "2026-07-08" + "version": "4.8", + "last_modified": "2026-07-16" }, "go-code-review": { "version": "1.3", "last_modified": "2026-07-08" }, "java-code-developer": { - "version": "4.8", - "last_modified": "2026-07-15" + "version": "4.9", + "last_modified": "2026-07-16" }, "java-code-review": { "version": "1.2", "last_modified": "2026-06-26" }, "python-code-developer": { - "version": "4.8", - "last_modified": "2026-07-15" + "version": "4.9", + "last_modified": "2026-07-16" }, "python-code-review": { "version": "1.2", "last_modified": "2026-06-26" }, "typescript-code-developer": { - "version": "4.8", - "last_modified": "2026-07-15" + "version": "4.9", + "last_modified": "2026-07-16" }, "web-frontend-developer": { - "version": "4.6", - "last_modified": "2026-06-01" + "version": "4.7", + "last_modified": "2026-07-16" } }, "testing": { @@ -369,11 +369,12 @@ "3.0": 1, "3.1": 1, "3.3": 1, + "4.10": 6, "4.3": 1, - "4.6": 7, - "4.7": 3, - "4.8": 9, - "4.9": 17 + "4.6": 5, + "4.7": 4, + "4.8": 7, + "4.9": 14 }, "version_list": [ [ @@ -470,31 +471,31 @@ "agent", "design", "des-enhance-feature", - "4.9" + "4.10" ], [ "agent", "design", "des-fix-bug", - "4.9" + "4.10" ], [ "agent", "design", "des-integrate", - "4.9" + "4.10" ], [ "agent", "design", "des-new-feature", - "4.9" + "4.10" ], [ "agent", "design", "des-optimize", - "4.9" + "4.10" ], [ "agent", @@ -506,7 +507,7 @@ "agent", "design", "des-refactor", - "4.9" + "4.10" ], [ "agent", @@ -518,13 +519,13 @@ "agent", "development", "frontend-code-developer", - "4.6" + "4.7" ], [ "agent", "development", "go-code-developer", - "4.7" + "4.8" ], [ "agent", @@ -536,7 +537,7 @@ "agent", "development", "java-code-developer", - "4.8" + "4.9" ], [ "agent", @@ -548,7 +549,7 @@ "agent", "development", "python-code-developer", - "4.8" + "4.9" ], [ "agent", @@ -560,13 +561,13 @@ "agent", "development", "typescript-code-developer", - "4.8" + "4.9" ], [ "agent", "development", "web-frontend-developer", - "4.6" + "4.7" ], [ "agent", @@ -857,16 +858,16 @@ "1.0" ] ], - "total_versions": 16 + "total_versions": 17 }, "metadata": { "total_agents": 36, "total_skills": 33, "total_commands": 11, "total_components": 80, - "total_versions": 16, + "total_versions": 17, "last_release": "4.9", - "last_release_date": "2026-07-14" + "last_release_date": "2026-07-16" }, "rules": { "max_minor_version": 19, -- Gitee From eb06f2f29ae8b7d68f5fa092e584bc8218179d97 Mon Sep 17 00:00:00 2001 From: ciel111 Date: Fri, 17 Jul 2026 16:47:43 +0800 Subject: [PATCH 05/13] =?UTF-8?q?#AI=20commit#=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E9=98=B6=E6=AE=B55=E4=B8=AAdes=20agent=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AD=98=E9=87=8F=E4=BB=A3=E7=A0=81=E4=B8=8E=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A4=8D=E7=94=A8=E7=BA=A6=E6=9D=9FP0=E7=AB=A0=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit des-enhance/fix-bug/optimize/refactor/integrate新增复用约束(优先复用Service与数据访问层,约束数据访问层即约束db设计);数据访问层术语按语言适配(Java=Mapper/Repository,Go/TS=Repository,Python=Model无DAO概念);des-new-feature不动(全新功能从零合理);5个agent版本4.10->4.11,current_version4.10->4.11 Co-Authored-By: Claude --- .claude/agents/design/des-enhance-feature.md | 40 ++++- .claude/agents/design/des-fix-bug.md | 37 ++++- .claude/agents/design/des-integrate.md | 37 ++++- .claude/agents/design/des-optimize.md | 37 ++++- .claude/agents/design/des-refactor.md | 37 ++++- .version-lock.json | 45 +++--- docs/stage3-design-reuse-constraint-plan.md | 147 +++++++++++++++++++ 7 files changed, 348 insertions(+), 32 deletions(-) create mode 100644 docs/stage3-design-reuse-constraint-plan.md diff --git a/.claude/agents/design/des-enhance-feature.md b/.claude/agents/design/des-enhance-feature.md index 75b15390..2c8c3c01 100644 --- a/.claude/agents/design/des-enhance-feature.md +++ b/.claude/agents/design/des-enhance-feature.md @@ -2,10 +2,14 @@ name: des-enhance-feature type: design description: 功能增强设计专家,为现有模块设计兼容的扩展方案 -version: 4.10 +version: 4.11 author: DevSyncAgent Team -last_updated: 2026-07-16 +last_updated: 2026-07-17 changelog: + v4.11 - 2026-07-17 + - 🚨 P0新增「存量代码与数据复用约束」章节:不影响存量前提下优先复用已有 Service 与数据访问层;约束数据访问层即约束 db 设计;新增表前评估复用现有表 + - 数据访问层术语按语言适配(Java=Mapper/Repository, Go/TypeScript=Repository, Python=Model,Python 无 DAO 概念) + - 与现有第4步(扩展Service不修改签名)/第2.5步(复用Adapter)/第5步(数据模型变更)约束一致,互为补充 v4.10 - 2026-07-16 - 🆕 新增 patch_mode 增量修补模式(配合 dev-flow Stage 3 设计-开发协调循环)--按开发 Agent 返回的 design_block_issues 清单用 Edit 精准修补设计文档对应章节,不重新生成全文,输出改动摘要 JSON(含 touches_api 标记) - 🛡️ patch_mode 仅修改 issues 指向的章节,保护已检视通过的内容不被破坏 @@ -337,6 +341,38 @@ public class OrderServiceImpl implements OrderService { --- +## 🚨 存量代码与数据复用约束(P0级强制执行) + +> 适用范围:本 Agent 处理的需求均为基于存量系统的功能增强,必须在不影响存量代码逻辑的前提下,优先复用已有的业务层与数据访问层代码,避免过度新建类/方法/表。 +> 注:全新功能(NEW,由 des-new-feature 处理)从零设计,不受本约束限制。 + +### 1. 业务层(Service)复用 +- ✅ 优先在现有 Service 中扩展方法(不修改现有方法签名与行为),仅当现有 Service 无法承载时才新增 Service。 +- ❌ 禁止为可用现有方法承载的需求新建重复 Service。 + +### 2. 数据访问层复用(按项目技术栈选用术语) +| 语言 | 数据访问层 | 复用要求 | +|---|---|---| +| Java | Mapper(MyBatis)/Repository(JPA) | 复用现有 Mapper/Repository,不新建访问已有表的 DAO | +| Go | Repository | 复用现有 Repository | +| TypeScript | Repository(TypeORM)/Prisma | 复用现有 Repository/Prisma Service | +| Python | Model(SQLAlchemy)(无独立DAO层,Service直接操作Model) | 复用现有 Model,不新建映射已有表的 Model | + +⚠️ **约束数据访问层即约束 db 设计**:访问已有表的代码必须复用,不得新建重复的数据访问实现或重复的表映射。 + +### 3. db 设计复用 +- ✅ 新增表前必须评估是否可复用/扩展现有表(加字段优先于建新表)。 +- ✅ 确需新建表时,须在设计文档中说明无法复用现有表的理由。 +- ❌ 禁止为可由现有表承载的数据新建重复表。 + +### 4. 复用决策记录 +- 设计文档须列出“复用决策表”:现有资产(Service / 数据访问层 / 表)-> 复用 / 扩展 / 新建 -> 理由。 +- 涉及复用判定的关键决策,通过 AskUserQuestion 与用户确认(设计阶段为主会话,可交互)。 + +> 本约束与第4步设计策略(扩展现有 Service 不修改签名)、第2.5步(复用现有 Adapter)、第5步(数据模型变更)一致,互为补充。 + +--- + ## 设计流程 ### 第0.2步:检查远程仓库状态 🆕 diff --git a/.claude/agents/design/des-fix-bug.md b/.claude/agents/design/des-fix-bug.md index 19f88baf..ef5a3fb6 100644 --- a/.claude/agents/design/des-fix-bug.md +++ b/.claude/agents/design/des-fix-bug.md @@ -2,10 +2,13 @@ name: des-fix-bug type: design description: Bug修复方案设计专家,根据问题分析报告生成完整的修复方案(+Web Search) -version: 4.10 +version: 4.11 author: DevSyncAgent Team -last_updated: 2026-07-16 +last_updated: 2026-07-17 changelog: + v4.11 - 2026-07-17 + - 🚨 P0新增「存量代码与数据复用约束」章节:不影响存量前提下优先复用已有 Service 与数据访问层;约束数据访问层即约束 db 设计;新增表前评估复用现有表 + - 数据访问层术语按语言适配(Java=Mapper/Repository, Go/TypeScript=Repository, Python=Model,Python 无 DAO 概念) v4.10 - 2026-07-16 - 🆕 新增 patch_mode 增量修补模式(配合 dev-flow Stage 3 设计-开发协调循环)--按开发 Agent 返回的 design_block_issues 清单用 Edit 精准修补设计文档对应章节,不重新生成全文,输出改动摘要 JSON(含 touches_api 标记) - 🛡️ patch_mode 仅修改 issues 指向的章节,保护已检视通过的内容不被破坏 @@ -400,6 +403,36 @@ public class OrderServiceImpl implements OrderService { --- +## 🚨 存量代码与数据复用约束(P0级强制执行) + +> 适用范围:本 Agent 处理的需求均为基于存量系统的缺陷修复,必须在不影响存量代码逻辑的前提下,优先复用已有的业务层与数据访问层代码,避免过度新建类/方法/表。 +> 注:全新功能(NEW,由 des-new-feature 处理)从零设计,不受本约束限制。 + +### 1. 业务层(Service)复用 +- ✅ 优先在现有 Service 中扩展方法(不修改现有方法签名与行为),仅当现有 Service 无法承载时才新增 Service。 +- ❌ 禁止为可用现有方法承载的需求新建重复 Service。 + +### 2. 数据访问层复用(按项目技术栈选用术语) +| 语言 | 数据访问层 | 复用要求 | +|---|---|---| +| Java | Mapper(MyBatis)/Repository(JPA) | 复用现有 Mapper/Repository,不新建访问已有表的 DAO | +| Go | Repository | 复用现有 Repository | +| TypeScript | Repository(TypeORM)/Prisma | 复用现有 Repository/Prisma Service | +| Python | Model(SQLAlchemy)(无独立DAO层,Service直接操作Model) | 复用现有 Model,不新建映射已有表的 Model | + +⚠️ **约束数据访问层即约束 db 设计**:访问已有表的代码必须复用,不得新建重复的数据访问实现或重复的表映射。 + +### 3. db 设计复用 +- ✅ 新增表前必须评估是否可复用/扩展现有表(加字段优先于建新表)。 +- ✅ 确需新建表时,须在设计文档中说明无法复用现有表的理由。 +- ❌ 禁止为可由现有表承载的数据新建重复表。 + +### 4. 复用决策记录 +- 设计文档须列出“复用决策表”:现有资产(Service / 数据访问层 / 表)-> 复用 / 扩展 / 新建 -> 理由。 +- 涉及复用判定的关键决策,通过 AskUserQuestion 与用户确认(设计阶段为主会话,可交互)。 + +--- + ## 设计流程 ### 第0.2步:检查远程仓库状态 🆕 diff --git a/.claude/agents/design/des-integrate.md b/.claude/agents/design/des-integrate.md index b08c712b..a30130f1 100644 --- a/.claude/agents/design/des-integrate.md +++ b/.claude/agents/design/des-integrate.md @@ -2,10 +2,13 @@ name: des-integrate type: design description: 系统集成方案设计专家,设计第三方系统集成方案(+集成风险深度思考+Web Search) -version: 4.10 +version: 4.11 author: DevSyncAgent Team -last_updated: 2026-07-16 +last_updated: 2026-07-17 changelog: + v4.11 - 2026-07-17 + - 🚨 P0新增「存量代码与数据复用约束」章节:不影响存量前提下优先复用已有 Service 与数据访问层;约束数据访问层即约束 db 设计;新增表前评估复用现有表 + - 数据访问层术语按语言适配(Java=Mapper/Repository, Go/TypeScript=Repository, Python=Model,Python 无 DAO 概念) v4.10 - 2026-07-16 - 🆕 新增 patch_mode 增量修补模式(配合 dev-flow Stage 3 设计-开发协调循环)--按开发 Agent 返回的 design_block_issues 清单用 Edit 精准修补设计文档对应章节,不重新生成全文,输出改动摘要 JSON(含 touches_api 标记) - 🛡️ patch_mode 仅修改 issues 指向的章节,保护已检视通过的内容不被破坏 @@ -504,6 +507,36 @@ END --- +## 🚨 存量代码与数据复用约束(P0级强制执行) + +> 适用范围:本 Agent 处理的需求均为基于存量系统的系统集成,必须在不影响存量代码逻辑的前提下,优先复用已有的业务层与数据访问层代码,避免过度新建类/方法/表。 +> 注:全新功能(NEW,由 des-new-feature 处理)从零设计,不受本约束限制。 + +### 1. 业务层(Service)复用 +- ✅ 优先在现有 Service 中扩展方法(不修改现有方法签名与行为),仅当现有 Service 无法承载时才新增 Service。 +- ❌ 禁止为可用现有方法承载的需求新建重复 Service。 + +### 2. 数据访问层复用(按项目技术栈选用术语) +| 语言 | 数据访问层 | 复用要求 | +|---|---|---| +| Java | Mapper(MyBatis)/Repository(JPA) | 复用现有 Mapper/Repository,不新建访问已有表的 DAO | +| Go | Repository | 复用现有 Repository | +| TypeScript | Repository(TypeORM)/Prisma | 复用现有 Repository/Prisma Service | +| Python | Model(SQLAlchemy)(无独立DAO层,Service直接操作Model) | 复用现有 Model,不新建映射已有表的 Model | + +⚠️ **约束数据访问层即约束 db 设计**:访问已有表的代码必须复用,不得新建重复的数据访问实现或重复的表映射。 + +### 3. db 设计复用 +- ✅ 新增表前必须评估是否可复用/扩展现有表(加字段优先于建新表)。 +- ✅ 确需新建表时,须在设计文档中说明无法复用现有表的理由。 +- ❌ 禁止为可由现有表承载的数据新建重复表。 + +### 4. 复用决策记录 +- 设计文档须列出“复用决策表”:现有资产(Service / 数据访问层 / 表)-> 复用 / 扩展 / 新建 -> 理由。 +- 涉及复用判定的关键决策,通过 AskUserQuestion 与用户确认(设计阶段为主会话,可交互)。 + +--- + ## 设计流程 ### 第0.2步:检查远程仓库状态 🆕 diff --git a/.claude/agents/design/des-optimize.md b/.claude/agents/design/des-optimize.md index 3ccb318e..66b086bf 100644 --- a/.claude/agents/design/des-optimize.md +++ b/.claude/agents/design/des-optimize.md @@ -2,10 +2,13 @@ name: des-optimize type: design description: 优化方案设计专家,设计性能/运维/代码优化方案,不涉及架构重构 -version: 4.10 +version: 4.11 author: DevSyncAgent Team -last_updated: 2026-07-16 +last_updated: 2026-07-17 changelog: + v4.11 - 2026-07-17 + - 🚨 P0新增「存量代码与数据复用约束」章节:不影响存量前提下优先复用已有 Service 与数据访问层;约束数据访问层即约束 db 设计;新增表前评估复用现有表 + - 数据访问层术语按语言适配(Java=Mapper/Repository, Go/TypeScript=Repository, Python=Model,Python 无 DAO 概念) v4.10 - 2026-07-16 - 🆕 新增 patch_mode 增量修补模式(配合 dev-flow Stage 3 设计-开发协调循环)--按开发 Agent 返回的 design_block_issues 清单用 Edit 精准修补设计文档对应章节,不重新生成全文,输出改动摘要 JSON(含 touches_api 标记) - 🛡️ patch_mode 仅修改 issues 指向的章节,保护已检视通过的内容不被破坏 @@ -336,6 +339,36 @@ public class OrderServiceImpl implements OrderService { --- +## 🚨 存量代码与数据复用约束(P0级强制执行) + +> 适用范围:本 Agent 处理的需求均为基于存量系统的性能/代码优化,必须在不影响存量代码逻辑的前提下,优先复用已有的业务层与数据访问层代码,避免过度新建类/方法/表。 +> 注:全新功能(NEW,由 des-new-feature 处理)从零设计,不受本约束限制。 + +### 1. 业务层(Service)复用 +- ✅ 优先在现有 Service 中扩展方法(不修改现有方法签名与行为),仅当现有 Service 无法承载时才新增 Service。 +- ❌ 禁止为可用现有方法承载的需求新建重复 Service。 + +### 2. 数据访问层复用(按项目技术栈选用术语) +| 语言 | 数据访问层 | 复用要求 | +|---|---|---| +| Java | Mapper(MyBatis)/Repository(JPA) | 复用现有 Mapper/Repository,不新建访问已有表的 DAO | +| Go | Repository | 复用现有 Repository | +| TypeScript | Repository(TypeORM)/Prisma | 复用现有 Repository/Prisma Service | +| Python | Model(SQLAlchemy)(无独立DAO层,Service直接操作Model) | 复用现有 Model,不新建映射已有表的 Model | + +⚠️ **约束数据访问层即约束 db 设计**:访问已有表的代码必须复用,不得新建重复的数据访问实现或重复的表映射。 + +### 3. db 设计复用 +- ✅ 新增表前必须评估是否可复用/扩展现有表(加字段优先于建新表)。 +- ✅ 确需新建表时,须在设计文档中说明无法复用现有表的理由。 +- ❌ 禁止为可由现有表承载的数据新建重复表。 + +### 4. 复用决策记录 +- 设计文档须列出“复用决策表”:现有资产(Service / 数据访问层 / 表)-> 复用 / 扩展 / 新建 -> 理由。 +- 涉及复用判定的关键决策,通过 AskUserQuestion 与用户确认(设计阶段为主会话,可交互)。 + +--- + ## 设计流程 ### 第0.2步:检查远程仓库状态 🆕 diff --git a/.claude/agents/design/des-refactor.md b/.claude/agents/design/des-refactor.md index 2dc7896a..9a2aeae9 100644 --- a/.claude/agents/design/des-refactor.md +++ b/.claude/agents/design/des-refactor.md @@ -2,10 +2,13 @@ name: des-refactor type: design description: 重构方案设计专家,设计架构级重构方案(+影响分析深度思考) -version: 4.10 +version: 4.11 author: DevSyncAgent Team -last_updated: 2026-07-16 +last_updated: 2026-07-17 changelog: + v4.11 - 2026-07-17 + - 🚨 P0新增「存量代码与数据复用约束」章节:不影响存量前提下优先复用已有 Service 与数据访问层;约束数据访问层即约束 db 设计;新增表前评估复用现有表 + - 数据访问层术语按语言适配(Java=Mapper/Repository, Go/TypeScript=Repository, Python=Model,Python 无 DAO 概念) v4.10 - 2026-07-16 - 🆕 新增 patch_mode 增量修补模式(配合 dev-flow Stage 3 设计-开发协调循环)--按开发 Agent 返回的 design_block_issues 清单用 Edit 精准修补设计文档对应章节,不重新生成全文,输出改动摘要 JSON(含 touches_api 标记) - 🛡️ patch_mode 仅修改 issues 指向的章节,保护已检视通过的内容不被破坏 @@ -443,6 +446,36 @@ public class UserServiceImpl implements UserService { --- +## 🚨 存量代码与数据复用约束(P0级强制执行) + +> 适用范围:本 Agent 处理的需求均为基于存量系统的架构重构,必须在不影响存量代码逻辑的前提下,优先复用已有的业务层与数据访问层代码,避免过度新建类/方法/表。 +> 注:全新功能(NEW,由 des-new-feature 处理)从零设计,不受本约束限制。 + +### 1. 业务层(Service)复用 +- ✅ 优先在现有 Service 中扩展方法(不修改现有方法签名与行为),仅当现有 Service 无法承载时才新增 Service。 +- ❌ 禁止为可用现有方法承载的需求新建重复 Service。 + +### 2. 数据访问层复用(按项目技术栈选用术语) +| 语言 | 数据访问层 | 复用要求 | +|---|---|---| +| Java | Mapper(MyBatis)/Repository(JPA) | 复用现有 Mapper/Repository,不新建访问已有表的 DAO | +| Go | Repository | 复用现有 Repository | +| TypeScript | Repository(TypeORM)/Prisma | 复用现有 Repository/Prisma Service | +| Python | Model(SQLAlchemy)(无独立DAO层,Service直接操作Model) | 复用现有 Model,不新建映射已有表的 Model | + +⚠️ **约束数据访问层即约束 db 设计**:访问已有表的代码必须复用,不得新建重复的数据访问实现或重复的表映射。 + +### 3. db 设计复用 +- ✅ 新增表前必须评估是否可复用/扩展现有表(加字段优先于建新表)。 +- ✅ 确需新建表时,须在设计文档中说明无法复用现有表的理由。 +- ❌ 禁止为可由现有表承载的数据新建重复表。 + +### 4. 复用决策记录 +- 设计文档须列出“复用决策表”:现有资产(Service / 数据访问层 / 表)-> 复用 / 扩展 / 新建 -> 理由。 +- 涉及复用判定的关键决策,通过 AskUserQuestion 与用户确认(设计阶段为主会话,可交互)。 + +--- + ## 设计流程 ### 第0.2步:检查远程仓库状态 🆕 diff --git a/.version-lock.json b/.version-lock.json index a06ba5ac..9165d838 100644 --- a/.version-lock.json +++ b/.version-lock.json @@ -1,7 +1,7 @@ { "schema_version": "3.0", - "current_version": "4.10", - "release_date": "2026-07-16", + "current_version": "4.11", + "release_date": "2026-07-17", "status": "development", "agents": { "requirement": { @@ -68,32 +68,32 @@ "last_modified": "2025-01-12" }, "des-enhance-feature": { - "version": "4.10", - "last_modified": "2026-07-16" + "version": "4.11", + "last_modified": "2026-07-17" }, "des-fix-bug": { - "version": "4.10", - "last_modified": "2026-07-16" + "version": "4.11", + "last_modified": "2026-07-17" }, "des-integrate": { - "version": "4.10", - "last_modified": "2026-07-16" + "version": "4.11", + "last_modified": "2026-07-17" }, "des-new-feature": { "version": "4.10", "last_modified": "2026-07-16" }, "des-optimize": { - "version": "4.10", - "last_modified": "2026-07-16" + "version": "4.11", + "last_modified": "2026-07-17" }, "des-recheck-orchestrator": { "version": "4.8", "last_modified": "2026-06-23" }, "des-refactor": { - "version": "4.10", - "last_modified": "2026-07-16" + "version": "4.11", + "last_modified": "2026-07-17" } }, "development": { @@ -369,7 +369,8 @@ "3.0": 1, "3.1": 1, "3.3": 1, - "4.10": 6, + "4.10": 1, + "4.11": 5, "4.3": 1, "4.6": 5, "4.7": 4, @@ -471,19 +472,19 @@ "agent", "design", "des-enhance-feature", - "4.10" + "4.11" ], [ "agent", "design", "des-fix-bug", - "4.10" + "4.11" ], [ "agent", "design", "des-integrate", - "4.10" + "4.11" ], [ "agent", @@ -495,7 +496,7 @@ "agent", "design", "des-optimize", - "4.10" + "4.11" ], [ "agent", @@ -507,7 +508,7 @@ "agent", "design", "des-refactor", - "4.10" + "4.11" ], [ "agent", @@ -858,16 +859,16 @@ "1.0" ] ], - "total_versions": 17 + "total_versions": 18 }, "metadata": { "total_agents": 36, "total_skills": 33, "total_commands": 11, "total_components": 80, - "total_versions": 17, - "last_release": "4.9", - "last_release_date": "2026-07-16" + "total_versions": 18, + "last_release": "4.10", + "last_release_date": "2026-07-17" }, "rules": { "max_minor_version": 19, diff --git a/docs/stage3-design-reuse-constraint-plan.md b/docs/stage3-design-reuse-constraint-plan.md new file mode 100644 index 00000000..30b19791 --- /dev/null +++ b/docs/stage3-design-reuse-constraint-plan.md @@ -0,0 +1,147 @@ +# 设计阶段 5 个 des-xxx Agent 新增"存量代码与数据复用约束"改造方案 + +## 一、背景与决策 + +**问题**:代码开发阶段对简单需求过度设计——新增大量类/方法、db 不复用已有表而新建表。 + +**根因核查结论**(前 7 轮对话已确认): +- des-new-feature 第1步明确"从零设计、不复用现有业务组件"(:661-668),但这是**全新功能**的合理策略 → **不修改**。 +- 其余 5 个 des-xxx(enhance/fix-bug/optimize/refactor/integrate)**均无明确的"优先复用现有代码和 db"约束**;db 层 6 个 agent 普遍缺复用闸门。 +- 代码开发阶段 4 种后端语言 agent 的数据访问层术语不同:Java=Mapper/Repository(DAO)、Go=Repository、TypeScript=Repository(TypeORM)/Prisma、**Python 无 DAO 概念**(Service 直接操作 Model)。 + +**用户决策**: +- des-new-feature 保持不动(全新功能从零合理)。 +- 其余 5 个 agent 新增约束:"在不影响存量代码逻辑前提下,复用已有 service 和数据访问层代码;约束数据访问层即约束 db 设计"。 +- 约束术语按语言适配(Python 用 Model,不用 DAO)。 + +## 二、改造范围 + +| Agent | 改动 | 当前版本 | 目标版本 | +|---|---|---|---| +| des-new-feature | ❌ 不修改 | 4.10 | 4.10 | +| des-enhance-feature | ✅ 新增约束(整合现有) | 4.10 | 4.11 | +| des-fix-bug | ✅ 新增约束 | 4.10 | 4.11 | +| des-optimize | ✅ 新增约束 | 4.10 | 4.11 | +| des-refactor | ✅ 新增约束 | 4.10 | 4.11 | +| des-integrate | ✅ 新增约束 | 4.10 | 4.11 | + +版本天花板:current_version 4.10 → 4.11(5 个 agent 已达天花板 4.10,修改必须提天花板)。 + +## 三、统一约束文本(插入 5 个 agent) + +插入位置:每个 agent 的 `## 设计流程` 章节之前(即 `## 📝 代码边界规则` 章节之后)。 + +插入锚点行号(`## 设计流程` 所在行,在其前插入): +- des-enhance-feature: :340 +- des-fix-bug: :403 +- des-optimize: :339 +- des-integrate: :507 +- des-refactor: :446 + +**约束章节内容**(统一模板,仅开头"{类型说明}"按 agent 替换): + +```markdown +## 🚨 存量代码与数据复用约束(P0级强制执行) + +> 适用范围:本 Agent 处理的需求均为基于存量系统的{类型说明},必须在不影响存量代码逻辑的前提下,优先复用已有的业务层与数据访问层代码,避免过度新建类/方法/表。 +> 注:全新功能(NEW,由 des-new-feature 处理)从零设计,不受本约束限制。 + +### 1. 业务层(Service)复用 +- ✅ 优先在现有 Service 中扩展方法(不修改现有方法签名与行为),仅当现有 Service 无法承载时才新增 Service。 +- ❌ 禁止为可用现有方法承载的需求新建重复 Service。 + +### 2. 数据访问层复用(按项目技术栈选用术语) +| 语言 | 数据访问层 | 复用要求 | +|---|---|---| +| Java | Mapper(MyBatis)/Repository(JPA) | 复用现有 Mapper/Repository,不新建访问已有表的 DAO | +| Go | Repository | 复用现有 Repository | +| TypeScript | Repository(TypeORM)/Prisma | 复用现有 Repository/Prisma Service | +| Python | Model(SQLAlchemy)(无独立DAO层,Service直接操作Model) | 复用现有 Model,不新建映射已有表的 Model | + +⚠️ **约束数据访问层即约束 db 设计**:访问已有表的代码必须复用,不得新建重复的数据访问实现或重复的表映射。 + +### 3. db 设计复用 +- ✅ 新增表前必须评估是否可复用/扩展现有表(加字段优先于建新表)。 +- ✅ 确需新建表时,须在设计文档中说明无法复用现有表的理由。 +- ❌ 禁止为可由现有表承载的数据新建重复表。 + +### 4. 复用决策记录 +- 设计文档须列出"复用决策表":现有资产(Service / 数据访问层 / 表)→ 复用 / 扩展 / 新建 → 理由。 +- 涉及复用判定的关键决策,通过 AskUserQuestion 与用户确认(设计阶段为主会话,可交互)。 +``` + +**类型说明替换**: +- des-enhance-feature:功能增强 +- des-fix-bug:缺陷修复 +- des-optimize:性能/代码优化 +- des-refactor:架构重构 +- des-integrate:系统集成 + +## 四、各 agent 额外改动 + +### 1. frontmatter 版本升级(5 个 agent 统一) +- `version: 4.10` → `version: 4.11` +- `last_updated: 2026-07-16` → `2026-07-17` +- changelog 顶部新增: + ``` + v4.11 - 2026-07-17 + - 🚨 P0新增「存量代码与数据复用约束」章节:不影响存量前提下优先复用已有 Service 与数据访问层;约束数据访问层即约束 db 设计;新增表前评估复用现有表 + - 数据访问层术语按语言适配(Java=Mapper/Repository, Go/TypeScript=Repository, Python=Model,Python 无 DAO 概念) + ``` + +### 2. des-enhance-feature 整合(避免与现有约束冲突/重复) +des-enhance 现有约束保留(作为 ENHANCE 类型的步骤细化,与新 P0 总纲一致、互为补充): +- :730-732 第4步"在现有Service添加新方法、不修改签名" → 保留 +- :761 第2.5步"复用现有Adapter" → 保留(外部依赖维度,与新约束的数据访问层维度不重叠) +- :818 第5步"数据模型变更(变更字段表格)" → 保留 + +在 des-enhance 新约束章节末尾追加一句衔接: +> 本约束与第4步设计策略(扩展现有 Service 不修改签名)、第2.5步(复用现有 Adapter)、第5步(数据模型变更)一致,互为补充。 + +## 五、版本管理流程(CLAUDE.md P0 强制) + +```bash +# 1. 提版本天花板 4.10 -> 4.11(5 个 agent 已达天花板,必须先提天花板) +python .claude/dev-tools/version-manager/release-init.py --version 4.11 + +# 2. 修改 5 个 agent 文件(Edit 新增约束章节 + frontmatter version/changelog) + +# 3. 批量升级修改的 agent 版本号(确认 5 个 agent -> 4.11) +python .claude/dev-tools/version-manager/batch-upgrade-changed.py --version 4.11 + +# 4. 同步版本锁文件 +python .claude/dev-tools/version-manager/sync-lock.py + +# 5. 合规性检查(必须通过:所有 agent 版本 <= current_version 4.11) +python .claude/dev-tools/version-compliance-checker/check.py + +# 6. 提交(触发 pre-commit-check-enhanced.py hook) +git add . && git commit -m "..." +``` + +## 六、验证清单 + +- [ ] 5 个 agent 均新增「存量代码与数据复用约束」章节,位置在「代码边界规则」后、「设计流程」前 +- [ ] 5 个 agent 约束文本的"{类型说明}"已正确替换 +- [ ] des-enhance 约束章节末尾有衔接句,现有 :730-732/:761/:818 未被删除 +- [ ] 5 个 agent frontmatter version=4.11,changelog 含 v4.11 条目 +- [ ] des-new-feature 未被修改(保持 4.10) +- [ ] release-init 4.11 后 current_version=4.11,status=development +- [ ] sync-lock.py 输出 5 个 des agent 版本=4.11,des-new-feature=4.10 +- [ ] version-compliance-checker/check.py 通过(无版本超天花板) +- [ ] git commit pre-commit hook 通过 + +## 七、风险与回滚 + +**风险**: +1. release-init 4.11 会将开发版本从 4.10 推进到 4.11。若 4.10 有未发布的正式变更,需先确认 4.10 是否需要正式 release。当前 status=development,4.10 未 released,release-init 4.11 直接推进开发版本,符合"按需升级"。 +2. des-enhance 新约束与现有 :730-732 措辞部分重叠(均讲"扩展现有 Service")。已通过"总纲+细化"定位处理,并在衔接句明确关系,不冲突。 +3. 约束文本含 4 语言术语表格,对单语言项目略显冗余,但保证 des-xxx(语言无关)通用性。可接受。 + +**回滚**:若改造有问题,`git revert` 本次 commit 即可恢复 5 个 agent 到 4.10。 + +## 八、不涉及 +- des-new-feature:不改(全新功能从零策略合理) +- 开发阶段 code-developer agent:不改(复用由设计文档约束传导,developer P0 忠于设计文档,设计文档含复用约束即生效) +- enforce-checklist.py:不适用(本任务改 agent prompt .md,非 Python 工具实施,无 spec doc / try-except) +- 模板联动更新:本次仅新增 agent 约束章节,不改模板字段结构,非 M/L 级模板变更,不触发模板联动 -- Gitee From 88e645bce94686690810254d610242f1e8fe8164 Mon Sep 17 00:00:00 2001 From: ciel111 Date: Mon, 20 Jul 2026 15:21:29 +0800 Subject: [PATCH 06/13] #AI commit# Design-Development Cycle Optimization --- .../config/dev-flow-checklists/stage-hooks.md | 101 ++++++++++++++---- .../dev-flow-checklists/standalone-mode.md | 101 ++++++++++++++---- 2 files changed, 158 insertions(+), 44 deletions(-) diff --git a/.claude/config/dev-flow-checklists/stage-hooks.md b/.claude/config/dev-flow-checklists/stage-hooks.md index 4a0a86a2..41dffe44 100644 --- a/.claude/config/dev-flow-checklists/stage-hooks.md +++ b/.claude/config/dev-flow-checklists/stage-hooks.md @@ -376,31 +376,88 @@ WHILE cycle_count < MAX_CYCLES: 输出 "ℹ️ 已跳过Stage {stage}检视Agent,继续执行该阶段后置Hook" → 跳到步骤8(不启动检视Agent,不执行本阶段优化交互) - ELIF stage == 3 AND len(selected_agents) >= 1 THEN - IF len(selected_agents) == 1 THEN - 标准串行执行:Agent(subagent_type: selected_agents[0], prompt: 构造的Prompt) - ELSE - 【多Agent串行执行】 - stage3_completed = [] - stage3_failed = [] - FOR each agent IN selected_agents: - 构造Agent专属Prompt: - - 后端Agent: 【设计文档路径】:{后端设计.md或设计.md},【开发范围】:后端(Controller/Service/Entity等) - - 前端Agent: 【设计文档路径】:{前端设计.md},【开发范围】:前端(页面/组件/API封装等) - Agent(subagent_type: agent, prompt: 构造的Prompt) - IF 成功 → stage3_completed.append(agent) - IF 失败 → stage3_failed.append(agent),继续下一个Agent(不中止) - END FOR - 【Stage 3多Agent完成判定规则】 - IF len(stage3_failed) == 0 THEN - → Stage 3全部完成,推进到Stage 3.1 - ELIF len(stage3_completed) > 0 THEN - → 部分完成 - AskUserQuestion("Stage 3部分完成:✅{stage3_completed} ❌{stage3_failed},如何处理?", - ["继续下一阶段(忽略失败Agent)", "重试失败Agent", "中止流程"]) + # ⭐设计-开发协调循环(修复循环断链):开发Agent返回 design_block_report -> 主会话解析 -> 调 des-xxx patch_mode 修补设计文档 -> 重启开发Agent -> 循环到 code_complete=true + cycle = 0; MAX_CYCLES = 3; user_intervene = 0; MAX_USER_INTERVENE = 3; aborted = false + des_agent = 按需求类型(requirement_type)从映射表(第43-48行)取 des-xxx(NEW->des-new-feature / ENHANCE->des-enhance-feature / FIX->des-fix-bug / OPTIMIZE->des-optimize / REFACTOR->des-refactor / INTEGRATE->des-integrate) + design_doc_path = 从 versions.json 该需求 design_doc_path 字段读取(Stage 2 产物路径,split多文档取后端设计.md) + + WHILE True: + # 6.A 启动/重启开发 Agent(prompt含【已有产物路径】,已生成的代码用 Edit 覆盖继续,不从头重建) + IF len(selected_agents) == 1 THEN + result = Agent(subagent_type: selected_agents[0], prompt: 构造的Prompt) ELSE - → 全部失败,按现有容错模式处理 + 【多Agent串行执行,任一 code_complete=false 即中断全部】 + stage3_completed = []; stage3_failed = []; blocked_result = None + FOR each agent IN selected_agents: + 构造Agent专属Prompt: + - 后端Agent: 【设计文档路径】:{后端设计.md或设计.md},【开发范围】:后端(Controller/Service/Entity等) + - 前端Agent: 【设计文档路径】:{前端设计.md},【开发范围】:前端(页面/组件/API封装等) + r = Agent(subagent_type: agent, prompt: 构造的Prompt) + p = parse_design_block_report(r) # 解析末尾 ```json 块,schema见6.B + IF p.code_complete == false: + blocked_result = r # 设计阻塞(critical缺失),中断后续Agent,走6.C patch循环 + BREAK FOR + IF Agent执行报错/异常退出 -> stage3_failed.append(agent),继续下一个Agent(不中止,与code_complete=false区分) + stage3_completed.append(agent) + END FOR + IF blocked_result != None THEN + result = blocked_result # 有设计阻塞,走6.C调 des-xxx patch + ELIF len(stage3_failed) == 0 THEN + result = 最后一个Agent的result # 全部成功,6.C判定 code_complete=true -> BREAK + ELIF len(stage3_completed) > 0 THEN + -> 部分完成(有报错但无阻塞) + AskUserQuestion("Stage 3部分完成:✅{stage3_completed} ❌{stage3_failed},如何处理?", + ["继续下一阶段(忽略失败Agent)", "重试失败Agent", "中止流程"]) + IF "继续下一阶段" -> result = 最后一个完成Agent的result(6.C判定 code_complete=true -> BREAK) + IF "重试失败Agent" -> CONTINUE(重启6.A,已完成的Agent注入已有产物覆盖继续) + IF "中止流程" -> aborted = true; BREAK + ELSE + -> 全部失败,按现有容错模式处理 + END IF + END IF + + # 6.B 解析 design_block_report(仿步骤8.4 的 JSON 块解析,解析返回文本末尾 ```json ... ``` 代码块) + parsed = parse_design_block_report(result) + # schema: {code_complete:bool, design_block_issues:[{id,category,location,description,suggestion,severity,touches_api}], progress_note:string} + IF JSON 解析失败 THEN + OUTPUT "⚠️ design_block_report 解析失败,fail-open 按 code_complete=true 放行" + parsed = {code_complete: true, design_block_issues: [], progress_note: "解析失败fail-open"} + END IF + + # 6.C 循环决策 + IF parsed.code_complete == true THEN + OUTPUT "✅ Stage 3 代码开发完成(cycle={cycle})" + BREAK # 退出循环 -> 步骤8.1 B4 转提测 -> Stage 3.1 + ELIF parsed.design_block_issues 非空 AND cycle < MAX_CYCLES THEN + OUTPUT "🔄 第{cycle+1}轮检测到设计阻塞(critical {count(severity==critical)} 个),调 {des_agent} patch_mode 修补设计文档" + patch_result = Agent(subagent_type: des_agent, + prompt: 【patch_mode】:true + 【design_doc_path】:design_doc_path + 【design_block_issues】:parsed.design_block_issues) + # des-xxx 直接改设计文档,不询问用户、不输出修改清单审查(石墨上传移至整个dev-flow流程末尾,防止反复上传) + OUTPUT "✅ {des_agent} 已修补设计文档:{patch_result.summary}" + cycle += 1 + CONTINUE # 重启 6.A(已完成的Agent注入已有产物覆盖继续) + ELIF cycle >= MAX_CYCLES THEN + # 超限:输出阻塞清单,用户介入 + IF user_intervene >= MAX_USER_INTERVENE THEN + OUTPUT "⚠️ 用户介入已达上限{MAX_USER_INTERVENE}次,强制中止" + aborted = true; BREAK + END IF + OUTPUT "❌ 自动协调已达上限{MAX_CYCLES}次,仍有设计阻塞:" + FOR each issue IN parsed.design_block_issues: + OUTPUT "- [{issue.severity}] {issue.location}: {issue.description}(建议:{issue.suggestion})" + END FOR + AskUserQuestion("已输出阻塞清单。请手动修改设计文档后选择", + ["我已修改设计文档,继续代码开发", "中止流程"]) + IF "中止流程" -> aborted = true; BREAK + IF "继续代码开发" -> user_intervene += 1; cycle = 0; CONTINUE END IF + END WHILE + IF aborted THEN + 更新 currentStage="3" + OUTPUT "⚠️ Stage 3 已中止,不执行 B4 转提测" + EXIT WHILE # 退出外层 WHILE cycle_count,中止整个流程 END IF + # 循环 BREAK 后 -> 步骤8.1 B4 转提测(在循环外,只执行一次,避免重复转提测) - ELSE(其他阶段): 从映射表获取该阶段的Agent/Skill列值 IF 映射值包含"(命令)"后缀 THEN ⭐v4.9 G4 新增 diff --git a/.claude/config/dev-flow-checklists/standalone-mode.md b/.claude/config/dev-flow-checklists/standalone-mode.md index e6ec1e2b..a3f61773 100644 --- a/.claude/config/dev-flow-checklists/standalone-mode.md +++ b/.claude/config/dev-flow-checklists/standalone-mode.md @@ -635,31 +635,88 @@ WHILE cycle_count < MAX_CYCLES: 输出 "ℹ️ 已跳过Stage {stage}检视Agent,继续执行该阶段本地后置动作" → 跳到步骤7(不启动检视Agent,不执行本阶段优化交互) - ELIF stage == 3 AND len(selected_agents) >= 1 THEN - IF len(selected_agents) == 1 THEN - 标准串行执行:Agent(subagent_type: selected_agents[0], prompt: 构造的Prompt) - ELSE - 【多Agent串行执行】(同版本模式逻辑) - stage3_completed = [] - stage3_failed = [] - FOR each agent IN selected_agents: - 构造Agent专属Prompt: - - 后端Agent: 【设计文档路径】:{后端设计.md或设计.md},【开发范围】:后端(Controller/Service/Entity等) - - 前端Agent: 【设计文档路径】:{前端设计.md},【开发范围】:前端(页面/组件/API封装等) - Agent(subagent_type: agent, prompt: 构造的Prompt) - IF 成功 → stage3_completed.append(agent) - IF 失败 → stage3_failed.append(agent),继续下一个Agent(不中止) - END FOR - 【Stage 3多Agent完成判定规则】 - IF len(stage3_failed) == 0 THEN - → Stage 3全部完成,推进到Stage 3.1 - ELIF len(stage3_completed) > 0 THEN - → 部分完成 - AskUserQuestion("Stage 3部分完成:✅{stage3_completed} ❌{stage3_failed},如何处理?", - ["继续下一阶段(忽略失败Agent)", "重试失败Agent", "中止流程"]) + # ⭐设计-开发协调循环(修复循环断链):开发Agent返回 design_block_report -> 主会话解析 -> 调 des-xxx patch_mode 修补设计文档 -> 重启开发Agent -> 循环到 code_complete=true + cycle = 0; MAX_CYCLES = 3; user_intervene = 0; MAX_USER_INTERVENE = 3; aborted = false + des_agent = 按需求类型(requirement_type)从映射表(stage-hooks.md第43-48行)取 des-xxx(NEW->des-new-feature / ENHANCE->des-enhance-feature / FIX->des-fix-bug / OPTIMIZE->des-optimize / REFACTOR->des-refactor / INTEGRATE->des-integrate) + design_doc_path = 从 context.md 的 design_doc_path 字段读取(Stage 2 产物路径,split多文档取后端设计.md) + + WHILE True: + # 6.A 启动/重启开发 Agent(prompt含【已有产物路径】,已生成的代码用 Edit 覆盖继续,不从头重建) + IF len(selected_agents) == 1 THEN + result = Agent(subagent_type: selected_agents[0], prompt: 构造的Prompt) ELSE - → 全部失败,按现有容错模式处理 + 【多Agent串行执行,任一 code_complete=false 即中断全部】(同版本模式逻辑) + stage3_completed = []; stage3_failed = []; blocked_result = None + FOR each agent IN selected_agents: + 构造Agent专属Prompt: + - 后端Agent: 【设计文档路径】:{后端设计.md或设计.md},【开发范围】:后端(Controller/Service/Entity等) + - 前端Agent: 【设计文档路径】:{前端设计.md},【开发范围】:前端(页面/组件/API封装等) + r = Agent(subagent_type: agent, prompt: 构造的Prompt) + p = parse_design_block_report(r) # 解析末尾 ```json 块,schema见6.B + IF p.code_complete == false: + blocked_result = r # 设计阻塞(critical缺失),中断后续Agent,走6.C patch循环 + BREAK FOR + IF Agent执行报错/异常退出 -> stage3_failed.append(agent),继续下一个Agent(不中止,与code_complete=false区分) + stage3_completed.append(agent) + END FOR + IF blocked_result != None THEN + result = blocked_result # 有设计阻塞,走6.C调 des-xxx patch + ELIF len(stage3_failed) == 0 THEN + result = 最后一个Agent的result # 全部成功,6.C判定 code_complete=true -> BREAK + ELIF len(stage3_completed) > 0 THEN + -> 部分完成(有报错但无阻塞) + AskUserQuestion("Stage 3部分完成:✅{stage3_completed} ❌{stage3_failed},如何处理?", + ["继续下一阶段(忽略失败Agent)", "重试失败Agent", "中止流程"]) + IF "继续下一阶段" -> result = 最后一个完成Agent的result(6.C判定 code_complete=true -> BREAK) + IF "重试失败Agent" -> CONTINUE(重启6.A,已完成的Agent注入已有产物覆盖继续) + IF "中止流程" -> aborted = true; BREAK + ELSE + -> 全部失败,按现有容错模式处理 + END IF + END IF + + # 6.B 解析 design_block_report(仿步骤8.4 的 JSON 块解析,解析返回文本末尾 ```json ... ``` 代码块) + parsed = parse_design_block_report(result) + # schema: {code_complete:bool, design_block_issues:[{id,category,location,description,suggestion,severity,touches_api}], progress_note:string} + IF JSON 解析失败 THEN + OUTPUT "⚠️ design_block_report 解析失败,fail-open 按 code_complete=true 放行" + parsed = {code_complete: true, design_block_issues: [], progress_note: "解析失败fail-open"} + END IF + + # 6.C 循环决策 + IF parsed.code_complete == true THEN + OUTPUT "✅ Stage 3 代码开发完成(cycle={cycle})" + BREAK # 退出循环 -> 推进 Stage 3.1(单需求模式无DPMS,B4转提测本就跳过) + ELIF parsed.design_block_issues 非空 AND cycle < MAX_CYCLES THEN + OUTPUT "🔄 第{cycle+1}轮检测到设计阻塞(critical {count(severity==critical)} 个),调 {des_agent} patch_mode 修补设计文档" + patch_result = Agent(subagent_type: des_agent, + prompt: 【patch_mode】:true + 【design_doc_path】:design_doc_path + 【design_block_issues】:parsed.design_block_issues) + # des-xxx 直接改设计文档,不询问用户、不输出修改清单审查(石墨上传移至整个dev-flow流程末尾,防止反复上传) + OUTPUT "✅ {des_agent} 已修补设计文档:{patch_result.summary}" + cycle += 1 + CONTINUE # 重启 6.A(已完成的Agent注入已有产物覆盖继续) + ELIF cycle >= MAX_CYCLES THEN + # 超限:输出阻塞清单,用户介入 + IF user_intervene >= MAX_USER_INTERVENE THEN + OUTPUT "⚠️ 用户介入已达上限{MAX_USER_INTERVENE}次,强制中止" + aborted = true; BREAK + END IF + OUTPUT "❌ 自动协调已达上限{MAX_CYCLES}次,仍有设计阻塞:" + FOR each issue IN parsed.design_block_issues: + OUTPUT "- [{issue.severity}] {issue.location}: {issue.description}(建议:{issue.suggestion})" + END FOR + AskUserQuestion("已输出阻塞清单。请手动修改设计文档后选择", + ["我已修改设计文档,继续代码开发", "中止流程"]) + IF "中止流程" -> aborted = true; BREAK + IF "继续代码开发" -> user_intervene += 1; cycle = 0; CONTINUE END IF + END WHILE + IF aborted THEN + 更新 context.md 的 currentStage="3" + OUTPUT "⚠️ Stage 3 已中止" + EXIT WHILE # 退出外层 WHILE cycle_count,中止整个流程 END IF + # 循环 BREAK 后 -> 推进 Stage 3.1(单需求模式无DPMS,B4转提测本就跳过,不重复触发) - ELSE(其他阶段): 从映射表获取该阶段的Agent/Skill列值 IF 映射值包含"(命令)"后缀 THEN ⭐v4.9 G4 新增 -- Gitee From 5c188c47959343706a2c881097b4b80e38926da8 Mon Sep 17 00:00:00 2001 From: ciel111 Date: Mon, 20 Jul 2026 15:44:51 +0800 Subject: [PATCH 07/13] #AI commit# Design-Development Cycle Optimization --- .../config/dev-flow-checklists/stage-hooks.md | 20 ++++++++++++++++--- .../dev-flow-checklists/standalone-mode.md | 20 ++++++++++++++++--- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/.claude/config/dev-flow-checklists/stage-hooks.md b/.claude/config/dev-flow-checklists/stage-hooks.md index 41dffe44..377b45a8 100644 --- a/.claude/config/dev-flow-checklists/stage-hooks.md +++ b/.claude/config/dev-flow-checklists/stage-hooks.md @@ -379,11 +379,18 @@ WHILE cycle_count < MAX_CYCLES: # ⭐设计-开发协调循环(修复循环断链):开发Agent返回 design_block_report -> 主会话解析 -> 调 des-xxx patch_mode 修补设计文档 -> 重启开发Agent -> 循环到 code_complete=true cycle = 0; MAX_CYCLES = 3; user_intervene = 0; MAX_USER_INTERVENE = 3; aborted = false des_agent = 按需求类型(requirement_type)从映射表(第43-48行)取 des-xxx(NEW->des-new-feature / ENHANCE->des-enhance-feature / FIX->des-fix-bug / OPTIMIZE->des-optimize / REFACTOR->des-refactor / INTEGRATE->des-integrate) - design_doc_path = 从 versions.json 该需求 design_doc_path 字段读取(Stage 2 产物路径,split多文档取后端设计.md) + raw_design_doc_path = 从 versions.json 该需求 design_doc_path 字段读取(Stage 2 产物路径) + IF raw_design_doc_path 含 ";" THEN # split多文档(后端设计.md;前端设计.md) + backend_design_path, frontend_design_path = raw_design_doc_path 按 ";" 拆分 + ELSE # 单文档(纯后端项目或未拆分) + backend_design_path = frontend_design_path = raw_design_doc_path + END IF + blocked_agent = None # 记录本轮阻塞的Agent,供6.C选对应设计文档路径 WHILE True: # 6.A 启动/重启开发 Agent(prompt含【已有产物路径】,已生成的代码用 Edit 覆盖继续,不从头重建) IF len(selected_agents) == 1 THEN + blocked_agent = selected_agents[0] # 单Agent,若阻塞就是它 result = Agent(subagent_type: selected_agents[0], prompt: 构造的Prompt) ELSE 【多Agent串行执行,任一 code_complete=false 即中断全部】 @@ -396,6 +403,7 @@ WHILE cycle_count < MAX_CYCLES: p = parse_design_block_report(r) # 解析末尾 ```json 块,schema见6.B IF p.code_complete == false: blocked_result = r # 设计阻塞(critical缺失),中断后续Agent,走6.C patch循环 + blocked_agent = agent # 记录阻塞的Agent,供6.C选对应设计文档路径 BREAK FOR IF Agent执行报错/异常退出 -> stage3_failed.append(agent),继续下一个Agent(不中止,与code_complete=false区分) stage3_completed.append(agent) @@ -429,9 +437,15 @@ WHILE cycle_count < MAX_CYCLES: OUTPUT "✅ Stage 3 代码开发完成(cycle={cycle})" BREAK # 退出循环 -> 步骤8.1 B4 转提测 -> Stage 3.1 ELIF parsed.design_block_issues 非空 AND cycle < MAX_CYCLES THEN - OUTPUT "🔄 第{cycle+1}轮检测到设计阻塞(critical {count(severity==critical)} 个),调 {des_agent} patch_mode 修补设计文档" + # 根据阻塞Agent选对应设计文档路径(修复:前端Agent阻塞修补前端设计.md,后端Agent阻塞修补后端设计.md) + IF blocked_agent IN [frontend-code-developer, web-frontend-developer] THEN + target_design_path = frontend_design_path + ELSE + target_design_path = backend_design_path + END IF + OUTPUT "🔄 第{cycle+1}轮检测到设计阻塞(critical {count(severity==critical)} 个,阻塞Agent: {blocked_agent}),调 {des_agent} patch_mode 修补设计文档:{target_design_path}" patch_result = Agent(subagent_type: des_agent, - prompt: 【patch_mode】:true + 【design_doc_path】:design_doc_path + 【design_block_issues】:parsed.design_block_issues) + prompt: 【patch_mode】:true + 【design_doc_path】:target_design_path + 【design_block_issues】:parsed.design_block_issues) # des-xxx 直接改设计文档,不询问用户、不输出修改清单审查(石墨上传移至整个dev-flow流程末尾,防止反复上传) OUTPUT "✅ {des_agent} 已修补设计文档:{patch_result.summary}" cycle += 1 diff --git a/.claude/config/dev-flow-checklists/standalone-mode.md b/.claude/config/dev-flow-checklists/standalone-mode.md index a3f61773..e04b7d95 100644 --- a/.claude/config/dev-flow-checklists/standalone-mode.md +++ b/.claude/config/dev-flow-checklists/standalone-mode.md @@ -638,11 +638,18 @@ WHILE cycle_count < MAX_CYCLES: # ⭐设计-开发协调循环(修复循环断链):开发Agent返回 design_block_report -> 主会话解析 -> 调 des-xxx patch_mode 修补设计文档 -> 重启开发Agent -> 循环到 code_complete=true cycle = 0; MAX_CYCLES = 3; user_intervene = 0; MAX_USER_INTERVENE = 3; aborted = false des_agent = 按需求类型(requirement_type)从映射表(stage-hooks.md第43-48行)取 des-xxx(NEW->des-new-feature / ENHANCE->des-enhance-feature / FIX->des-fix-bug / OPTIMIZE->des-optimize / REFACTOR->des-refactor / INTEGRATE->des-integrate) - design_doc_path = 从 context.md 的 design_doc_path 字段读取(Stage 2 产物路径,split多文档取后端设计.md) + raw_design_doc_path = 从 context.md 的 design_doc_path 字段读取(Stage 2 产物路径) + IF raw_design_doc_path 含 ";" THEN # split多文档(后端设计.md;前端设计.md) + backend_design_path, frontend_design_path = raw_design_doc_path 按 ";" 拆分 + ELSE # 单文档(纯后端项目或未拆分) + backend_design_path = frontend_design_path = raw_design_doc_path + END IF + blocked_agent = None # 记录本轮阻塞的Agent,供6.C选对应设计文档路径 WHILE True: # 6.A 启动/重启开发 Agent(prompt含【已有产物路径】,已生成的代码用 Edit 覆盖继续,不从头重建) IF len(selected_agents) == 1 THEN + blocked_agent = selected_agents[0] # 单Agent,若阻塞就是它 result = Agent(subagent_type: selected_agents[0], prompt: 构造的Prompt) ELSE 【多Agent串行执行,任一 code_complete=false 即中断全部】(同版本模式逻辑) @@ -655,6 +662,7 @@ WHILE cycle_count < MAX_CYCLES: p = parse_design_block_report(r) # 解析末尾 ```json 块,schema见6.B IF p.code_complete == false: blocked_result = r # 设计阻塞(critical缺失),中断后续Agent,走6.C patch循环 + blocked_agent = agent # 记录阻塞的Agent,供6.C选对应设计文档路径 BREAK FOR IF Agent执行报错/异常退出 -> stage3_failed.append(agent),继续下一个Agent(不中止,与code_complete=false区分) stage3_completed.append(agent) @@ -688,9 +696,15 @@ WHILE cycle_count < MAX_CYCLES: OUTPUT "✅ Stage 3 代码开发完成(cycle={cycle})" BREAK # 退出循环 -> 推进 Stage 3.1(单需求模式无DPMS,B4转提测本就跳过) ELIF parsed.design_block_issues 非空 AND cycle < MAX_CYCLES THEN - OUTPUT "🔄 第{cycle+1}轮检测到设计阻塞(critical {count(severity==critical)} 个),调 {des_agent} patch_mode 修补设计文档" + # 根据阻塞Agent选对应设计文档路径(修复:前端Agent阻塞修补前端设计.md,后端Agent阻塞修补后端设计.md) + IF blocked_agent IN [frontend-code-developer, web-frontend-developer] THEN + target_design_path = frontend_design_path + ELSE + target_design_path = backend_design_path + END IF + OUTPUT "🔄 第{cycle+1}轮检测到设计阻塞(critical {count(severity==critical)} 个,阻塞Agent: {blocked_agent}),调 {des_agent} patch_mode 修补设计文档:{target_design_path}" patch_result = Agent(subagent_type: des_agent, - prompt: 【patch_mode】:true + 【design_doc_path】:design_doc_path + 【design_block_issues】:parsed.design_block_issues) + prompt: 【patch_mode】:true + 【design_doc_path】:target_design_path + 【design_block_issues】:parsed.design_block_issues) # des-xxx 直接改设计文档,不询问用户、不输出修改清单审查(石墨上传移至整个dev-flow流程末尾,防止反复上传) OUTPUT "✅ {des_agent} 已修补设计文档:{patch_result.summary}" cycle += 1 -- Gitee From c98be332e027b25d5db24b393ca67a6a61b7b0ce Mon Sep 17 00:00:00 2001 From: ciel111 Date: Mon, 20 Jul 2026 17:37:52 +0800 Subject: [PATCH 08/13] #AI commit# New Requirement Name Naming Format Specification --- .claude/commands/dev-flow.md | 51 ++++++++++++++----- .../config/dev-flow-checklists/stage-hooks.md | 1 + 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/.claude/commands/dev-flow.md b/.claude/commands/dev-flow.md index 89e99200..aa4dfcd6 100644 --- a/.claude/commands/dev-flow.md +++ b/.claude/commands/dev-flow.md @@ -4,8 +4,16 @@ type: command description: 开发工作流编排命令,启动完整的开发工作流,从需求分析到测试报告生成,支持版本粒度管理 version: 4.9 author: DevSyncAgent Team -last_updated: 2026-07-14 +last_updated: 2026-07-20 changelog: + v4.9 - 2026-07-20 + - 🆕 版本轨添加需求支持需求名称格式规范:[风险等级][一级模块名][二级模块名][前后端]需求描述(如 [中风险][文件上传][作业管理-数据源][前后端需求]文件数据集导入功能) + - 🆕 add-story/add-stories 录入时内联格式校验+允许跳过降级(正则 ^\[(高风险|中风险|低风险)\]\[(.+?)\]\[(.+?)\]\[(.+?)\](.+)$);A3 调用 add-system-story 的 name=rawFullName(完整格式串;降级=纯文本 name) + - 🆕 versions.json requirements[] 只新增 rawFullName 字段;name 取末尾需求描述(文档命名用);riskLevel/moduleL1/moduleL2/frontendBackend 仅作确认展示不持久化 + - ⚠️ 风险等级仅作名称前缀和本地展示,不映射 DPMS priority(A3 维持原状不传 priority,DPMS 默认 2=中;P1 priority 维持原逻辑由 req-type-classifier 识别写回) + - 🔗 配套修改:dev-flow.md(添加单个/批量版本需求章节内联格式校验+A3调用4处 name=rawFullName)、stage-hooks.md(versions.json schema 新增 rawFullName) + - ⚠️ 适用范围:仅版本轨添加需求(单需求轨不与 DPMS 交互,不做格式校验) + - ⚠️ 版本号天花板约束:保持 v4.9(天花板=4.9),仅追加 changelog 条目 v4.9 - 2026-07-14(天花板回退至4.9,原 v4.11/v4.10 changelog 合并) - 🔄 6.5.1(关联子系统版本到Git分支)从创建版本后移至完成版本封板前:complete-version 新增 A6-Step0(封板前置),封板时先关联分支再封板 - 🔄 create-version 6.6(更新PACE流水线)解除与 6.5.1 的 v4.9 原子绑定,改为独立步骤(6.6 必须留创建版本以保障开发期 Stage3.5/Stage5/CI-CD 的 pipelineId 依赖) @@ -1074,17 +1082,32 @@ execute_rollback(requirement=target_requirement, mode="interactive", reason="主 1. 验证版本存在(读取 `dev/versions/versions.json`) 2. 验证版本未关联(`assigned == false`),若已关联则输出 "❌ 版本已关联版本计划,不允许新增需求!" 3. 验证版本未启动(`started == false`),若已启动则警告并询问是否继续 -4. 从 `story-desc` 智能提取需求名称 -5. 展示确认信息:需求名称、描述 -6. **始终执行**:创建本地记录,更新 `dev/versions/versions.json`(type/priority 留空,由后续 `version start` 时前置步骤P1自动识别填充) +4. 🆕 **需求名称格式校验与提取**(内联,无独立 checklist) + - 展示录入提示文字: + ``` + 请输入需求名称,格式要求:[风险等级][一级模块名][二级模块名][前后端]需求描述 + - 风险等级:高风险 / 中风险 / 低风险 + - 一级模块名:如 文件上传 + - 二级模块名:如 作业管理-数据源 + - 前后端:前端需求 / 后端需求 / 前后端需求 + - 需求描述:如 文件数据集导入功能 + 示例:[中风险][文件上传][作业管理-数据源][前后端需求]文件数据集导入功能 + ⚠️ 完整格式串将作为系统需求名称上传 DPMS,末尾"需求描述"作为本地文档名称。 + ``` + - 读取用户输入 raw_input,按正则 `^\[(高风险|中风险|低风险)\]\[(.+?)\]\[(.+?)\]\[(.+?)\](.+)$` 校验: + - **格式化模式**(匹配成功):`name`=第5段(末尾需求描述,作文档名),`rawFullName`=raw_input(完整格式串,作 DPMS name);风险等级/模块/前后端仅作确认展示,不持久化、不映射 priority + - **降级模式**(匹配失败):AskUserQuestion [重新输入 / 跳过格式按纯文本录入 / 取消];跳过时 `name`=raw_input,`rawFullName`=raw_input +5. 展示确认信息:需求名称(name)、rawFullName、风险等级、一级模块、二级模块、前后端 +6. **始终执行**:创建本地记录,更新 `dev/versions/versions.json`(type/priority 留空由后续 P1 自动识别;🆕 新增 `rawFullName` 字段) - **分配需求编号**:读取当前版本的 `nextReqIndex`,分配 `reqIndex = nextReqIndex`,然后 `nextReqIndex += 1`。`reqPrefix = "REQ-" + str(reqIndex).zfill(2)`(如 REQ-01、REQ-02)。写入 requirements 数组。 + - 🆕 requirements 数组新增 `rawFullName` 字段(完整格式串;降级模式=纯文本=name)。riskLevel/moduleL1/moduleL2/frontendBackend 不持久化;priority 维持原逻辑(P1 识别写回,不映射风险等级)。 7. 询问远程操作策略(使用 AskUserQuestion,A3/A4可独立跳过): - 选项1: "**全部执行(推荐)→ 创建本地记录 + DPMS创建系统需求 + 关联子系统版本**" - 选项2: "**仅DPMS创建系统需求 → 创建本地记录 + DPMS创建系统需求,跳过关联子系统版本**" - 选项3: "**全部跳过 → 仅创建本地记录(需求类型由后续启动开发时自动识别)**" 8. 根据用户选择执行远程操作: - - 选项1: 调用 `mcp__sdp__add-system-story`(A3),参数 `enableAiMode` = 1(⚠ 必须显式传入),成功后:① 调用 `mcp__sdp__get-storys(id=storyId)` 查询 `productName` 并回填 versions.json 该需求的 `dpmsStoryId` 和 `productName` 字段;② 自动调用 `mcp__sdp__associate-subsystem-version`(A4);A3或A4失败时按容错机制写入PendingItem - - 选项2: 调用 `mcp__sdp__add-system-story`(A3),参数 `enableAiMode` = 1(⚠ 必须显式传入),成功后:① 调用 `mcp__sdp__get-storys(id=storyId)` 查询 `productName` 并回填 versions.json 该需求的 `dpmsStoryId` 和 `productName` 字段;② A4写入PendingItem + - 选项1: 调用 `mcp__sdp__add-system-story`(A3),参数 `enableAiMode` = 1(⚠ 必须显式传入),🆕 `name` = rawFullName(完整格式串;降级模式=纯文本 name),成功后:① 调用 `mcp__sdp__get-storys(id=storyId)` 查询 `productName` 并回填 versions.json 该需求的 `dpmsStoryId` 和 `productName` 字段;② 自动调用 `mcp__sdp__associate-subsystem-version`(A4);A3或A4失败时按容错机制写入PendingItem + - 选项2: 调用 `mcp__sdp__add-system-story`(A3),参数 `enableAiMode` = 1(⚠ 必须显式传入),🆕 `name` = rawFullName(完整格式串;降级模式=纯文本 name),成功后:① 调用 `mcp__sdp__get-storys(id=storyId)` 查询 `productName` 并回填 versions.json 该需求的 `dpmsStoryId` 和 `productName` 字段;② A4写入PendingItem - 选项3: A3和A4分别写入PendingItem,productName保持null 9. 输出结果摘要(含A3/A4各步骤状态) 10. **下一步引导**(使用 AskUserQuestion): @@ -1095,23 +1118,25 @@ execute_rollback(requirement=target_requirement, mode="interactive", reason="主 ### 批量添加版本需求 **在指定版本下批量添加多个系统需求。版本名从当前活跃版本自动获取。** -2. **解析需求列表**:支持以下分隔格式: +2. 🆕 展示录入提示文字(格式 `[风险等级][一级模块名][二级模块名][前后端]需求描述` + 字段说明 + 示例,同添加单个需求),并解析需求列表(支持以下分隔格式): - `1. xxx; 2. yyy; 3. zzz` - `1、xxx 2、yyy 3、zzz` - `1) xxx 2) yyy 3) zzz` + - 🆕 对每条按正则 `^\[(高风险|中风险|低风险)\]\[(.+?)\]\[(.+?)\]\[(.+?)\](.+)$` 校验:✅ 符合(name=第5段doc_name, rawFullName=完整串)/ ❌ 不符(标记降级:name=raw_input, rawFullName=raw_input) 3. **确认识别结果**(关键步骤,使用 AskUserQuestion): - - 展示解析到的需求列表(表格形式) - - 选项:"**识别正确,继续**" / "**识别有误,重新输入**" -4. 展示完整确认信息(所有需求列表) -5. **始终执行**:创建本地记录,更新 `dev/versions/versions.json`(type/priority 留空,由后续 `version start` 时前置步骤P1自动识别填充) + - 展示解析结果表(序号 | 用户输入 | 格式校验 | doc_name | 风险 | 一级模块 | 二级模块 | 前后端) + - 选项:"**全部正确,继续(不符条目自动降级为纯文本)**" / "**识别有误,重新输入**" +4. 展示完整确认信息(所有需求列表,含 rawFullName 与风险等级) +5. **始终执行**:创建本地记录,更新 `dev/versions/versions.json`(type/priority 留空由后续 P1 自动识别;🆕 新增 `rawFullName` 字段) - **分配需求编号**:对每个需求按添加顺序分配递增的 `reqIndex`(从 `nextReqIndex` 开始,每个需求 +1),计算 `reqPrefix = "REQ-" + str(reqIndex).zfill(2)`。写入 requirements 数组并更新 `nextReqIndex`。 + - 🆕 每条需求写入 `rawFullName`(格式化=完整串;降级=纯文本=name)。riskLevel/moduleL1/moduleL2/frontendBackend 不持久化;priority 维持原逻辑(P1 识别写回,不映射风险等级)。 6. 询问远程操作策略(使用 AskUserQuestion,A3/A4可独立跳过): - 选项1: "**全部执行(推荐)→ 创建本地记录 + DPMS创建系统需求 + 关联子系统版本**" - 选项2: "**仅DPMS创建系统需求 → 创建本地记录 + DPMS创建系统需求,跳过关联子系统版本**" - 选项3: "**全部跳过 → 仅创建本地记录(需求类型由后续启动开发时自动识别)**" 7. 根据用户选择,对每个需求独立执行远程操作(单个失败不影响其余): - - 选项1: 调用 `mcp__sdp__add-system-story`(A3),参数 `enableAiMode` = 1(⚠ 必须显式传入),成功后:① 调用 `mcp__sdp__get-storys(id=storyId)` 查询 `productName` 并回填 versions.json 该需求的 `dpmsStoryId` 和 `productName` 字段;② 自动调用 `mcp__sdp__associate-subsystem-version`(A4);A3或A4失败时按容错机制写入PendingItem - - 选项2: 调用 `mcp__sdp__add-system-story`(A3),参数 `enableAiMode` = 1(⚠ 必须显式传入),成功后:① 调用 `mcp__sdp__get-storys(id=storyId)` 查询 `productName` 并回填 versions.json 该需求的 `dpmsStoryId` 和 `productName` 字段;② A4写入PendingItem + - 选项1: 调用 `mcp__sdp__add-system-story`(A3),参数 `enableAiMode` = 1(⚠ 必须显式传入),🆕 `name` = rawFullName(完整格式串;降级模式=纯文本 name),成功后:① 调用 `mcp__sdp__get-storys(id=storyId)` 查询 `productName` 并回填 versions.json 该需求的 `dpmsStoryId` 和 `productName` 字段;② 自动调用 `mcp__sdp__associate-subsystem-version`(A4);A3或A4失败时按容错机制写入PendingItem + - 选项2: 调用 `mcp__sdp__add-system-story`(A3),参数 `enableAiMode` = 1(⚠ 必须显式传入),🆕 `name` = rawFullName(完整格式串;降级模式=纯文本 name),成功后:① 调用 `mcp__sdp__get-storys(id=storyId)` 查询 `productName` 并回填 versions.json 该需求的 `dpmsStoryId` 和 `productName` 字段;② A4写入PendingItem - 选项3: A3和A4分别写入PendingItem,productName保持null 8. 输出结果摘要:本地创建 N 条 + A3成功 M 条 + A4成功 K 条 + 失败进待补录 L 条 9. **下一步引导**(使用 AskUserQuestion): diff --git a/.claude/config/dev-flow-checklists/stage-hooks.md b/.claude/config/dev-flow-checklists/stage-hooks.md index 377b45a8..d39f5eba 100644 --- a/.claude/config/dev-flow-checklists/stage-hooks.md +++ b/.claude/config/dev-flow-checklists/stage-hooks.md @@ -1554,6 +1554,7 @@ END IF "nextReqIndex": 3, "requirements": [{ "name": "xxx", + "rawFullName": "[中风险][文件上传][作业管理-数据源][前后端需求]文件数据集导入功能", # 🆕 完整格式串(DPMS name 用;降级模式=纯文本=name;旧数据可能不存在) "reqIndex": 1, "type": "ENHANCE", "currentStage": "1.1", -- Gitee From 43cb410e6248e5ed8b07fcb0a6666d9ce1b48e51 Mon Sep 17 00:00:00 2001 From: ciel111 Date: Mon, 20 Jul 2026 19:40:51 +0800 Subject: [PATCH 09/13] #AI commit# New Requirement Name Naming Format Specification --- .../development/frontend-code-developer.md | 48 ++++++++++++++++++- .../agents/development/go-code-developer.md | 48 ++++++++++++++++++- .../agents/development/java-code-developer.md | 48 ++++++++++++++++++- .../development/python-code-developer.md | 48 ++++++++++++++++++- .../development/typescript-code-developer.md | 48 ++++++++++++++++++- .../development/web-frontend-developer.md | 48 ++++++++++++++++++- .version-lock.json | 48 +++++++++---------- 7 files changed, 300 insertions(+), 36 deletions(-) diff --git a/.claude/agents/development/frontend-code-developer.md b/.claude/agents/development/frontend-code-developer.md index f7f142db..9930cef8 100644 --- a/.claude/agents/development/frontend-code-developer.md +++ b/.claude/agents/development/frontend-code-developer.md @@ -2,10 +2,12 @@ name: frontend-code-developer type: development description: 前端开发Agent,对接前端智能研发平台实现自动化代码生成 -version: 4.7 +version: 4.8 author: DevSyncAgent Team -last_updated: 2026-07-16 +last_updated: 2026-07-20 changelog: + v4.8 - 2026-07-20 + - 🆕 新增第0.7步:强制搜索开发规范(设计文档§章节 + 项目CLAUDE.md),输出规范清单;并通过约束注入机制(DEV-STANDARD约束清单+DS编号)将规范清单作为第2-6步全局硬约束一次性注入,生成时逐条对照相关规范。只搜索不回看(不做第7步全局回看验证)。 v4.7 - 2026-07-16 - 🆕 配合 dev-flow Stage 3 内嵌「设计-开发协调循环」--开发过程中遇设计阻塞时返回 design_block_report JSON(code_complete+design_block_issues),主会话协调 des-xxx patch_mode 修补后重启本 Agent - 🆕 新增第0.6步「设计文档可开发性预检查」(前端 category:api_endpoint/component_design/state_management/interaction/config),检测设计缺失产出 design_block_issues @@ -274,6 +276,48 @@ END IF --- +### 第0.7步:强制搜索开发规范 ⭐新增 + +**目标**:开发前强制从设计文档和项目规范文件搜索开发规范,显式列出供第2步及之后代码生成时参照。本步骤只搜索并输出清单,不做生成后回看验证。 + +**搜索范围**(强制逐项检查存在性并搜索): +1. 设计文档:使用 dev-flow 主会话注入的【设计文档路径】(已按属性感知解析为 `{需求名}_前端设计.md` 或回退 `{需求名}_设计.md`;未注入时按第1步属性感知规则自行检测) +2. 业务项目根 `CLAUDE.md`:路径 = 【项目路径】/CLAUDE.md(【项目路径】由 dev-flow 主会话注入;未注入时用当前工作目录的 CLAUDE.md,不存在则跳过) + +**搜索关键词**(章节名 + 正文匹配,大小写不敏感): +`规范 | 约束 | constraint | standard | 技术约束 | 开发规范 | 技术选型 | 实现要求 | 非功能要求 | 编码规范` + +**输出**(强制,即使为空也输出): + +```markdown +## 开发规范搜索结果 + +**搜索源**: +| 搜索源 | 路径 | 是否存在 | +|---|---|:---:| +| 设计文档 | {路径} | ✅/❌ | +| 项目 CLAUDE.md | {路径} | ✅/❌ | + +**搜到的规范清单**: +| 序号 | 规范内容 | 来源(文件§章节) | 强制级别 | +|:---:|---|---|:---:| +| 1 | {规范内容} | 设计文档§3.2 技术约束 | must | +| ... | ... | ... | ... | +``` + +**若清单为空**:输出 `⚠️ 未搜索到明确开发规范,按项目默认规范生成`,继续第1步(无 DEV-STANDARD 约束可注入,第2-6步按项目默认规范生成)。 + +**约束注入(DEV-STANDARD 约束清单)**: + +将上述"搜到的规范清单"标记为 DEV-STANDARD 约束,每条赋予编号(DS-001, DS-002, ...),作为第2步~第6步所有代码生成步骤的**全局硬约束**(一次性注入,后续每步生成代码时自动适用,无需每步重新回看)。 + +**约束应用规则**: +- 生成本步代码时,逐条检查 DEV-STANDARD 约束是否与本步相关;相关的规范**必须**体现在生成的代码中 + +> ⚠️ 本步骤通过约束注入机制,将规范清单从"可选参照"升级为"生成时强制对照的全局硬约束"(一次性注入,后续自动适用)。仍不做第7步的全局回看验证(规范全局遵守情况不在本机制保障范围,按既定决策保留)。 + +--- + ### 第1步:读取设计文档 **目标**:提取设计文档内容,构建任务提示词 diff --git a/.claude/agents/development/go-code-developer.md b/.claude/agents/development/go-code-developer.md index dbecaf66..633fc706 100644 --- a/.claude/agents/development/go-code-developer.md +++ b/.claude/agents/development/go-code-developer.md @@ -2,10 +2,12 @@ name: go-code-developer type: development description: Go后端开发专家,专注于Gin/Echo应用开发,生成高质量的Go代码 -version: 4.8 +version: 4.9 author: DevSyncAgent Team -last_updated: 2026-07-16 +last_updated: 2026-07-20 changelog: + v4.9 - 2026-07-20 + - 🆕 新增第0.7步:强制搜索开发规范(设计文档§章节 + 项目CLAUDE.md),输出规范清单;并通过约束注入机制(DEV-STANDARD约束清单+DS编号)将规范清单作为第2-6步全局硬约束一次性注入,生成时逐条对照相关规范。只搜索不回看(不做第7步全局回看验证)。 v4.8 - 2026-07-16 - 🆕 配合 dev-flow Stage 3 内嵌「设计-开发协调循环」--开发过程中遇设计阻塞时返回 design_block_report JSON(code_complete+design_block_issues),主会话协调 des-xxx patch_mode 修补后重启本 Agent - 🔄 第0.6步响应码预检查泛化为多 category 设计可开发性检测(response_code/api_endpoint/data_model/business_logic/config) @@ -385,6 +387,48 @@ END IF --- +### 第0.7步:强制搜索开发规范 ⭐新增 + +**目标**:开发前强制从设计文档和项目规范文件搜索开发规范,显式列出供第2步及之后代码生成时参照。本步骤只搜索并输出清单,不做生成后回看验证。 + +**搜索范围**(强制逐项检查存在性并搜索): +1. 设计文档:使用 dev-flow 主会话注入的【设计文档路径】(已按属性感知解析为 `{需求名}_后端设计.md` 或回退 `{需求名}_设计.md`;未注入时按第1步属性感知规则自行检测) +2. 业务项目根 `CLAUDE.md`:路径 = 【项目路径】/CLAUDE.md(【项目路径】由 dev-flow 主会话注入;未注入时用当前工作目录的 CLAUDE.md,不存在则跳过) + +**搜索关键词**(章节名 + 正文匹配,大小写不敏感): +`规范 | 约束 | constraint | standard | 技术约束 | 开发规范 | 技术选型 | 实现要求 | 非功能要求 | 编码规范` + +**输出**(强制,即使为空也输出): + +```markdown +## 开发规范搜索结果 + +**搜索源**: +| 搜索源 | 路径 | 是否存在 | +|---|---|:---:| +| 设计文档 | {路径} | ✅/❌ | +| 项目 CLAUDE.md | {路径} | ✅/❌ | + +**搜到的规范清单**: +| 序号 | 规范内容 | 来源(文件§章节) | 强制级别 | +|:---:|---|---|:---:| +| 1 | {规范内容} | 设计文档§3.2 技术约束 | must | +| ... | ... | ... | ... | +``` + +**若清单为空**:输出 `⚠️ 未搜索到明确开发规范,按项目默认规范生成`,继续第1步(无 DEV-STANDARD 约束可注入,第2-6步按项目默认规范生成)。 + +**约束注入(DEV-STANDARD 约束清单)**: + +将上述"搜到的规范清单"标记为 DEV-STANDARD 约束,每条赋予编号(DS-001, DS-002, ...),作为第2步~第6步所有代码生成步骤的**全局硬约束**(一次性注入,后续每步生成代码时自动适用,无需每步重新回看)。 + +**约束应用规则**: +- 生成本步代码时,逐条检查 DEV-STANDARD 约束是否与本步相关;相关的规范**必须**体现在生成的代码中 + +> ⚠️ 本步骤通过约束注入机制,将规范清单从"可选参照"升级为"生成时强制对照的全局硬约束"(一次性注入,后续自动适用)。仍不做第7步的全局回看验证(规范全局遵守情况不在本机制保障范围,按既定决策保留)。 + +--- + ### 第1步:分析设计文档 #### 属性感知设计文档路径检测 🆕v4.0 diff --git a/.claude/agents/development/java-code-developer.md b/.claude/agents/development/java-code-developer.md index bf11d6d2..1cf5c186 100644 --- a/.claude/agents/development/java-code-developer.md +++ b/.claude/agents/development/java-code-developer.md @@ -2,10 +2,12 @@ name: java-code-developer type: development description: Java后端开发专家,专注于Spring Boot应用开发,生成高质量的Java代码 -version: 4.9 +version: 4.10 author: DevSyncAgent Team -last_updated: 2026-07-16 +last_updated: 2026-07-20 changelog: + v4.10 - 2026-07-20 + - 🆕 新增第0.7步:强制搜索开发规范(设计文档§章节 + 项目CLAUDE.md),输出规范清单;并通过约束注入机制(DEV-STANDARD约束清单+DS编号)将规范清单作为第2-6步全局硬约束一次性注入,生成时逐条对照相关规范。只搜索不回看(不做第7步全局回看验证)。 v4.9 - 2026-07-16 - 🆕 配合 dev-flow Stage 3 内嵌「设计-开发协调循环」--开发过程中遇设计阻塞时返回 design_block_report JSON(code_complete+design_block_issues),主会话协调 des-xxx patch_mode 修补后重启本 Agent - 🔄 第0.6步响应码预检查泛化为多 category 设计可开发性检测(response_code/api_endpoint/data_model/business_logic/config) @@ -585,6 +587,48 @@ END IF --- +### 第0.7步:强制搜索开发规范 ⭐新增 + +**目标**:开发前强制从设计文档和项目规范文件搜索开发规范,显式列出供第2步及之后代码生成时参照。本步骤只搜索并输出清单,不做生成后回看验证。 + +**搜索范围**(强制逐项检查存在性并搜索): +1. 设计文档:使用 dev-flow 主会话注入的【设计文档路径】(已按属性感知解析为 `{需求名}_后端设计.md` 或回退 `{需求名}_设计.md`;未注入时按第1步属性感知规则自行检测) +2. 业务项目根 `CLAUDE.md`:路径 = 【项目路径】/CLAUDE.md(【项目路径】由 dev-flow 主会话注入;未注入时用当前工作目录的 CLAUDE.md,不存在则跳过) + +**搜索关键词**(章节名 + 正文匹配,大小写不敏感): +`规范 | 约束 | constraint | standard | 技术约束 | 开发规范 | 技术选型 | 实现要求 | 非功能要求 | 编码规范` + +**输出**(强制,即使为空也输出): + +```markdown +## 开发规范搜索结果 + +**搜索源**: +| 搜索源 | 路径 | 是否存在 | +|---|---|:---:| +| 设计文档 | {路径} | ✅/❌ | +| 项目 CLAUDE.md | {路径} | ✅/❌ | + +**搜到的规范清单**: +| 序号 | 规范内容 | 来源(文件§章节) | 强制级别 | +|:---:|---|---|:---:| +| 1 | {规范内容} | 设计文档§3.2 技术约束 | must | +| ... | ... | ... | ... | +``` + +**若清单为空**:输出 `⚠️ 未搜索到明确开发规范,按项目默认规范生成`,继续第1步(无 DEV-STANDARD 约束可注入,第2-6步按项目默认规范生成)。 + +**约束注入(DEV-STANDARD 约束清单)**: + +将上述"搜到的规范清单"标记为 DEV-STANDARD 约束,每条赋予编号(DS-001, DS-002, ...),作为第2步~第6步所有代码生成步骤的**全局硬约束**(一次性注入,后续每步生成代码时自动适用,无需每步重新回看)。 + +**约束应用规则**: +- 生成本步代码时,逐条检查 DEV-STANDARD 约束是否与本步相关;相关的规范**必须**体现在生成的代码中 + +> ⚠️ 本步骤通过约束注入机制,将规范清单从"可选参照"升级为"生成时强制对照的全局硬约束"(一次性注入,后续自动适用)。仍不做第7步的全局回看验证(规范全局遵守情况不在本机制保障范围,按既定决策保留)。 + +--- + ### 第1步:分析设计文档 #### 属性感知设计文档路径检测 🆕v4.0 diff --git a/.claude/agents/development/python-code-developer.md b/.claude/agents/development/python-code-developer.md index fd241ff3..5437822f 100644 --- a/.claude/agents/development/python-code-developer.md +++ b/.claude/agents/development/python-code-developer.md @@ -2,10 +2,12 @@ name: python-code-developer type: development description: Python后端开发专家,专注于FastAPI/Django应用开发,生成高质量的Python代码 -version: 4.9 +version: 4.10 author: DevSyncAgent Team -last_updated: 2026-07-16 +last_updated: 2026-07-20 changelog: + v4.10 - 2026-07-20 + - 🆕 新增第0.7步:强制搜索开发规范(设计文档§章节 + 项目CLAUDE.md),输出规范清单;并通过约束注入机制(DEV-STANDARD约束清单+DS编号)将规范清单作为第2-6步全局硬约束一次性注入,生成时逐条对照相关规范。只搜索不回看(不做第7步全局回看验证)。 v4.9 - 2026-07-16 - 🆕 配合 dev-flow Stage 3 内嵌「设计-开发协调循环」--开发过程中遇设计阻塞时返回 design_block_report JSON(code_complete+design_block_issues),主会话协调 des-xxx patch_mode 修补后重启本 Agent - 🔄 第0.6步响应码预检查泛化为多 category 设计可开发性检测(response_code/api_endpoint/data_model/business_logic/config) @@ -592,6 +594,48 @@ END IF --- +### 第0.7步:强制搜索开发规范 ⭐新增 + +**目标**:开发前强制从设计文档和项目规范文件搜索开发规范,显式列出供第2步及之后代码生成时参照。本步骤只搜索并输出清单,不做生成后回看验证。 + +**搜索范围**(强制逐项检查存在性并搜索): +1. 设计文档:使用 dev-flow 主会话注入的【设计文档路径】(已按属性感知解析为 `{需求名}_后端设计.md` 或回退 `{需求名}_设计.md`;未注入时按第1步属性感知规则自行检测) +2. 业务项目根 `CLAUDE.md`:路径 = 【项目路径】/CLAUDE.md(【项目路径】由 dev-flow 主会话注入;未注入时用当前工作目录的 CLAUDE.md,不存在则跳过) + +**搜索关键词**(章节名 + 正文匹配,大小写不敏感): +`规范 | 约束 | constraint | standard | 技术约束 | 开发规范 | 技术选型 | 实现要求 | 非功能要求 | 编码规范` + +**输出**(强制,即使为空也输出): + +```markdown +## 开发规范搜索结果 + +**搜索源**: +| 搜索源 | 路径 | 是否存在 | +|---|---|:---:| +| 设计文档 | {路径} | ✅/❌ | +| 项目 CLAUDE.md | {路径} | ✅/❌ | + +**搜到的规范清单**: +| 序号 | 规范内容 | 来源(文件§章节) | 强制级别 | +|:---:|---|---|:---:| +| 1 | {规范内容} | 设计文档§3.2 技术约束 | must | +| ... | ... | ... | ... | +``` + +**若清单为空**:输出 `⚠️ 未搜索到明确开发规范,按项目默认规范生成`,继续第1步(无 DEV-STANDARD 约束可注入,第2-6步按项目默认规范生成)。 + +**约束注入(DEV-STANDARD 约束清单)**: + +将上述"搜到的规范清单"标记为 DEV-STANDARD 约束,每条赋予编号(DS-001, DS-002, ...),作为第2步~第6步所有代码生成步骤的**全局硬约束**(一次性注入,后续每步生成代码时自动适用,无需每步重新回看)。 + +**约束应用规则**: +- 生成本步代码时,逐条检查 DEV-STANDARD 约束是否与本步相关;相关的规范**必须**体现在生成的代码中 + +> ⚠️ 本步骤通过约束注入机制,将规范清单从"可选参照"升级为"生成时强制对照的全局硬约束"(一次性注入,后续自动适用)。仍不做第7步的全局回看验证(规范全局遵守情况不在本机制保障范围,按既定决策保留)。 + +--- + ### 第1步:分析设计文档 #### 属性感知设计文档路径检测 🆕v4.0 diff --git a/.claude/agents/development/typescript-code-developer.md b/.claude/agents/development/typescript-code-developer.md index 257b3aa2..c9b7c961 100644 --- a/.claude/agents/development/typescript-code-developer.md +++ b/.claude/agents/development/typescript-code-developer.md @@ -2,10 +2,12 @@ name: typescript-code-developer type: development description: TypeScript后端开发专家,专注于NestJS应用开发,生成高质量的TypeScript代码 -version: 4.9 +version: 4.10 author: DevSyncAgent Team -last_updated: 2026-07-16 +last_updated: 2026-07-20 changelog: + v4.10 - 2026-07-20 + - 🆕 新增第0.7步:强制搜索开发规范(设计文档§章节 + 项目CLAUDE.md),输出规范清单;并通过约束注入机制(DEV-STANDARD约束清单+DS编号)将规范清单作为第2-6步全局硬约束一次性注入,生成时逐条对照相关规范。只搜索不回看(不做第7步全局回看验证)。 v4.9 - 2026-07-16 - 🆕 配合 dev-flow Stage 3 内嵌「设计-开发协调循环」--开发过程中遇设计阻塞时返回 design_block_report JSON(code_complete+design_block_issues),主会话协调 des-xxx patch_mode 修补后重启本 Agent - 🔄 第0.6步响应码预检查泛化为多 category 设计可开发性检测(response_code/api_endpoint/data_model/business_logic/config) @@ -440,6 +442,48 @@ END IF --- +### 第0.7步:强制搜索开发规范 ⭐新增 + +**目标**:开发前强制从设计文档和项目规范文件搜索开发规范,显式列出供第2步及之后代码生成时参照。本步骤只搜索并输出清单,不做生成后回看验证。 + +**搜索范围**(强制逐项检查存在性并搜索): +1. 设计文档:使用 dev-flow 主会话注入的【设计文档路径】(已按属性感知解析为 `{需求名}_后端设计.md` 或回退 `{需求名}_设计.md`;未注入时按第1步属性感知规则自行检测) +2. 业务项目根 `CLAUDE.md`:路径 = 【项目路径】/CLAUDE.md(【项目路径】由 dev-flow 主会话注入;未注入时用当前工作目录的 CLAUDE.md,不存在则跳过) + +**搜索关键词**(章节名 + 正文匹配,大小写不敏感): +`规范 | 约束 | constraint | standard | 技术约束 | 开发规范 | 技术选型 | 实现要求 | 非功能要求 | 编码规范` + +**输出**(强制,即使为空也输出): + +```markdown +## 开发规范搜索结果 + +**搜索源**: +| 搜索源 | 路径 | 是否存在 | +|---|---|:---:| +| 设计文档 | {路径} | ✅/❌ | +| 项目 CLAUDE.md | {路径} | ✅/❌ | + +**搜到的规范清单**: +| 序号 | 规范内容 | 来源(文件§章节) | 强制级别 | +|:---:|---|---|:---:| +| 1 | {规范内容} | 设计文档§3.2 技术约束 | must | +| ... | ... | ... | ... | +``` + +**若清单为空**:输出 `⚠️ 未搜索到明确开发规范,按项目默认规范生成`,继续第1步(无 DEV-STANDARD 约束可注入,第2-6步按项目默认规范生成)。 + +**约束注入(DEV-STANDARD 约束清单)**: + +将上述"搜到的规范清单"标记为 DEV-STANDARD 约束,每条赋予编号(DS-001, DS-002, ...),作为第2步~第6步所有代码生成步骤的**全局硬约束**(一次性注入,后续每步生成代码时自动适用,无需每步重新回看)。 + +**约束应用规则**: +- 生成本步代码时,逐条检查 DEV-STANDARD 约束是否与本步相关;相关的规范**必须**体现在生成的代码中 + +> ⚠️ 本步骤通过约束注入机制,将规范清单从"可选参照"升级为"生成时强制对照的全局硬约束"(一次性注入,后续自动适用)。仍不做第7步的全局回看验证(规范全局遵守情况不在本机制保障范围,按既定决策保留)。 + +--- + ### 第1步:分析设计文档 #### 属性感知设计文档路径检测 🆕v1.2 diff --git a/.claude/agents/development/web-frontend-developer.md b/.claude/agents/development/web-frontend-developer.md index e3bbad88..fcffc33b 100644 --- a/.claude/agents/development/web-frontend-developer.md +++ b/.claude/agents/development/web-frontend-developer.md @@ -2,10 +2,12 @@ name: web-frontend-developer type: development description: 前端项目开发专家,支持React/Vue项目的本地代码生成,遵循现有代码规范 -version: 4.7 +version: 4.8 author: DevSyncAgent Team -last_updated: 2026-07-16 +last_updated: 2026-07-20 changelog: + v4.8 - 2026-07-20 + - 🆕 新增第0.7步:强制搜索开发规范(设计文档§章节 + 项目CLAUDE.md),输出规范清单;并通过约束注入机制(DEV-STANDARD约束清单+DS编号)将规范清单作为第2-6步全局硬约束一次性注入,生成时逐条对照相关规范。只搜索不回看(不做第7步全局回看验证)。 v4.7 - 2026-07-16 - 🆕 配合 dev-flow Stage 3 内嵌「设计-开发协调循环」--开发过程中遇设计阻塞时返回 design_block_report JSON(code_complete+design_block_issues),主会话协调 des-xxx patch_mode 修补后重启本 Agent - 🆕 新增第0.6步「设计文档可开发性预检查」(前端 category:api_endpoint/component_design/state_management/interaction/config),检测设计缺失产出 design_block_issues @@ -261,6 +263,48 @@ END IF --- +### 第0.7步:强制搜索开发规范 ⭐新增 + +**目标**:开发前强制从设计文档和项目规范文件搜索开发规范,显式列出供第2步及之后代码生成时参照。本步骤只搜索并输出清单,不做生成后回看验证。 + +**搜索范围**(强制逐项检查存在性并搜索): +1. 设计文档:使用 dev-flow 主会话注入的【设计文档路径】(已按属性感知解析为 `{需求名}_前端设计.md` 或回退 `{需求名}_设计.md`;未注入时按第1步属性感知规则自行检测) +2. 业务项目根 `CLAUDE.md`:路径 = 【项目路径】/CLAUDE.md(【项目路径】由 dev-flow 主会话注入;未注入时用当前工作目录的 CLAUDE.md,不存在则跳过) + +**搜索关键词**(章节名 + 正文匹配,大小写不敏感): +`规范 | 约束 | constraint | standard | 技术约束 | 开发规范 | 技术选型 | 实现要求 | 非功能要求 | 编码规范` + +**输出**(强制,即使为空也输出): + +```markdown +## 开发规范搜索结果 + +**搜索源**: +| 搜索源 | 路径 | 是否存在 | +|---|---|:---:| +| 设计文档 | {路径} | ✅/❌ | +| 项目 CLAUDE.md | {路径} | ✅/❌ | + +**搜到的规范清单**: +| 序号 | 规范内容 | 来源(文件§章节) | 强制级别 | +|:---:|---|---|:---:| +| 1 | {规范内容} | 设计文档§3.2 技术约束 | must | +| ... | ... | ... | ... | +``` + +**若清单为空**:输出 `⚠️ 未搜索到明确开发规范,按项目默认规范生成`,继续第1步(无 DEV-STANDARD 约束可注入,第2-6步按项目默认规范生成)。 + +**约束注入(DEV-STANDARD 约束清单)**: + +将上述"搜到的规范清单"标记为 DEV-STANDARD 约束,每条赋予编号(DS-001, DS-002, ...),作为第2步~第6步所有代码生成步骤的**全局硬约束**(一次性注入,后续每步生成代码时自动适用,无需每步重新回看)。 + +**约束应用规则**: +- 生成本步代码时,逐条检查 DEV-STANDARD 约束是否与本步相关;相关的规范**必须**体现在生成的代码中 + +> ⚠️ 本步骤通过约束注入机制,将规范清单从"可选参照"升级为"生成时强制对照的全局硬约束"(一次性注入,后续自动适用)。仍不做第7步的全局回看验证(规范全局遵守情况不在本机制保障范围,按既定决策保留)。 + +--- + ### 第1步:读取设计文档 **目标**:从设计文档中提取前端开发所需的信息 diff --git a/.version-lock.json b/.version-lock.json index 9165d838..30615b44 100644 --- a/.version-lock.json +++ b/.version-lock.json @@ -1,7 +1,7 @@ { "schema_version": "3.0", "current_version": "4.11", - "release_date": "2026-07-17", + "release_date": "2026-07-20", "status": "development", "agents": { "requirement": { @@ -102,40 +102,40 @@ "last_modified": "2026-06-01" }, "frontend-code-developer": { - "version": "4.7", - "last_modified": "2026-07-16" + "version": "4.8", + "last_modified": "2026-07-20" }, "go-code-developer": { - "version": "4.8", - "last_modified": "2026-07-16" + "version": "4.9", + "last_modified": "2026-07-20" }, "go-code-review": { "version": "1.3", "last_modified": "2026-07-08" }, "java-code-developer": { - "version": "4.9", - "last_modified": "2026-07-16" + "version": "4.10", + "last_modified": "2026-07-20" }, "java-code-review": { "version": "1.2", "last_modified": "2026-06-26" }, "python-code-developer": { - "version": "4.9", - "last_modified": "2026-07-16" + "version": "4.10", + "last_modified": "2026-07-20" }, "python-code-review": { "version": "1.2", "last_modified": "2026-06-26" }, "typescript-code-developer": { - "version": "4.9", - "last_modified": "2026-07-16" + "version": "4.10", + "last_modified": "2026-07-20" }, "web-frontend-developer": { - "version": "4.7", - "last_modified": "2026-07-16" + "version": "4.8", + "last_modified": "2026-07-20" } }, "testing": { @@ -308,7 +308,7 @@ "workflow": { "dev-flow": { "version": "4.9", - "last_modified": "2026-07-14" + "last_modified": "2026-07-20" } }, "git": {}, @@ -369,13 +369,13 @@ "3.0": 1, "3.1": 1, "3.3": 1, - "4.10": 1, + "4.10": 4, "4.11": 5, "4.3": 1, "4.6": 5, - "4.7": 4, - "4.8": 7, - "4.9": 14 + "4.7": 2, + "4.8": 8, + "4.9": 12 }, "version_list": [ [ @@ -520,13 +520,13 @@ "agent", "development", "frontend-code-developer", - "4.7" + "4.8" ], [ "agent", "development", "go-code-developer", - "4.8" + "4.9" ], [ "agent", @@ -538,7 +538,7 @@ "agent", "development", "java-code-developer", - "4.9" + "4.10" ], [ "agent", @@ -550,7 +550,7 @@ "agent", "development", "python-code-developer", - "4.9" + "4.10" ], [ "agent", @@ -562,13 +562,13 @@ "agent", "development", "typescript-code-developer", - "4.9" + "4.10" ], [ "agent", "development", "web-frontend-developer", - "4.7" + "4.8" ], [ "agent", -- Gitee From 0e8396b34c44c13308384aed905d2425aad6e1c4 Mon Sep 17 00:00:00 2001 From: ciel111 Date: Tue, 21 Jul 2026 19:11:16 +0800 Subject: [PATCH 10/13] #AI commit# sdl optimize --- .../config/dev-flow-checklists/stage-hooks.md | 51 +++++++---- .claude/skills/dpms-design-sync/SKILL.md | 91 ++++++++++++------- 2 files changed, 92 insertions(+), 50 deletions(-) diff --git a/.claude/config/dev-flow-checklists/stage-hooks.md b/.claude/config/dev-flow-checklists/stage-hooks.md index d39f5eba..921d280a 100644 --- a/.claude/config/dev-flow-checklists/stage-hooks.md +++ b/.claude/config/dev-flow-checklists/stage-hooks.md @@ -1030,37 +1030,50 @@ IF "执行SDL安全设计同步" THEN # Step 2: 轮询SDL生成结果(每10秒一次,最多3次) sdl_completed = false + sdl_resp = null FOR i IN 1..3: 等待10秒 - 调用 mcp__sdp__get-story-sdl-detail({ + sdl_resp = 调用 mcp__sdp__get-story-sdl-detail({ "storyId": story_id, "userName": "{当前用户}" }) - → 获取 sdlStatus 和 requirementList - IF sdlStatus == 2(已完成)THEN + # get-story-sdl-detail 返回字段:sdl_status / requirement_list / use_sdl / no_sdl_reason / no_sdl_detail 等 + # sdl_status 枚举:2=不涉及安全设计(generate完成,requirement_list为空), 3=涉及安全设计(generate完成,requirement_list非空,待update), 4=生成中 + # 2 或 3 均代表 generate 完成;4 仍在生成中继续轮询 + IF sdl_resp.sdl_status == 2 OR sdl_resp.sdl_status == 3 THEN sdl_completed = true BREAK END IF END FOR IF sdl_completed THEN - # Step 3: 更新安全设计内容到DPMS - # 从requirementList提取storyReqDtoList,用设计文档安全设计章节内容填充htmlDesignContent - 调用 mcp__sdp__update-story-sec-design({ - "storyId": story_id, - "useSdl": 1, - "storyReqDtoList": requirementList.map(item => { + # Step 3: 根据 sdl_status 分支处理 + IF sdl_resp.sdl_status == 3 THEN + # status=3(设计中):根据 generate 实际返回填充 update 报文(generate 返回什么就填什么,不做 if-else 判断) + # - 涉及(use_sdl=1, requirement_list非空):storyReqDtoList 有内容,noSdlReason/noSdlDetail 为空 + # - 不涉及(use_sdl=0, requirement_list空, no_sdl_reason有值):storyReqDtoList 空,noSdlReason/noSdlDetail 有值 + # 按 generate 返回的 requirement_list 字段填充 update 的 storyReqDtoList;noSdlReason/noSdlDetail 取自 no_sdl_reason/no_sdl_detail;useSdl 取自 use_sdl + 调用 mcp__sdp__update-story-sec-design({ "storyId": story_id, - "reqSeq": item.reqSeq, - "isEffective": item.isEffective, - "htmlDesignContent": 从设计文档安全设计章节提取对应reqSeq的内容, - "remoteId": item.remoteId, - "isUpdate": true - }), - "userName": "{当前用户}" - }) - IF 成功 → 输出 "✅ 安全设计已同步到DPMS(Story ID: {story_id},SDL状态:已完成)" - IF 失败 → 按容错模式处理 + "useSdl": sdl_resp.use_sdl, + "storyReqDtoList": sdl_resp.requirement_list.map(item => { + "storyId": story_id, + "reqSeq": item.req_seq, + "isEffective": item.is_effective, + "htmlDesignContent": item.html_design_content, + "remoteId": item.remote_id, + "isUpdate": true + }), + "noSdlReason": sdl_resp.no_sdl_reason, + "noSdlDetail": sdl_resp.no_sdl_detail, + "userName": "{当前用户}" + }) + IF 成功 → 输出 "✅ 安全设计已同步到DPMS(Story ID: {story_id},useSdl: {sdl_resp.use_sdl})" + IF 失败 → 按容错模式处理 + ELIF sdl_resp.sdl_status == 2 THEN + # 不涉及安全设计:SDL系统已判定(requirement_list为空,use_sdl=0),无需 update 内容 + 输出 "ℹ️ SDL系统判定不涉及安全设计(sdl_status=2,requirement_list为空),无需同步安全设计内容" + END IF ELSE 输出 "⚠️ SDL安全设计生成未完成(3次轮询后仍为生成中),建议稍后手动检查" mcp__biz-sync__save_pending_item( diff --git a/.claude/skills/dpms-design-sync/SKILL.md b/.claude/skills/dpms-design-sync/SKILL.md index 93009849..d6fe8c7c 100644 --- a/.claude/skills/dpms-design-sync/SKILL.md +++ b/.claude/skills/dpms-design-sync/SKILL.md @@ -2,11 +2,17 @@ name: dpms-design-sync type: skill description: SDP设计同步Skill,负责设计阶段与SDP系统的数据同步(含安全设计) -version: 1.3 +version: 1.4 author: DevSyncAgent Team -last_updated: 2026-05-28 +last_updated: 2026-07-21 --- changelog: + v1.4 - 2026-07-21 + - 修复SDL响应字段映射:update-story-sec-design 入参按 get-story-sdl-detail 返回报文填充(storyReqDtoList 按 requirement_list 填充,noSdlReason/noSdlDetail 取自 no_sdl_reason/no_sdl_detail) + - 修复htmlDesignContent来源:直接复用SDL返回的html_design_content(SDL自动生成内容),非从设计文档安全设计章节提取 + - 修复sdl_status完成判断:2或3均代表generate完成(2=不涉及,3=待update确认),4=生成中; 完成判断改为 sdl_status IN (2,3) + - 补全get_sdl_detail输出字段表:requirement_list[]新增content/sec_design_demo/case_list/test_case_id/remote_id/llm_reason/source + - 修正status==3分支:根据generate实际返回统一填充update报文(不做if-else判断),补noSdlReason/noSdlDetail(取自no_sdl_reason/no_sdl_detail);status==2保持不调update v1.3 - 2026-05-28 - 新增 get_sdl_detail action(查询系统需求安全设计详情) - 新增 generate_sdl action(生成安全设计) @@ -130,8 +136,15 @@ changelog: **执行流程:** ``` 1. 调用 mcp__sdp__generate-sdl-requirement 触发生成安全设计任务 -2. 调用 mcp__sdp__get-story-sdl-detail 获取任务结果(每10秒轮询一次,最多3次;若3次后仍为生成中,提示用户稍后手动检查) -3. 根据任务结果,调用 mcp__sdp__update-story-sec-design 更新安全设计内容 +2. 调用 mcp__sdp__get-story-sdl-detail 获取任务结果(每10秒轮询一次,最多3次) + - 完成判断:sdl_status IN (2,3)(2或3均代表generate完成);4=生成中继续轮询 + - 若3次后仍为生成中(sdl_status==4),提示用户稍后手动检查 +3. 根据 sdl_status 分支处理: + - sdl_status==3(设计中):调用 mcp__sdp__update-story-sec-design,根据 generate 实际返回填充报文(generate返回什么就填什么,不做if-else判断) + - 涉及(use_sdl=1, requirement_list非空):传 storyReqDtoList + - 不涉及(use_sdl=0, requirement_list空, no_sdl_reason有值):传 noSdlReason/noSdlDetail + - 按 generate 返回报文中 requirement_list 下的字段填充 update 的 storyReqDtoList;noSdlReason/noSdlDetail 取自 no_sdl_reason/no_sdl_detail;useSdl 取自 use_sdl + - sdl_status==2(已完成终态):不调 update,输出"无需update" 4. 记录安全设计完成时间 5. 返回完成结果 ``` @@ -141,12 +154,12 @@ changelog: { "success": true, "status": "updated", - "sdlStatus": 2, - "completedAt": "2026-05-28T15:30:00Z" + "sdl_status": 3, + "completedAt": "2026-07-21T15:30:00Z" } ``` -**注意:** 安全设计是可选的,只有在有安全要求时才需要调用此 Action。SDL状态枚举:0=不涉及, 1=未完成, 2=已完成, 3=设计中, 4=生成中。 +**注意:** 安全设计是可选的,只有在有安全要求时才需要调用此 Action。SDL状态枚举:2或3均代表generate完成(2=不涉及/requirement_list通常为空, 3=待update确认/requirement_list可能非空也可能空); 4=生成中。 --- @@ -270,27 +283,34 @@ changelog: | 字段名 | 类型 | 说明 | |--------|------|------| -| `storyId` | number | 系统需求ID | -| `useSdl` | number | 是否执行SDL | -| `noSdlReason` | string | 不执行SDL原因 | -| `noSdlDetail` | string | 不执行SDL详情 | -| `sdlStatus` | number | 安全设计状态: 0=不涉及, 1=未完成, 2=已完成, 3=设计中, 4=生成中 | -| `secDesignTempStatus` | number | 安全设计暂存状态 | +| `story_id` | number | 系统需求ID | +| `use_sdl` | number | 是否执行SDL | +| `no_sdl_reason` | string | 不执行SDL原因 | +| `no_sdl_detail` | string | 不执行SDL详情 | +| `sdl_status` | number | 安全设计状态: 2或3均代表generate完成(2=不涉及/requirement_list通常为空, 3=待update确认/requirement_list可能非空也可能空); 4=生成中 | +| `sec_design_temp_status` | number | 安全设计暂存状态 | | `reviewer` | string | 安全设计审核人 | -| `enableSecDesignReview` | boolean | 是否开启安全设计审核 | -| `secTestCaseFinished` | boolean | 安全测试用例是否已完成 | -| `storyEnableNewSdl` | boolean | 是否启用智能化SDL流程 | -| `newSdlException` | string | 智能化SDL流程执行异常信息 | -| `requirementList` | array | 安全需求列表 | +| `enable_sec_design_review` | boolean | 是否开启安全设计审核 | +| `sec_test_case_finished` | boolean | 安全测试用例是否已完成 | +| `story_enable_new_sdl` | boolean | 是否启用智能化SDL流程 | +| `new_sdl_exception` | string | 智能化SDL流程执行异常信息 | +| `requirement_list` | array | 安全需求列表 | -**requirementList Item:** +**requirement_list Item:** | 字段名 | 类型 | 说明 | |--------|------|------| -| `reqSeq` | string | 安全需求ID | +| `req_seq` | string | 安全需求ID | | `title` | string | 安全需求标题 | -| `isEffective` | number | 是否涉及 | -| `htmlDesignContent` | string | 安全设计内容(HTML) | +| `content` | string | 安全需求内容(SDL规则说明) | +| `sec_design_demo` | string | 安全设计示例 | +| `is_effective` | number | 是否涉及 | +| `html_design_content` | string | 安全设计内容(HTML,SDL自动生成,update时直接复用) | +| `case_list` | array | 涉及案例类型列表(如["接口","数据库操作"]) | +| `test_case_id` | number | 关联测试用例ID | +| `remote_id` | number | 运营平台子系统安全需求记录ID(update时映射为remoteId) | +| `llm_reason` | string | LLM判定依据说明 | +| `source` | string | 判定来源(如"tag") | **执行流程:** ``` @@ -302,15 +322,22 @@ changelog: ```json { "success": true, - "storyId": 1001, - "useSdl": 1, - "sdlStatus": 3, - "requirementList": [ + "story_id": 533363, + "use_sdl": 1, + "sdl_status": 3, + "requirement_list": [ { - "reqSeq": "10", - "title": "输入校验", - "isEffective": 1, - "htmlDesignContent": "

对所有用户输入进行校验...

" + "req_seq": "21", + "title": "未授权访问", + "content": "1.应对用户的身份...2.鉴权逻辑应放在后台...", + "sec_design_demo": "1.除了公开的资源...2.使用XX框架进行鉴权...", + "is_effective": 1, + "html_design_content": "本次需求...无新增未授权访问面。", + "case_list": ["接口"], + "test_case_id": 0, + "remote_id": 37572, + "llm_reason": "判断来源:新增批量导出接口。判断依据:涉及接口。", + "source": "tag" } ] } @@ -362,7 +389,7 @@ changelog: } ``` -**注意:** 安全设计生成是异步过程,生成后需调用 get_sdl_detail 检查 sdlStatus 是否变为2(已完成)。 +**注意:** 安全设计生成是异步过程,生成后需调用 get_sdl_detail 检查 sdl_status 是否变为2或3(均代表generate完成;2=不涉及,3=待update确认)。 --- @@ -425,6 +452,8 @@ changelog: | `isUpdate` | boolean | Yes | 是否推送到运营平台更新(可为null) | | `subSystemId` | string | No | 子系统ID | +⚠️ status==3 时按 generate 返回报文填充:storyReqDtoList 按 requirement_list 下的字段填充,noSdlReason/noSdlDetail 取自 no_sdl_reason/no_sdl_detail,useSdl 取自 use_sdl。status==2 不调 update。 + **执行流程:** ``` 1. 调用 mcp__sdp__update-story-sec-design 更新安全设计内容 -- Gitee From 95d2dcd59da26973c26f9398cbb50a78c1abaa0a Mon Sep 17 00:00:00 2001 From: ciel111 Date: Tue, 21 Jul 2026 20:33:39 +0800 Subject: [PATCH 11/13] #AI commit# Modify trigger point for change order --- .claude/commands/dev-flow.md | 71 +------------------ .../dev-flow-checklists/complete-version.md | 37 ++++++++++ .../version-change-order-generator/SKILL.md | 4 +- 3 files changed, 40 insertions(+), 72 deletions(-) diff --git a/.claude/commands/dev-flow.md b/.claude/commands/dev-flow.md index 86340a99..a52e2b65 100644 --- a/.claude/commands/dev-flow.md +++ b/.claude/commands/dev-flow.md @@ -827,7 +827,7 @@ END IF > 📄 `.claude/config/dev-flow-checklists/complete-version.md` > ⛔ 禁止跳过Read直接执行。每个步骤执行完毕后必须逐项验证。 -**概要**:12步流程(状态检查→A6系列操作→DPMS版本状态更新→Business API Version状态更新→总结报告→归档→Git提交+推送)。A6系列含关联子系统版本分支、流水线封板、测试报告汇总、新增测试报告、发布测试报告。步骤11将版本文档(docs/)、归档目录(dev/completed/)、版本配置(versions.json)和待补录记录统一提交到git并可选推送。 +**概要**:状态检查→用户确认→A5.2前置检查→A6系列操作(关联子系统版本分支+流水线封板+测试报告汇总/新增/发布)→Business API Version状态更新→总结报告→归档→生成变更单询问→Git提交+推送。A6系列含关联子系统版本分支、流水线封板、测试报告汇总、新增测试报告、发布测试报告。步骤11将版本文档(docs/)、归档目录(dev/completed/)、版本配置(versions.json)和待补录记录统一提交到git并可选推送。 > 📋 **A5.2 已迁移至 Stage 10.3(v4.9)**:dpms 回归用例同步在 Stage 10 版本级回归测试中执行(所有需求 Stage 9 通过后触发)。complete-version 步骤2.5 改为前置检查(stage10Completed 已执行则跳过,未执行则提示补执行或跳过)。详见 `.claude/config/dev-flow-checklists/stage-10-version-regression.md`。 @@ -936,75 +936,6 @@ END IF --- -### 生成变更单 - -**生成版本发布变更单(调用 version-change-order-generator skill)**。 - -**执行流程**: - -```python -# 1. 读取 versions.json,提取所有有 versionPlanId 且 status==completed 的版本 -versions = read("dev/versions/versions.json") -IF versions 不存在 OR versions.get("list") 为空 THEN - OUTPUT "❌ 无版本可生成变更单" - 重新展示主菜单 -END IF - -candidates = [] -FOR each v IN versions.get("list", []): - dpms = v.get("dpms", {}) - vp_id = dpms.get("versionPlanId") OR dpms.get("releasePlanId") - # ⚠ 仅纳入版本级 status==completed 的版本(skill 步骤1 强制校验版本 status==completed,非 completed 会被 skill 终止) - IF vp_id 非空 AND v.get("status") == "completed" THEN - candidates.append({ - "versionName": v.get("versionName"), - "versionPlanId": str(vp_id), - "status": v.get("status", "unknown"), - "completedAt": v.get("completedAt") - }) - END IF -END FOR - -IF candidates 为空 THEN - OUTPUT "❌ 暂无满足条件的版本:需同时具备 versionPlanId 且 版本级 status==completed(skill 步骤1 强制校验)。请先完成版本流程(complete-version 将版本标记为 completed)后再生成变更单" - 重新展示主菜单 -END IF - -# 2. 按 completedAt 倒序排序(最近完成的版本在前,优先推荐;completedAt 缺失排末尾),再取首个为推荐 -candidates.sort(key=lambda c: c.get("completedAt") or "", reverse=True) -default_id = candidates[0]["versionPlanId"] IF candidates 非空 ELSE None -# 使用 AskUserQuestion 让用户选择(含"返回主菜单"出口) - -# 构造选项:各候选版本(推荐项标注)+ "返回主菜单" -# ⚠ AskUserQuestion 单问题选项上限 4(含自带 Other):候选版本 >3 时仅展示前 3 个,其余版本用户可选 Other 自定义输入 versionPlanId -options = [] -FOR c IN candidates[:3]: - label = c["versionName"] + ("(推荐)" IF c["versionPlanId"] == default_id ELSE "") - options.append({"label": label, "description": f"versionPlanId={c['versionPlanId']}, completedAt={c.get('completedAt') or '未知'}"}) -options.append({"label": "返回主菜单", "description": "取消生成变更单,返回主菜单"}) - -user_choice = AskUserQuestion( - question="请选择要生成变更单的版本", - header="生成变更单", - options=options -) - -IF user_choice.label == "返回主菜单" THEN - 重新展示主菜单 - RETURN # 不进入 skill,结束本次"生成变更单"流程 -END IF -selected_id = user_choice 对应候选版本的 versionPlanId - -# 3. 调用 version-change-order-generator skill -Skill(version-change-order-generator, args={"versionPlanId": selected_id}) -``` - -⚠️ **版本完成度校验由 skill 内部执行**:skill 步骤1会校验 `subsystemVersionId` 非空、`testReportId` 非空 且 版本 `status==completed`(target_version.status,字段不存在视为未完成),不符合则输出"版本未完成"并终止。用户需先完成版本流程(complete-version 将版本标记为 completed 并生成 testReportId)再生成本变更单。 - -4. skill 执行完成后(无论成功或终止),重新展示主菜单。 - ---- - ### 启动版本需求 > ⚠️ **详细执行流程已外置,禁止凭记忆执行!** diff --git a/.claude/config/dev-flow-checklists/complete-version.md b/.claude/config/dev-flow-checklists/complete-version.md index 95613e11..54761437 100644 --- a/.claude/config/dev-flow-checklists/complete-version.md +++ b/.claude/config/dev-flow-checklists/complete-version.md @@ -350,6 +350,42 @@ - 将 requirementContextIndex 中每个 contextPath 原子改写为 completed 路径,并再次校验文件存在 - 更新版本配置状态为 `completed` +10.5. **生成变更单询问**(🆕 在步骤10归档+版本状态置completed之后、步骤11 Git提交之前触发;衔接A6-Step3写入的testReportId): + ```python + # 前置:版本状态已置 completed(步骤10),testReportId 已在步骤6(A6-Step3)写入 versions.json + testReportId = 版本配置.testReportId + versionPlanId = 版本配置.dpms.versionPlanId OR 版本配置.dpms.releasePlanId + + # 条件:testReportId 非空才询问(A6-Step3 成功创建报告的标志;跳过A6系列或Step3失败时为空) + IF testReportId 为空 THEN + OUTPUT: "ℹ️ testReportId 为空(A6系列跳过或新增测试报告失败),跳过生成变更单询问,继续步骤11" + ELIF versionPlanId 为空 THEN + OUTPUT: "⚠️ versionPlanId 缺失,无法生成变更单,继续步骤11(可稍后手动 /version-change-order-generator 调用)" + ELSE + change_order_ans = AskUserQuestion({ + "questions": [{ + "question": "版本已完成并归档,测试报告已生成(testReportId 已写入)。是否现在生成版本发布变更单?", + "header": "生成变更单", + "options": [ + {"label": "生成变更单", "description": "调用 version-change-order-generator skill,按模板生成版本发布变更单文档"}, + {"label": "暂不生成,继续", "description": "跳过本次生成,继续步骤11 Git提交;可稍后手动 /version-change-order-generator 调用"} + ] + }] + }) + IF change_order_ans == "生成变更单" THEN + # 直接调用 skill(当前版本唯一,不走 dev-flow.md "生成变更单" 章节的多版本候选选择) + # skill 步骤1校验 subsystemVersionId/testReportId 非空 + 版本 status==completed(步骤10已满足) + Skill(version-change-order-generator, args={"versionPlanId": versionPlanId}) + OUTPUT: "ℹ️ 变更单生成流程结束(无论成功或终止),继续步骤11 Git提交" + END IF + END IF + # 无论生成与否,继续步骤11 + ``` + + ⚠️ **执行时机**:本步骤在步骤10(归档+版本状态置completed)之后、步骤11(Git提交)之前。版本 status 已为 completed,version-change-order-generator skill 步骤1的 `status==completed` 校验可自然通过(时序冲突已解决)。 + ⚠️ **与主菜单"生成变更单"的关系**:dev-flow.md 主菜单的"生成变更单"章节是多版本候选选择场景(当前 dev-flow-menus.json 未配置该入口);本步骤是完成版本流程内的单版本直接调用,不走候选选择,直接传当前版本 versionPlanId。 + ⚠️ **skill 执行后不回主菜单**:与 dev-flow.md "生成变更单"章节末尾"重新展示主菜单"不同,本步骤在 complete-version 流程内,skill 执行后继续步骤11 Git提交。 + 11. **版本归档Git提交**: ```python # 11a. 扫描版本相关文件变更 @@ -482,6 +518,7 @@ FOR operation IN [ - [ ] 步骤9: 总结报告已生成 = ? - [ ] 步骤10: 归档完成 = ? - [ ] 步骤10: versionContextPath/requirementContextIndex 已切换到 completed 路径 = ? +- [ ] 步骤10.5: 生成变更单询问 = ? (生成+skill调用/跳过testReportId空/跳过versionPlanId空/用户选暂不生成) - [ ] 步骤11: 版本归档Git提交 = ? (提交成功/跳过无变更) - [ ] 步骤11: `.agents/` 未修改、未暂存、未提交 = ? - [ ] 步骤11d: git commit = ? diff --git a/.claude/skills/version-change-order-generator/SKILL.md b/.claude/skills/version-change-order-generator/SKILL.md index c03adc2a..43911d42 100644 --- a/.claude/skills/version-change-order-generator/SKILL.md +++ b/.claude/skills/version-change-order-generator/SKILL.md @@ -1,7 +1,7 @@ --- name: version-change-order-generator type: skill -description: 版本发布变更单生成Skill,既可被dev-flow菜单调起也可手动调用,通过versionPlanId定位版本,读取versions.json和各文档石墨链接,按模板生成版本变更单 +description: 版本发布变更单生成Skill,可被complete-version步骤10.5调起或手动命令调用,通过versionPlanId定位版本,读取versions.json和各文档石墨链接,按模板生成版本变更单 version: 1.3 author: DevSyncAgent Team last_updated: 2026-07-14 @@ -34,7 +34,7 @@ changelog: ## 重要概念 -本 Skill 既可被 dev-flow 主菜单(STARTED + ALL_COMPLETED 状态)的"生成变更单"选项调起,也可通过 `/version-change-order-generator ` 手动独立调用,用于在版本开发完成(或阶段完成)后生成版本发布变更单文档。 +本 Skill 可在完成版本流程中由 complete-version 步骤10.5(版本归档后、testReportId非空时询问)调起,也可通过 `/version-change-order-generator ` 手动独立调用,用于在版本开发完成(或阶段完成)后生成版本发布变更单文档。 ## 调用形式 -- Gitee From d36cf712b8569d1aebc6c81d5089f85e9a98523d Mon Sep 17 00:00:00 2001 From: ciel111 Date: Sat, 25 Jul 2026 15:00:46 +0800 Subject: [PATCH 12/13] #AI commit# Modify Requirement Title Format Rules --- .claude/commands/dev-flow.md | 43 +++++++++++-------- .../config/dev-flow-checklists/stage-hooks.md | 3 +- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/.claude/commands/dev-flow.md b/.claude/commands/dev-flow.md index a52e2b65..8d6ae8a2 100644 --- a/.claude/commands/dev-flow.md +++ b/.claude/commands/dev-flow.md @@ -2,10 +2,14 @@ name: dev-flow type: command description: 开发工作流编排命令,启动完整的开发工作流,从需求分析到测试报告生成,支持版本粒度管理 -version: 4.9 +version: 4.10 author: DevSyncAgent Team -last_updated: 2026-07-20 +last_updated: 2026-07-22 changelog: + v4.10 - 2026-07-22 + - 🆕 需求名称格式规范升级为5段全角中括号:【xx风险】【用户体验优化/运维优化/需求部门】【组件名】【一级模块-二级模块】【前后端需求】需求名称(如 【低风险】【运维优化】【Exchangis】【告警管理-IMS告警】【前后端需求】IMS告警增加ecc_receiver ECC通知人字段) + - 🔄 正则升级为 ^【(高风险|中风险|低风险)】【(.+?)】【(.+?)】【(.+?)】【(.+?)】(.+)$(5段全角中括号;第1段风险枚举,第2/3/4/5段自由文本);name 取第6段需求名称,rawFullName 仍为完整格式串 + - 🔗 配套修改:stage-hooks.md(versions.json schema 示例 rawFullName 同步新格式) v4.9 - 2026-07-20 - 🆕 版本轨添加需求支持需求名称格式规范:[风险等级][一级模块名][二级模块名][前后端]需求描述(如 [中风险][文件上传][作业管理-数据源][前后端需求]文件数据集导入功能) - 🆕 add-story/add-stories 录入时内联格式校验+允许跳过降级(正则 ^\[(高风险|中风险|低风险)\]\[(.+?)\]\[(.+?)\]\[(.+?)\](.+)$);A3 调用 add-system-story 的 name=rawFullName(完整格式串;降级=纯文本 name) @@ -1100,22 +1104,23 @@ execute_rollback(requirement=target_requirement, mode="interactive", reason="主 4. 🆕 **需求名称格式校验与提取**(内联,无独立 checklist) - 展示录入提示文字: ``` - 请输入需求名称,格式要求:[风险等级][一级模块名][二级模块名][前后端]需求描述 - - 风险等级:高风险 / 中风险 / 低风险 - - 一级模块名:如 文件上传 - - 二级模块名:如 作业管理-数据源 - - 前后端:前端需求 / 后端需求 / 前后端需求 - - 需求描述:如 文件数据集导入功能 - 示例:[中风险][文件上传][作业管理-数据源][前后端需求]文件数据集导入功能 - ⚠️ 完整格式串将作为系统需求名称上传 DPMS,末尾"需求描述"作为本地文档名称。 + 请输入需求名称,格式要求:【xx风险】【用户体验优化/运维优化/需求部门】【组件名】【一级模块-二级模块】【前后端需求】需求名称 + - xx风险:高风险 / 中风险 / 低风险 + - 用户体验优化/运维优化/需求部门:需求来源/类型,如 运维优化("需求部门"填具体部门名) + - 组件名:如 Exchangis + - 一级模块-二级模块:如 告警管理-IMS告警 + - 前后端需求:前端需求 / 后端需求 / 前后端需求 + - 需求名称:如 IMS告警增加ecc_receiver ECC通知人字段 + 示例:【低风险】【运维优化】【Exchangis】【告警管理-IMS告警】【前后端需求】IMS告警增加ecc_receiver ECC通知人字段 + ⚠️ 完整格式串将作为系统需求名称上传 DPMS,末尾"需求名称"作为本地文档名称。 ``` - - 读取用户输入 raw_input,按正则 `^\[(高风险|中风险|低风险)\]\[(.+?)\]\[(.+?)\]\[(.+?)\](.+)$` 校验: - - **格式化模式**(匹配成功):`name`=第5段(末尾需求描述,作文档名),`rawFullName`=raw_input(完整格式串,作 DPMS name);风险等级/模块/前后端仅作确认展示,不持久化、不映射 priority + - 读取用户输入 raw_input,按正则 `^【(高风险|中风险|低风险)】【(.+?)】【(.+?)】【(.+?)】【(.+?)】(.+)$` 校验: + - **格式化模式**(匹配成功):`name`=第6段(末尾需求名称,作文档名),`rawFullName`=raw_input(完整格式串,作 DPMS name);风险/来源类型/组件/模块/前后端仅作确认展示,不持久化、不映射 priority - **降级模式**(匹配失败):AskUserQuestion [重新输入 / 跳过格式按纯文本录入 / 取消];跳过时 `name`=raw_input,`rawFullName`=raw_input -5. 展示确认信息:需求名称(name)、rawFullName、风险等级、一级模块、二级模块、前后端 +5. 展示确认信息:需求名称(name)、rawFullName、风险、来源/类型、组件名、一级模块-二级模块、前后端 6. **始终执行**:创建本地记录,更新 `dev/versions/versions.json`(type/priority 留空由后续 P1 自动识别;🆕 新增 `rawFullName` 字段) - **分配需求编号**:读取当前版本的 `nextReqIndex`,分配 `reqIndex = nextReqIndex`,然后 `nextReqIndex += 1`。`reqPrefix = "REQ-" + str(reqIndex).zfill(2)`(如 REQ-01、REQ-02)。写入 requirements 数组。 - - 🆕 requirements 数组新增 `rawFullName` 字段(完整格式串;降级模式=纯文本=name)。riskLevel/moduleL1/moduleL2/frontendBackend 不持久化;priority 维持原逻辑(P1 识别写回,不映射风险等级)。 + - 🆕 requirements 数组新增 `rawFullName` 字段(完整格式串;降级模式=纯文本=name)。risk/sourceType/component/module/frontendBackend 仅作确认展示不持久化;priority 维持原逻辑(P1 识别写回,不映射风险等级)。 7. 询问远程操作策略(使用 AskUserQuestion,A3/A4可独立跳过): - 选项1: "**全部执行(推荐)→ 创建本地记录 + DPMS创建系统需求 + 关联子系统版本**" - 选项2: "**仅DPMS创建系统需求 → 创建本地记录 + DPMS创建系统需求,跳过关联子系统版本**" @@ -1133,18 +1138,18 @@ execute_rollback(requirement=target_requirement, mode="interactive", reason="主 ### 批量添加版本需求 **在指定版本下批量添加多个系统需求。版本名从当前活跃版本自动获取。** -2. 🆕 展示录入提示文字(格式 `[风险等级][一级模块名][二级模块名][前后端]需求描述` + 字段说明 + 示例,同添加单个需求),并解析需求列表(支持以下分隔格式): +2. 🆕 展示录入提示文字(格式 `【xx风险】【用户体验优化/运维优化/需求部门】【组件名】【一级模块-二级模块】【前后端需求】需求名称` + 字段说明 + 示例,同添加单个需求),并解析需求列表(支持以下分隔格式): - `1. xxx; 2. yyy; 3. zzz` - `1、xxx 2、yyy 3、zzz` - `1) xxx 2) yyy 3) zzz` - - 🆕 对每条按正则 `^\[(高风险|中风险|低风险)\]\[(.+?)\]\[(.+?)\]\[(.+?)\](.+)$` 校验:✅ 符合(name=第5段doc_name, rawFullName=完整串)/ ❌ 不符(标记降级:name=raw_input, rawFullName=raw_input) + - 🆕 对每条按正则 `^【(高风险|中风险|低风险)】【(.+?)】【(.+?)】【(.+?)】【(.+?)】(.+)$` 校验:✅ 符合(name=第6段doc_name, rawFullName=完整串)/ ❌ 不符(标记降级:name=raw_input, rawFullName=raw_input) 3. **确认识别结果**(关键步骤,使用 AskUserQuestion): - - 展示解析结果表(序号 | 用户输入 | 格式校验 | doc_name | 风险 | 一级模块 | 二级模块 | 前后端) + - 展示解析结果表(序号 | 用户输入 | 格式校验 | doc_name | 风险 | 来源/类型 | 组件名 | 一级模块-二级模块 | 前后端) - 选项:"**全部正确,继续(不符条目自动降级为纯文本)**" / "**识别有误,重新输入**" -4. 展示完整确认信息(所有需求列表,含 rawFullName 与风险等级) +4. 展示完整确认信息(所有需求列表,含 rawFullName 与风险/来源类型/组件/模块/前后端) 5. **始终执行**:创建本地记录,更新 `dev/versions/versions.json`(type/priority 留空由后续 P1 自动识别;🆕 新增 `rawFullName` 字段) - **分配需求编号**:对每个需求按添加顺序分配递增的 `reqIndex`(从 `nextReqIndex` 开始,每个需求 +1),计算 `reqPrefix = "REQ-" + str(reqIndex).zfill(2)`。写入 requirements 数组并更新 `nextReqIndex`。 - - 🆕 每条需求写入 `rawFullName`(格式化=完整串;降级=纯文本=name)。riskLevel/moduleL1/moduleL2/frontendBackend 不持久化;priority 维持原逻辑(P1 识别写回,不映射风险等级)。 + - 🆕 每条需求写入 `rawFullName`(格式化=完整串;降级=纯文本=name)。risk/sourceType/component/module/frontendBackend 仅作确认展示不持久化;priority 维持原逻辑(P1 识别写回,不映射风险等级)。 6. 询问远程操作策略(使用 AskUserQuestion,A3/A4可独立跳过): - 选项1: "**全部执行(推荐)→ 创建本地记录 + DPMS创建系统需求 + 关联子系统版本**" - 选项2: "**仅DPMS创建系统需求 → 创建本地记录 + DPMS创建系统需求,跳过关联子系统版本**" diff --git a/.claude/config/dev-flow-checklists/stage-hooks.md b/.claude/config/dev-flow-checklists/stage-hooks.md index a5e568aa..3ba8a63f 100644 --- a/.claude/config/dev-flow-checklists/stage-hooks.md +++ b/.claude/config/dev-flow-checklists/stage-hooks.md @@ -3,6 +3,7 @@ > 来源:dev-flow.md "21阶段有序推进规则" + "逐阶段执行流程" + "阶段Prompt构造规则" + "阶段后置动作映射表" + "阶段后置动作执行指引"章节 > v4.9 G4 新增:Stage 3.5 插件开发迭代评估循环(仅 dev_target=Agent/Skill/Command 触发) > v4.9 上下文优化:统一版本/需求上下文契约、阶段结果协议与两阶段 checkpoint +> v4.10 同步:versions.json schema 示例 rawFullName 升级为5段全角中括号格式 > 用途:执行版本模式逐阶段推进时必须Read本文件,按步骤逐项执行 ## 21阶段有序推进规则 @@ -1779,7 +1780,7 @@ END IF "nextReqIndex": 3, "requirements": [{ "name": "xxx", - "rawFullName": "[中风险][文件上传][作业管理-数据源][前后端需求]文件数据集导入功能", # 🆕 完整格式串(DPMS name 用;降级模式=纯文本=name;旧数据可能不存在) + "rawFullName": "【低风险】【运维优化】【Exchangis】【告警管理-IMS告警】【前后端需求】IMS告警增加ecc_receiver ECC通知人字段", # 🆕 完整格式串(DPMS name 用;降级模式=纯文本=name;旧数据可能不存在) "reqIndex": 1, "type": "ENHANCE", "currentStage": "1.1", -- Gitee From 24f945f49fa4aeb4a88f504167510d5ee26c490a Mon Sep 17 00:00:00 2001 From: ciel111 Date: Wed, 29 Jul 2026 17:28:23 +0800 Subject: [PATCH 13/13] #AI commit# WIP: snapshot uncommitted changes before merging origin/master Co-Authored-By: Claude --- .../testing/functional-test-generator.md | 12 +- .claude/commands/dev-sync-agent-help.md | 18 +- .../associate-requirement.md | 17 +- .../dev-flow-checklists/create-version.md | 196 +- .../stage-10-version-regression.md | 81 + .../dev-flow-checklists/stage-names.json | 8 +- .claude/config/dev-flow-context-contract.json | 27 +- .../plugin-dev/plugin-dev-flow-rules.json | 57 + .claude/settings.local.json | 7 +- .../skills/functional-test-generator/SKILL.md | 12 +- .claude/skills/plugin-quality-scorer/SKILL.md | 85 + .../references/scoring-rubric.md | 110 + .../scripts/skill-scoring-check.py | 200 + ...41\347\211\210\345\206\205\345\256\271.md" | 5 +- CLAUDE.md | 21 + PROJECT_STRUCTURE.md | 10 +- RELEASE_NOTES.md | 75 +- ...75\345\212\233\350\260\203\347\240\224.md" | 317 + ...5\236\213spike\346\226\271\346\241\210.md" | 371 + ...57\346\214\201\346\226\271\346\241\210.md" | 421 + ...64\345\220\210\346\226\271\346\241\210.md" | 143 + ...26\346\216\222\346\226\271\346\241\210.md" | 224 + .../session_detail.md | 615 + .../session_index.json | 6 + .../session_detail.md | 52 + .../session_index.json | 6 + .../session_detail.md | 6496 +++++++++ .../session_index.json | 6 + .../session_detail.md | 806 ++ .../session_index.json | 4 +- .../session_detail.md | 11393 ++++++++++++++++ .../session_index.json | 6 + .../session_detail.md | 5571 ++++++++ .../session_index.json | 4 +- .../session_detail.md | 3793 +++++ .../session_index.json | 6 + .../session_detail.md | 4267 ++++++ .../session_index.json | 6 + .../session_detail.md | 667 + .../session_index.json | 6 + .../session_detail.md | 3368 +++++ .../session_index.json | 6 + .../session_detail.md" | 143 + .../session_index.json" | 6 + ...\345\212\233\350\260\203\347\240\224.html" | 335 + ...267\265\345\210\206\344\272\253-v2.0.html" | 452 + ...267\265\345\210\206\344\272\253-v2.1.html" | 575 + ...\350\267\265\345\210\206\344\272\253.html" | 498 + ...04\345\210\206\346\226\271\346\241\210.md" | 296 + ...56\345\244\215\346\226\271\346\241\210.md" | 221 + memory/daily/2026-07-27.md | 6 + memory/memory-index.json | 6 +- memory/topics/decisions.md | 14 + memory/topics/pitfalls.md | 18 + .../requirement/version-orchestrator.md | 8 +- .../testing/functional-test-generator.md | 12 +- output/.claude/commands/dev-flow.md | 169 +- .../.claude/commands/dev-sync-agent-help.md | 18 +- .../associate-requirement.md | 17 +- .../dev-flow-checklists/complete-version.md | 398 +- .../dev-flow-checklists/create-version.md | 211 +- .../stage-10-version-regression.md | 195 +- .../config/dev-flow-checklists/stage-hooks.md | 274 +- .../dev-flow-checklists/start-development.md | 60 +- .../config/dev-flow-context-contract.json | 8 +- output/.claude/mcp/scm-mcp-calls.md | 27 +- output/.claude/settings.local.json | 6 +- .../skills/functional-test-generator/SKILL.md | 12 +- .../version-change-order-generator/SKILL.md | 10 +- ...41\347\211\210\345\206\205\345\256\271.md" | 5 +- output/CODE_GO_USAGE_GUIDE.md | 12 +- .../clawrelay-api/clawrelay-api.exe | Bin 13824000 -> 13825024 bytes .../task-viewer/dist/index.html | 2 +- .../scripts/feedback_to_baseline.py | 903 ++ .../task-viewer/scripts/requirements.txt | 4 + .../wecom-server/scripts/install.bat | 8 +- .../clawrelay/clawrelay-api/business_api.go | 30 +- .../clawrelay/clawrelay-api/clawrelay-api.exe | Bin 13824000 -> 13825024 bytes .../clawrelay-wecom-server/pyproject.toml | 2 +- .../scripts/install.bat | 8 +- .../src/adapters/claude_relay_adapter.py | 13 +- .../src/core/claude_relay_orchestrator.py | 17 +- .../src/core/session_watcher.py | 6 + .../task-viewer/frontend/dist/index.html | 2 +- .../.claude/agents/README.md | 300 + .../.claude/agents/auth-route-debugger.md | 117 + .../.claude/agents/auth-route-tester.md | 93 + .../.claude/agents/auto-error-resolver.md | 96 + .../agents/code-architecture-reviewer.md | 83 + .../.claude/agents/code-refactor-master.md | 94 + .../.claude/agents/documentation-architect.md | 82 + .../.claude/agents/frontend-error-fixer.md | 76 + .../.claude/agents/plan-reviewer.md | 52 + .../.claude/agents/refactor-planner.md | 62 + .../.claude/agents/web-research-specialist.md | 78 + .../.claude/commands/dev-docs-update.md | 55 + .../.claude/commands/dev-docs.md | 51 + .../commands/route-research-for-testing.md | 37 + .../.claude/hooks/CONFIG.md | 448 + .../.claude/hooks/README.md | 163 + .../.claude/hooks/error-handling-reminder.sh | 12 + .../.claude/hooks/error-handling-reminder.ts | 222 + .../.claude/hooks/package-lock.json | 556 + .../.claude/hooks/package.json | 16 + .../.claude/hooks/post-tool-use-tracker.sh | 178 + .../.claude/hooks/skill-activation-prompt.sh | 5 + .../.claude/hooks/skill-activation-prompt.ts | 132 + .../hooks/stop-build-check-enhanced.sh | 125 + .../.claude/hooks/trigger-build-resolver.sh | 79 + .../.claude/hooks/tsc-check.sh | 173 + .../.claude/hooks/tsconfig.json | 19 + .../.claude/settings.json | 55 + .../.claude/skills/README.md | 368 + .../skills/backend-dev-guidelines/SKILL.md | 302 + .../resources/architecture-overview.md | 451 + .../resources/async-and-errors.md | 307 + .../resources/complete-examples.md | 638 + .../resources/configuration.md | 275 + .../resources/database-patterns.md | 224 + .../resources/middleware-guide.md | 213 + .../resources/routing-and-controllers.md | 756 + .../resources/sentry-and-monitoring.md | 336 + .../resources/services-and-repositories.md | 789 ++ .../resources/testing-guide.md | 235 + .../resources/validation-patterns.md | 754 + .../.claude/skills/error-tracking/SKILL.md | 375 + .../skills/frontend-dev-guidelines/SKILL.md | 399 + .../resources/common-patterns.md | 331 + .../resources/complete-examples.md | 872 ++ .../resources/component-patterns.md | 502 + .../resources/data-fetching.md | 767 ++ .../resources/file-organization.md | 502 + .../resources/loading-and-error-states.md | 501 + .../resources/performance.md | 406 + .../resources/routing-guide.md | 364 + .../resources/styling-guide.md | 428 + .../resources/typescript-standards.md | 418 + .../.claude/skills/route-tester/SKILL.md | 388 + .../skills/skill-developer/ADVANCED.md | 197 + .../skills/skill-developer/HOOK_MECHANISMS.md | 306 + .../skill-developer/PATTERNS_LIBRARY.md | 152 + .../.claude/skills/skill-developer/SKILL.md | 426 + .../skill-developer/SKILL_RULES_REFERENCE.md | 315 + .../skills/skill-developer/TRIGGER_TYPES.md | 305 + .../skills/skill-developer/TROUBLESHOOTING.md | 514 + .../.claude/skills/skill-rules.json | 241 + .../.gitignore | 51 + .../CLAUDE.md | 683 + .../CLAUDE_INTEGRATION_GUIDE.md | 883 ++ .../LICENSE | 21 + .../README.md | 360 + .../dev/README.md | 424 + ...73\347\273\237\346\211\223\351\200\232.md" | 55 + ...32\351\241\271\344\274\230\345\214\226.md" | 5565 ++++++++ ...06\346\213\206\344\274\230\345\214\226.md" | 123 + ...205\245Recheck\346\265\201\347\250\213.md" | 2354 ++++ .../artiste-workflow-composer/SKILL.md | 196 + .../evals/evals.json | 26 + .../references/node_types.md | 244 + .../.claude/commands/artiste-commit-push.md | 23 + .../.claude/commands/artiste-commit.md | 23 + .../.claude/plans/elegant-inventing-cosmos.md | 159 + .../tiangong/.claude/settings.json | 5 + .../skills/artiste-add-command/SKILL.md | 250 + .../artiste-add-command/evals/evals.json | 23 + .../references/examples.md | 355 + .../skills/artiste-dag-node-dev/SKILL.md | 484 + .../.claude/skills/artiste-design/SKILL.md | 456 + .../skills/artiste-wfaas-publish/SKILL.md | 402 + .../.claude/skills/get_product_info/SKILL.md | 24 + .../tiangong/.dockerignore | 206 + .../tiangong/.env.example | 64 + .../tiangong/.eslintignore | 11 + .../tiangong/.kilocode/rules/kiro.md | 10 + temp/archived-source-code/tiangong/.npmignore | 61 + .../tiangong/.prettierignore | 13 + temp/archived-source-code/tiangong/AGENTS.md | 32 + .../BACKOFF_MULTIPLIER_EXPLANATION.md | 335 + temp/archived-source-code/tiangong/CLAUDE.md | 811 ++ .../tiangong/CRITICAL_FIX_v1.4.md | 343 + .../tiangong/DEPLOYMENT_GUIDE_v1.3.md | 332 + .../tiangong/DEPLOY_NOW.md | 68 + .../tiangong/DEPLOY_v1.4.md | 59 + temp/archived-source-code/tiangong/Dockerfile | 82 + .../tiangong/FINAL_FIX_v1.3.md | 323 + .../tiangong/FRONTEND_MANUAL_CHANGES.md | 238 + .../tiangong/INFINITE_LOOP_ANALYSIS.md | 445 + .../tiangong/JSON_BUFFER_SIZE_FIX.md | 270 + .../tiangong/LAYER_PERSONNEL_REFRESH_POST.md | 207 + .../tiangong/MULTI_TAGS_IMPLEMENTATION.md | 343 + .../tiangong/NODE_RETRY_CONFIGURATION.md | 232 + .../tiangong/PERMISSION_SERVICE_GUIDE.md | 292 + .../tiangong/PERMISSION_TOGGLE_GUIDE.md | 132 + .../tiangong/PERSONNEL_SELECTION_FIX.md | 287 + .../tiangong/PRODUCT_FIELDS_EXTENSION.md | 0 .../tiangong/QUICK_REFERENCE.md | 110 + .../tiangong/README.en.md | 36 + temp/archived-source-code/tiangong/README.md | 137 + .../tiangong/RESOURCE_SERVICE_MANUAL_FIX.md | 54 + .../tiangong/SCHEDULED_FLOW_MULTI_TAGS.md | 142 + .../tiangong/SHIMO_EXPORT_IMPLEMENTATION.md | 486 + .../tiangong/TASK_COMPLETION_STATUS.md | 91 + .../tiangong/TROUBLESHOOTING.md | 225 + .../tiangong/ULTIMATE_FIX_v1.3-final.md | 412 + .../tiangong/backend/.env.example | 142 + .../tiangong/backend/.flake8 | 12 + .../tiangong/backend/API_REQUESTS.md | 155 + .../tiangong/backend/AUTOMATED_NODE_FIX.md | 171 + .../tiangong/backend/CHANGES.md | 370 + .../tiangong/backend/CODE_REVIEW_FIXES.md | 302 + .../tiangong/backend/DATABASE_SETUP.md | 192 + .../tiangong/backend/DEPLOYMENT_CHECKLIST.md | 300 + .../tiangong/backend/EMERGENCY_FIX_v1.2.md | 282 + .../tiangong/backend/FLOW_ANALYSIS.md | 346 + .../backend/IMPLEMENTATION_COMPLETE.md | 167 + .../tiangong/backend/MARIADB_FIX.md | 132 + .../backend/PARAMETER_COLLECTION_FIX.md | 200 + .../backend/REFACTORING_FINAL_COMPLETE.md | 230 + .../tiangong/backend/TROUBLESHOOTING.mdd | 225 + .../backend/WORKFLOW_GUIDE_SIMPLIFICATION.md | 140 + .../tiangong/backend/__init__.py | 0 .../backend/add_force_single_instance.sql | 5 + .../tiangong/backend/add_subflow_support.sql | 28 + .../tiangong/backend/api_requests.json | 107 + .../tiangong/backend/callback_test_plan.md | 33 + .../tiangong/backend/check_command_config.py | 186 + .../backend/config/commands/__init__.py | 193 + .../backend/config/commands/analysis.yaml | 258 + .../tiangong/backend/config/commands/base.py | 215 + .../tiangong/backend/config/commands/dev.yaml | 625 + .../backend/config/commands/flow.yaml | 48 + .../backend/config/commands/misc.yaml | 160 + .../backend/config/commands/publish.yaml | 133 + .../backend/config/commands/test.yaml | 899 ++ .../backend/config/commands/watch.yaml | 421 + .../backend/config/workflows/__init__.py | 281 + .../tiangong/backend/config/workflows/base.py | 174 + .../backend/config/workflows/core.yaml | 4046 ++++++ .../backend/config/workflows/dev.yaml | 690 + .../backend/config/workflows/misc.yaml | 1732 +++ .../backend/config/workflows/publish.yaml | 101 + .../backend/config/workflows/test.yaml | 1049 ++ .../backend/create_ai_configs_table.sql | 37 + .../backend/create_apscheduler_tables.sql | 10 + .../backend/create_callback_table.sql | 10 + .../backend/create_whitelist_table.sql | 13 + .../2026-01-27-multi-role-approval-design.md | 1581 +++ ...130000_add_workflow_instance_meta_table.py | 53 + .../docs/CODE_SIMPLIFICATION_SUMMARY.md | 91 + .../docs/DAG_INTENT_INTEGRATION_PLAN.md | 477 + .../Execute-Flow-Node-Configuration-Guide.md | 258 + .../ExecuteFlowNode-Optimization-Summary.md | 133 + .../backend/docs/FIX_AGENT_MESSAGE_ISSUES.md | 278 + .../docs/INTENT_RECOGNITION_SERVICE.md | 647 + .../InternalWorkflowService-UsageGuide.md | 1311 ++ .../backend/docs/NODE_DEVELOPMENT_GUIDE.md | 838 ++ .../PARAMETER_VALIDATION_SIMPLIFICATION.md | 270 + .../tiangong/backend/docs/README_RD_HOOKS.md | 105 + .../backend/docs/REFACTORING_GUIDE.md | 189 + .../backend/docs/SUSPENDED_NODE_REMINDER.md | 296 + ...TASK_STATUS_NOTIFICATION_IMPLEMENTATION.md | 199 + .../WFAAS_HOSTALIAS_VOLUMEMOUNTS_GUIDE.md | 338 + .../backend/docs/WHITELIST_BATCH_INPUT.md | 119 + .../tiangong/backend/docs/add_group.md | 31 + .../docs/agent_multi_repo_analysis_design.md | 431 + .../docs/command-config-integration-test.md | 237 + .../backend/docs/dag_context_parameters.md | 763 ++ .../backend/docs/dag_parameter_validation.md | 265 + .../docs/dag_parameter_validation_fix.md | 364 + .../docs/dag_parameter_validation_fix_v1.2.md | 318 + .../docs/dag_parameter_validation_fix_v1.3.md | 308 + ...dag_parameter_validation_implementation.md | 341 + .../backend/docs/intent_workflow_flow.md | 420 + .../backend/docs/multi_instance_analysis.md | 330 + .../docs/scheduled_flow_group_feature.md | 176 + .../docs/sql/financial_table_standards.md | 354 + ...12-add-command-role-permission-control.sql | 35 + ...kflow_statistics_implementation_summary.md | 145 + .../backend/file_operation_todo_list.md | 5 + .../tiangong/backend/init_db.py | 51 + .../tiangong/backend/init_rd_process.sql | 35 + .../tiangong/backend/init_rd_process_api.json | 98 + .../tiangong/backend/init_sqlite_db.py | 46 + .../backend/insert_intent_prompts.sql | 186 + .../backend/migrate_agent_messages_table.py | 64 + .../backend/migrate_resources_table.py | 38 + .../2026-01-21-wfaas-json-to-text.sql | 14 + .../tiangong/backend/migrations/README.md | 15 + .../migrations/add_agent_message_fields.sql | 19 + .../add_api_key_tags_to_scheduled_flows.sql | 11 + .../migrations/add_approval_history_table.sql | 18 + ...add_flow_instance_id_to_node_execution.sql | 22 + ...w_instance_id_to_node_execution_sqlite.sql | 17 + ..._concurrency_fields_to_scheduled_flows.sql | 13 + .../add_group_config_to_scheduled_flows.sql | 9 + .../add_hostalias_and_volumemounts.sql | 52 + ...add_is_published_to_workflow_templates.sql | 10 + ...tput_declaration_to_workflow_templates.sql | 6 + .../migrations/add_server_instance_to_dag.sql | 23 + .../add_show_in_man_to_command_config.sql | 9 + ...d_show_in_man_to_command_config_sqlite.sql | 7 + ...d_subflow_fields_to_workflow_instances.sql | 8 + .../add_suspended_node_reminders_table.sql | 31 + ..._suspended_node_reminders_table_sqlite.sql | 24 + .../migrations/add_tags_to_resources.sql | 14 + .../add_tags_to_resources_sqlite.sql | 14 + .../add_target_type_to_scheduled_flows.sql | 6 + .../migrations/add_user_auth_fields.sql | 10 + .../add_user_auth_fields_sqlite.sql | 9 + .../migrations/add_workflow_group_table.sql | 19 + .../add_workflow_statistics_fields.sql | 17 + .../create_command_config_table.sql | 29 + .../migrations/create_memory_tables.sql | 51 + .../migrations/create_wfaas_tables_fixed.sql | 67 + .../backend/migrations/fix_params_schema.sql | 75 + .../migrations/run_add_statistics_fields.py | 85 + .../tiangong/backend/mock_api.py | 17 + .../tiangong/backend/requirements-test.txt | 11 + .../tiangong/backend/scripts/README.md | 105 + ...add_flow_instance_id_to_agent_messages.sql | 16 + .../scripts/add_layer_personnel_indexes.sql | 0 .../scripts/add_rollback_history_table.sql | 22 + .../scripts/backfill_memory_categories.py | 418 + .../scripts/create_rollback_history_table.sql | 21 + .../backend/scripts/dump_dify_msg_database.sh | 70 + .../scripts/export_workflows_to_yaml.py | 295 + .../backend/scripts/final_verification.py | 191 + .../tiangong/backend/scripts/generate_keys.py | 59 + .../scripts/manage_function_schemas.py | 358 + .../scripts/memory_extraction_dryrun.py | 493 + .../backend/scripts/sqls/wegodev-dev.sql | 871 ++ .../backend/scripts/sqls/wegodev-sit.sql | 711 + .../test-mem/memory_extraction_dryrun.mjs | 1924 +++ ...memory_extraction_group_context_dryrun.mjs | 2588 ++++ .../backend/scripts/test-mem/package.json | 16 + .../backend/scripts/test-mem/pnpm-lock.yaml | 107 + .../tiangong/backend/scripts/test_in_wxmsg.py | 72 + .../scripts/test_llm_resource_management.py | 113 + .../backend/scripts/test_rate_limiting.py | 76 + .../test_scheduled_flow_feature_toggle.py | 222 + .../tiangong/backend/scripts/test_security.py | 125 + .../scripts/test_wechat_integration.py | 62 + .../scripts/verify_rollback_feature.py | 140 + .../migrations/add_clean_openspec_config.sql | 38 + .../add_command_config_data_driven_fields.sql | 14 + .../migrations/add_create_group_command.sql | 24 + .../sql/migrations/add_deploy_command.sql | 24 + .../sql/migrations/add_group_memory.sql | 13 + .../add_group_memory_query_prompt.sql | 24 + .../add_group_memory_summary_prompt.sql | 24 + .../add_intent_expire_hours_config.sql | 6 + .../add_intent_recognition_tables.sql | 58 + .../add_server_instance_id_column.sql | 7 + ...simplified_notification_feature_toggle.sql | 19 + .../migrate_analysis_workflow_commands.sql | 70 + .../migrate_commands_to_watch_category.sql | 100 + .../migrations/migrate_handler_commands.sql | 260 + ...grate_workflow_commands_to_data_driven.sql | 195 + .../tiangong/backend/src/__init__.py | 0 .../api/dtos/requirement_development_dto.py | 54 + .../backend/src/api/middleware/auth.py | 100 + .../src/api/middleware/request_tracking.py | 74 + .../backend/src/api/routes/__init__.py | 96 + .../src/api/routes/ai_config_routes.py | 369 + .../backend/src/api/routes/auth_routes.py | 308 + .../backend/src/api/routes/callback_routes.py | 116 + .../backend/src/api/routes/command_config.py | 588 + .../backend/src/api/routes/dag/__init__.py | 16 + .../backend/src/api/routes/dag/approvals.py | 240 + .../backend/src/api/routes/dag/executions.py | 1852 +++ .../src/api/routes/dag/wechat_webhook.py | 137 + .../backend/src/api/routes/dag/workflows.py | 522 + .../src/api/routes/dashboard_routes.py | 71 + .../src/api/routes/db_backup_routes.py | 465 + .../backend/src/api/routes/dify_routes.py | 563 + .../src/api/routes/feature_toggle_routes.py | 234 + .../src/api/routes/file_browser_routes.py | 249 + .../backend/src/api/routes/flow_routes.py | 448 + .../src/api/routes/itsm_proxy_routes.py | 146 + .../src/api/routes/layer_personnel_routes.py | 427 + .../api/routes/llm_token_tracking_routes.py | 454 + .../backend/src/api/routes/memory_routes.py | 240 + .../backend/src/api/routes/merge_routes.py | 92 + .../src/api/routes/message_send_routes.py | 137 + .../src/api/routes/node_execution_routes.py | 206 + .../src/api/routes/pace_deployment_routes.py | 158 + .../backend/src/api/routes/pace_routes.py | 23 + .../api/routes/product_flow_config_routes.py | 136 + .../backend/src/api/routes/product_routes.py | 270 + .../api/routes/product_submodule_routes.py | 0 .../api/routes/requirement_dev_flow_routes.py | 497 + .../routes/requirement_development_routes.py | 259 + .../src/api/routes/requirement_routes.py | 314 + .../backend/src/api/routes/resource_routes.py | 293 + .../src/api/routes/role_func_routes.py | 116 + .../src/api/routes/scheduled_flow_routes.py | 347 + .../src/api/routes/scheduler_routes.py | 194 + .../src/api/routes/shimo_export_routes.py | 72 + .../backend/src/api/routes/stage_routes.py | 201 + .../src/api/routes/subsystem_info_routes.py | 182 + .../backend/src/api/routes/system_routes.py | 261 + .../backend/src/api/routes/task_routes.py | 241 + .../src/api/routes/test_config_init_routes.py | 170 + .../src/api/routes/test_permission_routes.py | 78 + .../backend/src/api/routes/triggle_routes.py | 298 + .../src/api/routes/user_info_routes.py | 149 + .../src/api/routes/user_role_routes.py | 131 + .../src/api/routes/user_usage_stats_routes.py | 46 + .../backend/src/api/routes/wechat_routes.py | 2469 ++++ .../backend/src/api/routes/wfaas_routes.py | 680 + .../src/api/routes/whitelist_routes.py | 222 + .../api/routes/workflow_statistics_routes.py | 285 + .../src/api/routes/workflow_sync_routes.py | 237 + .../src/api/routes/wxmessage_routes.py | 143 + .../src/api/routes/wxmsg_config_routes.py | 197 + .../tiangong/backend/src/cli/__init__.py | 3 + .../tiangong/backend/src/cli/create_admin.py | 142 + .../backend/src/config/llm_token_config.py | 66 + .../tiangong/backend/src/config/settings.py | 196 + .../tiangong/backend/src/database.py | 85 + .../tiangong/backend/src/models/__init__.py | 94 + .../backend/src/models/agent_message.py | 20 + .../tiangong/backend/src/models/ai_config.py | 129 + .../backend/src/models/artiste_role_func.py | 18 + .../backend/src/models/artiste_user_role.py | 26 + .../tiangong/backend/src/models/base.py | 47 + .../backend/src/models/base_executable.py | 64 + .../tiangong/backend/src/models/bug_info.py | 39 + .../backend/src/models/callback_status.py | 37 + .../backend/src/models/command_config.py | 130 + .../backend/src/models/command_flow.py | 21 + .../backend/src/models/dag/__init__.py | 20 + .../src/models/dag/approval_history.py | 40 + .../backend/src/models/dag/create_tables.sql | 146 + .../backend/src/models/dag/execution_queue.py | 55 + .../backend/src/models/dag/node_execution.py | 107 + .../src/models/dag/rollback_history.py | 51 + .../src/models/dag/suspended_node_reminder.py | 51 + .../src/models/dag/workflow_instance.py | 118 + .../src/models/dag/workflow_instance_meta.py | 43 + .../src/models/dag/workflow_template.py | 113 + .../backend/src/models/dify_msg_receive.py | 50 + .../backend/src/models/dify_msg_send.py | 45 + .../backend/src/models/distributed_lock.py | 30 + .../src/models/dpms_business_requirement.py | 37 + .../tiangong/backend/src/models/event.py | 33 + .../backend/src/models/feature_toggle.py | 27 + .../backend/src/models/file_browser.py | 29 + .../backend/src/models/file_config.py | 15 + .../tiangong/backend/src/models/flow.py | 246 + .../backend/src/models/group_memory.py | 25 + .../backend/src/models/human_confirm.py | 46 + .../tiangong/backend/src/models/init_task.py | 31 + .../src/models/intent_recognition_log.py | 68 + .../backend/src/models/layer_personnel.py | 61 + .../backend/src/models/llm_token_usage.py | 59 + .../backend/src/models/manual_review.py | 29 + .../backend/src/models/merge_request.py | 37 + .../tiangong/backend/src/models/product.py | 38 + .../backend/src/models/product_flow_config.py | 21 + .../backend/src/models/product_submodule.py | 0 .../backend/src/models/project_person.py | 44 + .../backend/src/models/received_wx_msg.py | 57 + .../backend/src/models/requirement.py | 84 + .../src/models/requirement_dev_flow.py | 148 + .../models/requirement_development_record.py | 18 + .../tiangong/backend/src/models/resource.py | 125 + .../backend/src/models/scheduled_flow.py | 89 + .../src/models/scheduled_flow_request.py | 46 + .../backend/src/models/send_wx_msg.py | 37 + .../tiangong/backend/src/models/stage.py | 248 + .../backend/src/models/subsystem_info.py | 47 + .../tiangong/backend/src/models/system.py | 33 + .../tiangong/backend/src/models/task.py | 234 + .../backend/src/models/user_comment.py | 39 + .../tiangong/backend/src/models/user_info.py | 54 + .../backend/src/models/user_memory.py | 113 + .../tiangong/backend/src/models/user_token.py | 34 + .../tiangong/backend/src/models/wfaas.py | 127 + .../tiangong/backend/src/models/whitelist.py | 81 + .../src/models/workflow_function_schema.py | 42 + .../backend/src/models/workflow_group.py | 36 + .../backend/src/models/workflow_statistics.py | 29 + .../backend/src/models/wxmsg_config.py | 27 + .../backend/src/rd_process/__init__.py | 0 .../backend/src/rd_process/hooks/__init__.py | 0 .../hooks/rd_error_notification_hooks.py | 346 + .../rd_process/hooks/rd_parameter_hooks.py | 1038 ++ .../rd_process/hooks/rd_post_execute_hooks.py | 781 ++ .../rd_process/hooks/rd_validation_hooks.py | 108 + .../backend/src/rd_process/models/__init__.py | 7 + .../src/rd_process/models/rd_process.py | 72 + .../src/rd_process/tests/example_rd_hooks.py | 106 + .../src/rd_process/tests/test_rd_hooks.py | 174 + .../tests/test_rd_post_execute_hooks.py | 150 + .../backend/src/services/agent/__init__.py | 56 + .../src/services/agent/condition_checker.py | 153 + .../backend/src/services/agent/context.py | 70 + .../src/services/agent/execution_retry.py | 126 + .../src/services/agent/executors/__init__.py | 17 + .../src/services/agent/executors/base.py | 100 + .../agent/executors/claude_executor.py | 362 + .../services/agent/executors/kilo_executor.py | 104 + .../services/agent/executors/qwen_executor.py | 105 + .../backend/src/services/agent/git_manager.py | 470 + .../src/services/agent/message_handler.py | 141 + .../src/services/agent/orchestrator.py | 1282 ++ .../services/agent/pre_execution_handlers.py | 156 + .../src/services/agent/prompt_builder.py | 233 + .../src/services/agent/resource_selector.py | 356 + .../src/services/agent/result_validator.py | 282 + .../src/services/agent/workspace_manager.py | 809 ++ .../backend/src/services/agent_service.py | 2684 ++++ .../backend/src/services/ai_native.py | 1522 +++ .../src/services/callback_status_service.py | 180 + .../src/services/command_config_service.py | 337 + .../backend/src/services/command_role_sync.py | 195 + .../src/services/command_sync_service.py | 690 + .../backend/src/services/commands/__init__.py | 10 + .../services/commands/command_suggester.py | 277 + .../src/services/commands/dispatcher.py | 581 + .../services/commands/handlers/__init__.py | 13 + .../services/commands/handlers/analysis.py | 132 + .../src/services/commands/handlers/flow.py | 242 + .../src/services/commands/handlers/misc.py | 266 + .../src/services/commands/handlers/publish.py | 66 + .../src/services/commands/message_sender.py | 55 + .../src/services/commands/param_mapper.py | 130 + .../backend/src/services/commands/parser.py | 119 + .../src/services/commands/permissions.py | 252 + .../src/services/commands/preprocessors.py | 348 + .../backend/src/services/commands/registry.py | 6 + .../services/commands/services/__init__.py | 5 + .../src/services/commands/services/_shared.py | 832 ++ .../commands/services/analysis_service.py | 911 ++ .../commands/services/design_service.py | 241 + .../services/commands/services/dev_service.py | 397 + .../commands/services/flow_service.py | 239 + .../commands/services/misc_service.py | 202 + .../commands/services/openspec_service.py | 210 + .../commands/services/publish_service.py | 1693 +++ .../commands/services/test_service.py | 526 + .../backend/src/services/commands/utils.py | 1185 ++ .../src/services/config_file_watcher.py | 315 + .../services/configured_execution_methods.py | 514 + .../PARAMETER_VALIDATION_SIMPLIFICATION.md | 96 + .../src/services/dag/approval_manager.py | 406 + .../src/services/dag/approval_resolver.py | 419 + .../src/services/dag/execution_engine.py | 2105 +++ .../services/dag/internal_workflow_service.py | 1605 +++ .../backend/src/services/dag/node_factory.py | 942 ++ .../src/services/dag/node_reset_service.py | 100 + .../dag/nodes/CODE_SIMPLIFICATION_SUMMARY.md | 91 + .../dag/nodes/NODE_DEVELOPMENT_SUMMARY.md | 222 + .../PARAMETER_VALIDATION_SIMPLIFICATION.md | 270 + .../services/dag/nodes/REFACTORING_GUIDE.md | 189 + .../WEUP_SPRINGBOOT3_UPGRADE_NODE_GUIDE.md | 163 + .../src/services/dag/nodes/__init__.py | 107 + .../dag/nodes/analyze_sys_req_node.py | 176 + .../dag/nodes/assert_atmp_test_flow_node.py | 143 + .../services/dag/nodes/atmpdev_flow_node.py | 167 + .../dag/nodes/close_bug_flow_node_only.py | 151 + .../services/dag/nodes/code_analysis_nodes.py | 522 + .../dag/nodes/code_review_flow_node.py | 220 + .../services/dag/nodes/config_init_node.py | 664 + .../dag/nodes/create_release_plan_node.py | 167 + .../dag/nodes/design_development_nodes.py | 765 ++ .../services/dag/nodes/design_flow_node.py | 196 + .../dag/nodes/design_sys_req_sdl_node.py | 101 + .../dag/nodes/development_flow_node.py | 166 + .../src/services/dag/nodes/external_tools.py | 1 + .../services/dag/nodes/file_archive_node.py | 276 + .../services/dag/nodes/fix_bug_flow_node.py | 154 + .../src/services/dag/nodes/flow_execution.py | 1109 ++ .../dag/nodes/fps_um_account_nodes.py | 325 + .../dag/nodes/hello_world_flow_node.py | 169 + .../dag/nodes/link_req_subsys_version_node.py | 137 + .../src/services/dag/nodes/mock_nodes.py | 222 + .../parse_dpms_url_and_validate_product.py | 195 + .../dag/nodes/pre_gen_sys_req_node.py | 95 + .../dag/nodes/pre_review_biz_req_node.py | 248 + .../dag/nodes/production_release_nodes.py | 238 + .../nodes/pull_biz_req_list_to_shimo_node.py | 1013 ++ .../services/dag/nodes/pull_biz_req_node.py | 323 + .../nodes/pull_biz_req_to_pre_review_node.py | 207 + .../services/dag/nodes/pull_sys_req_node.py | 169 + .../dag/nodes/push_artifact_prod_node.py | 99 + .../nodes/rd_process_analysis_flow_node.py | 839 ++ .../services/dag/nodes/regress_flow_node.py | 165 + .../dag/nodes/security_work_close_node.py | 263 + .../dag/nodes/security_work_detail_node.py | 259 + .../nodes/split_biz_req_to_products_node.py | 379 + .../src/services/dag/nodes/subflow_nodes.py | 743 + .../dag/nodes/submit_bug_flow_node_only.py | 152 + .../dag/nodes/submit_pending_bug_flow_node.py | 151 + .../dag/nodes/submit_req_schedule_node.py | 72 + .../services/dag/nodes/submit_sys_req_node.py | 112 + .../dag/nodes/submit_sys_req_schedule_node.py | 72 + .../services/dag/nodes/testdpms_flow_node.py | 225 + .../dag/nodes/testdpmsforuat_flow_node.py | 211 + .../services/dag/nodes/testgen_flow_node.py | 250 + .../dag/nodes/testgensafe_flow_node.py | 167 + .../dag/nodes/testreport_flow_node.py | 171 + .../dag/nodes/testreportforuat_flow_node.py | 171 + .../services/dag/nodes/testrunui_flow_node.py | 175 + .../dag/nodes/tidb_permission_nodes.py | 329 + .../services/dag/nodes/um_account_nodes.py | 300 + .../dag/nodes/verify_fixed_bug_flow_node.py | 156 + .../nodes/weup_springboot3_upgrade_node.py | 324 + .../src/services/dag/notification/__init__.py | 37 + .../services/dag/notification/constants.py | 87 + .../dag/notification/message_builder.py | 478 + .../dag/notification/notification_service.py | 693 + .../services/dag/notification/templates.py | 57 + .../src/services/dag/parallel_coordinator.py | 97 + .../src/services/dag/parameter_guard.py | 1206 ++ .../dag/preflight_parameter_service.py | 963 ++ .../src/services/dag/progress_service.py | 509 + .../backend/src/services/dag/roles.py | 171 + .../src/services/dag/routing_service.py | 69 + .../src/services/dag/schema_bootstrap.py | 51 + .../src/services/dag/standalone_executor.py | 320 + .../dag/suspended_node_reminder_service.py | 338 + .../backend/src/services/dag/trace_context.py | 102 + .../src/services/dag/wechat_integration.py | 318 + .../dag/workflow_instance_meta_service.py | 229 + .../src/services/dag/workflow_service.py | 406 + .../services/dag_restart_resume_service.py | 115 + .../backend/src/services/data_service.py | 239 + .../backend/src/services/db_backup_service.py | 664 + .../backend/src/services/dev_design.py | 192 + .../backend/src/services/dev_openspec.py | 185 + .../backend/src/services/dev_service.py | 6550 +++++++++ .../backend/src/services/dev_utils.py | 538 + .../backend/src/services/dify_service.py | 948 ++ .../distributed_lock_async_wrapper.py | 207 + .../src/services/distributed_lock_service.py | 301 + .../backend/src/services/dpms_url_handler.py | 201 + .../src/services/entity_state_manager.py | 217 + .../src/services/events/event_handler.py | 220 + .../src/services/execution/__init__.py | 13 + .../backend/src/services/execution/base.py | 457 + .../services/execution/executors/__init__.py | 10 + .../execution/executors/flow_executor.py | 218 + .../execution/executors/stage_executor.py | 159 + .../execution/executors/task_executor.py | 156 + .../services/execution/handlers/__init__.py | 29 + .../handlers/agent_execution_handler.py | 73 + .../execution/handlers/callback_handler.py | 69 + .../execution/handlers/event_emitter.py | 81 + .../handlers/execute_method_handler.py | 131 + .../execution/handlers/hook_runner.py | 97 + .../handlers/manual_review_handler.py | 237 + .../handlers/notification_service.py | 343 + .../execution/handlers/parameter_handler.py | 121 + .../execution/handlers/result_collector.py | 102 + .../execution/handlers/skip_node_handler.py | 48 + .../backend/src/services/execution/models.py | 49 + .../backend/src/services/execution_manager.py | 3200 +++++ .../src/services/feature_toggle_service.py | 351 + .../src/services/file_browser_service.py | 577 + .../src/services/file_operation_service.py | 582 + .../backend/src/services/flow_service.py | 502 + .../src/services/group_command_handler.py | 239 + .../src/services/group_memory_service.py | 143 + .../src/services/human_confirm_service.py | 480 + .../backend/src/services/init_task_service.py | 150 + .../backend/src/services/intent_analyzers.py | 969 ++ .../src/services/intent_recognition_base.py | 505 + .../services/intent_recognition_helpers.py | 790 ++ .../services/intent_recognition_service.py | 2410 ++++ .../src/services/intent_recognition_types.py | 34 + .../src/services/intent_reference_helper.py | 164 + .../src/services/intent_result_actions.py | 63 + .../backend/src/services/intent_schemas.py | 395 + .../src/services/intent_state_service.py | 82 + .../src/services/itsm_proxy_service.py | 316 + .../src/services/layer_personnel_service.py | 546 + .../backend/src/services/llm_service.py | 273 + .../services/llm_token_tracking_scheduler.py | 195 + .../services/llm_token_tracking_service.py | 907 ++ .../src/services/manual_review_service.py | 149 + .../backend/src/services/memory/__init__.py | 20 + .../src/services/memory/consolidation.py | 177 + .../backend/src/services/memory/identity.py | 62 + .../backend/src/services/memory/llm_client.py | 23 + .../src/services/memory/memory_extractor.py | 1045 ++ .../src/services/memory/memory_middleware.py | 90 + .../src/services/memory/memory_service.py | 409 + .../src/services/memory/prompt_builder.py | 68 + .../backend/src/services/memory/protocols.py | 51 + .../backend/src/services/memory/provider.py | 58 + .../backend/src/services/memory/schemas.py | 93 + .../backend/src/services/merge_service.py | 457 + .../src/services/message_command_service.py | 165 + .../src/services/message_pattern_matcher.py | 176 + .../backend/src/services/message_service.py | 581 + .../src/services/permission_service.py | 335 + .../services/product_flow_config_service.py | 175 + .../backend/src/services/product_service.py | 372 + .../src/services/product_submodule_service.py | 0 .../services/requirement_dev_flow_service.py | 962 ++ .../requirement_development_service.py | 404 + .../services/requirement_scheduler_service.py | 623 + .../src/services/requirement_service.py | 192 + .../backend/src/services/resource_service.py | 388 + .../src/services/restart_resume_service.py | 120 + .../backend/src/services/role_func_service.py | 157 + .../src/services/scheduled_flow_service.py | 817 ++ .../backend/src/services/scheduler_service.py | 2228 +++ .../src/services/send_wxmsg_service.py | 264 + .../src/services/shimo_export_service.py | 388 + .../src/services/smart_response_generator.py | 142 + .../services/special_processing_service.py | 627 + .../services/special_processing_wrapper.py | 89 + .../backend/src/services/stage_service.py | 372 + .../src/services/startup_sync_service.py | 270 + .../src/services/sub_system_service.py | 251 + .../src/services/subsystem_info_service.py | 204 + .../backend/src/services/system_service.py | 329 + .../backend/src/services/task_service.py | 378 + .../task_status_notification_service.py | 413 + .../src/services/user_role_func_service.py | 238 + .../backend/src/services/user_role_service.py | 174 + .../backend/src/services/user_service.py | 173 + .../src/services/user_usage_stats_service.py | 130 + .../services/wechat_notification_service.py | 83 + .../backend/src/services/wedo_service.py | 601 + .../src/services/wfaas_client_service.py | 168 + .../src/services/wfaas_env_config_service.py | 213 + .../src/services/wfaas_function_service.py | 305 + .../src/services/wfaas_publish_service.py | 658 + .../backend/src/services/whitelist_service.py | 447 + .../src/services/workflow_control_service.py | 363 + .../src/services/workflow_orchestrator.py | 367 + .../services/workflow_statistics_service.py | 1010 ++ .../src/services/workflow_sync_service.py | 612 + .../src/services/wxmsg_config_service.py | 161 + .../services/wxmsg_intent_recong_service.py | 931 ++ .../backend/src/services/wxmsg_service.py | 716 + .../tiangong/backend/src/tasks/__init__.py | 0 .../tiangong/backend/src/tasks/data_clean.py | 62 + .../tiangong/backend/src/tasks/error_test.py | 11 + .../src/test_itsm_change_publish_v2.py | 257 + .../tiangong/backend/src/testor/__init__.py | 0 .../src/testor/data_quality_ai_agent.py | 501 + .../backend/src/testor/example_rd_hooks.py | 106 + .../src/testor/simple_test_api_endpoints.py | 250 + .../backend/src/testor/test_api_endpoints.py | 411 + .../backend/src/testor/test_rd_hooks.py | 174 + .../tiangong/backend/src/tools/artiste_bug.py | 165 + .../backend/src/utils/crypto_utils.py | 231 + .../src/utils/digital_worker_portal_util.py | 321 + .../tiangong/backend/src/utils/dpms_utils.py | 166 + .../backend/src/utils/dpms_workflow.py | 965 ++ .../tiangong/backend/src/utils/file_mapper.py | 442 + .../backend/src/utils/find_handlers.py | 295 + .../tiangong/backend/src/utils/git_utils.py | 1248 ++ .../backend/src/utils/init_ai_docs.py | 152 + .../tiangong/backend/src/utils/ip_utils.py | 191 + .../backend/src/utils/llm_token_errors.py | 77 + .../tiangong/backend/src/utils/logging.py | 311 + .../backend/src/utils/md_to_pdf_converter.py | 194 + .../backend/src/utils/rate_limit_utils.py | 166 + .../src/utils/requirement_dev_logging.py | 116 + .../backend/src/utils/result_check_utils.py | 127 + .../backend/src/utils/server_instance.py | 48 + .../tiangong/backend/src/utils/ssl_utils.py | 192 + .../backend/src/utils/string_utils.py | 110 + .../src/utils/test_manual_review_notes.py | 105 + .../src/utils/test_md_to_pdf_converter.py | 129 + .../tiangong/backend/src/utils/uuid_utils.py | 49 + .../backend/src/utils/wfaas_router_utils.py | 57 + .../backend/src/workers/dag_worker.py | 1365 ++ .../backend/test_agent_execution_hang_fix.py | 111 + .../backend/test_agent_service_fix.py | 252 + .../test_command_config_integration.py | 263 + .../tiangong/backend/test_complete_node.py | 193 + .../tiangong/backend/test_execute_method.py | 33 + .../backend/test_execute_method_direct.py | 125 + .../backend/test_execution_manager_method.py | 68 + .../test_flow_execution_optimization.py | 67 + .../tiangong/backend/test_flow_fix.py | 55 + .../backend/test_llm_token_tracking.py | 162 + .../tiangong/backend/test_mariadb_worker.py | 140 + .../tiangong/backend/test_node_types.py | 64 + .../backend/test_parameter_collection_fix.py | 196 + .../backend/test_parameter_validation.py | 120 + .../tiangong/backend/test_stage_fix.py | 53 + .../backend/tests/api/test_subflow_api.py | 462 + .../contract/test_biz_requirement_get.py | 70 + .../contract/test_biz_requirements_list.py | 128 + .../contract/test_feature_toggle_contract.py | 201 + .../test_feature_toggle_default_contract.py | 74 + .../test_feature_toggle_module_contract.py | 81 + .../tests/contract/test_merge_command.py | 77 + .../contract/test_tech_requirement_get.py | 70 + .../contract/test_tech_requirements_list.py | 132 + .../e2e/test_command_role_permission_e2e.py | 240 + .../integration/CONFIG_INIT_TEST_GUIDE.md | 363 + .../integration/PERMISSION_TEST_GUIDE.md | 234 + .../tests/integration/README_CONFIG_INIT.md | 83 + .../integration/README_PERMISSION_TEST.md | 267 + .../integration/api/test_approvals_api.py | 306 + .../tests/integration/api/test_auth_api.py | 159 + .../test_agent_orchestrator_integration.py | 637 + .../integration/test_command_config_e2e.py | 229 + .../test_command_role_sync_integration.py | 149 + .../integration/test_config_init_data.sql | 170 + .../tests/integration/test_event_logging.py | 73 + .../integration/test_execute_flow_e2e.py | 142 + .../integration/test_execution_refactor.py | 221 + .../integration/test_executor_migration.py | 229 + .../test_fail_node_notification.py | 177 + ...test_feature_toggle_default_integration.py | 87 + .../test_feature_toggle_integration.py | 158 + .../test_feature_toggle_module_integration.py | 102 + .../tests/integration/test_merge_workflow.py | 146 + .../test_node_execution_integration.py | 126 + .../integration/test_permission_check_api.py | 128 + .../integration/test_permission_data.sql | 153 + .../integration/test_permission_http.ps1 | 76 + .../tests/integration/test_permission_http.sh | 54 + .../integration/test_requirements_view.py | 148 + .../integration/test_subflow_execution.py | 485 + .../test_subflow_output_declaration.py | 242 + .../integration/test_wechat_rate_limiting.py | 178 + .../integration/test_whitelist_batch_api.py | 113 + .../test_workflow_api_filtering.py | 37 + .../test_workflow_published_e2e.py | 70 + .../performance/test_event_performance.py | 139 + .../tiangong/backend/tests/simple_verify.py | 109 + .../tests/test_data_quality_ai_agent.py | 398 + .../tiangong/backend/tests/test_git_utils.py | 137 + .../backend/tests/test_task_timeout.py | 136 + .../test_command_config_metadata_routes.py | 119 + .../unit/api/test_command_config_routes.py | 127 + .../tiangong/backend/tests/unit/conftest.py | 36 + .../tests/unit/dag/notification/__init__.py | 0 .../unit/dag/notification/test_constants.py | 73 + .../dag/notification/test_message_builder.py | 251 + .../notification/test_notification_service.py | 228 + .../unit/dag/notification/test_templates.py | 59 + .../backend/tests/unit/models/__init__.py | 1 + .../backend/tests/unit/models/dag/__init__.py | 1 + 845 files changed, 259310 insertions(+), 505 deletions(-) create mode 100644 .claude/skills/plugin-quality-scorer/SKILL.md create mode 100644 .claude/skills/plugin-quality-scorer/references/scoring-rubric.md create mode 100644 .claude/skills/plugin-quality-scorer/scripts/skill-scoring-check.py create mode 100644 "docs/code-go\346\212\242\345\215\225\350\203\275\345\212\233\350\260\203\347\240\224.md" create mode 100644 "docs/master/design/\351\230\266\346\256\2650-\345\275\242\346\200\201B\345\271\266\345\217\221\345\216\237\345\236\213spike\346\226\271\346\241\210.md" create mode 100644 "docs/master/design/\351\230\266\346\256\2651-S5\345\244\232\345\255\220\347\263\273\347\273\237\346\224\257\346\214\201\346\226\271\346\241\210.md" create mode 100644 "docs/master/design/\351\230\266\346\256\2652-S11\345\275\242\346\200\201B\345\244\232\345\255\220\347\263\273\347\273\237\346\225\264\345\220\210\346\226\271\346\241\210.md" create mode 100644 "docs/master/design/\351\230\266\346\256\2653-\345\244\232git\347\274\226\346\216\222\346\226\271\346\241\210.md" create mode 100644 docs/project-knowledge/sessions/agent_requirement-design_fd4df847/session_detail.md create mode 100644 docs/project-knowledge/sessions/agent_requirement-design_fd4df847/session_index.json create mode 100644 docs/project-knowledge/sessions/devsyncagent_architecture_12c2f926/session_detail.md create mode 100644 docs/project-knowledge/sessions/devsyncagent_architecture_12c2f926/session_index.json create mode 100644 docs/project-knowledge/sessions/devsyncagent_localcommandcaveatcaveat-the_0b082052/session_detail.md create mode 100644 docs/project-knowledge/sessions/devsyncagent_localcommandcaveatcaveat-the_0b082052/session_index.json create mode 100644 docs/project-knowledge/sessions/devsyncagent_localcommandcaveatcaveat-the_ce70904d/session_detail.md create mode 100644 docs/project-knowledge/sessions/devsyncagent_localcommandcaveatcaveat-the_ce70904d/session_index.json create mode 100644 docs/project-knowledge/sessions/devsyncagent_requirement-architecture_d9391f89/session_detail.md create mode 100644 docs/project-knowledge/sessions/devsyncagent_requirement-architecture_d9391f89/session_index.json create mode 100644 docs/project-knowledge/sessions/devsyncagent_requirement-design_ba77eb92/session_detail.md create mode 100644 docs/project-knowledge/sessions/devsyncagent_requirement-design_ba77eb92/session_index.json create mode 100644 docs/project-knowledge/sessions/devsyncagent_requirement-design_cc3eeebd/session_detail.md create mode 100644 docs/project-knowledge/sessions/devsyncagent_requirement-design_cc3eeebd/session_index.json create mode 100644 docs/project-knowledge/sessions/devsyncagent_requirement-usecase_598c2d2d/session_detail.md create mode 100644 docs/project-knowledge/sessions/devsyncagent_requirement-usecase_598c2d2d/session_index.json create mode 100644 "docs/project-knowledge/sessions/devsyncagent_\344\273\273\345\212\241\346\250\241\346\213\237\346\234\272\345\231\250\344\272\272\346\250\241\345\274\217\347\224\237\346\210\220\345\220\204\347\212\266\346\200\201\344\270\273\350\217\234\345\215\225\344\273\205\350\276\223\345\207\272-json_61f5d82f/session_detail.md" create mode 100644 "docs/project-knowledge/sessions/devsyncagent_\344\273\273\345\212\241\346\250\241\346\213\237\346\234\272\345\231\250\344\272\272\346\250\241\345\274\217\347\224\237\346\210\220\345\220\204\347\212\266\346\200\201\344\270\273\350\217\234\345\215\225\344\273\205\350\276\223\345\207\272-json_61f5d82f/session_index.json" create mode 100644 "docs/promotion/Code Go\346\212\242\345\215\225\350\203\275\345\212\233\350\260\203\347\240\224.html" create mode 100644 "docs/promotion/\345\244\247\346\225\260\346\215\256\345\233\242\351\230\237AI-Coding\346\234\200\344\275\263\345\256\236\350\267\265\345\210\206\344\272\253-v2.0.html" create mode 100644 "docs/promotion/\345\244\247\346\225\260\346\215\256\345\233\242\351\230\237AI-Coding\346\234\200\344\275\263\345\256\236\350\267\265\345\210\206\344\272\253-v2.1.html" create mode 100644 "docs/promotion/\345\244\247\346\225\260\346\215\256\345\233\242\351\230\237AI-Coding\346\234\200\344\275\263\345\256\236\350\267\265\345\210\206\344\272\253.html" create mode 100644 "docs/\346\217\222\344\273\266\345\274\200\345\217\221\345\274\272\345\214\226-G6\345\205\250\346\265\201\347\250\213\350\264\250\351\207\217\350\257\204\345\210\206\346\226\271\346\241\210.md" create mode 100644 "docs/\346\234\272\345\231\250\344\272\272compact\345\201\207\345\244\261\350\264\245\344\270\216subagent\347\233\221\346\265\213\351\227\256\351\242\230\344\277\256\345\244\215\346\226\271\346\241\210.md" create mode 100644 memory/daily/2026-07-27.md create mode 100644 output/deployment-materials/task-viewer/scripts/feedback_to_baseline.py create mode 100644 output/deployment-materials/task-viewer/scripts/requirements.txt create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/agents/README.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/agents/auth-route-debugger.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/agents/auth-route-tester.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/agents/auto-error-resolver.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/agents/code-architecture-reviewer.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/agents/code-refactor-master.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/agents/documentation-architect.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/agents/frontend-error-fixer.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/agents/plan-reviewer.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/agents/refactor-planner.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/agents/web-research-specialist.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/commands/dev-docs-update.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/commands/dev-docs.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/commands/route-research-for-testing.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/hooks/CONFIG.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/hooks/README.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/hooks/error-handling-reminder.sh create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/hooks/error-handling-reminder.ts create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/hooks/package-lock.json create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/hooks/package.json create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/hooks/post-tool-use-tracker.sh create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/hooks/skill-activation-prompt.sh create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/hooks/skill-activation-prompt.ts create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/hooks/stop-build-check-enhanced.sh create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/hooks/trigger-build-resolver.sh create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/hooks/tsc-check.sh create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/hooks/tsconfig.json create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/settings.json create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/README.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/backend-dev-guidelines/SKILL.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/backend-dev-guidelines/resources/architecture-overview.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/backend-dev-guidelines/resources/async-and-errors.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/backend-dev-guidelines/resources/complete-examples.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/backend-dev-guidelines/resources/configuration.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/backend-dev-guidelines/resources/database-patterns.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/backend-dev-guidelines/resources/middleware-guide.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/backend-dev-guidelines/resources/routing-and-controllers.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/backend-dev-guidelines/resources/sentry-and-monitoring.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/backend-dev-guidelines/resources/services-and-repositories.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/backend-dev-guidelines/resources/testing-guide.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/backend-dev-guidelines/resources/validation-patterns.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/error-tracking/SKILL.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/frontend-dev-guidelines/SKILL.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/frontend-dev-guidelines/resources/common-patterns.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/frontend-dev-guidelines/resources/complete-examples.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/frontend-dev-guidelines/resources/component-patterns.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/frontend-dev-guidelines/resources/data-fetching.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/frontend-dev-guidelines/resources/file-organization.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/frontend-dev-guidelines/resources/loading-and-error-states.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/frontend-dev-guidelines/resources/performance.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/frontend-dev-guidelines/resources/routing-guide.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/frontend-dev-guidelines/resources/styling-guide.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/frontend-dev-guidelines/resources/typescript-standards.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/route-tester/SKILL.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/skill-developer/ADVANCED.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/skill-developer/HOOK_MECHANISMS.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/skill-developer/PATTERNS_LIBRARY.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/skill-developer/SKILL.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/skill-developer/SKILL_RULES_REFERENCE.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/skill-developer/TRIGGER_TYPES.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/skill-developer/TROUBLESHOOTING.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.claude/skills/skill-rules.json create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/.gitignore create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/CLAUDE.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/CLAUDE_INTEGRATION_GUIDE.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/LICENSE create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/README.md create mode 100644 temp/archived-source-code/claude-code-infrastructure-showcase/dev/README.md create mode 100644 "temp/archived-source-code/prompts/prompt_AI Agent\345\222\214\347\240\224\345\217\221\346\265\201\347\250\213\345\267\245\345\205\267\347\263\273\347\273\237\346\211\223\351\200\232.md" create mode 100644 "temp/archived-source-code/prompts/prompt_AI Agent\346\225\264\344\275\223\345\244\232\351\241\271\344\274\230\345\214\226.md" create mode 100644 "temp/archived-source-code/prompts/prompt_AI Agent\351\234\200\346\261\202\345\210\206\346\213\206\344\274\230\345\214\226.md" create mode 100644 "temp/archived-source-code/prompts/prompt_AI Agent\351\234\200\346\261\202\350\256\276\350\256\241\351\230\266\346\256\265\345\274\225\345\205\245Recheck\346\265\201\347\250\213.md" create mode 100644 temp/archived-source-code/tiangong/.claude/artiste-workflow-composer/SKILL.md create mode 100644 temp/archived-source-code/tiangong/.claude/artiste-workflow-composer/evals/evals.json create mode 100644 temp/archived-source-code/tiangong/.claude/artiste-workflow-composer/references/node_types.md create mode 100644 temp/archived-source-code/tiangong/.claude/commands/artiste-commit-push.md create mode 100644 temp/archived-source-code/tiangong/.claude/commands/artiste-commit.md create mode 100644 temp/archived-source-code/tiangong/.claude/plans/elegant-inventing-cosmos.md create mode 100644 temp/archived-source-code/tiangong/.claude/settings.json create mode 100644 temp/archived-source-code/tiangong/.claude/skills/artiste-add-command/SKILL.md create mode 100644 temp/archived-source-code/tiangong/.claude/skills/artiste-add-command/evals/evals.json create mode 100644 temp/archived-source-code/tiangong/.claude/skills/artiste-add-command/references/examples.md create mode 100644 temp/archived-source-code/tiangong/.claude/skills/artiste-dag-node-dev/SKILL.md create mode 100644 temp/archived-source-code/tiangong/.claude/skills/artiste-design/SKILL.md create mode 100644 temp/archived-source-code/tiangong/.claude/skills/artiste-wfaas-publish/SKILL.md create mode 100644 temp/archived-source-code/tiangong/.claude/skills/get_product_info/SKILL.md create mode 100644 temp/archived-source-code/tiangong/.dockerignore create mode 100644 temp/archived-source-code/tiangong/.env.example create mode 100644 temp/archived-source-code/tiangong/.eslintignore create mode 100644 temp/archived-source-code/tiangong/.kilocode/rules/kiro.md create mode 100644 temp/archived-source-code/tiangong/.npmignore create mode 100644 temp/archived-source-code/tiangong/.prettierignore create mode 100644 temp/archived-source-code/tiangong/AGENTS.md create mode 100644 temp/archived-source-code/tiangong/BACKOFF_MULTIPLIER_EXPLANATION.md create mode 100644 temp/archived-source-code/tiangong/CLAUDE.md create mode 100644 temp/archived-source-code/tiangong/CRITICAL_FIX_v1.4.md create mode 100644 temp/archived-source-code/tiangong/DEPLOYMENT_GUIDE_v1.3.md create mode 100644 temp/archived-source-code/tiangong/DEPLOY_NOW.md create mode 100644 temp/archived-source-code/tiangong/DEPLOY_v1.4.md create mode 100644 temp/archived-source-code/tiangong/Dockerfile create mode 100644 temp/archived-source-code/tiangong/FINAL_FIX_v1.3.md create mode 100644 temp/archived-source-code/tiangong/FRONTEND_MANUAL_CHANGES.md create mode 100644 temp/archived-source-code/tiangong/INFINITE_LOOP_ANALYSIS.md create mode 100644 temp/archived-source-code/tiangong/JSON_BUFFER_SIZE_FIX.md create mode 100644 temp/archived-source-code/tiangong/LAYER_PERSONNEL_REFRESH_POST.md create mode 100644 temp/archived-source-code/tiangong/MULTI_TAGS_IMPLEMENTATION.md create mode 100644 temp/archived-source-code/tiangong/NODE_RETRY_CONFIGURATION.md create mode 100644 temp/archived-source-code/tiangong/PERMISSION_SERVICE_GUIDE.md create mode 100644 temp/archived-source-code/tiangong/PERMISSION_TOGGLE_GUIDE.md create mode 100644 temp/archived-source-code/tiangong/PERSONNEL_SELECTION_FIX.md create mode 100644 temp/archived-source-code/tiangong/PRODUCT_FIELDS_EXTENSION.md create mode 100644 temp/archived-source-code/tiangong/QUICK_REFERENCE.md create mode 100644 temp/archived-source-code/tiangong/README.en.md create mode 100644 temp/archived-source-code/tiangong/README.md create mode 100644 temp/archived-source-code/tiangong/RESOURCE_SERVICE_MANUAL_FIX.md create mode 100644 temp/archived-source-code/tiangong/SCHEDULED_FLOW_MULTI_TAGS.md create mode 100644 temp/archived-source-code/tiangong/SHIMO_EXPORT_IMPLEMENTATION.md create mode 100644 temp/archived-source-code/tiangong/TASK_COMPLETION_STATUS.md create mode 100644 temp/archived-source-code/tiangong/TROUBLESHOOTING.md create mode 100644 temp/archived-source-code/tiangong/ULTIMATE_FIX_v1.3-final.md create mode 100644 temp/archived-source-code/tiangong/backend/.env.example create mode 100644 temp/archived-source-code/tiangong/backend/.flake8 create mode 100644 temp/archived-source-code/tiangong/backend/API_REQUESTS.md create mode 100644 temp/archived-source-code/tiangong/backend/AUTOMATED_NODE_FIX.md create mode 100644 temp/archived-source-code/tiangong/backend/CHANGES.md create mode 100644 temp/archived-source-code/tiangong/backend/CODE_REVIEW_FIXES.md create mode 100644 temp/archived-source-code/tiangong/backend/DATABASE_SETUP.md create mode 100644 temp/archived-source-code/tiangong/backend/DEPLOYMENT_CHECKLIST.md create mode 100644 temp/archived-source-code/tiangong/backend/EMERGENCY_FIX_v1.2.md create mode 100644 temp/archived-source-code/tiangong/backend/FLOW_ANALYSIS.md create mode 100644 temp/archived-source-code/tiangong/backend/IMPLEMENTATION_COMPLETE.md create mode 100644 temp/archived-source-code/tiangong/backend/MARIADB_FIX.md create mode 100644 temp/archived-source-code/tiangong/backend/PARAMETER_COLLECTION_FIX.md create mode 100644 temp/archived-source-code/tiangong/backend/REFACTORING_FINAL_COMPLETE.md create mode 100644 temp/archived-source-code/tiangong/backend/TROUBLESHOOTING.mdd create mode 100644 temp/archived-source-code/tiangong/backend/WORKFLOW_GUIDE_SIMPLIFICATION.md create mode 100644 temp/archived-source-code/tiangong/backend/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/add_force_single_instance.sql create mode 100644 temp/archived-source-code/tiangong/backend/add_subflow_support.sql create mode 100644 temp/archived-source-code/tiangong/backend/api_requests.json create mode 100644 temp/archived-source-code/tiangong/backend/callback_test_plan.md create mode 100644 temp/archived-source-code/tiangong/backend/check_command_config.py create mode 100644 temp/archived-source-code/tiangong/backend/config/commands/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/config/commands/analysis.yaml create mode 100644 temp/archived-source-code/tiangong/backend/config/commands/base.py create mode 100644 temp/archived-source-code/tiangong/backend/config/commands/dev.yaml create mode 100644 temp/archived-source-code/tiangong/backend/config/commands/flow.yaml create mode 100644 temp/archived-source-code/tiangong/backend/config/commands/misc.yaml create mode 100644 temp/archived-source-code/tiangong/backend/config/commands/publish.yaml create mode 100644 temp/archived-source-code/tiangong/backend/config/commands/test.yaml create mode 100644 temp/archived-source-code/tiangong/backend/config/commands/watch.yaml create mode 100644 temp/archived-source-code/tiangong/backend/config/workflows/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/config/workflows/base.py create mode 100644 temp/archived-source-code/tiangong/backend/config/workflows/core.yaml create mode 100644 temp/archived-source-code/tiangong/backend/config/workflows/dev.yaml create mode 100644 temp/archived-source-code/tiangong/backend/config/workflows/misc.yaml create mode 100644 temp/archived-source-code/tiangong/backend/config/workflows/publish.yaml create mode 100644 temp/archived-source-code/tiangong/backend/config/workflows/test.yaml create mode 100644 temp/archived-source-code/tiangong/backend/create_ai_configs_table.sql create mode 100644 temp/archived-source-code/tiangong/backend/create_apscheduler_tables.sql create mode 100644 temp/archived-source-code/tiangong/backend/create_callback_table.sql create mode 100644 temp/archived-source-code/tiangong/backend/create_whitelist_table.sql create mode 100644 temp/archived-source-code/tiangong/backend/docs/2026-01-27-multi-role-approval-design.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/20260314130000_add_workflow_instance_meta_table.py create mode 100644 temp/archived-source-code/tiangong/backend/docs/CODE_SIMPLIFICATION_SUMMARY.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/DAG_INTENT_INTEGRATION_PLAN.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/Execute-Flow-Node-Configuration-Guide.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/ExecuteFlowNode-Optimization-Summary.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/FIX_AGENT_MESSAGE_ISSUES.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/INTENT_RECOGNITION_SERVICE.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/InternalWorkflowService-UsageGuide.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/NODE_DEVELOPMENT_GUIDE.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/PARAMETER_VALIDATION_SIMPLIFICATION.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/README_RD_HOOKS.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/REFACTORING_GUIDE.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/SUSPENDED_NODE_REMINDER.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/TASK_STATUS_NOTIFICATION_IMPLEMENTATION.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/WFAAS_HOSTALIAS_VOLUMEMOUNTS_GUIDE.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/WHITELIST_BATCH_INPUT.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/add_group.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/agent_multi_repo_analysis_design.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/command-config-integration-test.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/dag_context_parameters.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/dag_parameter_validation.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/dag_parameter_validation_fix.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/dag_parameter_validation_fix_v1.2.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/dag_parameter_validation_fix_v1.3.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/dag_parameter_validation_implementation.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/intent_workflow_flow.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/multi_instance_analysis.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/scheduled_flow_group_feature.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/sql/financial_table_standards.md create mode 100644 temp/archived-source-code/tiangong/backend/docs/sql/migrations/2026-02-12-add-command-role-permission-control.sql create mode 100644 temp/archived-source-code/tiangong/backend/docs/workflow_statistics_implementation_summary.md create mode 100644 temp/archived-source-code/tiangong/backend/file_operation_todo_list.md create mode 100644 temp/archived-source-code/tiangong/backend/init_db.py create mode 100644 temp/archived-source-code/tiangong/backend/init_rd_process.sql create mode 100644 temp/archived-source-code/tiangong/backend/init_rd_process_api.json create mode 100644 temp/archived-source-code/tiangong/backend/init_sqlite_db.py create mode 100644 temp/archived-source-code/tiangong/backend/insert_intent_prompts.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrate_agent_messages_table.py create mode 100644 temp/archived-source-code/tiangong/backend/migrate_resources_table.py create mode 100644 temp/archived-source-code/tiangong/backend/migrations/2026-01-21-wfaas-json-to-text.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/README.md create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_agent_message_fields.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_api_key_tags_to_scheduled_flows.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_approval_history_table.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_flow_instance_id_to_node_execution.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_flow_instance_id_to_node_execution_sqlite.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_group_and_concurrency_fields_to_scheduled_flows.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_group_config_to_scheduled_flows.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_hostalias_and_volumemounts.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_is_published_to_workflow_templates.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_output_declaration_to_workflow_templates.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_server_instance_to_dag.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_show_in_man_to_command_config.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_show_in_man_to_command_config_sqlite.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_subflow_fields_to_workflow_instances.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_suspended_node_reminders_table.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_suspended_node_reminders_table_sqlite.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_tags_to_resources.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_tags_to_resources_sqlite.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_target_type_to_scheduled_flows.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_user_auth_fields.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_user_auth_fields_sqlite.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_workflow_group_table.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/add_workflow_statistics_fields.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/create_command_config_table.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/create_memory_tables.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/create_wfaas_tables_fixed.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/fix_params_schema.sql create mode 100644 temp/archived-source-code/tiangong/backend/migrations/run_add_statistics_fields.py create mode 100644 temp/archived-source-code/tiangong/backend/mock_api.py create mode 100644 temp/archived-source-code/tiangong/backend/requirements-test.txt create mode 100644 temp/archived-source-code/tiangong/backend/scripts/README.md create mode 100644 temp/archived-source-code/tiangong/backend/scripts/add_flow_instance_id_to_agent_messages.sql create mode 100644 temp/archived-source-code/tiangong/backend/scripts/add_layer_personnel_indexes.sql create mode 100644 temp/archived-source-code/tiangong/backend/scripts/add_rollback_history_table.sql create mode 100644 temp/archived-source-code/tiangong/backend/scripts/backfill_memory_categories.py create mode 100644 temp/archived-source-code/tiangong/backend/scripts/create_rollback_history_table.sql create mode 100644 temp/archived-source-code/tiangong/backend/scripts/dump_dify_msg_database.sh create mode 100644 temp/archived-source-code/tiangong/backend/scripts/export_workflows_to_yaml.py create mode 100644 temp/archived-source-code/tiangong/backend/scripts/final_verification.py create mode 100644 temp/archived-source-code/tiangong/backend/scripts/generate_keys.py create mode 100644 temp/archived-source-code/tiangong/backend/scripts/manage_function_schemas.py create mode 100644 temp/archived-source-code/tiangong/backend/scripts/memory_extraction_dryrun.py create mode 100644 temp/archived-source-code/tiangong/backend/scripts/sqls/wegodev-dev.sql create mode 100644 temp/archived-source-code/tiangong/backend/scripts/sqls/wegodev-sit.sql create mode 100644 temp/archived-source-code/tiangong/backend/scripts/test-mem/memory_extraction_dryrun.mjs create mode 100644 temp/archived-source-code/tiangong/backend/scripts/test-mem/memory_extraction_group_context_dryrun.mjs create mode 100644 temp/archived-source-code/tiangong/backend/scripts/test-mem/package.json create mode 100644 temp/archived-source-code/tiangong/backend/scripts/test-mem/pnpm-lock.yaml create mode 100644 temp/archived-source-code/tiangong/backend/scripts/test_in_wxmsg.py create mode 100644 temp/archived-source-code/tiangong/backend/scripts/test_llm_resource_management.py create mode 100644 temp/archived-source-code/tiangong/backend/scripts/test_rate_limiting.py create mode 100644 temp/archived-source-code/tiangong/backend/scripts/test_scheduled_flow_feature_toggle.py create mode 100644 temp/archived-source-code/tiangong/backend/scripts/test_security.py create mode 100644 temp/archived-source-code/tiangong/backend/scripts/test_wechat_integration.py create mode 100644 temp/archived-source-code/tiangong/backend/scripts/verify_rollback_feature.py create mode 100644 temp/archived-source-code/tiangong/backend/sql/migrations/add_clean_openspec_config.sql create mode 100644 temp/archived-source-code/tiangong/backend/sql/migrations/add_command_config_data_driven_fields.sql create mode 100644 temp/archived-source-code/tiangong/backend/sql/migrations/add_create_group_command.sql create mode 100644 temp/archived-source-code/tiangong/backend/sql/migrations/add_deploy_command.sql create mode 100644 temp/archived-source-code/tiangong/backend/sql/migrations/add_group_memory.sql create mode 100644 temp/archived-source-code/tiangong/backend/sql/migrations/add_group_memory_query_prompt.sql create mode 100644 temp/archived-source-code/tiangong/backend/sql/migrations/add_group_memory_summary_prompt.sql create mode 100644 temp/archived-source-code/tiangong/backend/sql/migrations/add_intent_expire_hours_config.sql create mode 100644 temp/archived-source-code/tiangong/backend/sql/migrations/add_intent_recognition_tables.sql create mode 100644 temp/archived-source-code/tiangong/backend/sql/migrations/add_server_instance_id_column.sql create mode 100644 temp/archived-source-code/tiangong/backend/sql/migrations/add_simplified_notification_feature_toggle.sql create mode 100644 temp/archived-source-code/tiangong/backend/sql/migrations/migrate_analysis_workflow_commands.sql create mode 100644 temp/archived-source-code/tiangong/backend/sql/migrations/migrate_commands_to_watch_category.sql create mode 100644 temp/archived-source-code/tiangong/backend/sql/migrations/migrate_handler_commands.sql create mode 100644 temp/archived-source-code/tiangong/backend/sql/migrations/migrate_workflow_commands_to_data_driven.sql create mode 100644 temp/archived-source-code/tiangong/backend/src/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/dtos/requirement_development_dto.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/middleware/auth.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/middleware/request_tracking.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/ai_config_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/auth_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/callback_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/command_config.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/dag/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/dag/approvals.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/dag/executions.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/dag/wechat_webhook.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/dag/workflows.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/dashboard_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/db_backup_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/dify_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/feature_toggle_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/file_browser_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/flow_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/itsm_proxy_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/layer_personnel_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/llm_token_tracking_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/memory_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/merge_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/message_send_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/node_execution_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/pace_deployment_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/pace_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/product_flow_config_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/product_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/product_submodule_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/requirement_dev_flow_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/requirement_development_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/requirement_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/resource_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/role_func_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/scheduled_flow_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/scheduler_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/shimo_export_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/stage_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/subsystem_info_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/system_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/task_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/test_config_init_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/test_permission_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/triggle_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/user_info_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/user_role_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/user_usage_stats_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/wechat_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/wfaas_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/whitelist_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/workflow_statistics_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/workflow_sync_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/wxmessage_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/api/routes/wxmsg_config_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/cli/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/cli/create_admin.py create mode 100644 temp/archived-source-code/tiangong/backend/src/config/llm_token_config.py create mode 100644 temp/archived-source-code/tiangong/backend/src/config/settings.py create mode 100644 temp/archived-source-code/tiangong/backend/src/database.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/agent_message.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/ai_config.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/artiste_role_func.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/artiste_user_role.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/base.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/base_executable.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/bug_info.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/callback_status.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/command_config.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/command_flow.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/dag/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/dag/approval_history.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/dag/create_tables.sql create mode 100644 temp/archived-source-code/tiangong/backend/src/models/dag/execution_queue.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/dag/node_execution.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/dag/rollback_history.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/dag/suspended_node_reminder.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/dag/workflow_instance.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/dag/workflow_instance_meta.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/dag/workflow_template.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/dify_msg_receive.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/dify_msg_send.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/distributed_lock.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/dpms_business_requirement.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/event.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/feature_toggle.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/file_browser.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/file_config.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/flow.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/group_memory.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/human_confirm.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/init_task.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/intent_recognition_log.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/layer_personnel.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/llm_token_usage.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/manual_review.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/merge_request.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/product.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/product_flow_config.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/product_submodule.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/project_person.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/received_wx_msg.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/requirement.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/requirement_dev_flow.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/requirement_development_record.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/resource.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/scheduled_flow.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/scheduled_flow_request.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/send_wx_msg.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/stage.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/subsystem_info.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/system.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/task.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/user_comment.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/user_info.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/user_memory.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/user_token.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/wfaas.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/whitelist.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/workflow_function_schema.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/workflow_group.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/workflow_statistics.py create mode 100644 temp/archived-source-code/tiangong/backend/src/models/wxmsg_config.py create mode 100644 temp/archived-source-code/tiangong/backend/src/rd_process/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/rd_process/hooks/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/rd_process/hooks/rd_error_notification_hooks.py create mode 100644 temp/archived-source-code/tiangong/backend/src/rd_process/hooks/rd_parameter_hooks.py create mode 100644 temp/archived-source-code/tiangong/backend/src/rd_process/hooks/rd_post_execute_hooks.py create mode 100644 temp/archived-source-code/tiangong/backend/src/rd_process/hooks/rd_validation_hooks.py create mode 100644 temp/archived-source-code/tiangong/backend/src/rd_process/models/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/rd_process/models/rd_process.py create mode 100644 temp/archived-source-code/tiangong/backend/src/rd_process/tests/example_rd_hooks.py create mode 100644 temp/archived-source-code/tiangong/backend/src/rd_process/tests/test_rd_hooks.py create mode 100644 temp/archived-source-code/tiangong/backend/src/rd_process/tests/test_rd_post_execute_hooks.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/condition_checker.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/context.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/execution_retry.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/executors/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/executors/base.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/executors/claude_executor.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/executors/kilo_executor.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/executors/qwen_executor.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/git_manager.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/message_handler.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/orchestrator.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/pre_execution_handlers.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/prompt_builder.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/resource_selector.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/result_validator.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent/workspace_manager.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/agent_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/ai_native.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/callback_status_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/command_config_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/command_role_sync.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/command_sync_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/command_suggester.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/dispatcher.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/handlers/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/handlers/analysis.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/handlers/flow.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/handlers/misc.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/handlers/publish.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/message_sender.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/param_mapper.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/parser.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/permissions.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/preprocessors.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/registry.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/services/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/services/_shared.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/services/analysis_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/services/design_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/services/dev_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/services/flow_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/services/misc_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/services/openspec_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/services/publish_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/services/test_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/commands/utils.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/config_file_watcher.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/configured_execution_methods.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/PARAMETER_VALIDATION_SIMPLIFICATION.md create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/approval_manager.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/approval_resolver.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/execution_engine.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/internal_workflow_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/node_factory.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/node_reset_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/CODE_SIMPLIFICATION_SUMMARY.md create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/NODE_DEVELOPMENT_SUMMARY.md create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/PARAMETER_VALIDATION_SIMPLIFICATION.md create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/REFACTORING_GUIDE.md create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/WEUP_SPRINGBOOT3_UPGRADE_NODE_GUIDE.md create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/analyze_sys_req_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/assert_atmp_test_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/atmpdev_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/close_bug_flow_node_only.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/code_analysis_nodes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/code_review_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/config_init_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/create_release_plan_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/design_development_nodes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/design_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/design_sys_req_sdl_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/development_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/external_tools.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/file_archive_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/fix_bug_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/flow_execution.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/fps_um_account_nodes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/hello_world_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/link_req_subsys_version_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/mock_nodes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/parse_dpms_url_and_validate_product.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/pre_gen_sys_req_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/pre_review_biz_req_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/production_release_nodes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/pull_biz_req_list_to_shimo_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/pull_biz_req_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/pull_biz_req_to_pre_review_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/pull_sys_req_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/push_artifact_prod_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/rd_process_analysis_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/regress_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/security_work_close_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/security_work_detail_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/split_biz_req_to_products_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/subflow_nodes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/submit_bug_flow_node_only.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/submit_pending_bug_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/submit_req_schedule_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/submit_sys_req_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/submit_sys_req_schedule_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/testdpms_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/testdpmsforuat_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/testgen_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/testgensafe_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/testreport_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/testreportforuat_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/testrunui_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/tidb_permission_nodes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/um_account_nodes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/verify_fixed_bug_flow_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/nodes/weup_springboot3_upgrade_node.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/notification/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/notification/constants.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/notification/message_builder.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/notification/notification_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/notification/templates.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/parallel_coordinator.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/parameter_guard.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/preflight_parameter_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/progress_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/roles.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/routing_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/schema_bootstrap.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/standalone_executor.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/suspended_node_reminder_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/trace_context.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/wechat_integration.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/workflow_instance_meta_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag/workflow_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dag_restart_resume_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/data_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/db_backup_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dev_design.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dev_openspec.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dev_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dev_utils.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dify_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/distributed_lock_async_wrapper.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/distributed_lock_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/dpms_url_handler.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/entity_state_manager.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/events/event_handler.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/base.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/executors/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/executors/flow_executor.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/executors/stage_executor.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/executors/task_executor.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/handlers/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/handlers/agent_execution_handler.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/handlers/callback_handler.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/handlers/event_emitter.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/handlers/execute_method_handler.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/handlers/hook_runner.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/handlers/manual_review_handler.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/handlers/notification_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/handlers/parameter_handler.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/handlers/result_collector.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/handlers/skip_node_handler.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution/models.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/execution_manager.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/feature_toggle_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/file_browser_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/file_operation_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/flow_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/group_command_handler.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/group_memory_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/human_confirm_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/init_task_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/intent_analyzers.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/intent_recognition_base.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/intent_recognition_helpers.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/intent_recognition_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/intent_recognition_types.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/intent_reference_helper.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/intent_result_actions.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/intent_schemas.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/intent_state_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/itsm_proxy_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/layer_personnel_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/llm_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/llm_token_tracking_scheduler.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/llm_token_tracking_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/manual_review_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/memory/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/memory/consolidation.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/memory/identity.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/memory/llm_client.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/memory/memory_extractor.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/memory/memory_middleware.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/memory/memory_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/memory/prompt_builder.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/memory/protocols.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/memory/provider.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/memory/schemas.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/merge_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/message_command_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/message_pattern_matcher.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/message_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/permission_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/product_flow_config_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/product_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/product_submodule_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/requirement_dev_flow_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/requirement_development_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/requirement_scheduler_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/requirement_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/resource_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/restart_resume_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/role_func_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/scheduled_flow_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/scheduler_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/send_wxmsg_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/shimo_export_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/smart_response_generator.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/special_processing_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/special_processing_wrapper.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/stage_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/startup_sync_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/sub_system_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/subsystem_info_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/system_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/task_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/task_status_notification_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/user_role_func_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/user_role_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/user_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/user_usage_stats_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/wechat_notification_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/wedo_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/wfaas_client_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/wfaas_env_config_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/wfaas_function_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/wfaas_publish_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/whitelist_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/workflow_control_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/workflow_orchestrator.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/workflow_statistics_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/workflow_sync_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/wxmsg_config_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/wxmsg_intent_recong_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/services/wxmsg_service.py create mode 100644 temp/archived-source-code/tiangong/backend/src/tasks/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/tasks/data_clean.py create mode 100644 temp/archived-source-code/tiangong/backend/src/tasks/error_test.py create mode 100644 temp/archived-source-code/tiangong/backend/src/test_itsm_change_publish_v2.py create mode 100644 temp/archived-source-code/tiangong/backend/src/testor/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/src/testor/data_quality_ai_agent.py create mode 100644 temp/archived-source-code/tiangong/backend/src/testor/example_rd_hooks.py create mode 100644 temp/archived-source-code/tiangong/backend/src/testor/simple_test_api_endpoints.py create mode 100644 temp/archived-source-code/tiangong/backend/src/testor/test_api_endpoints.py create mode 100644 temp/archived-source-code/tiangong/backend/src/testor/test_rd_hooks.py create mode 100644 temp/archived-source-code/tiangong/backend/src/tools/artiste_bug.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/crypto_utils.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/digital_worker_portal_util.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/dpms_utils.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/dpms_workflow.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/file_mapper.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/find_handlers.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/git_utils.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/init_ai_docs.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/ip_utils.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/llm_token_errors.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/logging.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/md_to_pdf_converter.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/rate_limit_utils.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/requirement_dev_logging.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/result_check_utils.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/server_instance.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/ssl_utils.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/string_utils.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/test_manual_review_notes.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/test_md_to_pdf_converter.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/uuid_utils.py create mode 100644 temp/archived-source-code/tiangong/backend/src/utils/wfaas_router_utils.py create mode 100644 temp/archived-source-code/tiangong/backend/src/workers/dag_worker.py create mode 100644 temp/archived-source-code/tiangong/backend/test_agent_execution_hang_fix.py create mode 100644 temp/archived-source-code/tiangong/backend/test_agent_service_fix.py create mode 100644 temp/archived-source-code/tiangong/backend/test_command_config_integration.py create mode 100644 temp/archived-source-code/tiangong/backend/test_complete_node.py create mode 100644 temp/archived-source-code/tiangong/backend/test_execute_method.py create mode 100644 temp/archived-source-code/tiangong/backend/test_execute_method_direct.py create mode 100644 temp/archived-source-code/tiangong/backend/test_execution_manager_method.py create mode 100644 temp/archived-source-code/tiangong/backend/test_flow_execution_optimization.py create mode 100644 temp/archived-source-code/tiangong/backend/test_flow_fix.py create mode 100644 temp/archived-source-code/tiangong/backend/test_llm_token_tracking.py create mode 100644 temp/archived-source-code/tiangong/backend/test_mariadb_worker.py create mode 100644 temp/archived-source-code/tiangong/backend/test_node_types.py create mode 100644 temp/archived-source-code/tiangong/backend/test_parameter_collection_fix.py create mode 100644 temp/archived-source-code/tiangong/backend/test_parameter_validation.py create mode 100644 temp/archived-source-code/tiangong/backend/test_stage_fix.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/api/test_subflow_api.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/contract/test_biz_requirement_get.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/contract/test_biz_requirements_list.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/contract/test_feature_toggle_contract.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/contract/test_feature_toggle_default_contract.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/contract/test_feature_toggle_module_contract.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/contract/test_merge_command.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/contract/test_tech_requirement_get.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/contract/test_tech_requirements_list.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/e2e/test_command_role_permission_e2e.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/CONFIG_INIT_TEST_GUIDE.md create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/PERMISSION_TEST_GUIDE.md create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/README_CONFIG_INIT.md create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/README_PERMISSION_TEST.md create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/api/test_approvals_api.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/api/test_auth_api.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_agent_orchestrator_integration.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_command_config_e2e.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_command_role_sync_integration.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_config_init_data.sql create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_event_logging.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_execute_flow_e2e.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_execution_refactor.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_executor_migration.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_fail_node_notification.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_feature_toggle_default_integration.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_feature_toggle_integration.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_feature_toggle_module_integration.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_merge_workflow.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_node_execution_integration.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_permission_check_api.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_permission_data.sql create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_permission_http.ps1 create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_permission_http.sh create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_requirements_view.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_subflow_execution.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_subflow_output_declaration.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_wechat_rate_limiting.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_whitelist_batch_api.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_workflow_api_filtering.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/integration/test_workflow_published_e2e.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/performance/test_event_performance.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/simple_verify.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/test_data_quality_ai_agent.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/test_git_utils.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/test_task_timeout.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/unit/api/test_command_config_metadata_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/unit/api/test_command_config_routes.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/unit/conftest.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/unit/dag/notification/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/unit/dag/notification/test_constants.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/unit/dag/notification/test_message_builder.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/unit/dag/notification/test_notification_service.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/unit/dag/notification/test_templates.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/unit/models/__init__.py create mode 100644 temp/archived-source-code/tiangong/backend/tests/unit/models/dag/__init__.py diff --git a/.claude/agents/testing/functional-test-generator.md b/.claude/agents/testing/functional-test-generator.md index b27ad256..bca7b2b2 100644 --- a/.claude/agents/testing/functional-test-generator.md +++ b/.claude/agents/testing/functional-test-generator.md @@ -1797,14 +1797,14 @@ Scenario Outline: 输入验证失败 #### 字段获取策略 -**子系统名称**获取优先级: -1. 从 `project-context.json` 的 `system.subsystemName` 读取 -2. 从需求文档/设计文档中推断 +**子系统名称**获取优先级(⭐阶段1 S5 D13修正:反查versions.json,原project-context.system.subsystemName字段不存在): +1. 从需求 `context.md` 的 `reqSubsystemId` 反查 `versions.json.subsystems[]` 取 `subsystemName` +2. 降级取 `versions.json.subsystemName`(入口子系统单值) 3. 默认值:"子系统" -**子系统版本**获取优先级: -1. 从 `project-context.json` 的 `system.version` 读取 -2. 从Git分支名推断(如 `dev-v2.3.9`) +**子系统版本**获取优先级(⭐阶段1 S5 D13修正): +1. 从需求 `context.md` 的 `reqSubsystemId` 反查 `versions.json.subsystems[]` 取 `subsystemVersionId` +2. 降级取 `versions.json.subsystemVersionId`(入口子系统单值=版本计划版本号) 3. 默认值:"V1.0.0" **测试集名**获取策略: diff --git a/.claude/commands/dev-sync-agent-help.md b/.claude/commands/dev-sync-agent-help.md index 09936725..c647afdd 100644 --- a/.claude/commands/dev-sync-agent-help.md +++ b/.claude/commands/dev-sync-agent-help.md @@ -2,10 +2,16 @@ name: dev-sync-agent-help type: command description: 帮助命令,显示DevSyncAgent工具的所有Agent、Skill、Command的功能介绍和用法 -version: 4.8.3 +version: 4.9.1 author: DevSyncAgent Team -last_updated: 2026-07-19 +last_updated: 2026-07-27 changelog: + v4.9.1 - 2026-07-27 + - v4.9.1正式发布:Stage10版本级回归用例状态流转SIT回调路径补全(10.6.2 transition_version_regression_cases_sit_callback)——10.6.1只绑local test_passed,skip/SIT路径无流转入口导致回归用例卡在"synced but not transitioned"中间态(用例由SIT外部执行非local 10.5);新增10.6.2复用HTTP POST逻辑(updateTestCaseStatus status=3),幂等(transitionedAt)+transitionSource=sit_callback可追溯;complete-version步骤2.5加SIT reflow入口(检查transitionedAt,未流转则询问SIT结果:passed→10.6.2/pending SIT→待补录/skip→保留),未执行用例不自动标记passed避免DPMS数据污染 + - help命令直接写入版本号v4.9.1(dev-sync-agent-version命令已删除,不再提供查看版本的独立命令) + v4.9 - 2026-07-24 + - v4.9核心亮点:多需求并行形态B段调度+多子系统支持+S11整合+多git编排+wecom-server 2.5.12(compact false-failure修复)+版本流程修复(灰度发布双重缺口+Stage10回归用例状态流转10.6.1+complete-version越界步骤删除) + - help命令直接写入版本号v4.9(dev-sync-agent-version命令已删除,不再提供查看版本的独立命令) v4.8.3 - 2026-07-19 - v4.8.3正式发布:GEP自进化全Agent/Skill覆盖(design/dev/testing扩展) + dev-flow上下文传递优化(context-contract+三层上下文+两阶段checkpoint+resume checkpointId对账) + 版本进度一致性修复 + Stage9循环决策可配置(loop_decision ask/auto+暂停保留现场) + merge-feature标准化命令(9原则11步4准则,私有) - help命令直接写入版本号v4.8.3(dev-sync-agent-version命令已删除,不再提供查看版本的独立命令) @@ -146,10 +152,10 @@ skills = scan_skills('.claude/skills/') # 扫描Commands commands = scan_commands('.claude/commands/') -# 版本信息:直接使用 v4.8(2026-07-08 发布) +# 版本信息:直接使用 v4.9(2026-07-24 发布) # 注:dev-sync-agent-version 命令已删除,不再提供独立查看版本的命令 -version = "v4.8" -release_date = "2026-06-30" +version = "v4.9" +release_date = "2026-07-24" ``` ### Step 3: 过滤和搜索 @@ -169,7 +175,7 @@ if keyword: ```markdown ## 📚 DevSyncAgent 帮助中心 -**DevSyncAgent v4.8**(发布于 2026-07-08) +**DevSyncAgent v4.9**(发布于 2026-07-24) --- diff --git a/.claude/config/dev-flow-checklists/associate-requirement.md b/.claude/config/dev-flow-checklists/associate-requirement.md index 339b75bc..78edd2bb 100644 --- a/.claude/config/dev-flow-checklists/associate-requirement.md +++ b/.claude/config/dev-flow-checklists/associate-requirement.md @@ -21,11 +21,22 @@ ``` { "storyId": storyId, "releasePlanId": releasePlanId, "optUserName": currentUser } ``` - - **步骤A4-2:关联需求到子系统版本** — 调用 `mcp__sdp__associate-subsystem-version`: + - **步骤A4-2:关联需求到子系统版本**(⭐阶段1 S5 H2修正:按 `reqSubsystemId` 分组关联,非入口单值统一) — 调用 `mcp__sdp__associate-subsystem-version`: ``` - { "userName": currentUser, "subSystemId": subsystemId, "version": subsystemVersionId, "storyIds": [待关联的storyId列表] } + # 按 reqSubsystemId 分组,每组用对应子系统的 subSystemId/subsystemVersionId + subsystem_groups = {} + FOR each req IN 待关联需求: + sub_id = req.reqSubsystemId or 版本配置.entrySubsystemId # 兜底入口 + sub = FIND 版本配置.subsystems WHERE subsystemId == sub_id + IF sub THEN + IF sub_id NOT IN subsystem_groups THEN + subsystem_groups[sub_id] = {"subsystemVersionId": sub.subsystemVersionId, "storyIds": []} + END IF + subsystem_groups[sub_id].storyIds.append(req.dpmsStoryId) + FOR each sub_id, group IN subsystem_groups: + { "userName": currentUser, "subSystemId": sub_id, "version": group.subsystemVersionId, "storyIds": group.storyIds } ``` - ⚠️ `version` 参数使用 versions.json 中的 `subsystemVersionId`(如"12.23.34"),**禁止**使用 `versionName`(发布计划名称) + ⚠️ `version` 参数使用各子系统对应的 `subsystemVersionId`(如"12.23.34"),**禁止**使用 `versionName`(发布计划名称);**禁止**用入口单值统一关联所有需求(H2修正:非入口子系统需求会关联到错误子系统版本);单子系统时退化为1组(向后兼容) - IF 任一步骤 MCP 调用失败 THEN 按容错机制处理(写入 PendingItem) - 更新本地版本配置,标记 `assigned=true` - 创建本地需求目录 diff --git a/.claude/config/dev-flow-checklists/create-version.md b/.claude/config/dev-flow-checklists/create-version.md index b31b3a40..fdb960ae 100644 --- a/.claude/config/dev-flow-checklists/create-version.md +++ b/.claude/config/dev-flow-checklists/create-version.md @@ -24,13 +24,14 @@ - 参数 `items[].version` = subsystemVersionId(第1.5轮输入),**不是** 发布计划名称 - 参数 `items[].subsystemId` = 第4轮从MCP列表选择的 subsystemId - ⚠️ **参数来源约束(强制执行)**:A2a/A2b所需的所有参数已在前4轮收集中获取,**禁止在A2a执行前调用任何额外MCP获取子系统信息** -4. 调用 SCM MCP 新建子系统版本 A2b:`mcp__sdp__add-subsystem-version`(含容错,见下方) - - 参数(对齐 dpms-requirements-sync SKILL.md:418-472 权威定义): +4. 调用 SCM MCP 新建子系统版本 A2b:`mcp__sdp__add-subsystem-version`(含容错,见下方)⭐阶段1 S5:多子系统循环调用(D2非阻塞,不回滚已成功,失败写PendingItem) + - 单子系统:现有流程(1次调用) + - 多子系统:FOR each sub IN selected_subsystems 循环调用,参数(对齐 dpms-requirements-sync SKILL.md:418-472 权威定义): ```json { - "subSystemName": "{第4轮选择的子系统英文名}", - "subSystemVersionId": "{subsystemVersionId,第1.5轮输入}", - "isNeedGrayRelease": "{第4轮收集:1=灰度,0=非灰度}", + "subSystemName": "{sub.subsystemName,第4轮多选}", + "subSystemVersionId": "{sub.subsystemVersionId,第1.5轮该子系统独立版本号}", + "isNeedGrayRelease": "{第4轮收集:1=灰度,0=非灰度,版本级统一}", "createUserName": "{当前用户英文名}", "enableAiMode": 1, "expectGrayReleaseDate": "{isNeedGrayRelease=1 时传 timestamp毫秒;=0 时不传}", @@ -39,6 +40,15 @@ "versionType": 1 } ``` + - 循环伪代码: + ``` + subsystem_results = [] + FOR each sub IN selected_subsystems: + result = safe_call_mcp("mcp__sdp__add-subsystem-version", {...如上...}, context_description=f"A2b:创建子系统版本 {sub.subsystemName}") + IF result["success"]: subsystem_results.append(sub) + ELSE: save_pending_item(skip_reason="MCP_FAILED") # 不中止,继续其他子系统 + END FOR + ``` - 参数 `subSystemVersionId` = subsystemVersionId(第1.5轮输入),**不是** 发布计划名称 - 参数 `subSystemName` = 第4轮选择的子系统英文名 - ⚠️ `isNeedGrayRelease` 是 MCP required 必填(SKILL.md:446),漏传会导致创建失败 @@ -63,28 +73,49 @@ - **⚠️ 关键**:A5.1成功后,必须从返回结果中提取 `testPlanId`,写入 versions.json 的 `regressionTestSetId` 字段 - 后续 complete-version 阶段 A5.2(版本回归用例填充)依赖此字段关联回归用例 - 🛡️ 接入 safe_call_mcp 容错框架,失败时记录到 pending-sync,不阻塞版本创建流程 -6. 创建本地版本目录和配置 +6. 创建本地版本目录和配置(⭐阶段1 S5:入口单值保留+subsystems[]数组) - versions.json 中记录以下字段: ```json { "versionName": "{发布计划名称,第1轮输入}", - "subsystemVersionId": "{子系统版本号,第1.5轮输入}", "productId": "{产品ID}", "productName": null, // A3创建需求后通过get-storys回填,初始为null - "subsystemId": "{从MCP列表选择的subsystemId}", - "subsystemName": "{从MCP列表选择的subsystem英文名}", - "testSetId": "{A5返回的testPlanId,A5失败或跳过时为null}", - "regressionTestSetId": "{A5.1返回的testPlanId,A5.1失败或跳过时为null}", // 🆕 回归测试集ID - "isNeedGrayRelease": "{第4轮收集:1=灰度,0=非灰度}", // 🆕 灰度发布标识 - "grayReleaseDate": "{灰度日期YYYY-MM-DD或null,非灰度时null}", // 🆕 灰度发布日期 - "testReportId": null, // 🆕 v4.8 测试报告ID,初始null,由 complete-version A6-Step3 写入 - "branchName": "{步骤6.5创建的Git分支名,未创建时为null}", - "pipelineId": "{步骤6.6输入的流水线ID,未执行时为null}", - "pipelineVersion": "{步骤6.6输入的流水线版本号,未执行时为null}", - "contextSchemaVersion": "1.0", - "versionContextPath": "dev/versions/{versionName}/version-context.md" + "testSetId": "{A5返回的testPlanId,版本级共享}", + "regressionTestSetId": "{A5.1返回的testPlanId,版本级共享}", + "isNeedGrayRelease": "{第4轮收集:1=灰度,0=非灰度,版本级统一}", + "grayReleaseDate": "{灰度日期YYYY-MM-DD或null,版本级统一}", + "testReportId": null, + "contextSchemaVersion": "2.1", // ⭐阶段1 S5:1.0→2.0(多子系统);⭐阶段3 S6:2.0→2.1(多git) + "versionContextPath": "dev/versions/{versionName}/version-context.md", + "entrySubsystemId": "{入口子系统ID}", + "subsystemId": "{入口子系统ID,兼容下游单值消费者}", + "subsystemName": "{入口子系统名,兼容}", + "subsystemVersionId": "{入口子系统版本号,兼容=版本计划版本号}", + "branchName": "{版本级单分支(步骤6.5),所有子系统共享,兼容}", + "pipelineId": "{入口子系统流水线ID,兼容}", + "pipelineVersion": "{入口子系统流水线版本,兼容}", + "isMultiGit": false, // ⭐阶段3:是否多git(默认false,向后兼容) + "subsystems": [ // ⭐阶段1 S5:多子系统数组 + { + "subsystemId": "{子系统ID}", + "subsystemName": "{子系统英文名}", + "subsystemVersionId": "{该子系统版本号}", + "branchName": "{=版本级单分支}", + "pipelineId": "{该子系统流水线ID}", + "pipelineVersion": "{subsystemName}_{subsystemVersionId}", + "gitUrl": "{多git时该子系统仓库SSH,单git时null}", // ⭐阶段3 + "localPath": "{多git时该仓库本地路径,单git时null=pwd}", // ⭐阶段3 + "modules": [], + "isEntry": true + } + // 多子系统时多个元素,入口isEntry=true + ], + "repositories": [], // ⭐阶段3:去重仓库列表(单git时[]) + "requirements": [] // 各需求含 reqSubsystemId+repositoryId(add-story时填) } ``` + - ⭐阶段3 向后兼容:旧 versions.json(contextSchemaVersion=="2.0")读取时调 migrate_v2_to_v2_1()(isMultiGit=false,gitUrl=null,repositories=[],requirements[].repositoryId=null) + - 向后兼容:旧 versions.json(contextSchemaVersion=="1.0" 且有单值 subsystemId)读取时调 migrate_v1_to_v2()(单值包装为 subsystems[0]+isEntry=true,entrySubsystemId=原subsystemId,requirements[].reqSubsystemId=entrySubsystemId) - 初始化版本级上下文 `dev/versions/{versionName}/version-context.md`。该文件是执行期聚合视图,`versions.json` 仍是生命周期与控制字段权威源: ```markdown --- @@ -115,17 +146,18 @@ 本文件由 dev-flow version 主会话维护。禁止 Agent/Skill 直接修改控制字段。 ``` - 创建/更新该文件前必须读取 `.claude/config/dev-flow-context-contract.json`;若文件已存在,只刷新版本快照字段,保留 `requirementContextIndex/openRisks/stage10Result`。 -6.5 **创建版本 Git 分支**: +6.5 **创建版本 Git 分支**(⭐阶段1 S5 P5修正:单分支,所有子系统共享。单项目单git不可多分支——git工作区同时只能checkout一个分支,多子系统各一分支会导致Stage4提交混乱): ```python - # 基于第1.5轮收集的 subsystemVersionId 生成建议分支名 - suggested_branch = "dev-" + subsystemVersionId # 如 "dev-12.23.34" + # 基于入口子系统版本号生成建议分支名(版本级单分支) + entry = entry_subsystem + suggested_branch = "dev-" + entry.subsystemVersionId # 如 "dev-12.23.34" branch_name = AskUserQuestion({ "questions": [{ - "question": f"请输入新版本Git分支名称(建议基于子系统版本号 {subsystemVersionId}):", + "question": f"请输入新版本Git分支名称(建议基于入口子系统版本号 {entry.subsystemVersionId},所有子系统共享此分支):", "header": "Git分支", "options": [ - {"label": f"{suggested_branch}", "description": f"使用建议名称,基于子系统版本号 {subsystemVersionId}"}, + {"label": f"{suggested_branch}", "description": f"使用建议名称,基于入口子系统版本号 {entry.subsystemVersionId}"}, {"label": "自定义名称", "description": "输入自定义的分支名称"} ], "multiSelect": false @@ -148,13 +180,35 @@ OUTPUT: f"✅ 已创建并切换到分支:{branch_name}" END IF - # 将分支名写入 versions.json 当前版本配置 + # ⭐阶段1 S5 P5:所有子系统共享此分支(单项目单git) + FOR each sub IN subsystem_results: + sub.branchName = branch_name # 全部相同 + END FOR + + # 将分支名写入 versions.json 当前版本配置(版本级单值,所有子系统共享) 更新当前版本配置:branchName = branch_name 同步刷新 version-context.md:branchName = branch_name, contextRevision += 1, updatedAt = now + + # ⭐阶段3 S6 J2修正:多git时为每个仓库创建分支(原仅pwd单仓库) + IF 版本配置.isMultiGit THEN + FOR each repo IN 版本配置.repositories: + bash(f"cd {repo.localPath}") + repo_existing = bash(f"git branch --list {branch_name}").strip() + IF repo_existing 非空 THEN + bash(f"git checkout {branch_name}") + OUTPUT: f"⚠️ 仓库[{repo.gitUrl}]分支 {branch_name} 已存在,已切换" + ELSE + bash(f"git checkout -b {branch_name}") + OUTPUT: f"✅ 仓库[{repo.gitUrl}]已创建分支:{branch_name}" + END IF + repo.branchName = branch_name + END FOR + END IF ``` ⚠️ **分支名规范**:建议采用 `dev-{subsystemVersionId}` 格式(如 `dev-12.23.34`),便于版本追溯。 ⚠️ **幂等性**:若分支已存在,切换到该分支而非报错。 + ⚠️ **多git分支创建**(⭐阶段3):多git时每仓库各创建同名分支(不同仓库同名分支不冲突);仓库localPath不存在时写PendingItem不阻塞。 6.6 **更新PACE流水线版本及Git分支**(v4.11:6.5.1 关联分支已后移至 complete-version 封板前,本步骤独立执行): @@ -194,56 +248,50 @@ ) OUTPUT: "⚠️ 步骤6.6 跳过:subsystemName 或 subsystemVersionId 缺失,已记录到待补录" ELSE - # 询问 pipelineId(版本号强制按规则自动拼接,不询问用户) - pipeline_params = AskUserQuestion({ - "questions": [ - {"question": "请输入PACE流水线ID(pipelineId):", "header": "流水线ID"} - ] - }) - - # 强制规则:流水线版本号 = {subsystemName}_{subsystemVersionId} + # ⭐阶段1 S5 D5:FOR each sub IN subsystem_results 循环,每子系统独立询问pipelineId + 拼接pipeline_version + MCP调用 + # 强制规则:流水线版本号 = {subsystemName}_{subsystemVersionId}(每子系统独立) # 例:subsystemName="BDP-UDES" + subsystemVersionId="1.1.16" -> "BDP-UDES_1.1.16" - pipeline_version = f"{版本配置.subsystemName}_{版本配置.subsystemVersionId}" - OUTPUT: f"ℹ️ 流水线版本号已自动拼接为:{pipeline_version}" - - # 构造subsystemBranchList:使用步骤6.5的分支名和版本配置中的子系统名 - subsystem_branch_list = [{ - "subsystem": 版本配置.subsystemName, - "branch": branch_name - }] - - result = safe_call_mcp( - "mcp__sdp__update-version-build-branch", - { - "pipelineId": pipeline_params.pipelineId, - "version": pipeline_version, - "userId": 当前用户英文名, - "subsystemBranchList": subsystem_branch_list - }, - context_description="步骤6.6:更新PACE流水线版本及Git分支", - version_id=versionName - ) - - IF result["success"] THEN - OUTPUT: f"✅ 步骤6.6 已完成:流水线已更新(pipelineId: {pipeline_params.pipelineId}, version: {pipeline_version})" - 更新当前版本配置:pipelineId = pipeline_params.pipelineId, pipelineVersion = pipeline_version - 同步刷新 version-context.md:pipelineId/pipelineVersion/contextRevision/updatedAt - ELSE - mcp__biz-sync__save_pending_item( - version_id="{versionName}", - task_name="更新PACE流水线版本及Git分支", - mcp_method="mcp__sdp__update-version-build-branch", - mcp_params={ - "pipelineId": pipeline_params.pipelineId, - "version": pipeline_version, - "userId": 当前用户英文名, - "subsystemBranchList": subsystem_branch_list - }, - skip_reason="MCP_FAILED", - context_description="步骤6.6:更新流水线MCP调用失败" - ) - OUTPUT: "⚠️ 步骤6.6 失败:流水线更新失败,已记录到待补录" - END IF + version_branch = 版本配置.branchName # 版本级单分支(所有子系统共享,P5) + FOR each sub IN subsystem_results: + pipeline_version = f"{sub.subsystemName}_{sub.subsystemVersionId}" + OUTPUT: f"ℹ️ 子系统 [{sub.subsystemName}] 流水线版本号:{pipeline_version}" + # 询问该子系统的 pipelineId + sub_pipeline = AskUserQuestion({ + "questions": [{"question": f"请输入子系统[{sub.subsystemName}]的PACE流水线ID(pipelineId):", "header": f"流水线ID-{sub.subsystemName}"}] + }) + # subsystemBranchList 多元素但 branch 相同(版本级单分支,P5) + subsystem_branch_list = [{"subsystem": sub.subsystemName, "branch": version_branch}] + result = safe_call_mcp( + "mcp__sdp__update-version-build-branch", + { + "pipelineId": sub_pipeline.pipelineId, + "version": pipeline_version, + "userId": 当前用户英文名, + "subsystemBranchList": subsystem_branch_list + }, + context_description=f"步骤6.6:更新子系统[{sub.subsystemName}]PACE流水线版本及Git分支", + version_id=versionName + ) + IF result["success"] THEN + sub.pipelineId = sub_pipeline.pipelineId + sub.pipelineVersion = pipeline_version + OUTPUT: f"✅ 子系统[{sub.subsystemName}]流水线已更新(pipelineId: {sub.pipelineId}, version: {pipeline_version})" + ELSE + mcp__biz-sync__save_pending_item( + version_id="{versionName}", + task_name=f"更新PACE流水线版本及Git分支[{sub.subsystemName}]", + mcp_method="mcp__sdp__update-version-build-branch", + mcp_params={"pipelineId": sub_pipeline.pipelineId, "version": pipeline_version, "userId": 当前用户英文名, "subsystemBranchList": subsystem_branch_list}, + skip_reason="MCP_FAILED", + context_description=f"步骤6.6:子系统[{sub.subsystemName}]流水线更新失败" + ) + OUTPUT: f"⚠️ 子系统[{sub.subsystemName}]流水线更新失败,已记录到待补录,继续下一个子系统" + END IF + END FOR + # 入口子系统的 pipelineId/pipelineVersion 写入版本级单值(兼容下游单值消费者,D11) + entry = entry_subsystem + 更新当前版本配置:pipelineId = entry.pipelineId, pipelineVersion = entry.pipelineVersion + 同步刷新 version-context.md:pipelineId/pipelineVersion/contextRevision/updatedAt END IF ELSE # 跳过 mcp__biz-sync__save_pending_item( diff --git a/.claude/config/dev-flow-checklists/stage-10-version-regression.md b/.claude/config/dev-flow-checklists/stage-10-version-regression.md index aa4a0d10..236ffc38 100644 --- a/.claude/config/dev-flow-checklists/stage-10-version-regression.md +++ b/.claude/config/dev-flow-checklists/stage-10-version-regression.md @@ -523,6 +523,86 @@ FUNCTION transition_version_regression_cases(): END FUNCTION ``` +### 10.6.2 SIT 回流:版本级回归用例状态补流转 🆕 + +> **背景**:10.6.1 仅在 Stage 10.5 本地 `event_type=="test_passed"` 时触发。但版本级回归用例的业务执行方是 SIT(非本地,见 A6 测试报告 testStepList=[1,3] 含 SIT+回归)。两条路径下用例已同步入库(10.3 已 addTestCase+link,testCaseId 已生成于 `.regression-case-cache.json`)但无法流转: +> - **skip 模式**:10.5 被跳过 → 无 event_type → 10.6.1 不触发。此为**正确行为**(未执行不应标通过),不在此修复。 +> - **SIT 执行后**:SIT 在版本流程外部执行,10.6.1 无感知 → 用例已通过却无流转入口 → "已同步未流转"悬挂态。**此为本函数修复对象**。 +> +> **设计原则**(不臆断业务时序): +> 1. **不绑定任何"=SIT完成"的时序假设**(如"测试报告发布即SIT完成")——这类假设无法从源码确证,绑定即埋雷。 +> 2. **幂等**:复用 transitionedAt 标记,10.6.1 已流转的跳过,不重复流转。 +> 3. **显式触发**:由 complete-version 步骤2.5 在版本完成节点询问用户 SIT 结果后调用,不自动标通过(避免未执行标 status=3 的数据错误)。 +> 4. **复用 10.6.1 流转逻辑**:HTTP POST updateTestCaseStatus status=3 + stage-hooks.md:975-994 容错,不新写流转代码。 +> +> **调用方**:complete-version.md 步骤2.5(stage10Completed=True 分支内,SIT 回流兜底)。 + +```python +FUNCTION transition_version_regression_cases_sit_callback(): + # 与 10.6.1 transition_version_regression_cases() 共用同一缓存与幂等标记 + cache_path = f"dev/versions/{versionId}/.regression-case-cache.json" + + # 1. 缓存与幂等检查(同 10.6.1 决策点2) + IF NOT 文件存在 cache_path THEN + OUTPUT: "⚠️ 无回归用例缓存文件,SIT 回流跳过" + RETURN + cache = read cache_path + IF cache.get("transitionedAt") 非空 THEN + OUTPUT: f"ℹ️ 版本级回归用例已流转过({cache['transitionedAt']}),SIT 回流跳过" + RETURN + + # 2. 用例存在性校验 + test_case_ids = [c["testCaseId"] FOR c IN cache.get("uploadedCases", [])] + IF len(test_case_ids) == 0 THEN + OUTPUT: "⚠️ 回归用例缓存 uploadedCases 为空,SIT 回流跳过" + mcp__biz-sync__save_pending_item( + version_id="{versionName}", task_name="Stage10.6.2-SIT回流", + mcp_method="mcp__tctp-dpms-set__updateTestCaseStatus", + skip_reason="TEST_CASE_IDS_EMPTY") + RETURN + + # 3. 参数校验(同 10.6.1) + release_plan_id = 版本配置.releasePlanId + test_plan_id = 版本配置.regressionTestSetId + IF release_plan_id 为空 OR test_plan_id 为空 THEN + missing = [] + IF NOT release_plan_id THEN missing.append("releasePlanId") + IF NOT test_plan_id THEN missing.append("regressionTestSetId") + mcp__biz-sync__save_pending_item( + version_id="{versionName}", task_name="Stage10.6.2-SIT回流", + mcp_method="mcp__tctp-dpms-set__updateTestCaseStatus", + skip_reason="RELEASE_PLAN_OR_TEST_PLAN_EMPTY", + context_description=f"SIT 回流跳过,缺少参数:{missing}") + OUTPUT: f"⚠️ SIT 回流跳过,缺少参数:{missing},已记录待补录" + RETURN + + # 4. 流转为通过(status=3)— 复用 10.6.1 第3步 HTTP POST 逻辑 + # (HTTP POST updateTestCaseStatus + stage-hooks.md:975-994 容错模式) + operator = 当前用户英文名 + 发送 HTTP POST 到 http://10.107.100.21:3000/tctptest/chatbot/updateTestCaseStatus: + { + "releasePlanId": release_plan_id, + "testPlanId": test_plan_id, + "operator": operator, + "testCaseList": [ + {"testCaseId": tc_id, "status": 3, "modifier": operator, "runUser": operator} + FOR tc_id IN test_case_ids + ] + } + # 失败时 save_pending_item 的 mcp_method 统一用 "mcp__tctp-dpms-set__updateTestCaseStatus" + + IF HTTP成功 THEN + cache["transitionedAt"] = current_timestamp() + cache["transitionStatus"] = "passed" + cache["transitionSource"] = "sit_callback" # 标记流转来源,区分 10.6.1 本地流转 + write cache_path = cache + OUTPUT: f"✅ SIT 回流:版本级回归用例已流转为通过({len(test_case_ids)}条)" + ELSE + # 容错模式已 save_pending_item;transitionedAt 不回写,允许重试 + OUTPUT: "⚠️ SIT 回流流转失败,已记录待补录(transitionedAt未回写,可重试)" +END FUNCTION +``` + ### 10.7 版本级回归测试报告 ```python @@ -578,6 +658,7 @@ stage10_checkpoint_id = "{versionName}:VERSION:10:{ISO时间}" - [ ] 10.5 回归测试执行 event_type = ? - [ ] 10.6 循环次数 = ?(0=一次通过) - [ ] 10.6.1 版本级回归用例状态流转 = ?(已流转N条/跳过+pending/已流转过跳过)🆕 +- [ ] 10.6.2 SIT 回流 = ?(全量回归本地通过时 10.6.1 已流转→此入口跳过 / skip或SIT场景由 complete-version 步骤2.5 触发,此处仅声明函数已就绪)🆕 - [ ] 10.7 报告生成 = ? - [ ] versions.json stage10Completed = True - [ ] version-context.md stage10Result/checkpointState = ?(completed/clean) diff --git a/.claude/config/dev-flow-checklists/stage-names.json b/.claude/config/dev-flow-checklists/stage-names.json index 2ad9b640..27cff9fe 100644 --- a/.claude/config/dev-flow-checklists/stage-names.json +++ b/.claude/config/dev-flow-checklists/stage-names.json @@ -1,7 +1,7 @@ { - "version": "1.1", - "description": "dev-flow stage 中文映射 + STAGE_ORDER 单一真相源。回滚展示与查看版本状态复用,避免中文名散落维护。数据源对齐 stage-hooks.md 阶段Agent映射表。", - "stage_order": [0, 1, 1.1, 1.2, 1.6, 2, 2.1, 2.2, 3, 3.1, 3.2, 3.5, 4, 5, 5.5, 6, 6.1, 7, 8, 9, 10], + "version": "1.2", + "description": "dev-flow stage 中文映射 + STAGE_ORDER 单一真相源。回滚展示与查看版本状态复用,避免中文名散落维护。数据源对齐 stage-hooks.md 阶段Agent映射表。v1.2: G6新增3.5a/3.5b。", + "stage_order": [0, 1, 1.1, 1.2, 1.6, 2, 2.1, 2.2, 3, 3.1, 3.2, 3.5, "3.5a", "3.5b", 4, 5, 5.5, 6, 6.1, 7, 8, 9, 10], "stage_names": { "0": "需求澄清", "1": "需求分析", @@ -15,6 +15,8 @@ "3.1": "代码知识同步", "3.2": "代码部署前自检", "3.5": "插件开发迭代评估循环", + "3.5a": "G5静态质量评分", + "3.5b": "G3插件依赖校验", "4": "自动部署", "5": "部署确认", "5.5": "测试用例澄清", diff --git a/.claude/config/dev-flow-context-contract.json b/.claude/config/dev-flow-context-contract.json index 397dec84..989bf76a 100644 --- a/.claude/config/dev-flow-context-contract.json +++ b/.claude/config/dev-flow-context-contract.json @@ -42,6 +42,14 @@ "failed" ], "summary_max_chars": 1000, + "optional_quality": { + "description": "⭐v4.10 G6 新增:本阶段评审评分(可选,仅dev_target=Agent/Skill/Command插件需求收账)。向后兼容:旧阶段不填不影响。", + "quality_score": "number|null // 本阶段评审分(各阶段自有刻度:req-recheck四维度/des-recheck六维度1-5/functional-test百分制/pass_rate等)", + "quality_grade": "string|null // 等级(A/B/C/D 或 high/medium/low 或 A-F)", + "quality_dimensions": "object|null // 各维度分明细,如{relevance:4.5,rationality:4.0}", + "reviewer": "string|null // 评审载体,如 des-recheck-orchestrator", + "status": "string|null // completed|skipped(跳过检视时记skipped,末端scorer据此降级)" + }, "allowed_context_updates": [ "functionAttributes", "frontendType", @@ -61,7 +69,14 @@ "loopDecisionMode", "cycleDecision", "fixRequirementSummary", - "versionRegressionResult" + "versionRegressionResult", + "segmentProgress", + "subsystems", + "entrySubsystemId", + "reqSubsystemId", + "isMultiGit", + "repositoryId", + "qualityBaseline" ] }, "prompt_sections": [ @@ -124,6 +139,16 @@ "consumes": ["pluginPath", "dev_target", "codeReviewResult"], "produces": ["pluginEvalResult", "goldenFixtureArtifacts"] }, + "3.5a": { + "_comment": "⭐v4.10 G6 新增:G5静态质量评分(仅dev_target=Agent/Skill/Command触发,照搬Stage3.5守卫模式)", + "consumes": ["pluginPath", "dev_target", "pluginEvalResult"], + "produces": ["pluginStaticQualityResult", "qualityBaseline.development.static"] + }, + "3.5b": { + "_comment": "⭐v4.10 G6 新增:G3插件依赖校验(仅dev_target=Agent/Skill/Command触发,照搬Stage3.5守卫模式)", + "consumes": ["pluginPath", "dev_target"], + "produces": ["pluginDependencyResult", "qualityBaseline.development.dependencies"] + }, "4": { "consumes": ["changedFiles", "codeReviewResult", "pluginEvalResult", "branchName", "pipelineId"], "produces": ["commitId", "pushResult", "deploymentTriggerSummary"] diff --git a/.claude/config/plugin-dev/plugin-dev-flow-rules.json b/.claude/config/plugin-dev/plugin-dev-flow-rules.json index 5217bddd..0a64aa93 100644 --- a/.claude/config/plugin-dev/plugin-dev-flow-rules.json +++ b/.claude/config/plugin-dev/plugin-dev-flow-rules.json @@ -60,6 +60,63 @@ "2": "评估引擎不可用(降级提示)", "3": "参数错误" }, + "stage_3_5a": { + "_comment": "⭐v4.10 G6 新增:G5静态质量评分(仅dev_target=Agent/Skill/Command,照搬stage_3_5守卫模式)", + "enabled": true, + "trigger": { + "dev_target": ["Agent", "Skill", "Command"], + "source_stage": "3.5", + "next_stage_on_success": "3.5b", + "fallback_on_failure": "skip_to_stage_3_5b", + "note": "复用 dev_target 互斥机制,常规研发流程不触发" + }, + "evaluation": { + "engine": "plugin-quality-gate.py", + "engine_path": ".claude/dev-tools/plugin-quality-gate/", + "cli_interface_template": "python plugin-quality-gate.py --target {name} --target-type {type} --mode normal --report-format json --no-write", + "dimensions": ["D1_prompt_completeness", "D2_injection_safety", "D3_version_compliance", "D4_bdd_coverage", "D5_execution_evaluation", "D6_golden_fixture_coverage", "D7_dependency_integrity"], + "default_mode": "normal" + }, + "fallback": { + "on_gate_failed": "ask_user_degrade_or_rollback", + "on_tool_unavailable": "skip_to_stage_3_5b" + }, + "quality_baseline_key": "development.static", + "exit_codes": { + "0": "门禁通过(推进3.5b)", + "1": "门禁未通过(询问降级/回退/中止)", + "2": "G5工具不可用(自动降级3.5b)", + "3": "参数错误(中止)" + } + }, + "stage_3_5b": { + "_comment": "⭐v4.10 G6 新增:G3插件依赖校验(仅dev_target=Agent/Skill/Command,照搬stage_3_5守卫模式)", + "enabled": true, + "trigger": { + "dev_target": ["Agent", "Skill", "Command"], + "source_stage": "3.5a", + "next_stage_on_success": "4", + "fallback_on_failure": "skip_to_stage_4", + "note": "复用 dev_target 互斥机制,常规研发流程不触发" + }, + "evaluation": { + "engine": "plugin-dependency-analyzer.py", + "engine_path": ".claude/dev-tools/plugin-dependency-analyzer/", + "cli_interface_template": "python plugin-dependency-analyzer.py --target {name} --target-type {type} --no-write --report-format json", + "checks": ["existence", "mcp", "cycle"] + }, + "fallback": { + "on_p0_conflict": "ask_user_degrade_or_rollback", + "on_tool_unavailable": "skip_to_stage_4" + }, + "quality_baseline_key": "development.dependencies", + "exit_codes": { + "0": "无P0冲突(推进Stage4)", + "1": "有P0冲突(询问降级/回退/中止)", + "2": "G3工具不可用(自动降级Stage4)", + "3": "参数错误(中止)" + } + }, "constraints": { "must_not_modify": [ "现有 Stage 0-9 的定义", diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 458cb857..3c850b6c 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -137,7 +137,12 @@ "Bash(cp .claude/agents/requirement/req-type-classifier.md /tmp/g3test/.claude/agents/)", "Bash(mkdir -p /tmp/g3test/.claude/skills /tmp/g3test/.claude/commands)", "Bash(mkdir -p /tmp/g3test/.claude/agents/requirement /tmp/g3test/.claude/skills /tmp/g3test/.claude/commands /tmp/g3test/.claude/dev-tools)", - "Bash(cp -r .claude/dev-tools/plugin-dependency-analyzer /tmp/g3test/.claude/dev-tools/)" + "Bash(cp -r .claude/dev-tools/plugin-dependency-analyzer /tmp/g3test/.claude/dev-tools/)", + "WebFetch(domain:docs.claude.com)", + "WebFetch(domain:www.anthropic.com)", + "Bash(rm -rf output/.claude)", + "Bash(cp -r .claude output/.claude)", + "Bash(grep -vE \"^\\\\s*$\")" ] }, "enableAllProjectMcpServers": true, diff --git a/.claude/skills/functional-test-generator/SKILL.md b/.claude/skills/functional-test-generator/SKILL.md index da3b2301..52f23a38 100644 --- a/.claude/skills/functional-test-generator/SKILL.md +++ b/.claude/skills/functional-test-generator/SKILL.md @@ -1331,14 +1331,14 @@ public void sendEmail(String to, String subject, String content) #### 字段获取策略 -**子系统名称**获取优先级: -1. 从 `project-context.json` 的 `system.subsystemName` 读取 -2. 从需求文档/设计文档中推断 +**子系统名称**获取优先级(⭐阶段1 S5 D13修正:反查versions.json,原project-context.system.subsystemName字段不存在): +1. 从需求 `context.md` 的 `reqSubsystemId` 反查 `versions.json.subsystems[]` 取 `subsystemName` +2. 降级取 `versions.json.subsystemName`(入口子系统单值) 3. 默认值:"子系统" -**子系统版本**获取优先级: -1. 从 `project-context.json` 的 `system.version` 读取 -2. 从Git分支名推断(如 `dev-v2.3.9`) +**子系统版本**获取优先级(⭐阶段1 S5 D13修正): +1. 从需求 `context.md` 的 `reqSubsystemId` 反查 `versions.json.subsystems[]` 取 `subsystemVersionId` +2. 降级取 `versions.json.subsystemVersionId`(入口子系统单值=版本计划版本号) 3. 默认值:"V1.0.0" **测试集名**获取策略: diff --git a/.claude/skills/plugin-quality-scorer/SKILL.md b/.claude/skills/plugin-quality-scorer/SKILL.md new file mode 100644 index 00000000..a7f16a09 --- /dev/null +++ b/.claude/skills/plugin-quality-scorer/SKILL.md @@ -0,0 +1,85 @@ +--- +name: plugin-quality-scorer +type: plugin-quality-scorer +description: 插件(Agent/Skill/Command)质量评分与治理专家。聚合版本全流程各阶段qualityBaseline(需求/设计/开发静态/开发动态/依赖/测试),用7维度28项评分卡给出0-4分+总分+A/B/C/D评级+治理四态决策(保留/拆分/升格/退役)。用于插件需求开发末端(Stage9通过后每需求级)治理评分、存量插件定期巡检。触发:需要对插件本身做质量评级与治理决策时。不触发:评估代码质量(用code-review)/运行pass_rate(用G1)/能否发布门禁(用G5二值)。 +version: 1.0 +author: DevSyncAgent Team +last_updated: 2026-07-23 +changelog: + v1.0 - 2026-07-23 + - 🆕 G6 末端治理评分 skill:聚合 qualityBaseline → 7维度28项评分 → A/B/C/D评级 → 治理四态(保留/拆分/升格/退役) + - 评分内核:datago v3.0 评分卡(对齐 Anthropic skill-creator 官方参考实现) + - 配套脚本:skill-scoring-check.py(确定性逻辑自动定档,消除主观) + - 不建 Agent 镜像(独立 skill) + - 🔗 与 G1-G5 联动:维度六消费 G1/G4 benchmark.json 作评测证据;G5静态结果作为维度输入;G3依赖作为维度输入 +--- + +# 插件质量评分与治理 Skill(G6) + +## 核心职责 + +对指定的 Agent/Skill/Command 插件,聚合版本全流程 qualityBaseline,产出: +1. **7维度28项评分**(0-4分五级制,详见 `references/scoring-rubric.md`) +2. **总分 + A/B/C/D 评级** +3. **治理四态决策**(保留/拆分/升格/退役) +4. **红线检查**(5+1个一票否决项) + +## 与 G1-G5 的区别(不重叠) + +| 组件 | 评什么 | 输出 | 形态 | +|------|--------|------|------| +| G1 | 动态执行 pass_rate | 通过率/可靠性/Delta/成本 | 引擎 | +| G4 | 迭代评估循环 | pass_rate≥0.8 达标 | 流程(Stage3.5) | +| G5 | 二值门禁(D1-D7) | 过/不过+退出码 | 门禁 | +| **G6(本skill)** | **聚合评级+治理四态** | **0-4分+总分+A/B/C/D+保留/拆分/升格/退役** | **治理决策** | + +**关键**:G6 不重新评各阶段(各阶段 recheck/G1/G5 已评),只**聚合 + 治理决策**。 + +## 触发条件 + +- **自动**:版本全流程中,该需求 Stage 9 循环决策"通过"后、Stage 10 前(每需求/每插件级,仅 dev_target=Agent/Skill/Command) +- **手动**:`/plugin-quality-scorer [--target-type agent|skill|command]` +- **隔离**:仅插件需求触发;常规研发(dev_target=Java/Python/Go)不触发 + +## 执行流程 + +### Step 1: 确定评分对象与质量基线 +- 读取 `context.md.qualityBaseline`(需求/设计/开发静态/开发动态/依赖/测试 各段评分) +- 若无 qualityBaseline(手动评存量插件):直接读插件文件,各维度从文件特征评 + +### Step 2: 跑确定性评分脚本(消除主观) +- 执行 `scripts/skill-scoring-check.py ` → 自动定以下确定性项的档位: + - 行数(3.2 维度)、MUST计数(4.5)、硬编码凭据扫描(5.3)、frontmatter合规(7.1,调quick_validate)、evals存在(6.1)、三层目录(3.1)、allowed-tools一致性(7.2) + +### Step 3: 人工判定主观项(对照 `references/scoring-rubric.md`) +- 对确定性脚本未覆盖的项,逐项打分(0-4),**要求附证据**(实证类4分必须附官方格式证据:trigger eval/benchmark.json/comparator报告) + +### Step 4: 计算总分 + 评级 + 红线检查 +- 单项贡献分 = (得分/4) × 权重;总分 = Σ贡献分(百分制) +- 评级:A≥85 / B70-84 / C55-69 / D<55 +- 红线(任一触发强制D):frontmatter不合规(7.1=0)/高危脚本(5.2=0)/硬编码凭据(5.3=0)/高风险无审核(5.1=0)/未跑真实任务(6.1=0)/description写宽误触发(1.1≤1) + +### Step 5: 治理四态决策 +| 评级 | 触发条件 | 处置 | +|:---:|---|---| +| A | 全段qualityBaseline高分+G5过+G4 pass_rate≥0.9 | **保留**:上架默认层 | +| B | 各段≥中+G5过+G4 pass_rate≥0.8 | **保留/拆分**:上专业层;边界模糊(1.2低分)触发拆分 | +| C | 部分段低分或G5 P1失败 | **拆分**:收窄description/补Gotchas后复审 | +| D | 红线 或 **维度三高+维度四低剪刀差** | **退役/升格**:重做;或核心价值=稳定执行→升格为Tool/MCP | + +**升格剪刀差判定**(datago独有):qualityBaseline.development(结构/脚本化高分) + testing(内容深度低分) → 升格为 Tool/MCP。 + +**跳过降级**:若某段 qualityBaseline 为 `{status:"skipped"}` → 最高评 B(防"跳过检视反拿高分")。 + +### Step 6: 输出评分报告 +- markdown 报告(7维度28项+总分+评级+治理建议)+ json(机读) +- 自动触发时写入 context.md.qualityBaseline.plugin_final = {score, grade, governance} + +## 评分内核 + +完整 7 维度 28 项锚点见 `references/scoring-rubric.md`(基于 datago v3.0 评分卡,对齐 Anthropic skill-creator)。 + +## 诚实边界 + +- 本 skill 评的是"插件文件特征完整度+各阶段聚合分",**不替代** G1 动态执行/G5 二值门禁 +- 评级的"与skill真实表现正相关"属实证层,需后续用本skill评50+插件对照官方benchmark校准(本skill建立不依赖该校准) diff --git a/.claude/skills/plugin-quality-scorer/references/scoring-rubric.md b/.claude/skills/plugin-quality-scorer/references/scoring-rubric.md new file mode 100644 index 00000000..2a8de1ea --- /dev/null +++ b/.claude/skills/plugin-quality-scorer/references/scoring-rubric.md @@ -0,0 +1,110 @@ +# 插件质量评分卡(7 维度 28 项) + +> **来源**:datago v3.0 评分卡,对齐 Anthropic `anthropics/skills` 仓库 skill-creator 官方参考实现。 +> **制式**:0-4 分五级制(4标杆/3良好/2基本达标/1严重不足/0缺失),权重合计 100%。 +> **用途**:plugin-quality-scorer skill 的评分核验基准。 + +## 权重总览 + +| 维度 | 权重 | 核心问题 | +|---|:---:|---| +| 一、触发与边界 | 20% | 该不该用?会不会抢错? | +| 二、流程与契约 | 20% | 用起来对不对?稳不稳? | +| 三、结构与资源 | 15% | 加载是否按需?可维护? | +| 四、内容深度 | 15% | 信息有价值?解释 why? | +| 五、安全与护栏 | 10% | 会不会闯祸? | +| 六、评测与验证 | 15% | 效果有无实证证据? | +| 七、合规与可加载 | 5% | 能否被 Claude 加载? | + +## 红线(一票否决,任一触发强制 D) + +- 7.1=0(frontmatter 不合规,无法加载) +- 5.2=0(高危脚本/越权) +- 5.3=0(硬编码凭据/不可信外链) +- 5.1=0(高风险动作完全无审核) +- 6.1=0(从未在真实任务跑过) +- 1.1≤1 且误触发率超阈值(description 写宽) + +## 评级阈值 + +A≥85(保留,上默认层) / B70-84(保留/拆分,上专业层) / C55-69(拆分,不进公共目录) / D<55(退役/升格) + +--- + +## 维度一:触发与边界(20%) + +| 项 | 权重 | 4分锚点 | +|---|:---:|---| +| 1.1 description路由触发器 | 8% | 触发信号+禁用信号双向,边界精确,**适度pushy**防undertrigger,无泛化宣传 | +| 1.2 排他性边界 | 7% | 适用范围+禁用场景明确,与同类skill边界无重叠(列同类清单逐条标注) | +| 1.3 场景必要性 | 5% | 高频可复用可验证,**Claude无skill时易做错或做不了**(对齐SKILL.md L398),任务实质性 | + +## 维度二:流程与契约(20%) + +| 项 | 权重 | 4分锚点 | +|---|:---:|---| +| 2.1 命令式步骤 | 6% | 每步对应**明确工具调用或产物路径**(非泛化动作) | +| 2.2 输出契约 | 5% | "必须包含"+"禁止出现"明确,与下游消费方声明一致(可校验) | +| 2.3 退出条件 | 4% | 循环类有终止条件,非循环类有完成判定 | +| 2.4 异常熔断 | 5% | 枚举可预期错误+**错误码→熔断动作映射表**,未见错误转人工 | + +## 维度三:结构与资源(15%) + +| 项 | 权重 | 4分锚点 | +|---|:---:|---| +| 3.1 三层架构 | 4% | SKILL.md+references+scripts三层齐全(脚本校验目录存在性) | +| 3.2 渐进披露 | 3% | body<500行+reference>300行含TOC(**wc -l实测**) | +| 3.3 易变外置 | 3% | 正文grep无具体版本号/接口参数 | +| 3.4 脚本化 | 3% | 确定性动作全脚本化,IO+错误处理明确 | +| 3.5 现成脚本 | 2% | 提供完整helper脚本供直接调用 | + +## 维度四:内容深度(15%) + +| 项 | 权重 | 4分锚点 | +|---|:---:|---| +| 4.1 Gotchas | 4% | 独立Gotchas章节+≥3条"不要做X" | +| 4.2 反常识 | 3% | 列出区别于模型默认认知的具体点 | +| 4.3 示例 | 2% | 完整输入+期望输出,覆盖正常与边界 | +| 4.4 留余地 | 1% | 边界清晰但留变通空间 | +| 4.5 explain-why | 5% | 解释why非heavy MUST,**全大写MUST/ALWAYS/NEVER≤3次/千字**+每规则有why(grep计数) | + +## 维度五:安全与护栏(10%) + +| 项 | 权重 | 4分锚点 | +|---|:---:|---| +| 5.1 高风险审核⚡ | 3% | 枚举所有写操作+每个审核点(写操作→审核点映射) | +| 5.2 无越权⚡ | 3% | 网络/MCP/文件访问全受控(脚本扫描声明vs allowed-tools) | +| 5.3 无凭据⚡ | 2% | 无硬编码token/key/IP(脚本扫描) | +| 5.4 配置记忆 | 2% | config初始化+记忆机制(存稳定目录) | + +## 维度六:评测与验证(15%)— 实证导向 + +| 项 | 权重 | 4分锚点(必须附实证证据) | +|---|:---:|---| +| 6.1 真实任务⚡ | 3% | 附benchmark.json(pass_rate/token/time+stddev+delta),非仅evals目录 | +| 6.2 四层评测 | 3% | 附analyzer报告:assertion区分度(non-discriminating/flaky/skill-hurting) | +| 6.3 A/B对照 | 3% | 附with-skill vs baseline benchmark对比+delta | +| 6.4 冲突测试 | 3% | 附三类冲突测试case(抢任务/通用压专用/错误工具) | +| 6.5 回归评测 | 2% | 纳入回归集,防旧问题回归 | +| 6.6 盲评 | 1% | 附comparator报告:Content+Structure双维度rubric | + +## 维度七:合规与可加载(5%) + +| 项 | 权重 | 4分锚点 | +|---|:---:|---| +| 7.1 frontmatter合规⚡ | 5% | name/description必填+name kebab≤64+desc≤1024无<>;**项目规约白名单**(官方6+version/type/author/last_updated/changelog/sync_info等项目属性)+claude -p加载验证可触发 | +| 7.2 allowed-tools一致 | 0%(附加) | 声明=实际使用(脚本校验),作5.2输入 | + +--- + +## 总分计算 + +单项贡献分 = (得分/4) × 权重;总分(百分制) = Σ贡献分。 + +## 官方对齐来源(可回溯) + +- skill-creator/SKILL.md(485行):description pushy(L67)/三层结构(L75-84)/<500行(L90)/explain-why(L139,302)/A-B baseline(L169-186)/trigger eval near-miss(L354-358)/盲评(L325-329) +- skill-creator/agents/grader.md:false confidence警告(L18)/critique evals(L56-79) +- skill-creator/agents/analyzer.md:assertion区分度(L214-217) +- skill-creator/agents/comparator.md:Content/Structure rubric(L41-48) +- skill-creator/scripts/quick_validate.py:6属性白名单(L42) diff --git a/.claude/skills/plugin-quality-scorer/scripts/skill-scoring-check.py b/.claude/skills/plugin-quality-scorer/scripts/skill-scoring-check.py new file mode 100644 index 00000000..5bfc262f --- /dev/null +++ b/.claude/skills/plugin-quality-scorer/scripts/skill-scoring-check.py @@ -0,0 +1,200 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +plugin-quality-scorer 确定性评分脚本 (G6) +对 skill/agent/command 插件做确定性项自动定档,消除主观判定。 +覆盖7项确定性逻辑:行数/MUST计数/凭据扫描/frontmatter合规/evals存在/三层目录/allowed-tools一致性。 + +用法: + python skill-scoring-check.py [--target-type skill|agent|command] +退出码: + 0 = 检查完成(不论得分高低) + 1 = 参数错误 / 路径不存在 +""" +import sys +import os +import re +import json +from pathlib import Path + +# ⚠️ Windows 编码强制规范(feedback_python_tool_windows_encoding) +if sys.stdout and hasattr(sys.stdout, "reconfigure"): + sys.stdout.reconfigure(encoding="utf-8") +if sys.stderr and hasattr(sys.stderr, "reconfigure"): + sys.stderr.reconfigure(encoding="utf-8") + + +def load_skill_md(plugin_path: Path): + """定位 SKILL.md / Agent.md / Command.md 主文件""" + for name in ("SKILL.md", "AGENT.md", "agent.md"): + f = plugin_path / name + if f.exists(): + return f + # agent/command 可能是单文件 + for md in plugin_path.glob("*.md"): + if md.name.lower() not in ("readme.md", "changelog.md"): + return md + return None + + +def extract_frontmatter(text: str): + """提取 YAML frontmatter(简易,不依赖pyyaml)""" + m = re.match(r"^---\n(.*?)\n---", text, re.DOTALL) + if not m: + return None + return m.group(1) + + +def count_lines(file_path: Path) -> int: + """3.2 维度:主文件行数""" + try: + with open(file_path, "r", encoding="utf-8") as f: + return sum(1 for _ in f) + except Exception: + return -1 + + +def count_heavy_must(text: str) -> int: + """4.5 维度:全大写 MUST/ALWAYS/NEVER/FORBIDDEN 计数(每千字)""" + # 匹配全大写的强制词(独立词) + matches = re.findall(r"\b(MUST|ALWAYS|NEVER|FORBIDDEN|REQUIRED|SHALL)\b", text) + char_count = max(len(text), 1) + return round(len(matches) * 1000 / char_count, 2) + + +def scan_credentials(text: str): + """5.3 维度:硬编码凭据/token/IP 粗扫""" + hits = [] + # 内网IP(实证:评dpms-testing-sync时发现) + if re.search(r"\b(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)\d+\.\d+\b", text): + hits.append("内网IP") + # 常见token/key模式(粗扫,排除变量占位) + for pat in [r"(?i)token\s*=\s*['\"][a-zA-Z0-9]{16,}", r"(?i)(api[_-]?key|secret)\s*=\s*['\"][^'\"]{8,}"]: + if re.search(pat, text): + hits.append("疑似凭据") + return hits + + +def check_frontmatter(fm_text: str): + """7.1 维度:frontmatter 合规 + 本项目插件用项目规约 frontmatter(允许 version/type/author/last_updated/changelog/sync_info 等项目属性), + 官方 quick_validate 的 6 属性白名单是给'上架Claude官方目录'用的。 + 本检查对项目内部插件:核心校验 name/description 必填 + name kebab + desc 长度/无<>,自定义项目属性允许。 + """ + if fm_text is None: + return {"valid": False, "reason": "无 frontmatter"} + # 项目允许的属性 = 官方6 + 项目规约自定义 + allowed = { + # 官方6 + "name", "description", "license", "allowed-tools", "metadata", "compatibility", + # 项目规约自定义(DevSyncAgent 所有 agent/skill/command 通用) + "version", "type", "author", "last_updated", "lastUpdated", "changelog", + "sync_info", "origin_session_id", "originSessionId", "node_type", + } + keys = set() + for line in fm_text.splitlines(): + m = re.match(r"^([a-zA-Z][a-zA-Z0-9_-]*):", line) + if m and not line.startswith(" "): + keys.add(m.group(1)) + unexpected = keys - allowed + if unexpected: + return {"valid": False, "reason": f"非白名单属性: {unexpected}"} + # name kebab-case ≤64 + name_m = re.search(r"^name:\s*(.+)$", fm_text, re.MULTILINE) + if name_m: + name = name_m.group(1).strip() + if len(name) > 64: + return {"valid": False, "reason": f"name 超64字符({len(name)})"} + if not re.match(r"^[a-z0-9-]+$", name): + return {"valid": False, "reason": f"name 非kebab-case: {name}"} + # description ≤1024 无 <> + desc_m = re.search(r"^description:\s*(.+)$", fm_text, re.MULTILINE) + if desc_m: + desc = desc_m.group(1).strip() + if "<" in desc or ">" in desc: + return {"valid": False, "reason": "description 含 <> 角括号"} + if len(desc) > 1024: + return {"valid": False, "reason": f"description 超1024字符({len(desc)})"} + if "name" not in keys or "description" not in keys: + return {"valid": False, "reason": "缺 name 或 description"} + return {"valid": True, "reason": "合规"} + + +def check_three_layer(plugin_path: Path): + """3.1 维度:三层目录存在性""" + has_md = any((plugin_path / n).exists() for n in ("SKILL.md", "AGENT.md")) + has_references = (plugin_path / "references").is_dir() + has_scripts = (plugin_path / "scripts").is_dir() + return {"md": has_md, "references": has_references, "scripts": has_scripts} + + +def check_evals(plugin_path: Path): + """6.1 维度:evals 目录存在(实证证据存在性,非内容质量)""" + evals_dir = plugin_path / "evals" + if not evals_dir.is_dir(): + return {"exists": False} + json_files = list(evals_dir.glob("*.json")) + list(evals_dir.glob("*.jsonl")) + return {"exists": True, "files": len(json_files)} + + +def check_allowed_tools(fm_text: str, body: str): + """7.2 维度:allowed-tools 声明 vs 正文使用一致性(粗扫)""" + if fm_text is None: + return {"declared": False, "note": "无frontmatter"} + decl_m = re.search(r"^allowed-tools:\s*(.+)$", fm_text, re.MULTILINE) + declared = decl_m.group(1).strip() if decl_m else "" + # 正文是否提到工具调用(粗略) + uses_mcp = "mcp__" in body + uses_bash = re.search(r"\bBash\b|```bash|```sh", body) is not None + return {"declared": bool(declared), "declared_value": declared, "uses_mcp": uses_mcp, "uses_bash": uses_bash} + + +def main(): + if len(sys.argv) < 2: + print("用法: python skill-scoring-check.py [--target-type skill|agent|command]") + sys.exit(1) + plugin_path = Path(sys.argv[1]).resolve() + if not plugin_path.exists(): + print(f"[ERROR] 路径不存在: {plugin_path}", file=sys.stderr) + sys.exit(1) + + is_file = plugin_path.is_file() + main_md = plugin_path if is_file else load_skill_md(plugin_path) + if main_md is None or not Path(main_md).exists(): + print(f"[ERROR] 未找到主 .md 文件: {plugin_path}", file=sys.stderr) + sys.exit(1) + + main_md = Path(main_md) + text = main_md.read_text(encoding="utf-8") + fm_text = extract_frontmatter(text) + body = re.sub(r"^---\n.*?\n---", "", text, count=1, flags=re.DOTALL) + base_dir = main_md.parent if is_file else plugin_path + + result = { + "plugin": str(plugin_path), + "main_md": str(main_md), + "checks": { + "3.2_lines": {"value": count_lines(main_md), "rubric_ref": "<500行=候选4 / 500-800=3 / 800-1500=2 / >1500=1"}, + "4.5_heavy_must_per_1k": {"value": count_heavy_must(body), "rubric_ref": "≤3次/千字=候选4"}, + "5.3_credentials": {"hits": scan_credentials(body), "rubric_ref": "无命中=候选4"}, + "7.1_frontmatter": {**check_frontmatter(fm_text), "rubric_ref": "valid=候选4 / invalid=0(红线)"}, + "3.1_three_layer": {**check_three_layer(base_dir), "rubric_ref": "md+references+scripts齐全=候选4"}, + "6.1_evals": {**check_evals(base_dir), "rubric_ref": "存在=候选3+ / 不存在=低分"}, + "7.2_allowed_tools": {**check_allowed_tools(fm_text, body), "rubric_ref": "声明=使用=候选4"}, + }, + } + + # 红线预警:7.1 frontmatter invalid / 5.3 凭据命中 + warnings = [] + if not result["checks"]["7.1_frontmatter"].get("valid"): + warnings.append("🔴 红线: frontmatter不合规(7.1=0,强制D)") + if result["checks"]["5.3_credentials"]["hits"]: + warnings.append("🔴 红线: 疑似硬编码凭据(5.3=0候选)") + + result["warnings"] = warnings + print(json.dumps(result, ensure_ascii=False, indent=2)) + sys.exit(0) + + +if __name__ == "__main__": + main() diff --git "a/.claude/skills/version-change-order-generator/\347\211\210\346\234\254\345\217\221\345\270\203\345\217\230\346\233\264\345\215\225-\346\250\241\347\211\210\345\206\205\345\256\271.md" "b/.claude/skills/version-change-order-generator/\347\211\210\346\234\254\345\217\221\345\270\203\345\217\230\346\233\264\345\215\225-\346\250\241\347\211\210\345\206\205\345\256\271.md" index 7f9f90a6..7e023ecc 100644 --- "a/.claude/skills/version-change-order-generator/\347\211\210\346\234\254\345\217\221\345\270\203\345\217\230\346\233\264\345\215\225-\346\250\241\347\211\210\345\206\205\345\256\271.md" +++ "b/.claude/skills/version-change-order-generator/\347\211\210\346\234\254\345\217\221\345\270\203\345\217\230\346\233\264\345\215\225-\346\250\241\347\211\210\345\206\205\345\256\271.md" @@ -1,8 +1,9 @@ # 版本发布变更单 -## 一、子系统版本基础信息 +## 一、子系统版本基础信息(共 `#{versions.json.subsystems.length}` 个子系统) -- 子系统版本号:`#{versions.json.subsystemVersionId}` + +- 子系统:`#{subsystem.subsystemName}` | 版本号:`#{subsystem.subsystemVersionId}` | 入口子系统:`#{subsystem.isEntry ? "是" : "否"}` ## 二、变更背景 diff --git a/CLAUDE.md b/CLAUDE.md index f011ffbc..8c39ee48 120000 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -224,6 +224,27 @@ python .claude/dev-tools/implementation-methodology/enforce-checklist.py \ - 所有涉及 try/except/finally 的代码修改 - 所有涉及 spec doc 实施的任务 +### 🚨 思维模式准则(P0级 - 战略层,常驻执行) + +> 起因:菜单 hide 事件(2026-07-21)暴露的不是缺工具,是上层推理失守——用下层模型局限给上层失误背锅、被挑战就附和、用工具补丁回避推理转变。本节是战略层根约束,常驻 CLAUDE.md,无需用户唤起即生效。详见 memory `feedback_one_step_in_place.md` v1.3。 + +**三层协作与责任铁律**:上层推理(识别边界/规划验证/判断/归因)+ 下层模型服务(生成token,单次有概率性)+ 上下文管理(长对话会摘要丢失)。上层失守=推理失误必须修;下层固有=可声明边界但必须配逼近机制。该问的不是"能不能100%",而是"上层逼近机制用尽了吗"。 + +**6 条准则**: + +1. **责任层区分**:禁止混用上下层。尤其禁止用下层局限解释上层失误。 +2. **反推卸**:"不能100%"只在逼近机制用尽后才许说,且同时声明:①已用哪些逼近机制 ②残余边界具体是什么 ③残余边界对当前任务的实际影响。未用尽就说"不能100%"=推卸。 +3. **反附和**:被挑战时先定位指向哪层。上层失误→承认并修;用户误判为下层问题→澄清而非附和。禁止为求认同而无原则认错——附和比反驳更危险,它伪装成诚实。 +4. **验证维度对齐执行架构**:实施前必须先识别"实际执行路径",基于实际路径规划验证维度。禁止基于假设路径规划验证。 +5. **诚实声明次序**:先穷尽分析+用尽逼近机制,再声明残余边界。禁止一上来就"不能保证"——那是不做分析的借口。 +6. **聚焦思维模式,非工具堆砌**:工具是战术补丁(且工具自身有盲区)。禁止用"再加个工具/脚本/hook"替代思维转变。个例问题不该项目级兜底。 + +**最高优先级硬规则(对抗底层对齐倾向)**:当用户期待与事实冲突时,陈述事实,不顺期待。对齐用户是倾向不是义务;陈述事实是义务。冲突时选义务。 + +**关键任务输出前自检**:我的回答里有没有"为了顺应用户期待而放宽事实"的部分?有则改回事实。 + +**一句话主线**:不向下层推卸、不向用户附和、不向工具堆砌。保证一步到位是 AI 的责任,与用户如何提问无关——用户一句话需求已足够,准则全部是 AI 对自己的单方面约束。 + ### 方法论文档 详细方法论见:`.claude/dev-tools/implementation-methodology/METHODOLOGY.md` diff --git a/PROJECT_STRUCTURE.md b/PROJECT_STRUCTURE.md index f3d4bf3c..3cdd8921 120000 --- a/PROJECT_STRUCTURE.md +++ b/PROJECT_STRUCTURE.md @@ -1,7 +1,9 @@ # DevSyncAgent - 项目结构 -> **当前版本**: v4.8.3(2026-07-19 release) -> **核心亮点(v4.8.3)**: GEP自进化全Agent/Skill覆盖(design/dev/testing扩展,21阶段consume/produce契约) + dev-flow上下文传递优化(context-contract+三层上下文+两阶段checkpoint+resume checkpointId对账) + 版本进度一致性修复(checkpointId对账+business_api聚合+task-viewer) + Stage9循环决策可配置(loop_decision ask/auto+persist_stage_pause) + merge-feature标准化命令(9原则11步4准则,私有) + 版本天花板强制4.9 +> **当前版本**: v4.9.1(2026-07-27 release) +> **核心亮点(v4.9.1)**: Stage10版本级回归用例状态流转SIT回调路径补全(10.6.2 transition_version_regression_cases_sit_callback,复用HTTP POST逻辑+幂等transitionedAt+transitionSource=sit_callback可追溯) + complete-version步骤2.5 SIT reflow入口(检查transitionedAt,未流转询问SIT结果:passed→10.6.2/pending SIT→待补录/skip→保留,未执行用例不自动标记passed避免DPMS数据污染) +> **核心亮点(v4.9)**: 多需求并行形态B段调度+多子系统支持+S11整合+多git编排+wecom-server 2.5.12(compact false-failure修复)+版本流程修复(灰度发布双重缺口+Stage10回归用例状态流转10.6.1+complete-version越界步骤删除) +> **核心亮点(v4.8.3)**: GEP自进化全Agent/Skill覆盖(design/dev/testing扩展) + dev-flow上下文传递优化(三层上下文+两阶段checkpoint+resume checkpointId对账) + Stage9循环决策可配置(loop_decision ask/auto+暂停保留现场) + merge-feature标准化命令(9原则11步4准则,私有) > **核心亮点(v4.8.2)**: G3插件依赖分析器补齐(G1-G5完整闭环5/5)+G5 D7维度(7维质量门禁) + 合并skywu_test差异化feature(版本变更单/stage级回滚/文档落盘守卫/Stage5流水线校验/测试失败原因/测试报告id/dpms固定模板/priority统一) + 删除dev-flow自动shimo(保留手动) + 菜单精简 + req-*-analyzers瘦身 + wecom-server 2.5.11(机器人模式进度注入bug修复) > **核心亮点(v4.8.1)**: GEP v2.4自演进全链路覆盖+项目维度融合(project_path核心关联+12需求skill接入+gene CRUD闭环+跨进程原子可靠性+solidify调度可配置) + dev-flow v4.9(模块自动发现+Stage10版本级回归+一步到位强制门控+项目级交互配置P4.5三模板+version-init原子化) + 定时检视竞品分析维度 + 安装脚本可靠性强化(编码修复+Python版本检测稳健化) > **核心亮点(v4.8基线)**: GEP v2自演进架构 + 插件开发体系G1-G5完整闭环(v4.8.2补齐G3依赖分析) + MCP迁移(统一sdp/tctp-dpms-set) + api-doc-generator v1.3双产出同源原子 + 缺陷信息收集入口删除+Hook幂等+stageExecutionSkipped + Stage0需求澄清增强 + Stage5.5造数可跳过 + CLAUDE.md生成器+lint工具 + 实施方法论强制执行机制 + 部署包重建 @@ -41,9 +43,9 @@ DevSyncAgent/ │ │ ├── dev-flow-checklists/ # 🆕 dev-flow操作清单(v4.6新增,模块化拆分;v4.7增强;v4.7.2新增Stage 5.5测试用例澄清;v4.8删除缺陷信息收集入口+Hook幂等+stageExecutionSkipped+Stage 3.5+api-doc-generator集成;v4.8.1新增Stage 10版本级回归+P4.5项目级交互配置) │ │ │ ├── create-version.md # 创建版本清单(v4.7新增步骤5.1 A5.1回归测试集创建) │ │ │ ├── associate-requirement.md # 关联需求清单(A4-1/A4-2) -│ │ │ ├── complete-version.md # 完成版本清单(v4.7.2 A5.2 parse_regression_md对齐kbb产品格式+module_id英文化;v4.7新增步骤2.5 A5.2回归用例填充+步骤11版本归档Git提交) +│ │ │ ├── complete-version.md # 完成版本清单(v4.9.1步骤2.5加SIT reflow入口:检查transitionedAt未流转则询问SIT结果passed→10.6.2/pending→待补录/skip→保留;v4.7.2 A5.2 parse_regression_md对齐kbb产品格式+module_id英文化;v4.7新增步骤2.5 A5.2回归用例填充+步骤11版本归档Git提交) │ │ │ ├── start-development.md # 启动开发清单(P0四要素检查→P1-P6+function_attributes→并行启动+context.md模板) -│ │ │ ├── stage-hooks.md # 阶段推进清单(v4.8删除缺陷信息收集入口+Hook幂等+stageExecutionSkipped+Stage 3.5+api-doc-generator集成;v4.7.2新增Stage 5.5测试用例澄清前置步骤+read strategy;v4.7.1新增4个注入防护Hook+N/A门三层保障;v4.7 B4/B5.5/B7.5独立步骤+3D决策;v4.8.1新增P4.5项目级交互配置三态决策+Stage10版本级回归) +│ │ │ ├── stage-hooks.md # 阶段推进清单(v4.9.1 Stage10版本级回归用例状态流转SIT回调10.6.2补全skip/SIT路径流转入口,幂等transitionedAt+transitionSource=sit_callback;v4.9 10.6.1 test_passed流转+灰度发布双重缺口+complete-version越界步骤删除;v4.8删除缺陷信息收集入口+Hook幂等+stageExecutionSkipped+Stage 3.5+api-doc-generator集成;v4.7.2新增Stage 5.5测试用例澄清前置步骤+read strategy;v4.7.1新增4个注入防护Hook+N/A门三层保障;v4.7 B4/B5.5/B7.5独立步骤+3D决策;v4.8.1新增P4.5项目级交互配置三态决策+Stage10版本级回归) │ │ │ └── standalone-mode.md # 单需求模式清单(v4.8同步stage-hooks.md变更;v4.7.2新增Stage 5.5独立前置步骤+read strategy;v4.7.1新增4个注入防护Hook;语法1-8+情况1-5+P0-P6+function_attributes) │ │ ├── injection-defense-rules.json # 🆕 注入防护规则配置(v4.7.1新增,9种威胁模型T-01~T-09+3级风险+4层防御+7条检测规则INJ-001~007) │ │ │ ├── acceptance-criteria-templates.json # 🆕 验收标准模板 v1.0 diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 41908931..6c5aed62 120000 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,8 +1,8 @@ # DevSyncAgent Release Notes **项目名称**: DevSyncAgent - AI驱动全流程研发协作Agent -**当前版本**: v4.8.3 -**更新日期**: 2026-07-19 +**当前版本**: v4.9 +**更新日期**: 2026-07-24 --- @@ -10,7 +10,9 @@ | 版本 | 发布日期 | 核心特性 | 重要程度 | |-----|---------|---------|---------| -| [v4.8.3](#v483-2026-07-19) | 2026-07-19 | GEP自进化全Agent/Skill覆盖(design/dev/testing扩展,21阶段consume/produce契约) + dev-flow上下文传递优化(context-contract+三层上下文+两阶段checkpoint+resume checkpointId对账,废弃stageHistory长度模糊覆盖) + 版本进度一致性修复(checkpointId/checkpointState对账+business_api聚合+task-viewer STAGE_PIPELINE) + Stage9循环决策可配置(loop_decision mode=ask/auto,暂停保留现场persist_stage_pause) + merge-feature标准化命令(9原则11步4准则,私有不部署) + 版本天花板强制4.9 | ⭐⭐⭐⭐⭐ | +| [v4.9.1](#v491-2026-07-27) | 2026-07-27 | Stage10版本级回归用例状态流转SIT回调路径补全(10.6.2 transition_version_regression_cases_sit_callback,复用HTTP POST逻辑+幂等transitionedAt+transitionSource=sit_callback可追溯) + complete-version步骤2.5 SIT reflow入口(检查transitionedAt,未流转询问SIT结果:passed→10.6.2/pending SIT→待补录/skip→保留,未执行用例不自动标记passed避免DPMS数据污染) | ⭐⭐⭐⭐⭐ | +| [v4.9](#v49-2026-07-24) | 2026-07-24 | 多需求并行形态B段调度+多子系统支持+S11整合+多git编排+wecom-server 2.5.12(compact false-failure修复)+版本流程修复(灰度发布双重缺口+Stage10回归用例状态流转10.6.1+complete-version越界步骤删除) | ⭐⭐⭐⭐⭐ | +| [v4.8.3](#v483-2026-07-19) | 2026-07-19 | GEP自进化全Agent/Skill覆盖(design/dev/testing扩展,21阶段consume/produce契约) + dev-flow上下文传递优化(三层上下文+两阶段checkpoint+resume checkpointId对账) + Stage9循环决策可配置(loop_decision ask/auto+暂停保留现场) + merge-feature标准化命令(9原则11步4准则,私有) | ⭐⭐⭐⭐⭐ | | [v4.8.2](#v482-2026-07-16) | 2026-07-16 | G3插件依赖分析器补齐(G1-G5完整闭环)+G5 D7维度(7维质量门禁) + 合并skywu_test差异化feature(版本变更单生成/stage级统一回滚/文档落盘路径守卫/Stage5流水线状态校验/测试失败原因提取/测试报告id持久化/dpms同步固定模板/priority口径统一P0P1P2) + 删除dev-flow自动shimo(保留shimo-doc手动) + 菜单精简(隐藏回滚+变更单/失败决策4→3选项) + req-*-analyzers瘦身(4个分析器+澄清器3077→2630) + wecom-server 2.5.11(机器人模式进度注入bug修复:create_task stage空+Poller双标志基线) | ⭐⭐⭐⭐⭐ | | [v4.8.1](#v481-2026-07-13) | 2026-07-13 | GEP v2.4全链路覆盖+项目维度融合(project_path核心关联+12需求skill接入+gene CRUD闭环+跨进程原子可靠性+solidify调度可配置) + dev-flow v4.9(模块自动发现+Stage10版本级回归+一步到位强制门控+项目级交互配置P4.5三模板+version-init原子化) + 定时检视竞品分析维度 + 安装脚本可靠性强化(编码修复+Python版本检测稳健化) | ⭐⭐⭐⭐⭐ | | [v4.8](#v48-2026-07-08) | 2026-07-08 | GEP v2自演进架构(Gene三层存储+dogfood闭环+召回/执行/固化/PR/事件记录) + 插件开发体系G1/G2/G4/G5完整闭环(G1执行评估器+G2轨迹采集器+G4迭代评估循环+G5质量门禁;G3版本锁语义扩展暂未实施) + MCP迁移(dpms/tctptest-bug-service下线,统一sdp/tctp-dpms-set) + api-doc-generator v1.3双产出同源原子(OpenAPI yaml+Markdown) + 缺陷信息收集入口删除+Hook幂等+stageExecutionSkipped + Stage0需求澄清增强(显式功能属性问题) + Stage5.5造数可跳过子环节 + CLAUDE.md生成器(10规则x5适配器)+lint工具 + 实施方法论强制执行机制(enforce-checklist.py) + 需求文档上传dpms格式强固定html + 部署包重建(GEP v2同步) | ⭐⭐⭐⭐⭐ | @@ -62,43 +64,54 @@ --- -## v4.8.3 (2026-07-19) +## v4.9.1 (2026-07-27) + +### Stage10版本级回归用例状态流转SIT回调路径补全(10.6.2) + +**核心亮点**: + +1. **Stage10版本级回归用例SIT回调路径补全(10.6.2)** + - 根因:v4.9 的 10.6.1 transition_version_regression_cases 硬绑 local event_type==test_passed(Stage 10.5),导致 skip/SIT 路径无流转入口——回归用例同步进 DPMS 回归集(如 309919)后卡在 "synced but not transitioned" 中间态,因为用例由 SIT(外部)执行,非 local 10.5 + - 新增 10.6.2 transition_version_regression_cases_sit_callback():复用 10.6.1 HTTP POST 逻辑(updateTestCaseStatus status=3 + stage-hooks 容错模式),幂等(transitionedAt 标记),标记 transitionSource=sit_callback 便于追溯 + - complete-version 步骤 2.5 新增 SIT reflow 入口(stage10Completed=true 分支):检查 transitionedAt,未流转则询问用户 SIT 结果——passed→执行 10.6.2 / pending SIT→save_pending_item 待补录 / skip→保留不流转 + - 数据安全:未执行用例不自动标记 passed,避免 DPMS 数据污染 + +2. **跨清单调用语义消歧** + - complete-version 调用 10.6.2 的措辞明确为"Read 10.6.2 section then execute body inline"(读章节后内联执行函数体),避免重复调度 + - 两个清单(stage-10-version-regression.md + complete-version.md)的完成验证 checklist 同步更新 + +--- + +## v4.9 (2026-07-24) -### GEP自进化全Agent/Skill覆盖 + dev-flow上下文传递优化(context-contract+checkpoint) + 版本进度一致性修复 + Stage9循环决策可配置 + merge-feature标准化命令 +### 多需求并行形态B段调度 + 多子系统支持 + S11整合 + 多git编排 + wecom-server 2.5.12 **核心亮点**: -1. **GEP 自进化全链路覆盖 — 从 requirement 扩展到 design/dev/testing** - - v4.8.1 GEP 覆盖 12 个需求 skill;v4.8.3 扩展到 design(6个 des-\*)/ development(code-developer + code-review)/ testing(functional-test-generator 等)全 Agent/Skill - - 全链路自进化:需求→设计→开发→测试,每个环节的 Agent 执行前召回匹配 Gene 策略、执行后回流结果 - - dev-flow guard:确保 GEP 注入与上下文传递一致性 +1. **多需求并行形态B段调度(阶段0)**:21阶段按产物类型二分(改源码段S1/S2/V串行、文档段P1/P2/D并行,段间屏障同步);方案C队列化commit(并行段N需求并发生成文档→结果入队列→主会话串行commit规避并发写);批量交互复用(batch_ask_recheck_optimization + batch_ask_skippable 三分支);v4.0废弃教训规避(主会话掌段间屏障+commit,subagent只跑单阶段) -2. **dev-flow 上下文传递优化 — context-contract 契约化** - - 新增 `.claude/config/dev-flow-context-contract.json`:为 21 个阶段定义 consume/produce 白名单 + 统一 stage result 协议 - - 三层上下文:`version-context.md`(版本级聚合)+ `context.md`(需求级执行)+ `versions.json`(控制权威) - - 两阶段 checkpoint(commit_stage_transition):所有完成/跳过/自动跳过/降级分支统一提交 stageOutputs+stageHistory,修复"提前 CONTINUE 导致上下文和进度未传递" - - resume 改为 checkpointId/state 对账:废弃"只比较 stageHistory 长度"的模糊覆盖;冲突时中止恢复+禁止静默覆盖,fail-safe 从产物重建 +2. **多子系统支持(阶段1 S5)**:入口子系统设计(版本号=版本计划版本号,版本级保留单值D11兼容)+ subsystems[]数组(每子系统独立versionId/pipelineId)+ requirements[].reqSubsystemId + contextSchemaVersion 1.0→2.0 + H1/H2/P5修正 -3. **版本进度一致性修复** - - 在原 currentStage 双写基础上升级为 checkpointId/checkpointState 对账,避免仅按 stageHistory 长度推断权威状态 - - business_api.go 后端聚合 version 状态(aggregateVersionStatus:progress=max task / stage=max-progress task) - - message_dispatcher.py create_task stage 恢复非空(防 0% 进度注入) - - task-viewer 前端 STAGE_PIPELINE 补 deployment_confirm/version_regression key + 启动中显示 +3. **S11整合(阶段2:形态B×多子系统)**:Stage5 pipelineId按reqSubsystemId反查 + Stage9失败blocked段屏障三态(completed/skipped/blocked)+ execute_segments跳过已完成段 + 继续版本开发步骤5适配 -4. **Stage 9 循环决策可配置(loop_decision)** - - 新增独立 `loop_decision.mode=auto|ask`(标准/质量模板默认 ask,极简模板 auto),不再复用仅控制阶段进入确认的 non_skippable.9 - - ask 模式:测试失败 AskUserQuestion 询问"进入下一轮修复/暂停保留现场" - - persist_stage_pause:暂停保持 currentStage=9 且不完成 Stage 9,恢复后重新询问;交互模板 schema 升至 1.1(兼容 1.0 旧配置) +4. **多git编排(阶段3 S6)**:多仓库localPath映射 + repositories[]去重 + 4处新增交互(G1多git识别/G2仓库收集/G3需求级跨仓库提交/G4版本级跨仓库归档)+ contextSchemaVersion 2.0→2.1 -5. **merge-feature 标准化命令(私有)** - - 合并 feature 开发分支的标准化流程命令:9 原则 11 步 4 准则 - - feature 清单 🟢纯新增/🟡行为变更/🔴方向冲突 分类,🟡/🔴 逐个让用户决策"合并 / 以master为准" - - 私有命令(install.bat EXCLUDE 排除,不部署到外部项目) - - 配套记忆:feedback_merge_feature_branch_methodology(方法论沉淀) +5. **wecom-server 2.5.12**:compact timeout不归档(false-failure根因修复),超时返回特殊标记区分"超时"与"真失败" + +6. **版本流程修复**:灰度发布双重缺口(收集侧+传递侧)+ Stage10回归用例状态流转10.6.1 + complete-version步骤8删除越界版本计划状态更新 + +--- + +## v4.8.3 (2026-07-19) + +### GEP自进化全Agent/Skill覆盖 + dev-flow上下文传递优化 + Stage9循环决策可配置 + merge-feature标准化命令 + +**核心亮点**: -6. **版本天花板强制 4.9 + 回滚文档一致性** - - 合并 dev-stephenzhou 后强制版本天花板回退至 4.9(超天花板文件 changelog 合并) - - rollback.md 头部标注一致性修正(历史标注 + 当前菜单屏蔽状态) +1. **GEP 自进化全链路覆盖** — 从 requirement 扩展到 design/dev/testing 全 Agent/Skill,每个环节执行前召回 Gene 策略、执行后回流结果 +2. **dev-flow 上下文传递优化** — context-contract 契约化(21阶段consume/produce白名单)+ 三层上下文 + 两阶段checkpoint + resume checkpointId对账 +3. **Stage 9 循环决策可配置** — loop_decision.mode=auto|ask,ask模式暂停保留现场persist_stage_pause +4. **merge-feature 标准化命令** — 9原则11步4准则,私有不部署 --- diff --git "a/docs/code-go\346\212\242\345\215\225\350\203\275\345\212\233\350\260\203\347\240\224.md" "b/docs/code-go\346\212\242\345\215\225\350\203\275\345\212\233\350\260\203\347\240\224.md" new file mode 100644 index 00000000..c3000cb5 --- /dev/null +++ "b/docs/code-go\346\212\242\345\215\225\350\203\275\345\212\233\350\260\203\347\240\224.md" @@ -0,0 +1,317 @@ +# code go 抢单能力调研报告 + +| 项 | 内容 | +|---|---| +| 文档版本 | v1.0 | +| 调研日期 | 2026-07-23 | +| 调研范围 | `.claude/`(研发流程源码) + `source-core/`(manage 源码) | +| 调研方法 | 全量源码精读 + 关键词扫描 + 交叉验证(2 个子 Agent 独立精读 + 主线亲自核对) | +| 结论性质 | 基于真实源码的客观分析,所有结论附 `file:line` 证据;外部系统(DPMS)判断基于 MCP 工具签名推断,已标注 | + +--- + +## 一、抢单的本质定义 + +**一句话本质**:抢单 = 需求获取从"分配制"变为"竞争成交制"。需求方抛出需求,多个供给方凭能力竞争,谁先让需求方信服成交,需求归谁。 + +**胜负判据**(三个比较级): +1. 上下文知识库更完整(理解需求更全更准) +2. 方案与程序生成更快更好(交付更优更快) +3. 与需求方达成共识成交(率先成交) + +**对应三层能力**: +- **①上下文层**:比竞品更全的领域认知 +- **②生成层**:比竞品更快更优的方案与程序 +- **③成交层**:比竞品更早与需求方共识成交 + +--- + +## 二、调研方法与范围 + +### 2.1 源码阅读范围 + +| 目录 | 子项 | 性质 | +|---|---|---| +| `.claude/commands/dev-flow.md` | 核心研发流程命令(1337 行,v4.9) | 研发流程编排 | +| `.claude/agents/requirement/` | competitor-analyzer、req-clarification-orchestrator 等 | 需求侧 Agent | +| `.claude/skills/` | knowledge-base-builder、functional-test-generator 等 | 能力 Skill | +| `.claude/config/` | competitor-analysis-framework.json 等 | 配置 | +| `.claude/mcp-servers/biz-sync/` | server.py | dev-flow ↔ source-core 桥接 | +| `source-core/clawrelay/clawrelay-api/` | Go 核心 API(business_api.go 等) | 后端服务 | +| `source-core/clawrelay/clawrelay-wecom-server/` | Python 企微机器人(message_dispatcher.py 等) | 消息入口 | +| `source-core/task-viewer/` | Vue3 前端 | 可视化 | + +### 2.2 交叉验证方式 + +- 子 Agent A 精读 `dev-flow.md` 全文,逐阶段定位行号 +- 子 Agent B 精读 `source-core/` 全部源码,梳理架构与数据模型 +- 主线亲自核对 competitor-analyzer、competitor-analysis-framework.json、req-clarification-orchestrator、knowledge-base-builder、dev-flow 关键词 +- 对"竞品/竞争/抢单/成交/claim/assign"等关键词在 dev-flow 全文与 source-core Go 源码做 Grep 扫描 + +--- + +## 三、核心发现:架构范式 mismatch(非补功能,是范式转变) + +源码阅读后,最核心的结论是:**当前 code go 从架构上就是"单供给方独占执行"模型,而抢单需要的是"多供给方竞争成交"模型。这不是补几个功能,是架构范式的转变。** + +### 3.1 三处独立印证证据 + +| 层 | 证据 | 说明 | +|---|---|---| +| source-core 数据模型 | `business_api.go:44-57` Task 结构体**无 claim/owner/competitor/成交状态字段** | 任务"谁创建谁执行",无竞争者概念 | +| source-core 权限 | `message_dispatcher.py:390-400` 仅 master 可操作、`382-389` 禁群聊项目操作 | 单点独占,不是多供给方 | +| source-core 并发 | `concurrency.py:21,24` 全局 10 / 用户 3 并发上限 | 是**资源限流**,不是**业务竞争** | +| dev-flow 入口 | `dev-flow.md:419` `/dev-flow <描述>` 或 `--story ` | 被动接收需求,无需求池/竞争入口 | +| 全文关键词 | dev-flow 全文无"竞争/抢单/抢占/成交";source-core Go 源码 grep `claim/assign/compete/grab` 零业务命中 | 零竞争语义 | + +### 3.2 结论 + +抢单三层里②生成层是现成的,但①和③不只是"缺口",而是**整个竞争架构都不存在**。早期判断"③成交层是核心缺口"方向对,但程度偏轻——真实情况是竞争范式整体缺失。 + +--- + +## 四、关键纠正:"竞品"存在两个完全不同的语义 + +这是源码阅读后最重要的纠正。`competitor-analyzer` 存在,不等于"上下文层半具备"。 + +| 维度 | 语义A:产品竞品(技术对标) | 语义B:供给方竞品(需求争夺) | +|---|---|---| +| 含义 | 做"权限管理",别的**产品**(Spring Security/Keycloak)怎么做 | 同一个需求,别的**AI 供给方**在抢,谁先成交归谁 | +| 目的 | 把需求做全(发现标配/缺失功能) | 在竞争中率先成交 | +| 服务于 | ①上下文层 + ②生成层(研发辅助) | ③成交层(抢单本质) | +| code go 现状 | ✅ `competitor-analyzer.md:30` 做 3-5 个"类似系统"对标 | ❌ **完全不存在** | +| 在流程中 | P3 前置步骤,**可跳过**(`dev-flow.md:161`) | 无 | + +**纠正要点**:把"competitor-analyzer 已存在"当作"上下文层半具备"的依据是错的。competitor-analyzer 做的是语义A(产品对标,服务于把需求做全),而抢单需要的"竞争上下文"是语义B(感知其他供给方的能力/速度/方案)。**两者不是一回事,语义B在源码里零基础。** + +--- + +## 五、抢单三层能力现状分析(带源码证据) + +### 5.1 ① 上下文层:比竞品更全的领域认知 + +**现状判定**: + +| 现状能力 | 证据 | 说明 | +|---|---|---| +| 单项目存量知识 | `knowledge-base-builder/SKILL.md` 全量依赖链构建(代码→需求→设计→测试),输出 `docs/project-knowledge/` | 仅单项目,非跨领域 | +| 单项目单模块知识 | `project-context.json` + 4 个 `module-*-manager`(`dev-flow.md:153,283-287`) | 模块级增量 | +| 产品竞品对标(语义A) | `competitor-analyzer.md` 7 维度,`competitor-analysis-framework.json` 5 维度框架;P3 可跳过(`dev-flow.md:161`) | 服务研发辅助 | +| 项目级策略进化 | GEP gene(`competitor-analyzer.md:557-622`),`/gep/recall` `/gep/record_outcome` | **项目级**,非领域知识 | + +**缺失**: +1. 跨领域/跨行业知识库——当前所有知识绑定单一项目,零跨领域 +2. 供给方竞争态势感知(语义B)——其他供给方能力/速度/方案质量画像,零基础 +3. 需求方画像——当前只有需求描述(`dev-flow.md:1211` 从 story-desc 提取需求名),无需求方偏好/历史/决策链 + +### 5.2 ② 生成层:比竞品更快更优的方案与程序 + +**现状判定**:这是 code go 的**真实既有优势**。 +- 21 阶段流水线(`stage-hooks.md:11` STAGE_ORDER) +- 形态 B 并行(`dev-flow.md:13`,`stage-hooks.md:23-31`) +- 多语言 Java/Python/Go(`dev-flow.md:116-120`) +- DPMS 合规集成(`dev-flow.md:309-311,232`) + +**抢单视角下的隐藏缺口**: +1. **"更快"维度错位**:当前形态 B 并行是"文档段并行",但抢单的"更快"是"需求出现→方案成交"端到端速度。dev-flow 从 Stage 0 才开始,**前面缺"需求发现→快速出预案"环节** +2. **缺"轻量方案预案"生成能力**:抢单阶段需要"让需求方快速信服的方案预案(MVP方案/技术选型/工期估算/差异化卖点)",当前 dev-flow 只有"完整交付模式" +3. **缺方案对比能力**:当前无"我的方案 vs 竞品方案"对比输出 + +### 5.3 ③ 成交层:比竞品更早与需求方共识成交 + +**现状判定**: +- `req-clarification-orchestrator.md`:多轮澄清达成的是"**需求理解共识**"(用户提→AI澄清→用户确认),单方向、无竞争,**不是商务成交共识** +- source-core:Task 无成交字段、无 claim 机制、仅 master 私聊(`message_dispatcher.py:390-400`) +- 确认环节全是研发内部质量门控(Stage 1.1/2.1/5/6/9,`dev-flow.md:127,130,297,850`) + +**缺失(真实,且是核心)**: +1. 公开需求池/任务大厅——当前需求是 master 私聊触发,无公开可竞争池 +2. 竞争接单机制(claim/抢领)——source-core 零基础,需改 Task 模型 + 新增 API +3. 成交确认环节——需求方拍板选我,当前无 +4. 多供给方管理——供给方注册/能力画像/方案对比 + +--- + +## 六、抢单完整闭环建议(8 环节飞轮) + +### 6.1 角色映射 + +| 角色 | 含义 | code go 场景对应 | 依据 | +|---|---|---|---| +| 需求方 | 抛出需求、拍板成交的人 | 业务方/产品经理/其他团队 | 【假设待确认】 | +| 供给方 | 凭能力竞争、交付方案的人 | **code go 作为供给方之一**,与其他供给方(其他 AI 工具/其他 code go 实例/其他开发团队)竞争 | 【假设待确认】 | +| 需求池 | 公开可竞争的需求集合 | 需新建(source-core 当前无,DPMS 是分配制【推断】) | 源码证据 | + +### 6.2 闭环流程 + +```mermaid +flowchart TD + R1["①需求抛出
需求方在企微群/需求池抛需求"] --> R2["②公开需求池
可竞争池+广播给所有供给方"] + R2 --> R3{"③多供给方感知"} + R3 --> S1["供给方A
(code go)"] + R3 --> S2["供给方B
(竞品)"] + R3 --> SN["供给方N..."] + S1 --> C1["④竞争性上下文构建
领域知识+需求方画像+供给方态势(语义B)"] + S2 --> C2["④竞争性上下文构建"] + C1 --> P1["⑤快速预案生成
MVP方案/技术选型/工期/差异化卖点"] + C2 --> P2["⑤快速预案生成"] + P1 --> B1["⑥成交竞争
方案对比矩阵"] + P2 --> B1 + B1 --> D1{"需求方选择成交"} + D1 -->|成交-code go| E1["⑦启动dev-flow生成层
21阶段完整交付"] + D1 -->|成交-竞品| L0["竞品成交(我方未中)"] + D1 -->|未成交| L1["未成交经验回流"] + E1 --> F1["⑧交付验收"] + F1 --> L2["成交经验回流"] + L0 --> G1["GEP竞争级进化
反哺竞争性上下文"] + L1 --> G1 + L2 --> G1 + G1 -.->|"飞轮反哺"| C1 + E1 -.->|"生成层底气"| P1 +``` + +### 6.3 环节说明与 code go 衔接 + +| 环节 | 做什么 | 与 code go 现状衔接 | +|---|---|---| +| ①需求抛出 | 需求方在公开渠道抛需求 | **新建**:当前 master 私聊触发(`message_dispatcher.py:460`),非公开抛出 | +| ②公开需求池 | 需求入池,广播给所有供给方 | **新建**:source-core 无需求池,Task 创建即私有(`business_api.go:460-496`) | +| ③多供给方感知 | 供给方收到需求广播 | **新建**:当前仅单点接收,无广播机制 | +| ④竞争性上下文 | 领域知识+需求方画像+供给方态势 | **半新建**:competitor-analyzer 做语义A,语义B零基础 | +| ⑤快速预案 | MVP方案/工期/差异化卖点 | **新建**:dev-flow 只有完整交付模式,无轻量预案模式 | +| ⑥成交竞争 | 多方提交预案,需求方对比 | **新建**:无方案对比、无成交竞争 | +| ⑦交付执行 | 成交后启动 21 阶段 | **复用**:dev-flow 生成层现成(`stage-hooks.md:11`) | +| ⑧验收+复盘 | 交付验收,经验回流 | **半复用**:GEP 回流现成(`competitor-analyzer.md:557`),但仅项目级,需扩竞争级 | + +### 6.4 闭环核心设计原则 + +1. **预案层与交付层解耦**:抢单阶段用"轻量预案生成器"(快、面向成交),成交后才启动 21 阶段重流程。**理由**:dev-flow 一上来就是 21 阶段重流程,不适合抢单阶段"快速亮方案",端到端速度会输。**权衡**:两套生成逻辑需保持一致性(预案承诺的方案,交付层要能兑现)。 +2. **需求池是物理前提,优先级最高**:没有②,③④⑤⑥全是空中楼阁。**建议第一优先实现②+claim 机制**。 +3. **经验回流要扩到"竞争级"**:当前 GEP 只记录"项目内策略执行结果"(`competitor-analyzer.md:596`),抢单需要记录"成交/未成交原因+对手方案",反哺④。**权衡**:回流数据维度增加,需防 GEP 噪声膨胀。 +4. **权限范式必须转变**:当前 master 私聊独占(`message_dispatcher.py:390-400,382-389`),抢单需开放群聊+多供给方。**权衡**:开放权限带来安全风险,需配套供给方注册与鉴权。 + +--- + +## 七、能力清单(结合源码,分层表格) + +> 缺口类型:**新增**=源码零基础;**完善**=已有但需扩展;**复用**=现成可直接用。 + +### 7.1 ① 上下文层能力清单 + +| # | 能力项 | code go 现状(源码证据) | 缺口 | 具体改造点 | +|---|---|---|---|---| +| 1.1 | 跨领域知识中枢 | `knowledge-base-builder/SKILL.md` 仅单项目存量知识;`project-context.json`+4个`module-*-manager`(`dev-flow.md:153,283-287`)单项目单模块 | 新增 | 新建跨项目/跨行业知识召回能力(区别于单项目 kbb) | +| 1.2 | 需求方画像库 | 仅需求描述,`dev-flow.md:1211` 从 story-desc 提取需求名;无需求方偏好/历史/决策链 | 新增 | 扩展 `req-clarification-orchestrator` 第0.5步"历史决策检索"(changelog v4.9+)为"需求方历史偏好检索" | +| 1.3 | 供给方竞争态势感知(语义B) | **零基础**——source-core Go 源码 grep `claim/assign/compete/grab` 零业务命中;competitor-analyzer 做语义A(`competitor-analyzer.md:30`) | 新增 | 新建"供给方画像库":登记竞品供给方能力维度、历史成交率、平均交付速度/质量 | +| 1.4 | 产品竞品对标(语义A) | `competitor-analyzer.md` 7维度,`competitor-analysis-framework.json` 5维度;P3 可跳过(`dev-flow.md:161`) | 复用+强化 | 复用现成,抢单场景应从"可跳过"改为"成交前强制轻量版" | + +### 7.2 ② 生成层能力清单 + +| # | 能力项 | code go 现状(源码证据) | 缺口 | 具体改造点 | +|---|---|---|---|---| +| 2.1 | 21阶段研发流水线 | `stage-hooks.md:11` STAGE_ORDER;形态B并行(`dev-flow.md:13`);多语言(`dev-flow.md:116-120`) | **复用** | 直接作为抢单成交后的交付执行引擎,无需改造 | +| 2.2 | 轻量预案生成器 | dev-flow 只有完整交付模式,从 Stage 0 开始即重流程;无"快速亮方案"模式 | 新增 | 在 dev-flow 之上新建"抢单预案生成器"(MVP方案/技术选型/工期估算/差异化卖点),与21阶段解耦 | +| 2.3 | 工期与成本估算 | `competitor-analysis-framework.json:220-287` 维度5已有成本周期评估,产出面向"研发计划" | 完善 | 复用维度5估算逻辑,产出改为面向需求方的"成交承诺工期" | +| 2.4 | 方案对比矩阵 | 无"我的方案 vs 竞品方案"对比输出 | 新增 | 新建方案对比能力(功能覆盖/工期/差异化/风险维度对比) | +| 2.5 | 端到端加速 | 形态B文档段并行(`dev-flow.md:13`,`stage-hooks.md:23-31`) | 部分复用 | 现有并行在交付层;抢单"更快"需补①~⑥段加速(预案层轻量化) | + +### 7.3 ③ 成交层能力清单(核心新建) + +| # | 能力项 | code go 现状(源码证据) | 缺口 | 具体改造点 | +|---|---|---|---|---| +| 3.1 | 公开需求池 | 无;需求 master 私聊触发(`message_dispatcher.py:460,390-400`);DPMS 是分配制【推断】 | 新增 | 新建需求池(可竞争+广播),DPMS/企微群聊作为需求来源导入池 | +| 3.2 | 竞争接单 claim 机制 | Task 模型(`business_api.go:44-57`)**无 ClaimerID/ClaimedAt/ClaimStatus/Competitors 字段**;status 仅 `pending/running/waiting_confirm/completed/failed`(`api/index.ts:44`) | 新增 | `clawrelay-api` Task 模型加字段+新增 `POST /api/task/{id}/claim`、`/release`、`GET /api/tasks/available`(可复用 `businessStore` 的 `sync.RWMutex`,`business_api.go:126`) | +| 3.3 | 多供给方管理 | 仅 master 单点(`message_dispatcher.py:390-400`);群聊禁项目操作(`382-389`) | 新增 | 解除限制+供给方注册/鉴权+能力画像登记 | +| 3.4 | 需求广播机制 | 无群聊广播;`task_viewer_poller.py:32,144-157` 是 L2 轮询感知(单点拉),非广播推 | 新增 | 需求入池时通过企微群聊广播给所有注册供给方 | +| 3.5 | 成交确认环节 | 确认全是研发内部质量门控(Stage 1.1/2.1/5/6/9,`dev-flow.md:127,130,297,850`);澄清达成"需求理解共识"非"商务成交" | 新增 | 新增"需求方拍板选我=成交"环节,区别于研发内部确认 | +| 3.6 | 需求方方案对比选择 | 无 | 新增 | 需求方视角的方案对比页(对接 2.4 方案对比矩阵) | + +### 7.4 底座/数据层能力清单(支撑性,跨三层复用) + +| # | 能力项 | code go 现状(源码证据) | 缺口 | 具体改造点 | +|---|---|---|---|---| +| 4.1 | Task 模型扩展 | `business_api.go:44-57` 字段:ID/VersionID/ProjectID/SubsystemID/Status/Progress/Stage/SessionID/CreatedAt/UpdatedAt;无处理人/竞争者/成交字段 | 新增 | 加 ClaimerID/ClaimedAt/ClaimStatus/Competitors[]/BidPlan(预案)/WonAt | +| 4.2 | claim API | Business API 有 `/api/task` CRUD(`business_api.go:441,460,511,537`),无 claim 语义 | 新增 | 新增 claim/release/available 端点 + 原子性 claim(防多人同抢) | +| 4.3 | 任务大厅视图 | task-viewer 5页面(`router/index.ts:4-64`),无"可领取"视图;`TaskDetail.vue:21-38` 无处理人字段 | 新增 | 新增"任务大厅"页(展示 status=available)+TaskDetail 展示竞争者+Kanban 加"可领取"筛选 | +| 4.4 | 成交经验回流 | GEP 回流现成但仅**项目级**策略(`competitor-analyzer.md:557-622`,`gene_api.go`);`/gep/record_outcome` 无竞争维度 | 完善 | GEP 扩"竞争级"Gene:记录成交/未成交原因+对手方案,反哺 1.3 供给方态势 | +| 4.5 | biz-sync 上报扩展 | `biz-sync/server.py:110,138` 调 clawrelay-api 上报 stage/interaction | 完善 | 扩展上报 claim/成交 状态,打通 dev-flow 与 source-core 的竞争状态同步 | +| 4.6 | `/dev-flow claim` 命令 | `/dev-flow` 仅接收需求(`dev-flow.md:419`),无 claim 子命令 | 新增 | `wecom-server` 新增 `/dev-flow claim ` 路由(`message_dispatcher.py:838` _dispatch_single_devflow 处扩展) | + +--- + +## 八、根本问题:抢单的前提——需求从哪来? + +抢单定义是"需求方抛出需求,多个供给方竞争"。但源码显示**当前根本不存在"公开抛需求"的机制**: + +| 需求来源 | 现状 | 是否公开竞争 | +|---|---|---| +| 企微 | master **私聊**发 `/dev-flow`(`message_dispatcher.py:460`) | ❌ 私聊,非公开 | +| DPMS | 按 productId 查询/创建,绑定 createUser(`mcp__sdp__get-storys`/`add-system-story` 签名)【推断】 | ❌ 录入/分配制,非竞争池 | +| 本地 | 用户输入文本 | ❌ 单点 | + +**【推断】**:DPMS 是研发管理平台,需求按产品分配给特定团队,本质是分配制,不是公开竞争池。若要真正抢单,需要**先从 DPMS/企微群聊/外部建立"可竞争需求池"**,这是抢单的第零步——没有需求池,claim 机制无处落地。 + +--- + +## 九、结论与优先级建议 + +### 9.1 总判断 + +code go 实现"抢单",本质是把"单供给方独占执行"架构改为"多供给方竞争成交"架构: +- **②生成层基本复用**(21阶段流水线是现成底气) +- **①上下文层缺的是跨领域知识 + 供给方态势(语义B,非现有产品对标语义A)** +- **③成交层是从零新建需求池 + claim + 成交闭环** +- **最根本的完善点是第零步:先有公开可竞争的需求池,否则一切都是空中楼阁** + +### 9.2 优先级建议 + +| 优先级 | 能力项 | 理由 | +|---|---|---| +| P0(物理前提) | 3.1 公开需求池 + 3.2 claim 机制 + 4.1 Task 模型扩展 + 4.2 claim API | 没有需求池和接单机制,抢单无处发生 | +| P0(飞轮持续) | 4.4 成交经验回流(竞争级 GEP) | 没有经验回流,抢单无法持续进化 | +| P1(竞争力来源) | 1.3 供给方态势感知(语义B) + 1.2 需求方画像 | "更全更早"的竞争力来源 | +| P1(成交关键) | 2.2 轻量预案生成器 + 3.5 成交确认 | "更快成交"的关键 | +| P2(增强) | 1.1 跨领域知识中枢 + 2.4 方案对比矩阵 + 3.4 需求广播 | 增强竞争力与体验 | + +### 9.3 待澄清事项(避免方案悬空) + +1. **角色映射**:抢单的供给方到底是谁——多 code go 实例?多开发团队用 code go?code go vs 其他 AI 工具?需明确才能细化方案。 +2. **需求池来源**:可竞争需求池从哪建——企微群聊?DPMS 改造?独立需求池服务? +3. **DPMS 竞争化可行性**:DPMS 是否支持"需求公开池 + 多方领取",还是需另建系统?【需确认 DPMS 实际能力】 + +--- + +## 十、附录:源码证据索引 + +| 证据点 | 文件:行号 | 用途 | +|---|---|---| +| Task 结构体无竞争字段 | `source-core/clawrelay/clawrelay-api/business_api.go:44-57` | ③成交层零基础 | +| businessStore RWMutex 可复用 | `business_api.go:126` | claim 原子性 | +| Task POST 创建即私有 | `business_api.go:460-496,474-478` | 无需求池 | +| Task CRUD API | `business_api.go:441,511,537` | claim API 扩展点 | +| Task status 枚举 | `source-core/task-viewer/frontend/src/api/index.ts:44` | 需加 claim 状态 | +| 仅 master 可操作 | `clawrelay-wecom-server/message_dispatcher.py:390-400` | 权限范式需转变 | +| 禁群聊项目操作 | `message_dispatcher.py:382-389` | 抢单需开放群聊 | +| dev-flow 命令路由 | `message_dispatcher.py:460,838,974-980` | claim 子命令扩展点 | +| 并发限流(非竞争) | `concurrency.py:21,24` | 区分限流与竞争 | +| L2 轮询(非广播) | `task_viewer_poller.py:32,144-157` | 广播机制需新建 | +| 21 阶段 STAGE_ORDER | `.claude/config/dev-flow-checklists/stage-hooks.md:11` | 生成层复用 | +| 形态 B 并行 | `.claude/commands/dev-flow.md:13` | 生成层加速 | +| 多语言支持 | `dev-flow.md:116-120` | 生成层覆盖 | +| P3 竞品分析可跳过 | `dev-flow.md:161` | 语义A定位 | +| dev-flow 入口(被动) | `dev-flow.md:419` | 需求获取被动 | +| 研发内部确认环节 | `dev-flow.md:127,130,297,850` | 非商务成交 | +| 单项目知识 | `dev-flow.md:153,283-287` | 上下文层单项目 | +| competitor-analyzer 语义A | `.claude/agents/requirement/competitor-analyzer.md:30` | 纠正语义混淆 | +| GEP 项目级回流 | `competitor-analyzer.md:557-622` | 需扩竞争级 | +| 成本周期评估维度5 | `.claude/config/competitor-analysis-framework.json:220-287` | 工期估算复用 | +| knowledge-base-builder 单项目 | `.claude/skills/knowledge-base-builder/SKILL.md` | 跨领域需新建 | +| 需求理解共识(非成交) | `.claude/agents/requirement/req-clarification-orchestrator.md` | 成交层缺口 | +| biz-sync MCP 上报 | `.claude/mcp-servers/biz-sync/server.py:110,138` | 竞争状态同步扩展 | +| task-viewer 5页面 | `source-core/task-viewer/frontend/src/router/index.ts:4-64` | 任务大厅视图新增 | +| TaskDetail 无处理人 | `TaskDetail.vue:21-38` | 竞争者展示新增 | +| GEP API | `source-core/clawrelay/clawrelay-api/gene_api.go` | 竞争级 Gene 扩展 | + +--- + +*本报告由 code go 抢单能力调研生成,所有结论基于源码精读,标注【推断】/【假设待确认】的部分需进一步验证。* diff --git "a/docs/master/design/\351\230\266\346\256\2650-\345\275\242\346\200\201B\345\271\266\345\217\221\345\216\237\345\236\213spike\346\226\271\346\241\210.md" "b/docs/master/design/\351\230\266\346\256\2650-\345\275\242\346\200\201B\345\271\266\345\217\221\345\216\237\345\236\213spike\346\226\271\346\241\210.md" new file mode 100644 index 00000000..ef451628 --- /dev/null +++ "b/docs/master/design/\351\230\266\346\256\2650-\345\275\242\346\200\201B\345\271\266\345\217\221\345\216\237\345\236\213spike\346\226\271\346\241\210.md" @@ -0,0 +1,371 @@ +# 阶段0:形态B并发原型 spike 实施方案 + +> 版本:v4.9 阶段0 spike(天花板约束,不升版本号) +> 创建日期:2026-07-21 +> 关联:S11/S12 最终实现计划的第0阶段(详见 memory: project_s11_s12_implementation_plan) +> 状态:**已实施**(本文档为已落地方案的持久化,非待实施方案) + +--- + +## 一、方案定位与诚实声明 + +### 1.1 方案性质 + +阶段0是 **spike(技术验证原型)**,不是生产特性。目标是用最小改动验证形态B三要素可行,为阶段2(S11)提供存在性证据。 + +### 1.2 一步到位边界 + +本方案所有改动点均基于已 Read 的源码(start-development.md:599-698 / stage-hooks.md:32-73,245-871 / business_api.go),行号已确认。伪代码与现有结构对齐,不臆想。 + +### 1.3 v4.0 废弃教训前置 + +version-orchestrator v4.0 并行因"subagent独立编排丢子阶段+编排断裂+并发checkpoint冲突"被 v4.6 废弃。本方案每个设计决策都对应一条规避措施(见 §6)。 + +--- + +## 二、验收标准(可验证,非口号) + +| # | 验收项 | 验证方法 | 通过标准 | +|---|---|---|---| +| AC1 | 段间屏障正确同步 | 跑3需求,P1未全完成时S1不启动 | version-context.md segmentProgress:S1.startAt > P1所有req.endAt | +| AC2 | P1段并发commit无冲突 | 3需求P1段并发生成需求文档 | versions.json 无损坏,3需求 stageHistory 均完整含 0-2.2 | +| AC3 | S1段串行无子阶段丢失 | 3需求S1段排队开发 | 每需求 stageHistory 含 3/3.1/3.2/3.5/4/5 全部(v4.0教训不复现) | +| AC4 | Stage0澄清流水线无阻塞 | 需求1澄清完即进Stage1,不等需求3 | 需求1的Stage1.startAt < 需求3的Stage0.endAt | +| AC5 | 检视批量决策无歧义 | Stage1.1一次问3需求统一优化 | 1次AskUserQuestion覆盖3需求,非3次 | +| AC6 | v4.0三根因不复现 | 对照§6规避表逐项核验 | 3项全过 | + +--- + +## 三、形态B核心规则与21阶段二分 + +### 3.1 核心规则(用户2026-07-21确认) + +涉及修改源码的环节不能并行,其余环节可并行。 + +### 3.2 21阶段二分(已源码验证产物类型) + +| Stage | 名称 | 产物 | 改源码? | 并行性 | 源码依据 | +|:--:|---|---|:--:|:--:|---| +| 0 | 需求澄清 | 澄清纪要.md | 否 | ✅并行 | 文档(含交互) | +| 1 | 需求分析 | 需求.md | 否 | ✅并行 | 文档 | +| 1.1 | 需求检视 | 改需求.md | 否 | ✅并行 | 文档(含交互) | +| 1.2 | 需求知识同步 | 知识库.md | 否 | ✅并行 | docs/文档 | +| 1.6 | 组件依赖分析 | 依赖分析.md | 否 | ✅并行 | 文档 | +| 2 | 设计方案 | 设计.md | 否 | ✅并行 | 文档 | +| 2.1 | 设计检视 | 改设计.md | 否 | ✅并行 | 文档(含交互) | +| 2.2 | 设计知识同步 | 知识库.md | 否 | ✅并行 | docs/文档 | +| 3 | 代码开发 | 项目源码 | 是 | ❌串行 | 修改源码 | +| 3.1 | 代码知识同步 | 知识库.md | 否 | ✅* | docs/文档(依赖Stage3结果) | +| 3.2 | 代码部署前自检 | auto_fix源码 | 是 | ❌串行 | 自动修复改代码 | +| 3.5 | 插件迭代评估 | 改Prompt插件 | 是 | ❌串行 | 迭代插件代码(仅dev_target=插件触发) | +| 4 | 自动部署 | git-commit/push | 是 | ❌串行 | 提交源码 | +| 5 | 部署确认 | — | 依赖4 | ❌串行 | 依赖串行部署 | +| 5.5 | 测试用例澄清 | 测试澄清.md | 否 | ✅并行 | 文档(含交互) | +| 6 | 测试验证 | 测试案例.md | 否 | ✅并行 | 文档(functional-test-generator description"生成测试用例文档") | +| 6.1 | 回归测试同步 | 知识库.md | 否 | ✅并行 | docs/文档 | +| 7 | 测试执行 | 测试代码+执行 | 是 | ❌串行 | 生成测试代码(test-code-generator description"生成可执行的测试代码") | +| 8 | 测试报告 | 报告.md | 否 | ✅* | 文档(依赖Stage7结果) | +| 9 | 循环决策 | — | 否 | ✅* | 决策(依赖Stage8) | +| 10 | 版本级回归 | 回归测试代码+执行 | 是 | ❌串行 | 生成回归测试代码+执行(版本级单次) | + +标注 `*`:3.1/8/9 虽是文档/决策类,但强依赖前序串行段结果,归入串行段尾部或交错执行。 + +### 3.3 二分结论 + +- **可并行阶段(13个)**:0, 1, 1.1, 1.2, 1.6, 2, 2.1, 2.2, 5.5, 6, 6.1(纯文档生成)+ 8, 9(依赖约束下交错) +- **不可并行阶段(8个)**:3, 3.2, 3.5, 4, 5, 7, 10(改源码/执行)+ 3.1(依赖3) + +--- + +## 四、6段交错编排 + +### 4.1 段定义 + +| 段 | 含Stage | 并行性 | 编排逻辑 | 交互处理 | +|---|---|:--:|---|---| +| P1 | 0,1,1.1,1.2,1.6,2,2.1,2.2 | 并行 | N需求同时生成需求/设计文档 | Stage0澄清/1.1-2.1检视优化需批量交互复用 | +| S1 | 3,3.1,3.2,3.5,4,5 | 串行 | N需求排队开发→自检→部署→确认 | 单需求交互,排队执行 | +| P2 | 5.5,6,6.1 | 并行 | N需求同时生成测试案例文档 | Stage5.5澄清需批量交互;Stage6自动生成真并行 | +| S2 | 7,8 | 串行 | N需求排队生成测试代码+执行;8报告可交错 | 单需求执行,8可随7完成交错生成 | +| D | 9 | 并行/交错 | N需求各自循环决策(通过/失败回滚) | 各需求独立决策,失败者回滚Stage1 | +| V | 10 | 单次 | 所有需求Stage9通过后,版本级回归单次执行 | 版本级,不并行 | + +### 4.2 段间屏障 + +段间屏障(barrier):P1全完成→S1开始,S1全完成→P2开始,P2→S2→D→V(段间同步点)。 + +--- + +## 五、变更文件清单(基于已确认源码) + +| 文件 | 当前结构(已Read) | 阶段0变更 | +|---|---|---| +| `start-development.md` | 步骤E(692-698)只有架构说明 | 新增"步骤E形态B编排"章节,含6段调度 | +| `stage-hooks.md` | WHILE+FOR(250-871)单需求单元;commit_stage_transition(32-73) | ①新增SEGMENTS定义 ②新增flush_commit_queue ③WHILE+FOR增加段标识衔接说明 | +| `dev-flow-context-contract.json` | stage_result_schema.allowed_context_updates | 新增 segmentProgress 字段 | +| `dev-flow.md` | 继续版本开发恢复逻辑 + changelog | 恢复逻辑适配 segmentProgress + changelog追加 | + +**不改动的文件**(spike 边界):create-version.md / complete-version.md / business_api.go —— 阶段0是单子系统单模块(S1基准),不碰多子系统数据模型(阶段1)。 + +--- + +## 六、v4.0 废弃教训规避表(AC6) + +| v4.0 废弃根因 | 源码证据 | 阶段0规避措施 | 落地位置 | +|---|---|---|---| +| subagent独立编排丢子阶段 | version-orchestrator v4.0"每个需求独立调用req-type-classifier执行16阶段"被v4.6废弃 | 形态B主会话掌段间屏障+commit,subagent只跑单stage | stage-hooks execute_parallel/serial_segment | +| 编排断裂(错误恢复主会话接管) | v4.6 changelog"subagent独立编排改为主会话逐阶段控制" | 段内复用单阶段11步,主会话始终在场 | stage-hooks WHILE+FOR衔接说明 | +| 并发checkpoint冲突 | commit_stage_transition 同步写versions.json(32-73) | 方案C:局部队列+flush_commit_queue串行commit | stage-hooks flush_commit_queue | + +--- + +## 七、核心数据结构与伪代码(已落地) + +### 7.1 SEGMENTS 定义(写入 stage-hooks.md "形态B分段交错编排"章节) + +```python +SEGMENTS = { + "P1": {"stages": ["0","1","1.1","1.2","1.6","2","2.1","2.2"], "parallel": True, "nature": "文档生成"}, + "S1": {"stages": ["3","3.1","3.2","3.5","4","5"], "parallel": False, "nature": "改源码"}, + "P2": {"stages": ["5.5","6","6.1"], "parallel": True, "nature": "文档生成"}, + "S2": {"stages": ["7","8"], "parallel": False, "nature": "测试执行"}, + "D": {"stages": ["9"], "parallel": True, "nature": "循环决策"}, + "V": {"stages": ["10"], "parallel": False, "nature": "版本级回归"} +} +SEGMENT_ORDER = ["P1","S1","P2","S2","D","V"] +``` + +### 7.2 段调度入口(替代原"对每个需求按STAGE_ORDER逐阶段"外层循环) + +```python +FUNCTION execute_segments(all_requirements): + # 0. 迁移:为每个需求补 segmentProgress(向后兼容旧 versions.json/context.md) + FOR each req IN all_requirements: + migrate_add_segment_progress(req) + END FOR + FOR each segment IN SEGMENT_ORDER: + IF segment == "V" THEN + wait_segment_barrier("D", all_requirements) + execute_stage_10() # 复用 stage-10-version-regression.md + BREAK + END IF + IF SEGMENTS[segment].parallel == True THEN + execute_parallel_segment(segment, all_requirements) + ELSE + execute_serial_segment(segment, all_requirements) + END IF + wait_segment_barrier(segment, all_requirements) + END FOR +END FUNCTION +``` + +### 7.3 并行段执行(方案C:并发生成+串行commit) + +```python +FUNCTION execute_parallel_segment(segment, requirements): + stages = SEGMENTS[segment].stages + FOR each stage IN stages: + stage_results_queue = [] + IF stage == "0" THEN + # 澄清流水线式(逐个澄清,不阻塞其他需求) + FOR each req IN requirements: + Agent(req-clarification-orchestrator, prompt=构造(req,"0")) + ENQUEUE(stage_results_queue, (req,"0",result)) + END FOR + ELIF stage IN ["1.1","2.1"] THEN + # 检视批量决策(交互复用,1次AskUserQuestion覆盖N需求) + batch_decision = batch_ask_recheck_optimization(requirements, stage) + FOR each req IN requirements: + Agent/recheck-orchestrator(prompt=构造(req,stage)) + apply_batch_decision(req, stage, batch_decision) + ENQUEUE(stage_results_queue, (req,stage,result)) + END FOR + ELSE + # 文档stage真并发(无交互冲突) + FOR each req IN requirements (并发启动): + Agent/Skill(映射表对应agent, prompt=构造(req,stage)) + ENQUEUE(stage_results_queue, (req,stage,result)) + END FOR + END IF + # 方案C:该stage所有需求完成后,主会话串行commit(规避并发写versions.json) + flush_commit_queue(stage_results_queue) + FOR each req IN requirements: + update_segment_progress(req, segment, "running") + END FOR + END FOR +END FUNCTION +``` + +### 7.4 串行段执行(改源码排队) + +```python +FUNCTION execute_serial_segment(segment, requirements): + FOR each req IN requirements (顺序): + FOR each stage IN SEGMENTS[segment].stages: + execute_single_stage(req, stage) # 复用 WHILE+FOR 体内单阶段11步逻辑 + commit_stage_transition(result) # 串行段直接commit(签名不变) + END FOR + update_segment_progress(req, segment, "completed") + END FOR +END FUNCTION +``` + +### 7.5 段间屏障 + 批量决策 + 段进度更新 + 迁移 + +```python +FUNCTION wait_segment_barrier(segment, requirements): + FOR each req IN requirements: + WHILE req.segmentProgress[segment].status NOT IN ["completed","skipped"]: + WAIT + END WHILE + END FOR +END FUNCTION + +FUNCTION batch_ask_recheck_optimization(requirements, stage): + names = [req.name FOR req IN requirements] + AskUserQuestion(question=f"Stage {stage}检视完成,{len(names)}个需求统一应用优化范围?", + header="批量检视决策", + options=[{label:"全部执行必要优化(推荐)",description:"N个需求统一应用critical+recommended"}, + {label:"仅必须修改",description:"N个需求统一应用critical"}, + {label:"跳过优化",description:"N个需求保持原文档"}, + {label:"逐个确认",description:"退化为逐需求询问(降级)"}]) + RETURN decision +END FUNCTION + +FUNCTION update_segment_progress(req, segment, status): + req.segmentProgress[segment].status = status + IF status == "completed" THEN req.segmentProgress[segment].endAt = now + ELIF status == "running" THEN req.segmentProgress[segment].startAt = now + END IF + 原子写 version-context.md requirementContextIndex.{reqPrefix}.segmentProgress +END FUNCTION + +# 向后兼容迁移:旧 versions.json/context.md 无 segmentProgress 时按 stageHistory 推断 +FUNCTION migrate_add_segment_progress(req): + IF req.segmentProgress 不存在 THEN + req.segmentProgress = {P1:{status:"pending"},S1:{status:"pending"},P2:{status:"pending"},S2:{status:"pending"},D:{status:"pending"},V:{status:"pending"}} + FOR each s IN req.stageHistory: + seg = find_segment_by_stage(s) + IF seg THEN req.segmentProgress[seg].status = "completed" + END FOR + IF req.currentStage 存在 THEN + current_seg = find_segment_by_stage(req.currentStage) + IF current_seg THEN req.segmentProgress[current_seg].status = "running" + END IF + END IF +END FUNCTION +``` + +### 7.6 flush_commit_queue(方案C,commit_stage_transition 签名不变) + +```python +FUNCTION flush_commit_queue(stage_results_queue): + FOR each (req, stage, result) IN stage_results_queue: + commit_stage_transition(result) # 串行提交,复用 prepare→commit→finalize + END FOR + CLEAR(stage_results_queue) +END FUNCTION +``` + +--- + +## 八、恢复场景兼容 + +### 8.1 恢复逻辑适配(dev-flow.md "继续版本开发" 步骤2) + +恢复时**优先读 version-context.md 的 segmentProgress 定位当前段**,再读 currentStage 定位段内断点 stage。若 segmentProgress 不存在(旧版本),调 `migrate_add_segment_progress(req)` 按 stageHistory 推断段进度后恢复。恢复后仍按 SEGMENT_ORDER 段调度,已完成段跳过,从 (current_segment, current_stage) 继续。 + +### 8.2 向后兼容 + +- 旧 versions.json 无 segmentProgress → migrate_add_segment_progress 迁移 +- 单需求时段调度退化为串行(1需求各段仅1需求,等价现有串行) +- commit_stage_transition 签名不变,现有13处调用100%不受影响 + +--- + +## 九、执行期修正记录 + +### 9.1 queue_mode 死代码修正 + +**发现**:方案设计初版给 commit_stage_transition 增加 queue_mode 参数,但 execute_parallel_segment 实际用局部 stage_results_queue 直接 ENQUEUE,flush 时调原签名。queue_mode=True 分支是死代码,违反一步到位(不引入技术债务)。 + +**修正**:删除 queue_mode 参数,commit_stage_transition 恢复原签名 `FUNCTION commit_stage_transition(stage_result):`。方案C由局部队列+flush_commit_queue 实现。 + +**收益**:commit_stage_transition 签名不变,现有13处调用100%不受影响。 + +### 9.2 Stage9通过分支绕V段屏障修正(检视发现) + +**发现**:检视阶段发现 WHILE+FOR 的 Stage9 通过分支(stage-hooks.md 原 `GOTO Stage 10` 行978)是单需求路径。多需求形态B下,若各需求各自 GOTO Stage10,会绕过外层 execute_segments 的 V段 `wait_segment_barrier("D")` 屏障,导致多需求未全部完成D段就触发版本级回归。这是 happy path 下的真实架构冲突(v1.3 准则4 验证维度对齐执行架构命中)。 + +**修正**:WHILE+FOR 的 Stage9 通过分支增加形态B感知——单需求直接 GOTO Stage10;多需求形态B 标记 D段完成(update_segment_progress(req,"D","completed"))后 EXIT WHILE,交外层 execute_segments 的 V段屏障统一触发 Stage10。同步更新 stage-hooks.md 边界声明 + start-development.md 边界声明。 + +**收益**:多需求下 V段屏障不被绕过,单需求行为不变(向后兼容)。 + +### 9.3 检视方法论诚实记录 + +本节2处修正(9.1执行期发现 / 9.2检视期发现)证明"检视不是走过场"——v1.3 准则配套示例第3条"检视也是AI执行同样盲区"在此验证:9.2 的架构冲突在执行期未发现,检视期通过 Read WHILE+FOR 末尾 Stage9 决策段才暴露。这正是 full_positive_verification 记忆强调的"对照条款逐项验证,不依赖工具"——spec-reference-checker 对此盲区(0 Skill调用)。 + +### 9.4 阶段0完善:并行段可跳过交互补全(2026-07-21 第1阶段实施同步完善,最终版) + +**发现**:阶段0原始方案 execute_parallel_segment 的 ELSE 分支(Stage 1/1.2/1.6/2/2.2/5.5/6/6.1 等文档阶段)标注"真并发(无交互冲突)",但这些阶段在步骤3"判断可跳过"若项目级配置是 ask 模式会 AskUserQuestion。多需求并行时,N个需求各自执行步骤3会产生N次询问(交互歧义),原始方案未设计批量处理。 + +**修正(最终版,含C7完善)**: +- ELSE 分支增加可跳过环节批量决策:`IF stage IN 可跳过环节 AND 项目级配置[stage]=="ask" THEN batch_ask_skippable(requirements, stage)`,1次AskUserQuestion覆盖N需求 +- 新增 `batch_ask_skippable` 函数(3选项:全部执行/全部跳过/逐个确认降级) +- **三分支完整处理**(C7完善): + - `skip_all`:N需求全部跳过,记录skipDecisions,flush_commit_queue,CONTINUE下一stage + - `ask_individual`:逐需求询问执行/跳过,各自处理,flush_commit_queue,CONTINUE + - `execute_all`:落到下方并发启动 +- skip_all/ask_individual 分支均补 `flush_commit_queue`(跳过也需commit skipped状态)+ 记录 skipDecisions + +**收益**:阶段0交互复用从3个点(Stage0/1.1/2.1)扩展到全部并行段可跳过环节,消除多需求并行ask模式的交互歧义。C7完善确保"逐个确认"选项真实生效(原版会误落并发启动=全部执行)。 + +**落地位置**:stage-hooks.md "形态B分段交错编排"章节 execute_parallel_segment ELSE分支 + 新增 batch_ask_skippable 函数。 + +**真实性核验**:C7满足"方案条款违规"(batch_ask_skippable声明3选项但只处理1个,"逐个确认"失效),非过度分析。 + +--- + +## 十、降级预案(spike 失败时) + +| 级别 | 触发条件 | 降级方案 | 影响 | +|---|---|---|---| +| 降级1 | 方案C队列化丢失并行收益 | 改方案A(文件锁串行化commit),保留段内并发生成 | commit串行,生成并发 | +| 降级2 | 方案A锁机制不可靠 | 改方案B(per-requirement分片,versions.json仅聚合层加锁) | 改动大但隔离性好 | +| 降级3 | 交互复用无法消歧 | 形态B退化为"伪并行"(段内串行,段间重叠) | 收益降低但不违背核心规则 | +| 最坏 | 三方案均不可行 | S11/S12并行维度降级,重新与用户确认目标 | 目标重构 | + +--- + +## 十一、阶段0 spike 边界(诚实声明) + +- 限定 happy path(所有需求Stage9一次通过),Stage9失败回滚与段屏障交互待阶段2 S11实现 +- 单需求时段调度退化为串行(向后兼容现有单需求版本流程) +- commit_stage_transition 签名不变,现有调用不受影响 +- V段(Stage10)复用现有 stage-10-version-regression.md,不改 +- 不改 business_api.go / create-version / complete-version(多子系统是阶段1) + +--- + +## 十二、真机验证清单(AC1-AC6,待用户执行) + +``` +□ AC1: 3需求P1段,验证 S1.startAt > P1所有req.endAt(段屏障) +□ AC2: 3需求P1段并发生成,versions.json无损坏,stageHistory完整含0-2.2 +□ AC3: 3需求S1段排队,stageHistory含3/3.1/3.2/3.5/4/5全部(v4.0教训不复现) +□ AC4: 需求1澄清完即进Stage1,不等需求3(Stage1.startAt < 需求3 Stage0.endAt) +□ AC5: Stage1.1一次AskUserQuestion覆盖3需求(非3次) +□ AC6: §6规避表3项全过 +□ 向后兼容:旧版本(无segmentProgress)能正常恢复(migrate生效) +□ 单需求退化:1需求版本等价现有串行流程 +``` + +--- + +## 附录A:关联文档 + +- memory: `project_s11_s12_implementation_plan` — S11/S12 最终实现计划(5阶段路线图) +- memory: `project_version_flow_scenario_matrix` — 版本全流程场景三维矩阵 +- memory: `feedback_one_step_in_place` v1.4 — 一步到位方法论总纲 +- `.claude/config/dev-flow-checklists/stage-hooks.md` "形态B分段交错编排"章节 — 实施落地 +- `.claude/config/dev-flow-checklists/start-development.md` 步骤E — 段调度入口 diff --git "a/docs/master/design/\351\230\266\346\256\2651-S5\345\244\232\345\255\220\347\263\273\347\273\237\346\224\257\346\214\201\346\226\271\346\241\210.md" "b/docs/master/design/\351\230\266\346\256\2651-S5\345\244\232\345\255\220\347\263\273\347\273\237\346\224\257\346\214\201\346\226\271\346\241\210.md" new file mode 100644 index 00000000..e2a01856 --- /dev/null +++ "b/docs/master/design/\351\230\266\346\256\2651-S5\345\244\232\345\255\220\347\263\273\347\273\237\346\224\257\346\214\201\346\226\271\346\241\210.md" @@ -0,0 +1,421 @@ +# 第1阶段 S5:多子系统支持 实施方案 + +> 版本:v4.9 阶段1 S5(天花板约束,不升版本号) +> 创建日期:2026-07-21 +> 关联:S11/S12 最终实现计划第1阶段(详见 memory: project_s11_s12_implementation_plan) +> 状态:**最终方案**(经3轮检视:缺口G+遗漏L1-L5 → H1/H2/P1红利误判 → P5多分支架构错误,全修正) + +--- + +## 一、方案定位与核心设计 + +### 1.1 阶段1核心 +支持多子系统场景(用户确认)。多需求仍**串行**(形态B并行是阶段0已落地、阶段2整合)。 + +### 1.2 入口子系统设计(关键创新,用户补充) + +**版本计划初始化阶段明确涉及子系统**(前提:子系统必须归属当前操作人,`list-user-subsystem-role` 天然保证)。交互形式: +1. 第3.5轮询问"是否涉及多个子系统" +2. 单子系统:现有流程(向后兼容) +3. 多子系统:多选子系统 + 每子系统独立版本号 + **设定入口子系统**(其版本号=版本计划版本号) + +**入口子系统语义**:版本级保留单值 `subsystemVersionId`(=入口子系统版本号)+ `subsystemName`/`subsystemId`/`branchName`/`pipelineId`/`pipelineVersion`(=入口子系统对应值),供"版本计划版本号语义"的下游兼容;同时 `subsystems[]` 数组记录所有子系统完整信息。 + +### 1.3 D11红利范围(诚实界定,3轮检视修正) + +| 下游消费者 | 读单值用途 | D11红利 | 处理 | +|---|---|:--:|---| +| 版本计划版本号语义 | 版本级标识 | ✅成立 | 入口单值保留 | +| complete-version A6-Step1 封板 | 流水线封板 | ⚠️已改 | 循环subsystems[] | +| dev-flow.md 状态表 | 展示 | ⚠️已改 | 遍历subsystems[] | +| version-change-order-generator 第一章 | 变更单展示 | ❌不成立 | 改:遍历subsystems[]多行(P1) | +| Stage7 B7 fixBug | Bug所在子系统版本号 | ❌不成立(有害H1) | 改:反查reqSubsystemId(H1) | +| A4-2 associate-subsystem-version | 需求关联所属子系统版本 | ❌不成立(有害H2) | 改:按reqSubsystemId分组(H2) | + +### 1.4 顺带修复(用户确认点3) +functional-test-generator:1798-1810 / SKILL.md:1335 的 `project-context.json system.subsystemName` 既有错误(project-context-analyzer 不生成此字段),顺带修正为反查 versions.json。 + +--- + +## 二、15个决策点(全基于源码+用户3点确认) + +| # | 决策点 | 解决方案 | +|---|---|---| +| D1 | 多子系统测试集 | 版本级共享(testSetId/regressionTestSetId 不变) | +| D2 | A2b 多子系统原子性 | 沿用非阻塞(不回滚成功,失败写PendingItem) | +| D3 | 多子系统版本号收集 | 每子系统独立收集(第1.5轮循环) | +| D4 | 分支命名 | **单分支** `dev-{入口subsystemVersionId}`(所有子系统共享,P5修正) | +| D5 | 多流水线 | 每子系统独立pipelineId,规则 `{subsystemName}_{subsystemVersionId}` 不变 | +| D6 | Stage4 多模块 | 不变(单项目多模块同git) | +| D7 | Stage10 多子系统回归 | 不变(版本级共享) | +| D8 | 向后兼容 | contextSchemaVersion 1.0→2.0 + migrate_v1_to_v2 | +| D9 | 第4轮多选 | multiSelect,>4分批(参考stage-10:10.2) | +| D10 | A6 多子系统封板 | 循环多子系统(入口优先) | +| D11 | 入口子系统红利范围 | 仅"版本计划版本号语义"成立;P1/H1/H2必改 | +| D12 | 需求-子系统归属 | requirements[].reqSubsystemId,add-story时选 | +| D13 | functional-test-generator 既有错误 | 顺带修(Agent:1801+SKILL:1335两处同步) | +| D14 | B7 fixBug Bug-子系统归属 | Bug来自需求→reqSubsystemId→反查subsystems[] | +| D15 | A4-2 分组关联 | 按reqSubsystemId分组,单子系统退化为1组 | + +--- + +## 三、11个变更文件清单(基于已确认源码,行号锚定) + +| # | 文件 | 当前结构(已Read) | S5 变更 | +|---|---|---|---| +| 1 | `dev-flow.md` | 第4轮(582-617)单选 / 状态表(765-785)单值 / 第1.5轮(536-553)单版本号 | ①第3.5轮新增"是否多子系统" ②第4轮改多选+入口 ③第1.5轮循环多版本号 ④状态表遍历subsystems[] | +| 2 | `create-version.md` | A2b(27-48)/6.5(118-154)/6.6(159-262)/步骤6(66-86) | A2b循环+6.5单分支+6.6多流水线+schema(subsystems[]+入口单值保留) | +| 3 | `complete-version.md` | A6-Step0(113-184)/A6-Step1(188-245) | 循环多子系统(入口优先) | +| 4 | `start-development.md` | context.md schema(451-456)/add-story(1155+)/A4-2(51) | context.md加reqSubsystemId + add-story归属 + A4-2按reqSubsystemId分组 | +| 5 | `functional-test-generator.md`(Agent) | :1801读project-context错误 | 反查versions.json(D13) | +| 6 | `functional-test-generator/SKILL.md` | :1335读project-context错误 | 反查versions.json(D13,与Agent同步) | +| 7 | `business_api.go` | Version/Task struct(20-42)无Subsystem | Version加Subsystems[]+EntrySubsystemID / Task加SubsystemID | +| 8 | `ProjectDetail.vue` | 单子系统展示 | 多子系统展示 | +| 9 | `dev-flow-context-contract.json` | allowed_context_updates | 加subsystems/entrySubsystemId/reqSubsystemId | +| 10 | `version-change-order-generator`(SKILL.md+模版) | 第一章单值subsystemVersionId | 遍历subsystems[]多行(P1) | +| 11 | `stage-hooks.md` B7 | :1676读dpms.subsystemVersionId | 反查reqSubsystemId(H1) | +| 12 | `associate-requirement.md` | A4-2(24-53)单值 | 按reqSubsystemId分组(H2) | + +> start-development.md(4) 与 associate-requirement.md(12) 都含A4-2,A4-2主体在associate-requirement.md,start-development.md:51是跳过PendingItem记录(同步改)。合并计11个文件。 + +--- + +## 四、核心数据模型 + +### 4.1 versions.json schema(create-version.md:66-86 扩展,入口单值保留+subsystems[]) + +```json +{ + "versionName": "{发布计划名称}", + "productId": "{产品ID}", + "productName": null, + "testSetId": "{版本级共享}", + "regressionTestSetId": "{版本级共享}", + "isNeedGrayRelease": "{版本级统一}", + "grayReleaseDate": "{版本级统一}", + "testReportId": null, + "contextSchemaVersion": "2.0", + "versionContextPath": "...", + "entrySubsystemId": "{入口子系统ID}", + "subsystemId": "{入口子系统ID,兼容}", + "subsystemName": "{入口子系统名,兼容}", + "subsystemVersionId": "{入口子系统版本号,兼容=版本计划版本号}", + "branchName": "{版本级单分支=入口subsystemVersionId派生,兼容}", + "pipelineId": "{入口子系统流水线,兼容}", + "pipelineVersion": "{入口子系统流水线版本,兼容}", + "subsystems": [ + { + "subsystemId": "...", "subsystemName": "...", + "subsystemVersionId": "...", "branchName": "{=版本级单分支}", + "pipelineId": "...", "pipelineVersion": "{subsystemName}_{subsystemVersionId}", + "modules": [], "isEntry": true + } + ], + "requirements": [ + {"name":"...","reqIndex":1,"reqPrefix":"REQ-01","dpmsStoryId":"...", + "productName":"...","reqSubsystemId":"{需求归属子系统ID}"} + ] +} +``` + +### 4.2 business_api.go struct 扩展(行20-42) + +```go +type Version struct { + ID string `json:"id"` + ProjectID string `json:"projectId"` + Status string `json:"status"` + Progress int `json:"progress"` + Stage string `json:"stage"` + Tasks []string `json:"tasks"` + EntrySubsystemID string `json:"entrySubsystemId,omitempty"` + Subsystems []Subsystem `json:"subsystems,omitempty"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` +} + +type Subsystem struct { + SubsystemID string `json:"subsystemId"` + SubsystemName string `json:"subsystemName"` + SubsystemVersionID string `json:"subsystemVersionId"` + BranchName string `json:"branchName"` + PipelineID string `json:"pipelineId"` + Modules []string `json:"modules,omitempty"` + IsEntry bool `json:"isEntry"` +} + +type Task struct { + ID string `json:"id"` + VersionID string `json:"versionId"` + ProjectID string `json:"projectId"` + SubsystemID string `json:"subsystemId,omitempty"` + // ...其余不变 +} +``` + +### 4.3 向后兼容迁移函数 + +```python +FUNCTION migrate_v1_to_v2(version_config): + IF version_config.contextSchemaVersion == "1.0" AND version_config.get("subsystemId") 非空 THEN + version_config.subsystems = [{ + "subsystemId": version_config.subsystemId, + "subsystemName": version_config.subsystemName, + "subsystemVersionId": version_config.subsystemVersionId, + "branchName": version_config.branchName, + "pipelineId": version_config.pipelineId, + "pipelineVersion": version_config.pipelineVersion, + "modules": [], "isEntry": True + }] + version_config.entrySubsystemId = version_config.subsystemId + version_config.contextSchemaVersion = "2.0" + FOR each req IN version_config.requirements: + req.reqSubsystemId = version_config.entrySubsystemId + END FOR + 原子写 versions.json + END IF +END FUNCTION +``` + +--- + +## 五、核心伪代码(与现有源码对齐) + +### 5.1 dev-flow.md 第3.5轮新增"是否多子系统"(第3轮后第4轮前) + +```python +multi_sub_ans = AskUserQuestion(question="本次版本是否涉及多个子系统?", + header="子系统范围", + options=[{label:"单子系统(现有流程)", description:"仅1个子系统"}, + {label:"多子系统", description:"涉及2+子系统,每子系统独立版本号,需设定入口子系统"}]) +is_multi_subsystem = (multi_sub_ans == "多子系统") +``` + +### 5.2 dev-flow.md 第4轮改多选+入口(替代582-617) + +```python +IF subsystem_list 非空 THEN + IF NOT is_multi_subsystem THEN + selected_subsystems = [单选结果] + entry_subsystem = selected_subsystems[0] + ELSE + selected_subsystems = multi_select_subsystems(subsystem_list) # >4分批 + entry_ans = AskUserQuestion(question="请设定入口子系统(其版本号将作为版本计划版本号):", + header="入口子系统", + options=[{label:s.subsystemName, description:f"ID:{s.subsysId}"} for s in selected_subsystems]) + entry_subsystem = FIND selected_subsystems WHERE name == entry_ans + END IF + # 灰度发布收集(版本级统一,不变) +END IF +``` + +### 5.3 dev-flow.md 第1.5轮循环多版本号(替代536-553) + +```python +FOR each sub IN selected_subsystems: + WHILE True: + version_input = AskUserQuestion(question=f"子系统 [{sub.subsystemName}] 版本号(X.Y.Z):") + IF version_input 匹配 ^\d+\.\d+\.\d+$ THEN sub.subsystemVersionId = version_input; BREAK + END WHILE +END FOR +``` + +### 5.4 create-version A2b 循环(替代27-48,D2非阻塞) + +```python +subsystem_results = [] +FOR each sub IN selected_subsystems: + result = safe_call_mcp("mcp__sdp__add-subsystem-version", { + "subSystemName": sub.subsystemName, "subSystemVersionId": sub.subsystemVersionId, + "isNeedGrayRelease": isNeedGrayRelease, "createUserName": 当前用户, "enableAiMode": 1, + "expectGrayReleaseDate": grayReleaseDate_ts IF isNeedGrayRelease==1 ELSE 不传, + "expectReleaseDate": endDate_ts, "releasePlanId": [releasePlanId], "versionType": 1 + }, context_description=f"A2b:创建子系统版本 {sub.subsystemName}") + IF result["success"]: subsystem_results.append(sub) + ELSE: save_pending_item(skip_reason="MCP_FAILED") +END FOR +# A2a add-business-version items[] 原生支持多subsystem,一次调用传全部 +``` + +### 5.5 create-version 6.5 单分支(P5修正,替代118-154) + +```python +# 单分支(版本级,所有子系统共享)——P5修正,单项目单git不可多分支 +entry = entry_subsystem +version_branch = f"dev-{entry.subsystemVersionId}" +IF NOT branch_exists(version_branch): bash(f"git checkout -b {version_branch}") +FOR each sub IN subsystem_results: sub.branchName = version_branch # 全部相同 +``` + +### 5.6 create-version 6.6 多流水线(替代159-262,D5) + +```python +FOR each sub IN subsystem_results: + pipeline_version = f"{sub.subsystemName}_{sub.subsystemVersionId}" + pipelineId = AskUserQuestion(question=f"子系统[{sub.subsystemName}]流水线ID:") + subsystem_branch_list = [{"subsystem": s.subsystemName, "branch": version_branch} for s in subsystem_results] # 多元素同branch + result = safe_call_mcp("mcp__sdp__update-version-build-branch", { + "pipelineId": pipelineId, "version": pipeline_version, "userId": 当前用户, + "subsystemBranchList": subsystem_branch_list + }, ...) + IF result["success"]: sub.pipelineId = pipelineId; sub.pipelineVersion = pipeline_version + ELSE: save_pending_item(skip_reason="MCP_FAILED") +END FOR +``` + +### 5.7 create-version 步骤6 写入入口单值+subsystems[](替代66-86) + +```python +entry = entry_subsystem +版本配置 = { + "versionName":..., "contextSchemaVersion":"2.0", + "entrySubsystemId": entry.subsystemId, + "subsystemId": entry.subsystemId, "subsystemName": entry.subsystemName, + "subsystemVersionId": entry.subsystemVersionId, "branchName": version_branch, + "pipelineId": entry.pipelineId, "pipelineVersion": entry.pipelineVersion, + "subsystems": [{"subsystemId":s.subsystemId,"subsystemName":s.subsystemName, + "subsystemVersionId":s.subsystemVersionId,"branchName":version_branch, + "pipelineId":s.pipelineId,"pipelineVersion":s.pipelineVersion, + "modules":[],"isEntry":(s==entry)} FOR s IN subsystem_results] +} +``` + +### 5.8 complete-version A6 循环多子系统(替代113-245,D10) + +```python +ordered = sorted(版本配置.subsystems, key=lambda s: not s.isEntry) # 入口优先 +FOR each sub IN ordered: + # A6-Step0 关联分支(同一version_branch) + safe_call_mcp("mcp__sdp__associate-subsystem-version-branch", { + "userId":当前用户,"subsystemId":sub.subsystemId,"subsystemVersion":sub.subsystemVersionId, + "gitUrl":git_url,"branch":版本配置.branchName,"branchType":AskUserQuestion(DEV/RELEASE)}) + # A6-Step1 流水线封板 + safe_call_mcp("mcp__tctp-dpms-set__freezePipeline", { + "pipelineId":sub.pipelineId,"operateUser":当前用户,"subsystem":sub.subsystemName, + "version":sub.subsystemVersionId,"branch":版本配置.branchName,"gitSshUrl":git_ssh}) +END FOR +``` + +### 5.9 start-development add-story 需求-子系统归属(D12) + +```python +IF len(版本配置.subsystems) == 1 THEN + req.reqSubsystemId = 版本配置.subsystems[0].subsystemId # 自动归属 +ELSE + ans = AskUserQuestion(question=f"需求[{name}]归属哪个子系统?", + options=[{label:s.subsystemName,description:f"ID:{s.subsystemId}"} for s in 版本配置.subsystems]) + req.reqSubsystemId = (FIND subsystems WHERE name==ans).subsystemId +END IF +``` + +### 5.10 H1 修正:Stage7 B7 fixBug 反查 reqSubsystemId(stage-hooks.md:1676) + +```python +sub_system_version_id = None +bug_req_subsystem_id = bug_info.reqSubsystemId +IF bug_req_subsystem_id 非空 AND 版本配置.subsystems 存在 THEN + sub = FIND 版本配置.subsystems WHERE subsystemId == bug_req_subsystem_id + IF sub THEN sub_system_version_id = sub.subsystemVersionId +END IF +IF sub_system_version_id 为空 THEN sub_system_version_id = 版本配置.subsystemVersionId # 入口兜底 +``` + +### 5.11 H2 修正:A4-2 按 reqSubsystemId 分组(associate-requirement.md) + +```python +subsystem_groups = {} +FOR each req IN 待关联需求: + sub_id = req.reqSubsystemId or 版本配置.entrySubsystemId + sub = FIND 版本配置.subsystems WHERE subsystemId == sub_id + IF sub THEN + IF sub_id NOT IN subsystem_groups THEN + subsystem_groups[sub_id] = {"subsystemVersionId": sub.subsystemVersionId, "storyIds": []} + END IF + subsystem_groups[sub_id].storyIds.append(req.dpmsStoryId) +END FOR +FOR each sub_id, group IN subsystem_groups: + safe_call_mcp("mcp__sdp__associate-subsystem-version", { + "userName": 当前用户, "subSystemId": sub_id, + "version": group.subsystemVersionId, "storyIds": group.storyIds}) +END FOR +``` + +### 5.12 P1 修正:version-change-order-generator 第一章遍历 subsystems[] + +```markdown +## 一、子系统版本基础信息(共 #{versions.json.subsystems.length} 个子系统) + +- 子系统:`#{subsystem.subsystemName}` | 版本号:`#{subsystem.subsystemVersionId}` | 入口:`#{subsystem.isEntry ? "是":"否"}` +``` + +```python +# SKILL.md 第一章填充修正 +subsystems = target_version.get("subsystems", []) +IF len(subsystems) == 0 THEN # 向后兼容旧1.0 + subsystems = [{"subsystemName": target_version.get("subsystemName",""), + "subsystemVersionId": target_version.get("subsystemVersionId",""), "isEntry": True}] +END IF +IF 所有 s.subsystemVersionId 均为空 THEN EXIT +``` + +### 5.13 D13 修正:functional-test-generator 子系统来源反查 + +```python +# 子系统名称(修正既有project-context错误,反查versions.json) +subsystem_name = None +req_subsystem_id = context.md.reqSubsystemId +IF req_subsystem_id 非空 AND 版本配置.subsystems 存在 THEN + sub = FIND 版本配置.subsystems WHERE subsystemId == req_subsystem_id + IF sub THEN subsystem_name = sub.subsystemName +END IF +IF subsystem_name 为空 THEN subsystem_name = 版本配置.subsystemName # 入口兜底 +IF subsystem_name 为空 THEN subsystem_name = "子系统" +``` + +--- + +## 六、验收标准(12项) + +| # | 验收项 | 通过标准 | +|---|---|---| +| AC1 | 多子系统数据模型 | 2子系统版本,subsystems[]含2元素,入口isEntry=true | +| AC2 | 入口子系统版本号=版本计划版本号 | versions.json.subsystemVersionId == subsystems[入口].subsystemVersionId | +| AC3 | 子系统归属校验 | list-user-subsystem-role 范围外不可选 | +| AC4 | A2b 多子系统原子性 | 1失败,成功保留,PendingItem,不阻塞 | +| AC5 | 向后兼容 | 旧1.0版本migrate,单值包装subsystems[0]+isEntry=true | +| AC6 | 需求-子系统归属 | add-story 2子系统询问归属;单子系统自动 | +| AC7 | 下游单值兼容 | version-change-order/B7 读单值正常(=入口,P1/H1修正后内容正确) | +| AC8 | functional-test-generator 修正 | 反查versions.json,不读project-context错误字段 | +| AC9 | A6 多子系统封板 | 循环封板,入口优先 | +| AC10 | task-viewer 多子系统展示 | 遍历subsystems[] | +| AC11 | B7 fixBug子系统版本号正确 | 非入口子系统Bug用reqSubsystemId对应versionId | +| AC12 | A4-2分组关联正确 | 2需求属不同子系统,调用2次各用对应subSystemId/version | + +--- + +## 七、诚实边界 + +1. business_api.go 是Go:enforce-checklist不覆盖,须go build+人工Read核验。handler逻辑未深入,struct扩展后可能需适配。 +2. task-viewer 前端Vue:ProjectDetail.vue需Read前端源码后实施。 +3. 多需求串行不并行:S5串行,形态B阶段2整合。 +4. D11入口设计本身正确:红利范围诚实界定,P1/H1/H2修正后保留。 +5. spec-reference-checker盲区:MCP参数跨组件一致性靠人工Read。 +6. 版本号天花板:contextSchemaVersion 1.0→2.0数据模型层;dev-sync-agent工具版本v4.9天花板,是否升v5.0待用户定,本阶段可在v4.9追加changelog。 +7. P5单分支是单项目单git约束:多git多分支是阶段3。 + +--- + +## 附录A:3轮检视发现的问题与修正 + +| 轮次 | 发现 | 修正 | +|---|---|---| +| 第1轮 | 缺口G(需求-子系统归属未定义)+L1-L5(context.md/functional-test/变更单/状态表/B7) | D12 reqSubsystemId + 顺带修 | +| 第2轮 | D11红利误判H1(fixBug)/H2(A4-2)/P1(变更单) | H1反查/H2分组/P1遍历 | +| 第3轮 | P5 D4多分支架构错误(单仓库不可多分支) | D4改单分支 | +| 第4轮(实施检视) | C1 6.6循环单流水线残留 / C2 A6-Step0循环未闭合 / C3 A6-Step1循环未闭合 / C4 SKILL.md第一章填充逻辑未改 / C5 add-story归属询问未实施 | 全修正:循环体逻辑移入+END FOR闭合+SKILL遍历+add-story归属 | +| 第5轮(实施检视) | C6 A6-Step1末尾旧单子系统残留(修正C3时未清尾巴) / C8 6.6修正C1时旧单子系统询问+失败分支残留 | 全修正:删除残留尾巴,代码块闭合20/20 | +| 第6轮(实施检视) | C9 complete-version"跳过A6系列"分支PendingItem仅记录入口单值,非入口子系统跳过丢失 / 点1 FOR配对不匹配(过度分析:说明文字+注释被当伪代码FOR) | C9修正:跳过分支循环多子系统记录PendingItem; 点1判定过度分析不修正 | + +## 附录B:关联文档 +- memory: `project_s11_s12_implementation_plan` — S11/S12最终实现计划 +- docs/master/design/阶段0-形态B并发原型spike方案.md — 阶段0 diff --git "a/docs/master/design/\351\230\266\346\256\2652-S11\345\275\242\346\200\201B\345\244\232\345\255\220\347\263\273\347\273\237\346\225\264\345\220\210\346\226\271\346\241\210.md" "b/docs/master/design/\351\230\266\346\256\2652-S11\345\275\242\346\200\201B\345\244\232\345\255\220\347\263\273\347\273\237\346\225\264\345\220\210\346\226\271\346\241\210.md" new file mode 100644 index 00000000..d57b8ab0 --- /dev/null +++ "b/docs/master/design/\351\230\266\346\256\2652-S11\345\275\242\346\200\201B\345\244\232\345\255\220\347\263\273\347\273\237\346\225\264\345\220\210\346\226\271\346\241\210.md" @@ -0,0 +1,143 @@ +# 第2阶段 S11:形态B × 多子系统整合 实施方案 + +> 版本:v4.9 阶段2 S11(天花板约束,不升版本号) +> 创建日期:2026-07-21 +> 关联:S11/S12最终实现计划第2阶段(最终目标1) +> 状态:**已实施**(伪代码层落地,待真机验证) + +--- + +## 实施检视修正记录 + +| 轮次 | 发现 | 修正 | +|---|---|---| +| 第1轮(实施检视) | F1 execute_segments只返回completed无exited_with_blocked路径,交互强化1退出引导永不触发(跨函数调用链断裂) | V段后检查blocked_reqs,有则返回exited_with_blocked | +| 第1轮(实施检视) | F2 D段parallel=True走execute_parallel_segment(文档并发),但Stage9是循环决策含失败blocked,并行段无blocked感知 | D段parallel改False,走execute_serial_segment(含D段blocked感知) | + +--- + +## 一、方案定位 + +阶段2 S11 = 形态B(需求间并行)× S5(多子系统)整合。让形态B段调度感知多子系统。 + +**核心认知**:需求属于不同子系统(reqSubsystemId),但形态B段调度是"需求间"并行,子系统是需求属性。整合是"段调度各阶段感知reqSubsystemId",非"需求×子系统二维并行"。 + +**真实整合点2个 + 交互强化2个**(v1.5反附和:6整合点经源码核验4虚假排除)。 + +--- + +## 二、4个改动点(全基于源码) + +| # | 改动点 | 类别 | 源码位置 | +|---|---|---|---| +| E6 | Stage5 pipelineId反查reqSubsystemId | 整合点 | stage-hooks.md:655 | +| E4 | Stage9失败回滚与段屏障(D1跳过已完成段/D2退出+resume) | 整合点 | stage-hooks.md Stage9失败分支+execute_segments | +| 交互强化1 | execute_segments提前退出的用户引导 | 交互强化 | start-development.md步骤E | +| 交互强化2 | 继续版本开发步骤5适配形态B段调度 | 交互强化(阶段0遗漏补全) | dev-flow.md:1140 | + +--- + +## 三、核心伪代码 + +### E6:Stage5 pipelineId反查(stage-hooks.md:655) +```python +pipeline_id = None +req_subsystem_id = req.reqSubsystemId +IF req_subsystem_id 非空 AND 版本配置.subsystems 存在 THEN + sub = FIND 版本配置.subsystems WHERE subsystemId == req_subsystem_id + IF sub THEN pipeline_id = sub.pipelineId +END IF +IF pipeline_id 为空 THEN pipeline_id = 版本配置.pipelineId # 入口兜底 +``` + +### E4 D1:execute_segments跳过已完成段 +```python +FUNCTION execute_segments(all_requirements): + FOR each req IN all_requirements: migrate_add_segment_progress(req) + FOR each segment IN SEGMENT_ORDER: + pending_reqs = [req FOR req IN all_requirements + IF req.segmentProgress[segment].status NOT IN ["completed","skipped","blocked"]] + IF len(pending_reqs) == 0 THEN CONTINUE + IF segment == "V" THEN + wait_segment_barrier("D", all_requirements) + active_reqs = [req FOR req IN all_requirements IF req.segmentProgress["D"].status != "blocked"] + IF len(active_reqs) > 0 THEN execute_stage_10(active_reqs) + RETURN "completed" + END IF + IF SEGMENTS[segment].parallel THEN execute_parallel_segment(segment, pending_reqs) + ELSE execute_serial_segment(segment, pending_reqs) + wait_segment_barrier(segment, all_requirements) + END FOR + RETURN "completed" +END FUNCTION +``` + +### E4 D2:Stage9失败分支退出+blocked +```python +ELSE IF 存在失败测试用例或缺陷 THEN + # ...loop_decision ask/auto... + 调用 req-fix-bug-analyzer 生成bug fix子需求 + commit_stage_transition({stage:"9",status:"blocked",...}) + 版本配置.requirements.append(bugfix子需求对象) + OUTPUT: "⚠️ 需求Stage9失败已blocked,bugfix子需求已生成。请继续开发resume" + RETURN "exited_with_blocked" # 退出execute_segments +END IF +``` + +### 交互强化1:execute_segments退出引导(start-development.md步骤E) +```python +result = execute_segments(all_requirements) +IF result == "exited_with_blocked" THEN + AskUserQuestion("需求Stage9失败已blocked,bugfix子需求已生成。如何继续?", + ["继续开发(推荐)—resume,已完成需求跳过已完成段,bugfix从P1", + "返回主菜单"]) + IF "继续开发" THEN 内联执行"继续版本开发" +END IF +``` + +### 交互强化2:继续版本开发步骤5适配形态B(dev-flow.md:1140) +```python +3. **调用 execute_segments 恢复(形态B段调度)**: + - execute_segments内含migrate_add_segment_progress + pending_reqs跳过已完成段 + - 已完成段需求跳过,未完成段从断点继续,bugfix子需求从P1 + - 与启动版本需求步骤E使用同一execute_segments入口 +``` + +--- + +## 四、7变更文件清单 + +| # | 文件 | 变更 | +|---|---|---| +| 1 | stage-hooks.md Stage5 | E6反查reqSubsystemId | +| 2 | stage-hooks.md Stage9失败分支 | E4 D2改blocked+退出 | +| 3 | stage-hooks.md execute_segments | E4 D1 pending_reqs跳过已完成段 | +| 4 | stage-hooks.md V段屏障+wait_segment_barrier | E4含blocked三态 | +| 5 | start-development.md步骤E | 交互强化1退出引导 | +| 6 | dev-flow.md继续版本开发步骤5 | 交互强化2调execute_segments | +| 7 | dev-flow.md changelog | 追加 | + +--- + +## 五、8验收标准 + +| # | 验收项 | +|---|---| +| AC1 | Stage5 pipelineId多子系统正确 | +| AC2 | Stage9失败不破坏段屏障 | +| AC3 | execute_segments跳过已完成段 | +| AC4 | bugfix子需求纳入下一轮 | +| AC5 | V段blocked需求不参与回归 | +| AC6 | 段屏障三态 | +| AC7 | 交互强化1退出引导 | +| AC8 | 交互强化2继续开发适配形态B | + +--- + +## 六、诚实边界 + +1. 伪代码层方案,待真机验证 +2. 交互强化2是阶段0遗漏(继续开发步骤5未同步execute_segments) +3. execute_segments需增加返回值机制(过程函数→带退出码) +4. E7(Stage3技术栈)S11边界/S12真实,不在S11处理 +5. 第0/1阶段未真机验证 diff --git "a/docs/master/design/\351\230\266\346\256\2653-\345\244\232git\347\274\226\346\216\222\346\226\271\346\241\210.md" "b/docs/master/design/\351\230\266\346\256\2653-\345\244\232git\347\274\226\346\216\222\346\226\271\346\241\210.md" new file mode 100644 index 00000000..9ddd2a57 --- /dev/null +++ "b/docs/master/design/\351\230\266\346\256\2653-\345\244\232git\347\274\226\346\216\222\346\226\271\346\241\210.md" @@ -0,0 +1,224 @@ +# 第3阶段:多git编排(S6增量)最终方案 + +> 版本:v4.9 阶段3(天花板约束,不升版本号) +> 创建日期:2026-07-23 +> 关联:S11/S12最终实现计划第3阶段(S12的纵向增量) +> 状态:**已实施**(伪代码层落地,待真机验证) + +--- + +## 一、方案定位 + +阶段3 = 多git编排(多项目多仓库),S12的纵向增量。在S5多子系统基础上增加跨git仓库编排能力。 + +**前置依赖**:第1阶段S5(多子系统数据模型)。 + +**核心架构挑战**:当前dev-sync-agent假设单一工作目录(pwd)单一git仓库。多git是多项目多仓库,是**工作目录模型的根本变更**——5个阶段中范围最大。 + +--- + +## 二、是否涉及新增交互:是,4处 + +| # | 新增交互 | 触发时机 | 必要性 | +|---|---|---|---| +| G1 | "是否多git(多项目多仓库)"询问 | create-version第3.8轮 | 必须 | +| G2 | 每子系统git仓库收集(SSH地址+本地路径) | create-version多git时 | 必须 | +| G3 | Stage4跨仓库提交策略确认 | Stage4部署(每需求各自仓库提交) | 必须 | +| G4 | complete-version跨仓库归档确认 | complete-version步骤11 | 必须 | + +--- + +## 三、数据模型变更 + +### versions.json(contextSchemaVersion 2.0→2.1) + +```json +{ + "contextSchemaVersion": "2.1", + "isMultiGit": false, + "subsystems": [ + { + "subsystemId": "...", "subsystemName": "...", + "subsystemVersionId": "...", "branchName": "...", + "pipelineId": "...", "pipelineVersion": "...", + "gitUrl": "git@xxx:repo.git", + "localPath": "/path/to/repo", + "modules": [], "isEntry": true + } + ], + "repositories": [ + {"gitUrl":"git@xxx:repo.git","localPath":"/path/to/repo","branchName":"dev-{ver}","subsystemIds":["subA"]} + ], + "requirements": [ + {"name":"...","reqSubsystemId":"subA","repositoryId":"repoA"} + ] +} +``` + +### 向后兼容迁移 + +```python +FUNCTION migrate_v2_to_v2_1(version_config): + IF version_config.contextSchemaVersion == "2.0" THEN + version_config.isMultiGit = False + version_config.repositories = [] + FOR each sub IN version_config.subsystems: + sub.gitUrl = None; sub.localPath = None + END FOR + FOR each req IN version_config.requirements: + req.repositoryId = None + END FOR + version_config.contextSchemaVersion = "2.1" + END IF +END FUNCTION +``` + +--- + +## 四、5个决策点(全解决) + +| # | 决策点 | 解决方案 | +|---|---|---| +| G-D1 | 多git工作目录模型 | versions.json记录localPath,Stage3/4按需求repositoryId反查localPath | +| G-D2 | Stage3 Agent工作目录 | 【代码工作目录】注入需求的repositoryId对应localPath(非pwd) | +| G-D3 | 跨仓库git原子性 | 按仓库分组+部分失败PendingItem(非全回滚) | +| G-D4 | 多仓库分支命名 | 每仓库统一dev-{入口subsystemVersionId}(P5延伸,不同仓库同名分支不冲突) | +| G-D5 | project-context多项目 | 每仓库一份project-context.json,Stage3按localPath读取 | + +--- + +## 五、8个改动点(完整伪代码,行号锚定) + +### 改动1:create-version 第3.8轮多git询问(dev-flow.md:554后) + +```python +multi_git_ans = AskUserQuestion("本次版本是否涉及多个git仓库(多项目)?", + ["单git(现有流程)— 所有子系统在同一git仓库", + "多git — 不同子系统在不同git仓库,需收集每仓库SSH地址+本地路径"]) +is_multi_git = (用户选择"多git") + +IF is_multi_git THEN + FOR each sub IN selected_subsystems: + sub.gitUrl = AskUserQuestion(f"子系统[{sub.subsystemName}]的git仓库SSH地址:") + sub.localPath = AskUserQuestion(f"子系统[{sub.subsystemName}]的本地仓库路径:") + END FOR + repositories = dedup_repositories(selected_subsystems) +END IF +``` + +### 改动2:subsystems[] schema加gitUrl/localPath(create-version.md:97-110) + +subsystems[]每元素加 `"gitUrl"` + `"localPath"`;新增顶层 `"isMultiGit"` + `"repositories"` + requirements加 `"repositoryId"`。 + +### 改动3:Stage4 需求级跨仓库提交(stage-hooks.md:450-453区域)⭐H1修正 + +```python +# Stage4(单需求WHILE+FOR内,⭐阶段3 H1修正:需求级仓库提交,非遍历所有仓库) +IF 版本配置.isMultiGit THEN + repo = FIND 版本配置.repositories WHERE gitUrl == req.repositoryId + IF repo 存在 THEN + bash(f"cd {repo.localPath}") + bash("git status --short") + bash(f'git add -- {该需求变更路径}') + bash(f'git commit -m "#AI commit# 需求{req.name}仓库{repo.gitUrl}提交"') + bash(f"git push origin {repo.branchName}") + ELSE + save_pending_item(skip_reason="REPOSITORY_NOT_FOUND") + END IF +ELSE + # 单git:现有流程(git add/commit/push origin,行450-453不变) +END IF +``` + +**H1修正关键**:Stage4是**需求级**(每需求各自仓库,`FIND repositories WHERE gitUrl == req.repositoryId`),不是版本级遍历(FOR each repo)。对比:步骤11归档是版本级(FOR each repo,正确)。 + +### 改动4:complete-version 步骤11 版本级跨仓库归档(complete-version.md:425-445区域) + +```python +IF 版本配置.isMultiGit THEN + FOR each repo IN 版本配置.repositories: + bash(f"cd {repo.localPath}") + # 现有归档逻辑(git status筛选+过滤+add+commit),每仓库一次 + push_choice = AskUserQuestion(f"仓库[{repo.gitUrl}]是否推送?", + [{label:"推送"},{label:"暂不推送"}]) + IF "推送" THEN bash(f"git push origin {repo.branchName}") + END FOR +ELSE + # 单git:现有流程 +END IF +``` + +### 改动5:complete-version A6 gitUrl(complete-version.md:121/197区域) + +```python +IF 版本配置.isMultiGit AND sub.gitUrl 非空 THEN + git_url = sub.gitUrl +ELSE + git_url = bash("git remote get-url origin") # 单git兼容 +END IF +``` + +### 改动6:阶段Prompt【代码工作目录】(stage-hooks.md:1127) + +``` +【代码工作目录】:{req_repository_localPath}(⭐阶段3:多git时需求所属仓库localPath;单git时=pwd) +``` + +### 改动7:start-development context.md加repositoryId + add-story归属 + +```yaml +repositoryId: "{需求所属仓库ID,多git时从subsystem.gitUrl映射;单git时null}" +``` + +### 改动8:project-context多项目 + dev-flow状态表 + +```python +IF 版本配置.isMultiGit THEN + FOR each repo IN 版本配置.repositories: + IF NOT 文件存在(f"{repo.localPath}/project-context.json") THEN + AskUserQuestion(f"仓库[{repo.gitUrl}]的project-context.json不存在,是否生成?") + IF "生成" THEN bash(f"cd {repo.localPath}"); Agent(project-context-analyzer) + END IF + END FOR +END IF +``` + +--- + +## 六、8验收标准 + +| # | 验收项 | 通过标准 | +|---|---|---| +| AC1 | 多git数据模型 | 2仓库版本,repositories[]含2元素,subsystems[].gitUrl/localPath非空 | +| AC2 | 向后兼容 | 旧2.0版本migrate_v2_to_v2_1,isMultiGit=false | +| AC3 | G1是否多git交互 | 多git时询问,单git时跳过 | +| AC4 | G2仓库收集 | 多git时每子系统收集gitUrl+localPath | +| AC5 | G3 Stage4需求级跨仓库 | 每需求提交其repositoryId对应仓库(非遍历所有仓库) | +| AC6 | G4归档版本级跨仓库 | 归档时遍历所有仓库commit/push | +| AC7 | 工作目录切换 | Stage3 code-developer在需求所属localPath工作 | +| AC8 | project-context多项目 | 多git时每仓库一份project-context | + +--- + +## 七、诚实边界 + +1. 阶段3是5阶段中范围最大的(工作目录模型根本变更),不宣称"最终保证",待真机验证。 +2. 4处新增交互(G1-G4),交互量最大。 +3. H1修正(Stage4需求级vs版本级层次)是检视发现的真实缺陷,已修正。 +4. 跨仓库git操作风险(cd切换/Windows路径/权限)需真机验证。 +5. E7(Stage3技术栈)在多git下变真实,G-D5多project-context处理。 +6. 第0/1/2阶段未真机验证,阶段3建立在S5之上。 + +--- + +## 附录A:H1修正记录 + +| 缺陷 | 判定标准 | 修正 | +|---|---|---| +| H1 Stage4跨仓库提交层次错误(方案写版本级FOR each repo,实际Stage4是需求级每需求各自仓库) | ①方案条款违规③运行行为错误 | 改动3改为`repo = FIND repositories WHERE gitUrl == req.repositoryId`需求级(步骤11归档保持版本级FOR each repo) | + +## 附录B:关联文档 +- docs/master/design/阶段0-形态B并发原型spike方案.md +- docs/master/design/阶段1-S5多子系统支持方案.md +- docs/master/design/阶段2-S11形态B多子系统整合方案.md +- memory: project_s11_s12_implementation_plan diff --git a/docs/project-knowledge/sessions/agent_requirement-design_fd4df847/session_detail.md b/docs/project-knowledge/sessions/agent_requirement-design_fd4df847/session_detail.md new file mode 100644 index 00000000..6aa30ae9 --- /dev/null +++ b/docs/project-knowledge/sessions/agent_requirement-design_fd4df847/session_detail.md @@ -0,0 +1,615 @@ + +## 交互记录 (2026-07-27T09:22:25.393Z) + +**用户**: +分析下当前agent,用户执行dev-flow version和dev-flow 需求描述,整个流程设计哪些agent或skill,输出一个文档,标出具体的stage,具体的agent\skill名称,用途 + +**AI**: +[思考] 用户要求分析当前agent项目,针对"dev-flow version"和"dev-flow 需求描述"两条流程,梳理涉及的agent或skill,输出一个文档,标出具体的stage、agent/skill名称、用途。 + +让我先回顾上下文(CLAUDE.md要求每次回复前必须做上下文回顾)。 + +## 上下文回顾 + +**本次对话的核心问题**:分析dev-flow version和dev-flow 需求描述两条流程涉及的agent/skill,输出文档说明stage、agent/skill名称、用途。 + +**已识别的缺陷/问题**:暂无(这是第一轮对话) + +**当前处于哪个阶段**:分析任务,需要先探索代码库结构。 + +根据CLAUDE.md规范,这是一个分析任务,我需要: +1. 先实际读取agent/skill内容,不能凭假设(memory: verify-against-actual-agent-content) +2. 不要关注changelog,以当前文件内容为准(memory: analyze-project-ignore-changelog) +3. 多对象分析完整性检查 - 涉及多个agent,需要完整枚举 + +这是一个研究/分析任务,不是实施任务,所以不需要enforce-checklist。但需要全面探索代码库。 + +让我先探索项目结构,理解dev-flow的设计。我应该: +1. 找到dev-flow相关的核心文件 +2. 理解stage定义 +3. 梳理version流程和需求描述流程涉及的agent/skill + +让我并行启动几个探索任务。先看项目结构。 + +实际上,这种跨多文件的探索分析任务,适合用Agent工具委托。但我也可以自己先快速探索关键文件。 + +让我先看dev-flow的核心定义文件。从git status看到有 "dev-flow" 相关的md文件在根目录。让我先探索。 + +我会并行: +1. 找dev-flow.md主文件 +2. 找stage-names.json +3. 列出agents目录 +4. 列出skills目录 + +让我开始。考虑到这是一个需要读跨多文件的分析任务,我可以用Agent委托探索,但我自己先建立全局结构会更准确。让我先并行读取关键索引文件。... + + +## 交互记录 (2026-07-27T09:22:49.104Z) + +**用户**: +[{'tool_use_id': 'call_669d77413543467ca6532cc3', 'type': 'tool_result', 'content': '.claude\\commands\\dev-flow.md'}] + +**AI**: +## 上下文回顾 + +**本次对话的核心问题**:分析 `dev-flow version` 和 `dev-flow 需求描述` 两条流程分别涉及哪些 agent/skill,输出文档说明 stage、agent/skill 名称、用途。 + +**当前阶段**:分析任务,需先探索代码库实际结构(遵循 memory `verify-against-actual-agent-content`:不凭假设标注,以实际文件内容为准;`analyze-project-ignore-changelog`:不看 changelog)。 + +先并行探索关键索引文件,建立全局结构。... + + +## 交互记录 (2026-07-27T09:22:49.540Z) + +**用户**: +[{'tool_use_id': 'call_7a4bcb4b8ee34fcdb86f5e98', 'type': 'tool_result', 'content': '.claude\\config\\dev-flow-checklists\\stage-names.json'}] + +**AI**: +[思考] 现在我有了完整的agent和skill列表。接下来需要读取关键文件: +1. `.claude/commands/dev-flow.md` - dev-flow主入口 +2. `.claude/config/dev-flow-checklists/stage-names.json` - stage定义 + +让我读取这两个核心文件,它们应该能告诉我整个流程的stage设计和agent/skill调用。 + +由于dev-flow.md可能很大,我先读它和stage-names.json。并行读取。... + + +## 交互记录 (2026-07-27T09:22:49.730Z) + +**用户**: +[{'tool_use_id': 'call_aa08ec11801a4230b3b5f76e', 'type': 'tool_result', 'content': '.claude\\agents\\common\\word-generation-module.md\n.claude\\agents\\documentation\\diagram-sync-agent.md\n.claude\\agents\\requirement\\SPLITTING_INTEGRATION_GUIDE.md\n.claude\\agents\\requirement\\_clarification-result-complete-example.md\n.claude\\agents\\requirement\\_clarification-result-enhanced-template.md\n.claude\\agents\\requirement\\_qa-io-identification-interaction-optimization.md\n.claude\\agents\\requirement\\_requirement-splitting-workflow.md\n.claude\\agents\\requirement\\req-template-adapter.md\n.claude\\agents\\requirement\\resources\\gherkin-guide.md\n.claude\\agents\\design\\architecture-reviewer.md\n.claude\\agents\\design\\des-recheck-orchestrator.md\n.claude\\agents\\requirement\\req-recheck-orchestrator.md\n.claude\\agents\\analysis\\project-context-analyzer.md\n.claude\\agents\\requirement\\req-refactor-analyzer.md\n.claude\\agents\\requirement\\req-optimize-analyzer.md\n.claude\\agents\\requirement\\req-fix-bug-analyzer.md\n.claude\\agents\\requirement\\req-type-classifier.md\n.claude\\agents\\requirement\\req-clarification-orchestrator.md\n.claude\\agents\\requirement\\req-enhance-feature-analyzer.md\n.claude\\agents\\requirement\\req-integrate-analyzer.md\n.claude\\agents\\requirement\\req-new-feature-analyzer.md\n.claude\\agents\\development\\claude-code-developer.md\n.claude\\agents\\development\\go-code-review.md\n.claude\\agents\\development\\java-code-review.md\n.claude\\agents\\development\\python-code-review.md\n.claude\\agents\\requirement\\acceptance-criteria-generator.md\n.claude\\agents\\requirement\\competitor-analyzer.md\n.claude\\agents\\requirement\\integrate-security-clarifier.md\n.claude\\agents\\requirement\\version-orchestrator.md\n.claude\\agents\\testing\\test-case-clarification-orchestrator.md\n.claude\\agents\\design\\des-enhance-feature.md\n.claude\\agents\\design\\des-fix-bug.md\n.claude\\agents\\design\\des-integrate.md\n.claude\\agents\\design\\des-new-feature.md\n.claude\\agents\\design\\des-optimize.md\n.claude\\agents\\design\\des-refactor.md\n.claude\\agents\\development\\frontend-code-developer.md\n.claude\\agents\\development\\go-code-developer.md\n.claude\\agents\\development\\java-code-developer.md\n.claude\\agents\\development\\python-code-developer.md\n.claude\\agents\\development\\typescript-code-developer.md\n.claude\\agents\\development\\web-frontend-developer.md\n.claude\\agents\\testing\\functional-test-generator.md'}] + +**AI**: +已获得完整 agent/skill 清单。现在读取 dev-flow 主入口和 stage 定义两个核心文件。... + + +## 交互记录 (2026-07-27T09:22:50.122Z) + +**用户**: +[{'tool_use_id': 'call_d4f15867071947e0a84fa958', 'type': 'tool_result', 'content': '.claude\\skills\\des-doc-validator\\SKILL.md\n.claude\\skills\\diagram-sync\\SKILL.md\n.claude\\skills\\docx\\SKILL.md\n.claude\\skills\\module-design-manager\\SKILL.md\n.claude\\skills\\req-doc-validator\\SKILL.md\n.claude\\skills\\session-persistence-manager\\SKILL.md\n.claude\\skills\\injection-attack-tester\\SKILL.md\n.claude\\skills\\injection-defense-designer\\SKILL.md\n.claude\\skills\\injection-guard-prompter\\SKILL.md\n.claude\\skills\\plugin-trace-collector\\SKILL.md\n.claude\\skills\\api-doc-generator\\SKILL.md\n.claude\\skills\\component-dependency-analyzer-go\\SKILL.md\n.claude\\skills\\component-dependency-analyzer-java\\SKILL.md\n.claude\\skills\\component-dependency-analyzer-python\\SKILL.md\n.claude\\skills\\knowledge-base-builder\\SKILL.md\n.claude\\skills\\module-requirement-manager\\SKILL.md\n.claude\\skills\\project-deployer\\SKILL.md\n.claude\\skills\\shimo-doc\\SKILL.md\n.claude\\skills\\memory-manager\\SKILL.md\n.claude\\skills\\dpms-requirements-sync\\SKILL.md\n.claude\\skills\\dpms-testing-sync\\SKILL.md\n.claude\\skills\\frontend-dynamic-tester\\SKILL.md\n.claude\\skills\\injection-risk-identifier\\SKILL.md\n.claude\\skills\\module-code-manager\\SKILL.md\n.claude\\skills\\module-testing-manager\\SKILL.md\n.claude\\skills\\test-case-document-reviewer\\SKILL.md\n.claude\\skills\\test-code-generator\\SKILL.md\n.claude\\skills\\test-code-reviewer\\SKILL.md\n.claude\\skills\\test-executor\\SKILL.md\n.claude\\skills\\test-report\\SKILL.md\n.claude\\skills\\dpms-design-sync\\SKILL.md\n.claude\\skills\\functional-test-generator\\SKILL.md\n.claude\\skills\\version-change-order-generator\\SKILL.md'}] + +**AI**: +[思考] 这是个大文件,我已读到1058行,还有更多内容。让我继续读dev-flow.md的剩余部分,特别是standalone模式(单需求模式)和stage-hooks部分。 + +让我继续读dev-flow.md剩余内容。同时需要读stage-hooks.md(阶段Agent映射表的核心)和standalone-mode.md(单需求模式)。 + +让我先看dev-flow.md还有多少行,然后并行读取关键文件。 + +实际上,我已经获得了核心信息: +- 两条流程入口: + 1. `/dev-flow version` → 版本轨(版本模式) + 2. `/dev-flow <需求描述>` → 单需求轨(standalone模式) +- STAGE_ORDER: 21个阶段(0,1,1.1,1.2,1.6,2,2.1,2.2,3,3.1,3.2,3.5,4,5,5.5,6,6.1,7,8,9,10) + +现在我需要知道每个stage对应哪个agent/skill。这需要读stage-hooks.md。还需要读standalone-mode.md了解单需求模式。 + +让我并行读取: +1. dev-flow.md 剩余部分(1058行之后) +2. stage-hooks.md +3. standalone-mode.md +4. start-development.md(启动版本需求) + +先找这些文件的位置。stage-hooks和standalone-mode、start-development应该都在dev-flow-checklists目录。... + + +## 交互记录 (2026-07-27T09:22:56.954Z) + +**用户**: +[{'tool_use_id': 'call_c5ccb7048e3e45a0a33a10af', 'type': 'tool_result', 'content': '1\t---\n2\tname: dev-flow\n3\ttype: command\n4\tdescription: 开发工作流编排命令,启动完整的开发工作流,从需求分析到测试报告生成,支持版本粒度管理\n5\tversion: 4.9\n6\tauthor: DevSyncAgent Team\n7\tlast_updated: 2026-07-21\n8\tchangelog:\n9\t v4.9 - 2026-07-23\n10\t - 🆕 阶段3 S6:多git编排(多项目多仓库,S12纵向增量)。核心:工作目录模型从单一pwd扩展为多仓库localPath映射。4处新增交互:G1第3.8轮"是否多git"询问+G2每子系统git仓库收集(SSH+localPath)+G3 Stage4需求级跨仓库提交确认+G4 complete-version版本级跨仓库归档确认。数据模型:versions.json contextSchemaVersion 2.0→2.1+isMultiGit+subsystems[].gitUrl/localPath+repositories[]去重仓库列表+requirements[].repositoryId+migrate_v2_to_v2_1向后兼容。8改动点:dev-flow第3.8轮+create-version schema+Stage4需求级跨仓库提交(H1修正:用req.repositoryId非遍历所有仓库)+步骤11版本级跨仓库归档+A6 gitUrl用sub.gitUrl+阶段Prompt【代码工作目录】注入localPath+context.md加repositoryId+add-story仓库归属+context-contract字段。H1修正(Stage4需求级vs步骤11版本级层次)。5决策点(G-D1工作目录模型/G-D2 Stage3 Agent非pwd工作/G-D3跨仓库原子性PendingItem/G-D4每仓库分支/G-D5多project-context)。P5单分支在多git下自然延伸为每仓库一分支(不同仓库同名分支不冲突)。E7技术栈多git下变真实(G-D5多project-context处理)\n11\t - ⚠️ 版本号天花板约束:保持 v4.9(天花板=4.9),仅追加 changelog 条目\n12\t v4.9 - 2026-07-21\n13\t - 🆕 阶段2 S11:形态B×多子系统整合(最终目标1)。真实整合点2个+交互强化2个(v1.5反附和:6整合点经源码核验4虚假排除):①E6 Stage5部署确认pipelineId从版本级入口单值改为reqSubsystemId反查(第1阶段遗漏补全,与B7 fixBug同模式);②E4 Stage9失败回滚与段屏障交互(阶段0遗留):D1 execute_segments增加pending_reqs跳过已完成段(支持resume:已完成段跳过/bugfix从P1)+D2 Stage9失败分支改blocked+退出+bugfix子需求纳入(原execute_rollback破坏段屏障)+V段屏障判定含completed/skipped/blocked三态+blocked需求不参与V段版本级回归+wait_segment_barrier含blocked+execute_serial_segment感知D段blocked跳出;③交互强化1 execute_segments提前退出(Stage9失败blocked)的用户引导(AskUserQuestion继续开发/返回主菜单);④交互强化2 继续版本开发步骤5适配形态B段调度(阶段0遗漏补全:原"按STAGE_ORDER逐阶段"改调execute_segments统一编排)。execute_segments增加返回值(completed/exited_with_blocked)。不碰数据模型(第1阶段已处理多子系统)。v1.5循环体改造按强制清单:全分支扫描+残留变量扫描+一次收敛\n14\t - ⚠️ 版本号天花板约束:保持 v4.9(天花板=4.9),仅追加 changelog 条目\n15\t v4.9 - 2026-07-21\n16\t - 🆕 阶段1 S5:多子系统支持落地(S11/S12最终目标的纵向基础)。核心设计:入口子系统(其版本号=版本计划版本号,版本级保留单值subsystemId/subsystemName/subsystemVersionId/branchName/pipelineId/pipelineVersion供"版本计划版本号语义"下游兼容)+ subsystems[]数组(每子系统独立versionId/pipelineId,isEntry标识)+ requirements[].reqSubsystemId需求归属。dev-flow.md 第3.5轮新增"是否多子系统"询问+第4轮单选改多选+入口+第1.5轮循环多版本号+状态表加subsystems[]清单;create-version.md A2b循环多子系统(非阻塞)/6.5单分支(所有子系统共享,P5修正)/6.6多流水线/subsystems[]+入口单值schema;complete-version.md A6循环多子系统封板(入口优先);start-development.md context.md加reqSubsystemId+add-story归属;functional-test-generator(Agent+SKILL两处)子系统来源反查versions.json(顺带修既有project-context错误);business_api.go Version/Task struct加Subsystems[]/EntrySubsystemID/SubsystemID;version-change-order-generator第一章遍历subsystems[]多行(P1修正);stage-hooks.md B7 fixBug反查reqSubsystemId(H1修正:Bug关联到实际所在子系统版本非入口);associate-requirement.md A4-2按reqSubsystemId分组(H2修正:需求关联到各自子系统版本非入口统一);contextSchemaVersion 1.0→2.0+migrate_v1_to_v2向后兼容。D11红利诚实界定:仅"版本计划版本号语义"成立,P1/H1/H2下游必改。3轮检视修正:缺口G(reqSubsystemId)+H1/H2红利误判+P5多分支架构错误(单项目单git不可多分支)\n17\t - ⚠️ 版本号天花板约束:保持 v4.9(天花板=4.9),仅追加 changelog 条目\n18\t v4.9 - 2026-07-21\n19\t - 🆕 阶段0 spike:形态B分阶段交错并行编排落地(S11/S12最终目标的并行基础)。start-development.md 步骤E 从"逐需求串行A-E全流程"重构为 SEGMENT_ORDER 段调度(P1/S1/P2/S2/D/V 6段,段间屏障同步);stage-hooks.md 新增"形态B分段交错编排"章节含 SEGMENTS 定义+7个段调度函数(execute_segments/execute_parallel_segment/execute_serial_segment/wait_segment_barrier/batch_ask_recheck_optimization/update_segment_progress/migrate_add_segment_progress)+commit_stage_transition 签名不变+flush_commit_queue(方案C:并行段N需求并发生成文档、结果入局部stage_results_queue、主会话串行commit规避并发写versions.json,现有调用100%兼容);dev-flow-context-contract.json allowed_context_updates 新增 segmentProgress;dev-flow.md 继续版本开发恢复逻辑适配 segmentProgress 优先定位。形态B核心规则:改源码段(S1/S2/V)串行、文档段(P1/P2/D)并行(21阶段二分已源码验证:Stage6文档✅/Stage7代码❌/Stage3.2改码❌/Stage3.5改插件❌)。v4.0废弃教训规避:主会话掌段间屏障+commit、subagent只跑单阶段(不重蹈subagent独立编排丢子阶段覆辙)。阶段0限定happy path(Stage9一次通过),Stage9失败回滚与段屏障交互待阶段2 S11实现\n20\t - ⚠️ 版本号天花板约束:保持 v4.9(天花板=4.9),仅追加 changelog 条目\n21\t v4.9 - 2026-07-21\n22\t - 🐛 修复 636c1008 hide 提交不彻底:dev-flow.md "### 生成变更单""### 回滚到指定阶段"章节本体保留但无隐藏标注,机器人模式 LLM 读完整 dev-flow.md 生成菜单时误将其当主菜单项→出现 8 项菜单(含变更单/回滚入口)。修复:两章节标题加"⛔已从主菜单隐藏"标注 + 章节开头加明确禁止列入主菜单的约束说明;STARTED 段补"主菜单仅以下6项,禁止把后续章节当菜单项"双保险。能力保留不变(变更单 skill 手动渠道、回滚 execute_rollback 内部调用)\n23\t - ⚠️ 版本号天花板约束:保持 v4.9(天花板=4.9),仅追加 changelog 条目\n24\t v4.9 - 2026-07-20\n25\t - 🐛 修复创建版本灰度发布场景双重缺口:①收集侧 dev-flow.md 第4轮补"灰度发布日期"询问(选"是"后追加,含 YYYY-MM-DD 格式校验+版本周期范围校验,IF/ELSE双分支同步);②传递侧 create-version.md A2b 补全 MCP 必填 isNeedGrayRelease 与条件必填 expectGrayReleaseDate(对齐 dpms-requirements-sync SKILL.md:418-472 权威定义);versions.json + version-context.md 新增 isNeedGrayRelease/grayReleaseDate 字段持久化\n26\t - ⚠️ 版本号天花板约束:保持 v4.9(天花板=4.9),仅追加 changelog 条目\n27\t v4.9 - 2026-07-20\n28\t - 🐛 修复 Stage 10 版本级回归用例状态流转缺失:新增 10.6.1 子步骤,test_passed 时将版本级回归用例流转为通过(status=3),对齐 Stage 7 B7.5 语义;复用 stage-hooks.md HTTP POST 容错模式;新增 .regression-case-cache.json transitionedAt 幂等标记\n29\t - 🐛 修复 Stage 10.3 product_name 无空值兜底:对齐 Stage6-Hook B5,productName 为空时优先取 requirements[].productName,降级用 storyId 调 get-storys 实时查询回填\n30\t - 🔧 Stage 10.3 safe_call_mcp 调用补 task_name 参数(addTestCase/linkTestCaseToTestPlan)\n31\t - ⚠️ 已知未修:safe_call_mcp 业务错误分支不写 pending(P1-3,通用包装器缺陷,影响所有 Hook,需独立方案评估)\n32\t - ⚠️ 版本号天花板约束:保持 v4.9(天花板=4.9),仅追加 changelog 条目\n33\t v4.9 - 2026-07-17\n34\t - 🔁 Stage 9 循环决策改为可配置:新增独立 `loop_decision.mode=auto|ask`,标准/质量模板默认询问,极简模板保持自动;不再复用仅控制阶段进入确认的 `non_skippable.9`\n35\t - ⏸️ `ask` 模式检测到测试失败时通过 AskUserQuestion 询问“进入下一轮修复/暂停保留现场”;暂停保持 currentStage=9 且不完成 Stage 9,恢复后重新询问\n36\t - 🧩 交互模板与运行时配置 schema 升至1.1;兼容1.0旧配置,无配置/解析失败/非法值安全回退为询问\n37\t - 🧭 版本全流程上下文传递优化:新增 `.claude/config/dev-flow-context-contract.json`,为 21 个阶段定义 consume/produce 白名单与统一 stage result 协议\n38\t - 🔄 新增版本级 `version-context.md` + 需求级 `context.md` 双层上下文;阶段 Prompt 每次实时刷新版本快照、上一阶段摘要、产物索引、决策与风险\n39\t - 🛡️ 新增两阶段 checkpoint:所有完成/跳过/自动跳过/降级分支统一提交 stageOutputs + stageHistory,修复提前 CONTINUE 导致上下文和进度未传递\n40\t - ♻️ resume 改为 checkpointId/state 恢复,废弃“只比较 stageHistory 长度”的模糊覆盖;Stage 10/complete-version 消费版本聚合上下文\n41\t - 🔧 `stage-names.json` v1.1 补齐 Stage 10,确保 STAGE_ORDER、中文映射与上下文契约均为21阶段\n42\t - ⛔ Claude Code 边界:Stage 4 和版本归档显式排除根目录 `.agents/`,禁止 `git add .`/`git add -A`\n43\t - 🛡️ 版本全流程进度一致性修复:在原 currentStage 双写基础上升级为 checkpointId/checkpointState 对账,避免仅按 stageHistory 长度推断权威状态\n44\t - 🔗 配套修改:stage-hooks.md 步骤1 改为双写一致(versions.json + context.md currentStage 同步写入)、business_api.go 后端聚合 version 状态、message_dispatcher.py create_task stage 恢复非空、task-viewer 前端 STAGE_PIPELINE 补 key + 启动中显示\n45\t - ⚠️ 版本号天花板约束:保持 v4.9(天花板=4.9),仅追加 changelog 条目\n46\t v4.9 - 2026-07-14(天花板回退至4.9,原 v4.11/v4.10 changelog 合并)\n47\t - 🔄 6.5.1(关联子系统版本到Git分支)从创建版本后移至完成版本封板前:complete-version 新增 A6-Step0(封板前置),封板时先关联分支再封板\n48\t - 🔄 create-version 6.6(更新PACE流水线)解除与 6.5.1 的 v4.9 原子绑定,改为独立步骤(6.6 必须留创建版本以保障开发期 Stage3.5/Stage5/CI-CD 的 pipelineId 依赖)\n49\t - 🗑️ 删除 dev-flow.md 待补录重试中 6.5.1->6.6 联动块(二者不再原子,各自独立重试)\n50\t - ⚠️ 代价:拆开原子绑定后,开发期存在"流水线已指向分支但分支未在SCM关联"的窗口期,直到封板补关联(CI-CD不受影响)\n51\t - 🔗 配套修改:create-version.md(6.6独立+跳过规则+schema注释+验证清单)、complete-version.md(步骤3.5+跳过PendingItem+验证清单)\n52\t - 🔧 Stage1-Hook(B1) content 从全文 Markdown->HTML 转换改为四章节关键信息提取:按「需求背景/需求描述与设计/后台技术设计/测试关注点」四章节从需求文档语义提取(LLM 提取,容忍标题变体),固化 HTML 模板组装(只用

/

/