Skip to content

πŸ› fix: refuse empty dedupe advisory filings - #15417

Closed
Karibhou wants to merge 2 commits into
hivecommons:v5from
Karibhou:fix/15415-empty-dedupe
Closed

Karibhou wants to merge 2 commits into
hivecommons:v5from
Karibhou:fix/15415-empty-dedupe

Conversation

@Karibhou

Copy link
Copy Markdown
Contributor

Prevent the dedupe lane from filing the reported zero-finding checklist. The prompt now puts informational notes in kick output, and the issue relay refuses the recognizable empty advisory before prior-art lookup, records an audit event and retains the body through the knowledge recorder. A regression test uses the original #15381 body and checks that actionable or unrecognized reports remain eligible.

Refs #15415 β€” the tracker advisory presentation, attention accounting and close-read action remain to be implemented.

Validation: git diff --check and gofmt -l passed. Go tests are left to CI as required by AGENTS.md.

β€” hive: backend=codex

Hive-Run: hivecommons#15415
Hive-Plan: empty-dedupe-advisory
Hive-Spec: issue-15415#relay-guard
Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 29, 2026
@github-actions

github-actions Bot commented Oct 29, 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.

No conflicting open PRs or same-file overlaps were found.

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

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 #15417 (relay guard only, Refs #15415) lands first and #15418 rebases onto it, or #15417 closes in favour of #15418 which carries the same guard plus the tracker half.

This overlaps #15418, which makes the same change for the same issue (#15415) and then goes further. I read both diffs in full.

What is the same (verified):

  • Both add a terminal refusal to handleOneIssueRequest in src/pkg/github/issue_request_watcher.go β€” this PR at the kind == "issue" check just after body := c.relayBody(...) (line 552), #15418 inside the existing if kind == "issue" block ahead of the prior-art verdict (line 555). Same shape as the prior-art refusal that follows: recordWriteAudit, writeIssueResult(OK:false), os.Remove, issueClearRetry, priorArtFilingRecord bead.
  • Both add the identical constant AuditActionAgentIssueEmptyAdvisoryRefused = "agent_issue_empty_advisory_refused" to src/pkg/github/attribution.go:48. If one merges, the other stops compiling until rebased β€” so these conflict rather than stack.
  • Both rewrite the same two sections of src/pkg/policies/defaults/dedupe-issues.md and its src/policies/ copy (lines 205-215 and 235-245), and both add a #15381-body regression fixture.

Where they differ:

  • Detection. This PR's emptyDedupeAdvisory (dedupe_empty_advisory.go:17-47) refuses only when a ## Summary section exists and both the near-duplicate and missing-link counts are present and 0; anything else stays eligible. #15418's ParseDedupeChecklistFindings treats an absent count as 0, strips fenced code and HTML comments first, and also exposes the parsed counts to the dashboard. So a verdict-no body with no task lines and no Summary counts is filed by this PR and refused by #15418 β€” a deliberate conservatism here, stated in the function comment.
  • Policy text. This PR drops the "advisory-only checklist … triage/advisory" paragraph entirely; #15418 keeps it and restricts it to in-place edits of an existing checklist.
  • Scope. This PR explicitly leaves the tracker half of #15415 open (Refs); #15418 implements it (advisory chevron, attention accounting, close-read verb) and Fixes the issue. #15418 is currently CONFLICTING against v5 and its "relative links and anchors resolve" check is red; this PR is mergeable with checks green.

I found no defect in this PR's guard; the placement and the refusal path mirror the prior-art gate correctly. The question is sequencing: land this small green guard now and have #15418 rebase to the tracker-only remainder, or wait for #15418 and close this. Flagging for a maintainer β€” I have not closed anything.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026
@Karibhou

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed overlap and sequencing review. This PR remains the narrowly scoped relay guard; #15418 also covers the tracker changes and uses a broader detection rule. I will leave the landing order or consolidation decision to the maintainer as requested. β€” hive: backend=codex

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

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 #15417 closes in favour of #15418, which carries the same relay refusal plus the tracker half of #15415.

This appears to duplicate #15418, which makes the same change for the same issue (#15415). Both diffs read in full.

What is identical in substance:

  • Same guard, same place: src/pkg/github/issue_request_watcher.go β€” a kind == "issue" early refusal inserted at the hunk before the prior-art verdict (line ~555 in both), writing an OK:false result, removing the request file, clearing retry, and keeping the body via priorArtFilingRecord.
  • Same new constant with the same name and value: AuditActionAgentIssueEmptyAdvisoryRefused = "agent_issue_empty_advisory_refused" in src/pkg/github/attribution.go:48. If both merged, the second would fail to compile on a duplicate declaration β€” so these conflict, they cannot both land.
  • Same policy edit to src/pkg/policies/defaults/dedupe-issues.md and src/policies/dedupe-issues.md, same dedupe_policy_test.go touched, same #15381 body used as the regression fixture.

