Skip to content

fix(code-review): group council findings by line instead of lossy dedup#4620

Open
St0rmz1 wants to merge 1 commit into
mainfrom
fix/council-finding-fidelity
Open

fix(code-review): group council findings by line instead of lossy dedup#4620
St0rmz1 wants to merge 1 commit into
mainfrom
fix/council-finding-fidelity

Conversation

@St0rmz1

@St0rmz1 St0rmz1 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

The Code Reviewer Council coordinator was told to "merge duplicate findings that
land on the same file and line." When two specialists flagged the same line for
different reasons (for example a security issue and a logic error), that
instruction collapsed them into one and could drop a finding or lower its
severity. This changes the instruction to group by line instead of dedup: one
inline comment per line that lists each specialist's finding, keeps the highest
severity, and drops nothing.

Changes

  • Coordinator prompt (council-prompt.ts): replace the "merge duplicate
    findings on the same file and line" step with a grouping step. Findings that
    share a file:line are posted as one inline comment that lists each
    specialist separately (name, severity, rationale), the header severity is the
    highest in the group (no downgrade), findings on different lines stay separate
    comments, and no finding is discarded.
  • Council Review section (code-review-council.ts): add a note under the
    per-specialist table explaining that findings are counted per specialist and
    same-line findings are grouped into one comment, so the raw total reads higher
    than the inline-comment count by design.
  • Tests for both (council-prompt.test.ts, code-review-council.test.ts).

Verification

Ran a council review against a test pull request with intentional issues in
provider mode and confirmed on the posted comments:

  • A line flagged by two different specialists (a security issue and a
    correctness issue on the same line) produced one inline comment listing
    both, neither dropped, header severity critical.
  • A line with four findings of mixed severity produced one comment listing
    all four, header severity critical (the max), not downgraded.
  • The council table note renders and the counts reconcile (raw
    per-specialist total vs the grouped inline-comment count).

Visual Changes

N/A (no application UI). The change affects the content of the posted PR inline
comments and the council summary note.

Reviewer Notes

  • This fixes the behavior at the prompt level, so the coordinator still formats
    the posted comments. It is no longer lossy (nothing dropped, severity
    preserved), but still formatted by the model. A fully code-owned version
    (code posts the grouped inline comments itself) is a possible follow-up.
  • Focus area: the grouping instruction in buildCouncilOrchestratorPrompt
    (council-prompt.ts), specifically that it replaces dedup with
    group-and-list and mandates max severity with no dropped findings.

@kilo-code-bot

kilo-code-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

This PR only changes coordinator prompt text (grouping same-line council findings instead of lossy dedup) and an accompanying summary-table note, with matching test coverage; no logic, security, or correctness issues found in the changed lines.

Files Reviewed (4 files)
  • apps/web/src/lib/code-reviews/prompts/council-prompt.ts
  • apps/web/src/lib/code-reviews/prompts/council-prompt.test.ts
  • packages/worker-utils/src/code-review-council.ts
  • packages/worker-utils/src/code-review-council.test.ts

Reviewed by claude-sonnet-5 · Input: 20 · Output: 3.3K · Cached: 402.1K

Review guidance: REVIEW.md from base branch main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant