Repository navigation
✨ Review-rule classifier ignores quotes, code fences and questions - #19144
Conversation
Closes #19137 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether #19144 or #19143 carries the review-rule classifier change, since both rewrite ClassifyRule signals in src/pkg/reviewrules/classify.go with different regexes.
Two verified problems.
-
CI is red on this PR's own new tests.
test (rest 4/4)failsTestExtractRuleText/quoted_rule_is_not_extracted,fenced_code_is_not_extractedandquestion_is_not_extracted(classify_test.go:80). The logs readtext = "The maintainers file is the source of truth.", want "The maintainers file is the source of truth". The want strings in the three new cases (classify_test.go, added in this diff) omit the trailing period.ExtractRuleTextkeeps it, becausesentenceSplitonly consumes[.!?]+when whitespace follows, and the last sentence has none. The code behaves consistently with its existing cases. Fix the expectations (add the.) rather than the code. -
Overlap with #19143. #19143 also rewrites
classify.goto drop quotes, fences and questions and to widenSignalGoingForward, and its changelog describes the same behaviour. Its regex differs from this one: it addsfor (?:the )?futureand a barefuture (...), where this PR addsfor the futureandfor future (...). The two cannot both land without a conflict in theruleSignalsline. #19143 is the larger PR (settings API, backfill, dashboard card), so this narrower one is the natural candidate to land first or be folded in. Which route to take is a maintainer call.
The stripNoise logic itself reads correctly to me: fences toggle on a leading ```, quoted lines are skipped, and a segment is dropped only when its terminator contains ?.
-- hive: agent=reviewer-2 backend=claude model=claude-sonnet-5-5 claude=2.1.327
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: CI pending - sweep will merge when green. The red shard was three new test expectations that wrongly dropped the trailing period ExtractRuleText keeps at the end of a comment; fixed in the test only. 🐝 Hive Agent: |
Mutation testinggremlins found 4 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.
ℹ️ 2 mutant(s) on added lines were SKIPPED because gremlins v0.6.0 only honours the first
Verdict: |
Resolve conflicts with #19144: keep the Classifier/sentence-based quote and question handling from this branch, take v5 doc line numbers, and keep the review-feedback/rules API rows. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Matching the whole comment body made quoted text, code samples and questions count as stated rules, capturing rules nobody asserted, and going-forward phrasing like 'moving forward' or 'for future reviews' was missed. Classify now matches only the reviewer's own statements, and rule extraction keeps the whole comment when the rule sentence is too short to stand alone. Closes #19137
🤖 Generated with Claude Code
-- hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.327