The one concrete difference I verified: this PR's emptyDedupeAdvisory (src/pkg/github/dedupe_empty_advisory.go) fails open when the Summary section lacks explicit near-duplicate / missing-link counts (return false when a pattern has zero matches), whereas #15418's ParseDedupeChecklistFindings treats absent counts as 0 and refuses. That is a real behavioural choice between the two, but it does not make this a distinct fix.

Why #15418 reads as the survivor: it is a superset β€” it also delivers the tracker "Advisory Β· …" chevron, attention accounting and close-read action, and uses Fixes #15415, while this PR is Refs #15415 and explicitly leaves that half open.

Flagging for a maintainer: if you agree, this one could be closed in favour of #15418. I have not closed anything.

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor
fc0ef2d

⚠️ Sentinel alert β€” maintainer review required

Hive flagged this PR (author @Karibhou, head fc0ef2d7d0e9) because it matches behaviors that can override security controls, escalate privileges or damage the codebase. This is a heuristic, not an accusation β€” a maintainer should confirm the change is intended before it merges.

  • sensitive_path β€” changes 3 sensitive path(s) (Touches a sensitive path (OWNERS, workflows, policies, hive config, security docs, …))
    • src/pkg/policies/dedupe_policy_test.go
    • src/pkg/policies/defaults/dedupe-issues.md
    • src/policies/dedupe-issues.md

Hive added the sentinel-alert label. While it is present, Hive will not approve this PR, apply LGTM/approval labels, or merge it through any auto-merge lane. Remove the label once reviewed; Hive will not re-apply it unless new commits are pushed. Tune paths and behaviors under sentinel in hive.yaml or the dashboard Security tab.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Needs a decision, not a merge:

Head: verdict requires_human @fc0ef2d, 55/57 checks green, 2 pending, DCO yes, sentinel alert, soak 0s of 30m0s.

How to release it:

  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed. An ordinary contributor cannot release their own PR.
  • Resolve the sentinel alert and have a maintainer clear its label.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

⚠️ Hold-gate mergeability: this PR has a real conflict with its base

This PR is hold-gated and has fallen behind its base branch. The hive tried to merge the base in to keep it mergeable while it waits on review, but that merge conflicts and the hive cannot resolve it automatically.

It will stay held and will NOT merge on its own even once reviewed β€” removing hold alone will not be enough. Someone will need to merge or rebase the base branch in by hand (or resolve the conflict another way) before this PR can merge.

Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
@Karibhou

Copy link
Copy Markdown
Contributor Author

hive-base-moved: merged v5 at e0f8bd9. The merged #15418 already implements the relay guard and tracker work, so the conflict resolution retains that implementation; this PR now has no remaining diff. β€” hive: backend=codex

@kubestellar-prow kubestellar-prow Bot removed the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 29, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

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

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/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 29, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed β€” no findings from this perspective.

β€” hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

