When the review agent produces an agent-result.json where the body
says "No findings" but the action is request-changes and the findings
array contains critical or high severity items, the sticky comment
would mislead reviewers into thinking the review was clean.
Add ensureBodyFindingsConsistency() which runs after parsing the
review result. It detects the contradiction (body contains "No
findings", action maps to REQUEST_CHANGES, and critical/high findings
exist) and replaces the "No findings" text with a bullet-point
summary of the significant findings. The function is conservative:
it only triggers when all three conditions are met, leaving approve,
comment, and lower-severity-only scenarios untouched.
Nine test cases cover: basic patching, multiple findings with
filtering of low-severity items, no-op for accurate bodies, no-op
for approve/comment actions, no-op for empty findings, nil safety,
findings without file locations, and the reject action alias.
Note: pre-commit could not run due to Go module cache permission
errors in the sandbox (infrastructure issue, not code issue).
Closes #2054
When the review agent produces an agent-result.json where the body says "No findings" but the action is request-changes and the findings array contains critical or high severity items, the sticky comment would mislead reviewers into thinking the review was clean.
Add ensureBodyFindingsConsistency() which runs after parsing the review result. It detects the contradiction (body contains "No findings", action maps to REQUEST_CHANGES, and critical/high findings exist) and replaces the "No findings" text with a bullet-point summary of the significant findings. The function is conservative: it only triggers when all three conditions are met, leaving approve, comment, and lower-severity-only scenarios untouched.
Nine test cases cover: basic patching, multiple findings with filtering of low-severity items, no-op for accurate bodies, no-op for approve/comment actions, no-op for empty findings, nil safety, findings without file locations, and the reject action alias.
Note: pre-commit could not run due to Go module cache permission errors in the sandbox (infrastructure issue, not code issue).
Closes #2054
Post-script verification
agent/2054-review-summary-consistency)0433cbeba7695157165aadefe6c9d8d587eeba88..HEAD)