Improve bot finding extraction - #47
Conversation
e8c5936 to
2380182
Compare
2380182 to
da40ead
Compare
| _SUB_RE = re.compile(r"<sub\b[^>]*>.*?</sub>", re.DOTALL | re.IGNORECASE) | ||
| _PROMO_FOOTER_HINTS = ( | ||
| "if you found this review helpful", | ||
| "coderabbit", |
There was a problem hiding this comment.
i get what this is trying to do, but putting a specific bot name may be too targeted. and if they change format in the future, it would be affected
| _DETAILS_RE = re.compile(r"<details\b[^>]*>.*?</details>", re.DOTALL | re.IGNORECASE) | ||
| _SUB_RE = re.compile(r"<sub\b[^>]*>.*?</sub>", re.DOTALL | re.IGNORECASE) |
There was a problem hiding this comment.
i'd prefer not to strip <details> and <sub> blocks. some bots may put actual review content inside <details>, and we can't guarantee every bot only uses these tags for boilerplate. the extraction prompt already instructs the LLM to skip summaries and configuration, so the redundancy is handled there too. the <!-- --> stripping is fine.
|
Thanks, agreed. I pushed a follow-up that removes the bot-specific footer heuristic and no longer strips visible Markdown like |
Summary
This PR tightens the bot-comment extraction step so it extracts concrete code-review findings, not only comments phrased as explicit imperative suggestions.
The change is intentionally limited to extraction input/prompting:
REVIEW_BODY,INLINE_REVIEW_COMMENT, orISSUE_COMMENT.<!-- ... -->, collapsed<details>,<sub>metadata, and generated footers).Why
The current extractor is framed around "actionable suggestions." In real review comments, a reviewer may clearly flag a defect or risk without writing it as "change X to Y." Those comments should still count as findings: if the later PR changes address the flagged issue, the benchmark should be able to match that review finding to the fix.
This is a measurement-correctness issue rather than a reviewer-specific rule. It affects comment styles differently: reviewers whose comments already look like explicit suggestions are easier for the current prompt to extract, while issue-first or risk-first comments can be under-extracted.
Each part of this extraction shape supports that same measurement goal:
COMMENT C1,COMMENT C2, ... boundaries make it easier for the model to scan every review round and reduce accidental skipping when a PR has many comments.INLINE_REVIEW_COMMENT,REVIEW_BODY, andISSUE_COMMENTgive neutral structure that reflects GitHub source data. Inline review comments are especially likely to contain code-review findings, while review bodies and issue comments can contain summaries or additional findings.configuration used, rather than broad common words. That keeps known generated footer cleanup while preserving real findings that mention something being configured incorrectly.Local Evidence
The table below lists concrete examples from a local paired run for
2026-06-29 <= bot_reviewed_at < 2026-07-06. In each case, the revised extraction shape included a substantive review finding that the production extraction left out.Together, these examples show the intended measurement improvement: the extractor more reliably reads substantive issue-first comments across inline comments and later review rounds.
What This Does Not Change
Validation
uv run pytest tests/test_analyze_formatting.pyuv run python -m compileall llm/prompts.py llm/schemas.py pipeline/analyze.py tests/test_analyze_formatting.py