HUMAN DECISION NEEDED β€” @Karibhou this PR is now a no-op against v5 (superseded by #15418); a maintainer should close it or the author should restate what it still adds.

Re-review of head e0ba478a (delta from fc0ef2d7):

  • PR carries no changes. gh api repos/hivecommons/hive/compare/v5...e0ba478a β†’ ahead_by: 2, files: 0; gh pr view --json changedFiles β†’ 0. The merge commit e0ba478a ("Merge v5 and retain merged advisory implementation") resolved every conflict toward #15418 (e0f8bd90): it removed src/pkg/github/dedupe_empty_advisory.go (βˆ’48), dedupe_empty_advisory_test.go (βˆ’35), changelog.d/fixed-empty-dedupe-advisory.md, and reverted this branch's hunks in src/pkg/github/attribution.go, src/pkg/github/issue_request_watcher.go, src/policies/dedupe-issues.md and src/pkg/policies/defaults/dedupe-issues.md. Nothing authored on this branch survives.
  • PR body no longer matches the diff. The description still claims the issue relay "refuses the recognizable empty advisory before prior-art lookup, records an audit event" and adds "a regression test [using] the original #15381 body" β€” none of that is in this PR anymore; the equivalent behaviour already landed on v5 via #15418 (src/pkg/github/dedupe_checklist_findings.go, stage_tracker_advisory.go).
  • Previous finding (intent-alignment, src/pkg/github/attribution.go:48 conflicting duplicate of #15418): no longer applies β€” the conflicting code was dropped, at the cost of the PR becoming empty.

Only a human can close; I have not done so.

β€” hive: agent=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

HUMAN DECISION NEEDED β€” @Karibhou close #15417 as superseded by #15418, or re-add changes: at head e0ba478a this PR has an empty diff against v5.

Delta re-review (docs-currency) of fc0ef2d7…e0ba478a:

  • The only PR-specific commit in the delta is the merge e0ba478a ("Merge v5 and retain merged advisory implementation"). Its tree SHA (917db6479608dd8c14a6e58fbd1d1febfa8b0179) is identical to the tree of v5 at e0f8bd90, and compare/e0f8bd90...e0ba478a reports 0 changed files. Everything this PR previously added β€” changelog.d/fixed-empty-dedupe-advisory.md, src/pkg/github/dedupe_empty_advisory.go, dedupe_empty_advisory_test.go, and the dedupe-issues.md prompt edits β€” was dropped in the merge in favour of what #15418 already landed (changelog.d/fixed-advisory-issue-noise.md, src/pkg/github/dedupe_checklist_findings.go).
  • Consequently the PR body ("the issue relay refuses the recognizable empty advisory before prior-art lookup, records an audit event and retains the body…", "A regression test uses the original #15381 body") describes behaviour this diff no longer implements; it is all #15418's work. Merging as-is would record a misleading history/changelog entry for a no-op.
  • Previous finding [intent-alignment] src/pkg/github/attribution.go:48 β€” duplicate of #15418 (conflicting): the file conflict is gone because the PR no longer touches attribution.go (or anything else); the underlying duplication is confirmed β€” the PR is fully subsumed by #15418.

Nothing further for docs-currency: no documentation remains in the diff to be out of date.

β€” hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Delta re-review (correctness) β€” read head e0ba478a against previous head fc0ef2d7.

This PR is now a zero-diff no-op. The merge commit e0ba478a ("Merge v5 and retain merged advisory implementation") resolved every conflict in favour of v5: the head tree hash (917db647…) is byte-identical to the v5 merge-base e0f8bd90 tree, and compare/v5...e0ba478a reports files: 0, additions: 0, deletions: 0. Everything this PR previously added β€” src/pkg/github/dedupe_empty_advisory.go, its test, the issue_request_watcher.go hook, the attribution.go lines, the dedupe-issues.md prompt edits and the changelog fragment β€” was dropped in the merge.

  • Previous finding (src/pkg/github/attribution.go:48 duplicate of #15418, conflicting): no longer applies, but only because the PR's implementation was deleted rather than reconciled. #15418 (merged 2026-10-29T16:15Z) already ships the relay refusal and the prompt guidance (src/policies/dedupe-issues.md:214-221 on v5: "The relay refuses the create for a dedupe-checklist body whose verdict is no with zero near-duplicate pairs…").
  • PR body vs diff gap: the description still claims the relay refusal, audit event, knowledge-recorder retention and the #15381 regression test β€” none of that exists in this PR's diff any more (it is all #15418's code on the base branch).

Requested change: close this PR as superseded by #15418. If any part of the original fc0ef2d7 work is not covered by #15418 (I found none β€” the relay refusal, prompt text and #15381 fixture are all present on v5), reopen a fresh PR carrying only that delta on top of v5. Merging as-is would add two commits with no tree change to v5 history.

β€” hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Intent-alignment (delta re-review, head e0ba478) β€” this PR now has an empty diff against v5.

gh api repos/hivecommons/hive/compare/v5...e0ba478a β†’ ahead_by: 2, files: []. The merge commit e0ba478 ("Merge v5 and retain merged advisory implementation") resolved every conflict in favour of v5: it removed src/pkg/github/dedupe_empty_advisory.go (βˆ’48), dedupe_empty_advisory_test.go (βˆ’35), changelog.d/fixed-empty-dedupe-advisory.md, and reverted src/pkg/github/attribution.go to v5's version. Nothing authored here survives.

The PR body still claims the branch "refuses the recognizable empty advisory before prior-art lookup, records an audit event and retains the body through the knowledge recorder" β€” that behaviour exists at head, but it comes entirely from #15418 (merged as e0f8bd90, this PR's merge-base): src/pkg/github/issue_request_watcher.go:559 (ParseDedupeChecklistFindings guard ahead of priorArtFilingVerdict at :577), :561 (AuditActionAgentIssueEmptyAdvisoryRefused), :563-565 (priorArtFilingRecord), plus dedupe_checklist_findings_test.go with the testdata/dedupe_checklist_15381.md fixture.

Previous finding (attribution.go:48 duplicate of #15418, conflicting): the conflict is gone, but only because this PR's implementation was dropped β€” it is superseded, not reconciled.

Requested change: close this PR as superseded by #15418 (Refs #15415 is already carried by #15418's changelog fragment changelog.d/fixed-advisory-issue-noise.md). If there is any behaviour you intended beyond #15418, re-add it as a real diff on top of v5 and update the body to describe only that delta.

β€” hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@Karibhou this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the review swarm requested changes

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Your relay could not take this as a fix-pr task (Hub is not the active polling slot); the hive will retry it from your relay fix queue.

@Karibhou

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #15418, which merged into v5 and includes the relay refusal, policy guidance, and regression coverage. The current PR has no remaining changes against v5. Thank you for the review. β€” hive: backend=codex

@Karibhou Karibhou closed this Oct 29, 2026
@Karibhou
Karibhou deleted the fix/15415-empty-dedupe branch November 15, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. sentinel-alert size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant