Skip to content

fix(test/requirement-review): 杜绝 review_mode 写出 single_agent_serial 等非法值#58

Closed
Jun-Hex wants to merge 1 commit intomainfrom
fix/rr-summary-review-mode-text
Closed

fix(test/requirement-review): 杜绝 review_mode 写出 single_agent_serial 等非法值#58
Jun-Hex wants to merge 1 commit intomainfrom
fix/rr-summary-review-mode-text

Conversation

@Jun-Hex
Copy link
Copy Markdown
Collaborator

@Jun-Hex Jun-Hex commented Apr 29, 2026

Problem

requirement-review skill 的 PHASES.md 5.2 chat 输出文案使用 "单 Agent 串行",与 contracts/rr-summary.schema.jsonreview_mode enum ['multi_perspective', 'single_agent'] 不一致。AI 在写 rr_summary.json 时会直译"串行" → serial,拼出非法值 single_agent_serial,触发 schema 校验违规。

实测案例(ai-case 平台 session 248):

WARNING  post_complete schema 违规: file=rr_summary.json,
         path=['review_mode'],
         error='single_agent_serial' is not one of ['multi_perspective', 'single_agent']

verdict / issue_count 等核心字段均正常,仅 review_mode 被污染,会一直进 output_data._schema_violations 让前端 banner 显示违规数。

Fix

  1. PHASES.md line 373 5.2 chat 输出模板:单 Agent 串行单 Agent,与 enum 对齐
  2. PHASES.md line 357 5.1.5 约束清单:补一条 review_mode 强制约束(与 verdict / 字段名黑名单同样的写法),明确禁止 single_agent_serial / serial 等变体

不动 line 195 / 216 / 218 那些"流程方法"描述("4.1b 单 Agent 串行评审"作为章节名是合理的),AI 不会把章节名当 enum 值。

测试

下游 ai-case 仓库会 bump submodule version 引用本 PR 合并后的 commit。

PHASES.md 5.2 chat 输出文案 '单 Agent 串行' 与 schema enum
['multi_perspective', 'single_agent'] 不一致,AI 在写
rr_summary.json 时直译 '串行' → 'serial' 拼出 single_agent_serial,
触发 contracts/rr-summary.schema.json 校验违规(非阻断但污染
output_data._schema_violations)。

修复:
1. 5.2 文案从 '单 Agent 串行' 改为 '单 Agent'(与 enum 对齐)
2. 5.1.5 约束清单补一条 review_mode 枚举说明 + 黑名单
   single_agent_serial/serial 变体,与 verdict 同样的强制写法

实测案例:ai-case session 248 完成时触发该违规,verdict + 49
issues 均正常,仅 review_mode 字段被污染。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Jun-Hex Jun-Hex requested a review from em0t as a code owner April 29, 2026 06:56
@github-actions github-actions Bot added scope:plugins Changes one or more plugins. kind:fix Fixes a bug or regression. size:xs Tiny PR, usually quick to review. labels Apr 29, 2026
@Jun-Hex
Copy link
Copy Markdown
Collaborator Author

Jun-Hex commented Apr 29, 2026

本 PR 内容已通过 cherry-pick 合并到 PR #59 (commit 32eb7f1)。

#59 已包含本 PR 的全部修改 + 4 大 workflow 报告可读性优化。请在 #59 一并 review。

关闭本 PR 避免重复 review。

@Jun-Hex Jun-Hex closed this Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:fix Fixes a bug or regression. scope:plugins Changes one or more plugins. size:xs Tiny PR, usually quick to review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant