Repository navigation
✨ Capture reviewer-stated rules from review feedback into the hive's knowledge - #19086
Conversation
…knowledge The review-feedback sweep now classifies each comment in a burst from explicit phrase signals and writes a stated rule or source of truth to a local review-rules knowledge channel with provenance, instead of leaving it to the kicked agent. Rules are deduplicated by comment id and near duplicate text, gated on the reviewer's association (others are queued as drafts), acknowledged on the PR, and primed into the matching agent's next kick through a new pinned-entry path in the knowledge primer. A validated hive:review-rules block in the agent's reply can sharpen a rule. A rule whose home is another project's repo gets one needs-human note carrying the proposed text. Fixes #19046 Signed-off-by: Andy Anderson <andy@clubanderson.com>
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
Mutation testinggremlins found 29 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.
13 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the
ℹ️ 1 mutant(s) on added lines were SKIPPED because gremlins v0.6.0 only honours the first
Verdict: |
| // HasPinned reports whether any pinned store is registered. | ||
| func (p *Primer) HasPinned() bool { return p != nil && len(p.pinned) > 0 } | ||
|
|
||
| // pinnedFacts returns the pinned entries a kick must carry, oldest slug first |
There was a problem hiding this comment.
Comment says "oldest slug first" but the sort at line 61 is lexicographic (rule-r-10 sorts before rule-r-2), and the cap at line 62 contradicts "Pinned entries are never trimmed" in withPinned. Suggest rewording: // pinnedFacts returns the pinned entries a kick must carry, sorted by slug (lexicographic) and capped at maxPinnedFacts.
| Queued: r.Rule.Status == reviewrules.StatusPending, SourceURL: it.URL}) | ||
| } | ||
| s.postRuleNotices(ctx, repo, number) | ||
| return recorded |
There was a problem hiding this comment.
postRuleNotices is also called from run() (line 124) for the same PR in the same pass. Either drop one or note why both are needed.
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Intent alignment (head 2519b78): the diff delivers bullets 1 and 3 of #19046. The sweep captures rules deterministically ( Advisory, not blocking: bullet 2 ("locate where the quality agent's docs-assessment criteria live and seed the rule there") is only partly delivered. The PR gets the rule to the quality agent through the pinned primer ( Review findings from Security: agent block can launder a trusted reviewer's authority (src/pkg/reviewrules/store.go:563, 588, 599). Details are in the inline thread. One in-scope blocker; everything else I checked in the trust gate, frontmatter writer and hive-login check looked sound. Findings not on a changed line
Review findings from Correctness review at head 2519b78. The classify, persist, trust and primer-load paths match the #19046 contract. The block-injection path is safe: needsHuman quotes only URLs, and rule text is stripped of
Not verified: I did not run the tests. Out of scope, noted only: repo-scoped rules do not get the Findings not on a changed line
|
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Fixes #19046
What
The review-feedback sweep (#19029) used to tell the kicked agent to record a reviewer-stated rule on a best-effort basis. This makes the capture deterministic.
source-of-truth,authoritative,always,never,going-forward,capture-request,assessment-criteria,knowledge-base). A match is a rule, anything else is a correction and is handled as before. Comment text is data: matched and quoted, never executed.review-rulesknowledge channel as a scoped,pin-tagged entry with provenance (PR, comment id and URL assource, reviewer, association, time, confidence). Idempotent per comment id across restarts, near-duplicate text merges, size-bounded.OWNER,MEMBERandCOLLABORATORreviewers (HIVE_REVIEW_FEEDBACK_RULE_TRUSTED_ASSOCIATIONS) are captured at once. Others are queued as draft entries;hivectl knowledge state <id> approvedconfirms.pinentry whose scope admits the kick is carried whatever the kick's keywords are, ahead of ranked knowledge. Rules default to the authoring agent's lane, so the quality agent receives its rules on its next kick. Lifecycle andagent_scopesstill apply.hivectl knowledge state rule-r-n deprecated(or delete the entry); the sweep reconciles.hive:review-rulesJSON block to sharpen a rule or state one the classifier missed. Itsevidence_urlmust name a comment the hive saw, so the reviewer's trust comes from that comment, never from the agent.Capture also runs when the per-PR cap was reached or no agent was available. Debounce, cap and thread behavior are unchanged. Env knobs follow the
HIVE_REVIEW_FEEDBACK_*convention; docs insrc/docs/review-feedback-rules.md.Related scanner issues
This covers #19048 (capture path and idempotency; the sweep posts the acknowledgement itself, so no reply check is needed) and #19051 (one needs-human note per foreign-home rule). #19050 is partly covered: a captured rule scoped to an assessment workflow or lane is primed into that kick. The static assessment criteria entries are #19079.
Tests
Table-driven tests for classification signals, block parsing and validation, trust gating, idempotency across reload, near-duplicate merge, scoping, retraction and reconciliation, retrieval by the quality agent (primer and scheduler), and the foreign-repo note. The fixture of the maintainer's comment (
.project/maintainers.yamlis the source of truth for ownership and maintainership; capture this in the assessment knowledge base) is captured with provenance and retrieved for the quality agent incmd/hive.🤖 Generated with Claude Code