feat(review): add tiered feedback with warning level#62
Conversation
…nd pass-level inputs Closes #61 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
可合并简短总结:改动整体质量良好,引入了三级反馈机制(阻塞项/警告项/建议项)、 阻塞项:无建议项
|
|
发现遗漏 总结PR 在 prompt 层面实现了三级反馈、JSON schema 注入和 pass-level 提示词追加,但与下游处理管线的集成缺失,导致两个核心功能实际上不可用。 CRITICAL
建议:在 run-github-opencode.py 或 run-opencode.sh 中增加 post-processing 步骤:当 output-format 为 json 时,解析模型输出的 JSON,提取 decision 作为首行,或将整个 JSON 结构化为 CLI 可处理的格式。同时需要将 MEDIUM
建议:有两种可能的修复方向:(a) 在 action 侧增加对 opencode CLI 输出首行的解析,根据 LOW
建议:当两者同时启用时,将 |
…pass-level downstream integration - Fix YAML syntax error in review/action.yml where multi-line strings in json_suffix and standard_suffix broke the run: | block scalar due to zero-indent lines causing 'Mapping values are not allowed' error - Add input validation for output-format (text|json) and pass-level (strict|standard) with warning on invalid values - Add JSON output post-processing in run-github-opencode.py: extract decision from JSON model output and map to correct exit code - Add pass-level exit code mapping: standard treats 有条件合并 as passing (exit 0), strict treats it as failing (exit 1) - Merge json+standard prompt suffixes to avoid contradictory instructions
|
可合并 总结PR 实现了三级反馈(阻塞项/警告项/建议项)、 阻塞项:无建议项
|
|
无遗漏 总结Issue #61 中描述的所有功能均已完整实现,无遗漏。 Spec 覆盖情况对照
关于先前 Review 中的问题先前 review 评论(2026-05-12T23:59:41Z)指出 |
- Use json.JSONDecoder().raw_decode() instead of manual brace counting for robust JSON parsing (handles braces inside strings) - Extract _run_subprocess and _build_cmd helpers to reduce duplication in run_single and run_model - Remove excess indentation from json_suffix heredoc to reduce token consumption in LLM prompts - Use startswith for text mode decision extraction to handle trailing punctuation from LLM output
|
可合并 代码实现了三级反馈机制、 阻塞项:无 建议项:
|
|
现已获取完整的 spec(Issue #61)和 PR diff。让我仔细比对。 无遗漏 总结:Issue #61 中描述的全部功能均已在 PR 中完整实现,无遗漏项。 Spec 功能覆盖对照:
所有逻辑链路完整:action.yml 输入定义 → 环境变量 → shell 校验/ prompt 构造 → Python 输出解析 → 退出码决策。 |
…rror The json_suffix and standard_suffix multiline strings had content at column 0, which broke the YAML literal block scalar indentation rules. Added proper indentation so the YAML parser correctly includes them in the run block.
|
无遗漏 总结:Issue #61 中描述的所有功能均已完整实现,无遗漏项。 Spec 覆盖情况对照:
所有逻辑链路完整:action.yml input 定义 → 环境变量 → shell 校验/ prompt 构造 → Python 输出解析 → 退出码决策。 |
|
可合并 改动完整实现了三级反馈(阻塞项/警告项/建议项)、 阻塞项:无 建议项:
|
…_decision robustness, examples fork ref
- Change JSON schema decision enum from pipe-delimited string
("可合并|有条件合并|不可合并") to natural language
("可合并" or "有条件合并" or "不可合并") for better LLM comprehension
- Add json.loads() fast-path in extract_decision() before falling back
to incremental raw_decode scanning for improved robustness
- Fix examples/opencode-review.yml to reference sun-praise/opencode-actions
instead of personal fork
|
无遗漏 Spec 覆盖情况对照: Issue #61 中描述的全部功能均已实现。
所有逻辑链路完整:input 定义 → 环境变量 → shell 校验/prompt 构造 → Python 输出解析 → 退出码决策。JSON+standard 同时启用时使用 |
…ecision key When json.loads successfully parses JSON but the resulting dict lacks a 'decision' key, return empty string immediately instead of falling through to the manual decoder which would re-parse the same text.
|
可合并 改动实现了三级反馈(阻塞项/警告项/建议项)、 阻塞项:无 建议项:
|
|
无遗漏 所有 spec 要求均已实现:
完整链路:input 定义 → env → shell 校验/prompt 构造 → Python 输出解析 → 退出码决策,所有 spec 功能均已覆盖。 |
|
可合并 审查总结PR 实现了三级反馈机制(阻塞项/警告项/建议项)、 阻塞项:无建议项
以上均为非阻塞的改进建议,不影响功能正确性和向后兼容性。 |
Addresses medium-severity review feedback: adds TestExtractDecision class covering pure JSON, markdown fence, surrounding text, invalid JSON, missing decision field, array input, and text format decision extraction.
|
无遗漏 Issue #61 中描述的所有功能均已完整实现。以下是对照:
完整链路:input 定义 → env 导出 → shell 校验/prompt 构造(含 |
|
I fetched the PR branch diff, reviewed all changed files (action.yml, run-github-opencode.py, test files, example), and verified the logic flow for both JSON and text output paths and the pass-level exit code handling. |
…comment, whitespace test
- Replace ["item", ...] with [{...}, ...] in JSON schema examples to
match actual structured output contract (review/action.yml:292,298)
- Add comment explaining json.loads fast path fallback design intent
- Add test case for json.loads fast path with whitespace-surrounded JSON
|
无遗漏 Issue #61 中描述的所有功能均已完整实现,无遗漏项。以下为 spec 覆盖对照:
完整链路:input 定义 → env 导出 → shell 校验/prompt 构造( |
|
可合并 改动实现了三级反馈(阻塞项/警告项/建议项)、 阻塞项:无 建议项:
|
…validate decision
- Replace {...} JSON schema placeholders with explicit field definitions
(file, line, description, severity, suggested_fix) to guide LLM output
- Deduplicate JSON schema by extracting shared schema string into variable
- Validate extract_decision returns only recognized decision values,
returning empty string for unknown values
- Add test case for unknown JSON decision value
|
无遗漏 Issue #61 中描述的全部功能均已完整实现,无遗漏项。 Spec 覆盖对照:
完整链路:action.yml input 定义 → env 导出 → shell 校验 + prompt 构造( |
|
可合并 总结PR 完整实现了三级反馈机制(阻塞项/警告项/建议项)、 阻塞项:无 建议项:
|


















Summary
Closes #61
output-formatinput (text|json, defaulttext) to control review output formatpass-levelinput (strict|standard, defaultstrict) to control pass thresholdoutput-format: text,pass-level: strict) is backward compatible — existing users can upgrade without changesoutput-format: json, prompt is appended with JSON schema overridepass-level: standard, prompt notes that 有条件合并 is considered passingTest plan
output-format: jsonproduces valid JSON with correct schemapass-level: standardincludes standard note in prompt🤖 Generated with Claude Code