Skip to content

✨ Review-rule classifier ignores quotes, code fences and questions - #19144

Merged
hivecommons-hive[bot] merged 3 commits into
v5from
scanner/fix-19137
Nov 18, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
v5from
scanner/fix-19137

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

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

Closes #19137

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 18, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hanthor for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#19143 🐛 Read reviewer-stated rules from every PR comment once, and give their preferences a Settings card same files src/pkg/reviewrules/classify.go

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 18, 2026
@github-actions github-actions Bot added copilot conflicts-with-open-pr Open PR has a merge conflict with another open PR labels Nov 18, 2026
@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 18, 2026
@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 18, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

  1. CI is red on this PR's own new tests. test (rest 4/4) fails TestExtractRuleText/quoted_rule_is_not_extracted, fenced_code_is_not_extracted and question_is_not_extracted (classify_test.go:80). The logs read text = "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. ExtractRuleText keeps it, because sentenceSplit only 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.

  2. Overlap with #19143. #19143 also rewrites classify.go to drop quotes, fences and questions and to widen SignalGoingForward, and its changelog describes the same behaviour. Its regex differs from this one: it adds for (?:the )?future and a bare future (...), where this PR adds for the future and for future (...). The two cannot both land without a conflict in the ruleSignals line. #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>
@hivecommons-hive

hivecommons-hive Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor Author

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: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 697979487

Evidence bundle `#191446979794` sha256:585aaad5dcf88583ca46dbd0952b1072a0dc3420d29909522e15ae3ce3915413 — download from the dashboard or `hivectl review evidence #19144`.

@github-actions

Copy link
Copy Markdown
Contributor

Mutation testing

gremlins found 4 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.

File Line Mutation
src/pkg/reviewrules/classify.go 118 ARITHMETIC_BASE
src/pkg/reviewrules/classify.go 118 INVERT_NEGATIVES
src/pkg/reviewrules/classify.go 170 CONDITIONALS_BOUNDARY
src/pkg/reviewrules/classify.go 172 CONDITIONALS_NEGATION

ℹ️ 2 mutant(s) on added lines were SKIPPED because gremlins v0.6.0 only honours the first lines added lines of each default-context hunk, so non-contiguous edits in one hunk are partly missed. This does not affect the verdict.

File Line Mutation
src/pkg/reviewrules/classify.go 162 ARITHMETIC_BASE
src/pkg/reviewrules/classify.go 162 INVERT_NEGATIVES

Verdict: lived (#17349).

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 18, 2026
@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 18, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Nov 18, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 39f3c5b into v5 Nov 18, 2026
101 of 102 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-19137 branch November 18, 2026 21:57
hivecommons-hive Bot added a commit that referenced this pull request Nov 19, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/M Denotes a PR that changes 30-99 lines, ignoring generated files. stage/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] Review-rule classifier ignores quotes, code fences and questions; broaden going-forward phrases

0 participants