feat: 通用评审生态位 — 产出普通代码级问题 (generalFindings)#13
Merged
Conversation
…eralFindings) Architecture findings are BanGD's differentiator, but emitting only those cedes ordinary bugs (off-by-one, swallowed errors, nil deref, races) to Copilot. Add a second result class, generalFindings: concrete diff-evidenced correctness/logic defects, lightweight (no four-段式), filed inline in the PR comment (not as tracked issues). - schema: GeneralFindingSchema + generalFindings (.default([]) for graceful degradation), kept in sync with the tool JSON schema by a test - prompt/system-prompt: 4th output part + quality red-lines (diff-evidenced only, no style nits, no dup of architecture findings, <=6, [] when none) - verify: generalize VerifyOutcome<T>/verifyItems<T>; verifyGeneralFindings runs the SAME adversarial majority-refute pass (refuter prompt reframed to "is this a real correctness defect") - review: verify both finding kinds in parallel; ReviewOutcome.droppedGeneralFindings - format: render general findings inline; omit the section when empty - action(.yml): general_finding_count output; dropped count covers both kinds - DESIGN.md §七: why both classes coexist, structural/delivery differences - tests: rendering, verification, schema-sync, default-omit coverage Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR #13 shipped the generalFindings niche described in the system prompt but with no worked example, while every architecture dimension has one. A wrong-or- absent few-shot is the single biggest quality lever per CLAUDE.md, so add the missing exemplar. - prompts/examples/general-findings.md: a worked example (binary-search off-by- one that infinite-loops) showing the 7-field generalFinding shape AND, just as important, the red-line — what NOT to report (style/naming nits, "add a test", unfounded speculation, dup of an architecture finding), plus the boundary vs architecture findings. - prompt.ts: assembleSystemPrompt takes an always-on generalExample, appended in its own block regardless of selected dimensions (generalFindings is requested on every review). Architecture examples relabeled "架构级 Few-shot 范例". - prompts.ts: PromptTexts.generalExample, loaded unconditionally (not dimension- gated); lives in the prompt-cached system block so marginal token cost ~= nil. - DESIGN.md §七: note the niche now ships with its own few-shot (parity with the per-dimension architecture examples). - tests: new prompt.test.ts (assembleSystemPrompt always-on behavior + user prompt parts); prompts.test.ts loads + red-line check; review.test.ts asserts the exemplar is present regardless of dimension selection. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced May 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
架构级
findings是 BanGD 的差异化价值,但只产出架构级问题会留下缺口:任何称职通用评审者都会指出的普通 bug(分支写反、off-by-one、空指针、吞错、资源泄漏、明显竞态)如果 BanGD 不报,就把这块生态位让给了 Copilot。本 PR 让一次评审同时产出第二类结果
generalFindings——普通代码级问题——在占住通用生态位的同时,保住垂类架构深度。设计(与架构级刻意区分,详见 DESIGN.md §七)
file/line/severity/category/title/description/suggestion,不走四段式——指出位置 + 普通修法即可。[]。目的是不让 BanGD 沦为嘈杂的通用 linter。verifyGeneralFindings复用多反驳者、严格多数否决的同一套验证(反驳提示词改为"是否真实正确性缺陷")。generalFindings在 schema 里.default([]),模型遗漏字段不致整条评审解析失败。改动
schema.ts:GeneralFindingSchema+generalFindings+ JSON schema 同步(测试守护)prompt.ts/system-prompt.md:产出第 4 部分 + 质量红线verify.ts:泛型化VerifyOutcome<T>/verifyItems<T>,新增verifyGeneralFindingsreview.ts:两类 finding 并行验证,ReviewOutcome.droppedGeneralFindingsformat.ts:普通问题内联渲染,无则省略整节action.ts/action.yml:general_finding_count输出,dropped 计数合并两类DESIGN.md:§一表格 + 新增 §七验证
typecheck / lint 通过;
npm test82 passed;Action bundle 已重打 (dist/)。已知后续(非本 PR 范围)
generalFindings目前零样本——尚无 few-shot 范例(架构维度每个都有)。这是最高杠杆的后续补强。🤖 Generated with Claude Code