Skip to content

✨ Review-rule capture reads its own candidate set - #19146

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-19136
Nov 18, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-19136

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

A reviewer-stated rule was only classified while its comment was still unanswered feedback, so a rule in a comment the agent already handled, in a resolved or answered thread, or in a plain PR comment not addressed to the hive never reached the hive's knowledge (the maintainers.yaml comment on cncf/techdocs#424 is one). Capture now reads every human comment on the hive's open PRs, and the rule index keeps its own evaluated comment ids, separate from the sweep's handled ids, so the first pass after deploy is a one-time backfill and later passes classify only new comments. Kick routing is unchanged; the brief looks up captured rules by comment id. Classifier phrasing (#19137) and settings keys (#19138) are left to their own PRs.

Closes #19136

🤖 Generated with Claude Code

-- hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.327

Rule capture only saw the routed burst, so a rule stated in a comment that
was already handled, sat in a resolved or answered thread, or was a plain
PR comment not addressed to the hive was never classified. Capture now reads
every human comment on the PR (RuleCandidates), and the rule index keeps its
own evaluated comment ids, separate from the sweep's handled ids, so the
first pass is a one-time backfill and later passes read only new comments.
Kick routing is unchanged; the brief looks up rules by comment id.

Closes #19136

Co-Authored-By: Claude Opus 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

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 18, 2026
@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
#19102 🐛 Let the agent that opened a PR reply on its review threads same files src/cmd/hive/review_feedback_wire.go
#19143 🐛 Read reviewer-stated rules from every PR comment once, and give their preferences a Settings card CONFLICT src/cmd/hive/review_feedback_wire.go (conflict)
src/docs/review-feedback-rules.md (conflict)
src/pkg/github/pr_feedback.go (conflict)
src/pkg/reviewrules/store.go (conflict)

@github-actions github-actions Bot added 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 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
@github-actions

Copy link
Copy Markdown
Contributor

Mutation testing

gremlins found 3 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/store.go 492 CONDITIONALS_BOUNDARY
src/pkg/reviewrules/store.go 502 CONDITIONALS_BOUNDARY
src/pkg/reviewrules/store.go 502 CONDITIONALS_NEGATION

ℹ️ 4 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/cmd/hive/review_feedback_wire.go 212 CONDITIONALS_BOUNDARY
src/cmd/hive/review_feedback_wire.go 212 CONDITIONALS_NEGATION
src/cmd/hive/review_feedback_wire.go 221 CONDITIONALS_NEGATION
src/cmd/hive/review_feedback_wire.go 262 CONDITIONALS_NEGATION

Verdict: lived (#17349).

@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.

Review follow-ups: 2 open of 2 (below review.backlog.min_severity: P2)

Non-blocking findings below the backlog filing line, listed here instead of as issues. Tick them off as they are fixed; set review.backlog.min_severity: P3 to file every finding.

  • P3 info correctness — Evaluated-id eviction can re-run backfill every pass when visible comments exceed the cap (src/pkg/reviewrules/store.go:62): maxEvaluatedComments=5000 evicts oldest ids across all PRs; if open PRs ever carry more than 5000 human comments, evicted ones are re-classified each pass (idempotent via Comments map, but repeated w…
  • P3 info intent-alignment — Capture skipped for paused agents' PRs (src/cmd/hive/review_feedback_wire.go:124): captureRules runs after the route.Paused continue in run(), so PRs whose owner agent is paused get no rule capture or backfill until resumed. Pre-existing loop structure; not required by [scanner] Review-rule capture reads its own candidate set (all human comments, evaluated-id index, backfill) #19136.

Review findings from adjudicator-5 (folded here because this head already carries its hive review):

Docs-currency: approve. src/docs/review-feedback-rules.md and the changelog fragment match the new behavior (own candidate set, backfill, evaluated-id index). Optional: mention the 5000-id bound on evaluated ids (src/pkg/reviewrules/store.go, maxEvaluatedComments); eviction only causes an idempotent re-classification.

Evidence bundle `#191469593332` sha256:3818bdd9e0cb118c7d5fba6cc7cfdf610e9c49f31cf5d6a45c7927920b571b74 — download from the dashboard or `hivectl review evidence #19146`.

@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.

Style review at head 9593332: no blockers. The diff is consistent with repo idioms, and the docs, changelog and tests are updated.

Advisory: src/cmd/hive/review_feedback_wire.go:126 calls postRuleNotices, and captureRules ends with another postRuleNotices call, so it runs twice per pass. The first call looks redundant.

-- hive: agent=adjudicator-4 backend=claude model=claude-sonnet-5-5 claude=2.1.327

@hivecommons-hive
hivecommons-hive Bot merged commit 0854166 into v5 Nov 18, 2026
109 of 110 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-19136 branch November 18, 2026 21:49
clubanderson added a commit that referenced this pull request Nov 18, 2026
…re phrasings, and give the preferences a Settings card

The rule classifier read the whole comment, so a reply that quotes the
hive and asks whether the hive can add something to the knowledge base
would be recorded as the reviewer's rule with the hive's words as its
text. Block quotes, fenced code and questions no longer count, a short
rule sentence that refers back keeps the rest of the comment, and
going-forward also matches future assessments, moving forward and for
the future.

Which phrases count and whose rules are recorded at once are the owner's
preferences: review_feedback.rules.enabled, trusted_associations,
extra_phrases and disabled_signals in hive.yaml, with the env vars still
honoured and a saved value winning. An owner-only Settings card under
Features, Review edits them in place, validated, audited as
config_review_feedback_rules, and applied on the sweep's next pass.

The candidate set and evaluated-id backfill this issue also asked for
landed in #19146.

Fixes #19135

Signed-off-by: Andy Anderson <andy@clubanderson.com>
kubestellar-prow Bot pushed a commit that referenced this pull request Nov 19, 2026
…re phrasings, and give the preferences a Settings card (#19143)

* 🐛 Reviewer-stated rules: ignore quotes and questions, match more future phrasings, and give the preferences a Settings card

The rule classifier read the whole comment, so a reply that quotes the
hive and asks whether the hive can add something to the knowledge base
would be recorded as the reviewer's rule with the hive's words as its
text. Block quotes, fenced code and questions no longer count, a short
rule sentence that refers back keeps the rest of the comment, and
going-forward also matches future assessments, moving forward and for
the future.

Which phrases count and whose rules are recorded at once are the owner's
preferences: review_feedback.rules.enabled, trusted_associations,
extra_phrases and disabled_signals in hive.yaml, with the env vars still
honoured and a saved value winning. An owner-only Settings card under
Features, Review edits them in place, validated, audited as
config_review_feedback_rules, and applied on the sweep's next pass.

The candidate set and evaluated-id backfill this issue also asked for
landed in #19146.

Fixes #19135

Signed-off-by: Andy Anderson <andy@clubanderson.com>

* 🐛 Reviewer-stated rules: keep the whole comment when the extracted rule is too short to stand alone

Signed-off-by: Andy Anderson <andy@clubanderson.com>

* 📖 docs: refresh api-reference citations after merging v5

Signed-off-by: Andy Anderson <andy@clubanderson.com>

* 📖 docs: refresh api-reference citations after merging v5

Signed-off-by: Andy Anderson <andy@clubanderson.com>

---------

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.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 conflicts-with-open-pr Open PR has a merge conflict with another open 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/L Denotes a PR that changes 100-499 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 capture reads its own candidate set (all human comments, evaluated-id index, backfill)

0 participants