Skip to content

Replace genai dedup action with agentic duplicate-surfacing workflow - #6400

Merged
denelon merged 2 commits into
microsoft:masterfrom
denelon:denelon/agentic-dup-surfacing
Jul 29, 2026
Merged

Replace genai dedup action with agentic duplicate-surfacing workflow#6400
denelon merged 2 commits into
microsoft:masterfrom
denelon:denelon/agentic-dup-surfacing

Conversation

@denelon

@denelon denelon commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

📖 Description

Replaces automatic-issue-deduplication.yml (which used pelikhan/action-genai-issue-dedup@v0 with label_as_duplicate: false, so it produced no visible signal — no label, no comment) with a GitHub Agentic Workflow (gh aw) that surfaces likely duplicates for maintainer review.

On every newly opened issue, a Copilot-engine agent reads the issue and searches existing issues (open and closed) by meaning, not keyword overlap, then — only when confident — applies a new Possible-Duplicate label and posts a single comment listing up to five candidate duplicates with links and one-line rationale.

The workflow detects but never resolves: it never closes the issue, never removes Needs-Triage, and never emits the Duplicate of #NNN moderator trigger. Choosing the canonical issue (earliest / curated preferred) and closing stays a maintainer decision.

Why replace the current action

Changed files

  • Add .github/workflows/duplicate-surfacing.md (agentic spec)
  • Add .github/workflows/duplicate-surfacing.lock.yml (compiled via gh aw compile; generated — do not hand-edit)
  • Add .github/aw/actions-lock.json (pinned action versions for the framework)
  • Update .gitattributes (marks *.lock.yml as generated / merge=ours)
  • Remove .github/workflows/automatic-issue-deduplication.yml
  • Update .github/actions/spelling/allow.txt (add toolsets and msftbot)

New label required: Possible-Duplicate (advisory), distinct from the authoritative Resolution-Duplicate (applied on human confirmation via the trigger). See the linked issue for the label plan.

Enablement prerequisites (org/repo): agentic workflows enabled + the Copilot engine and its secrets (COPILOT_GITHUB_TOKEN, GH_AW_GITHUB_TOKEN, GH_AW_GITHUB_MCP_SERVER_TOKEN). Same framework microsoft/mxc adopted (#639/#646).

Safety posture: safe-outputs restricts the agent to add-labels: [Possible-Duplicate] (max 1) and add-comment (max 1); MCP GitHub access is repo-scoped; workflow token is issues: read; issue content is treated as untrusted (prompt-injection defenses); trigger is opened only to bound comment volume; egress is firewalled to a pinned domain allowlist.

Authored with GitHub Copilot assistance.

🔗 References

🔍 Validation

🚀 Rollout & enablement

  • Scope (intentionally narrow): this is a contained first step — dedup only, safe-outputs limited to one comment + the Possible-Duplicate label, no code changes, no PRs. Chosen deliberately for a public, first-party repo to build trust before considering broader automation.
  • Engine auth — no custom secret required: the Copilot engine runs on the built-in GITHUB_TOKEN together with the copilot-requests: write job permission. A dedicated COPILOT_GITHUB_TOKEN secret is not configured or needed (same setup microsoft/mxc uses, Fix typo #639/New Manifest Schema and Structure #646). Copilot is already available to Actions in the microsoft org.
  • Workflow permissions: the repo default GITHUB_TOKEN is read-only; this workflow's safe-outputs jobs request issues: write + pull-requests: write explicitly, which overrides the default — no repo-wide setting change was needed.
  • Actions allow-list: the repo restricts actions to a selected allow-list; github/gh-aw-actions/*@* was added so the gh-aw setup action is permitted. GitHub-owned actions/* were already allowed; the gh-aw container images (ghcr.io/github/gh-aw-*) are pulled at runtime and are not gated by the actions allow-list.
  • Not adopting Repo Assist here: githubnext's broader Repo Assist workflow (which opens PRs and edits code) is a separate, governed decision — out of scope for this PR.
  • Public-repo note: do not set GH_AW_CI_TRIGGER_TOKEN on this repo (abuse risk per gh aw docs).

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task

Replaces automatic-issue-deduplication.yml (which ran with
label_as_duplicate: false and produced no visible signal) with a
gh aw agentic workflow that surfaces likely duplicates by meaning on
newly opened issues. The agent applies a Possible-Duplicate label and
posts one comment with candidate duplicates for maintainer review; it
never closes issues, removes Needs-Triage, or emits the Duplicate of
trigger. Outputs are constrained by a safe-outputs allowlist.

Closes microsoft#6399

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3701d64a-96ba-42f1-be59-b4e7d2a2820a
@github-actions

This comment was marked as outdated.

Resolves the Check Spelling failure on the duplicate-surfacing workflow:
'toolsets' (gh aw frontmatter) and 'msftbot' (bot comment template tag).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3701d64a-96ba-42f1-be59-b4e7d2a2820a
@denelon
denelon marked this pull request as ready for review July 29, 2026 00:55
@denelon
denelon requested a review from a team as a code owner July 29, 2026 00:55
@denelon
denelon merged commit d791f05 into microsoft:master Jul 29, 2026
4 checks passed
@denelon
denelon deleted the denelon/agentic-dup-surfacing branch July 29, 2026 16:58
denelon added a commit that referenced this pull request Jul 29, 2026
## 📖 Description

The agentic **Duplicate Surfacing** workflow (added in #6399 / #6400)
inherited gh-aw's **default no-op reporting**. When a run finds no
likely duplicate — the common case for most newly opened issues — gh-aw
logs the run to an auto-created **"[aw] No-Op Runs"** tracking issue
(#6406), adding a comment per run.

On a high-volume repo like winget-cli this produces near-constant noise
and contradicts the workflow's intended design: **detect-only, and stay
silent unless a likely duplicate is found**.

This PR sets `safe-outputs.noop.report-as-issue: false` in the workflow
frontmatter and recompiles the lock. The change is config-only — the
detect → label (`Possible-Duplicate`) → comment behavior is unchanged;
only the no-op issue/comment reporting is turned off.

Reported by @Trenly on #6406.

_Authored with GitHub Copilot assistance._

## 🔗 References

- Resolves #6407
- Follow-up to #6399 / #6400
- Feedback: #6406 (the auto-managed "[aw] No-Op Runs" tracking issue;
gh-aw-managed and self-expiring)

## 🔍 Validation

- `gh aw compile duplicate-surfacing` → **0 errors, 0 warnings**.
- Lock diff is limited to the no-op toggle: `noop.report-as-issue` and
`GH_AW_NOOP_REPORT_AS_ISSUE` flip `true` → `false` in the three
generated config sites, plus the frontmatter hash. No job structure,
permissions, or action pins changed.
- Prior production run confirmed the detect/label/comment path works
(#6404 → surfaced #6388); this PR does not touch that path.

## ✅ Checklist

- [x] Signed the [Contributor License
Agreement](https://cla.opensource.microsoft.com)
- [x] Linked to an issue
- [ ] Updated [Release Notes](../doc/ReleaseNotes.md) (if applicable)
- [ ] Updated documentation (if applicable)
- [ ] Updated [Copilot instructions](.github/copilot-instructions.md)
(if build, architecture, or conventions changed)

## 📋 Issue Type

- [ ] Bug fix
- [x] Feature
- [ ] Task

###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/winget-cli/pull/6408)

Co-authored-by: Demitrius Nelon <denelon@outlook.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3701d64a-96ba-42f1-be59-b4e7d2a2820a
@github-actions github-actions Bot mentioned this pull request Jul 29, 2026
denelon added a commit that referenced this pull request Jul 29, 2026
…ries) (#6410)

## 📖 Description

The agentic **Duplicate Surfacing** workflow (#6399 / #6400) reasons
about duplicates semantically, but its **only retrieval mechanism is
GitHub's full-text issue search**, whose relevance ranking buries older,
sparsely-worded issues. Genuine duplicates that never surface in search
can never be judged by the model.

**Concrete miss** (found by @Trenly, #6406): on **#6405** ("Support
source type detection") the agent ran jargon-heavy queries (`source add
--type PreIndexedPackage Rest autodetect`, etc.) and no-op'd — but
**#1477** ("The type of a source should be automatically detected when
possible") is a near-verbatim duplicate (same feature *and* same
proposed `/information`-endpoint mechanism). GitHub full-text search
never returned #1477, even for its own title words; only `in:title`
concept searches surface it.

This PR updates the workflow's "How to search" guidance to raise recall:
- Always run at least two `in:title` concept searches (2–3 core nouns).
- Prefer short, high-recall queries; don't pile many exact CLI tokens
into one query.
- Vary noun/verb vocabulary (weak stemming) and scan ~20–30 results per
search.

The change is prompt-only — detection thresholds, safe-outputs,
permissions, and action pins are unchanged.

_Authored with GitHub Copilot assistance._

## 🔗 References

- Resolves #6409
- Follow-up to #6399 / #6400
- Feedback: #6406 (Trenly); real duplicate demonstrated: #6405#1477

## 🔍 Validation

- `gh aw compile duplicate-surfacing` → **0 errors, 0 warnings**.
- **`gh aw trial` replaying #6405** against the live winget-cli corpus:
with the new guidance the agent surfaces **#1477** with **HIGH**
confidence (label + comment), exactly the duplicate previously missed.
- Diff is limited to the "How to search" prompt section plus the
regenerated lock; no job/permission/action-pin changes.

## ✅ Checklist

- [x] Signed the [Contributor License
Agreement](https://cla.opensource.microsoft.com)
- [x] Linked to an issue
- [ ] Updated [Release Notes](../doc/ReleaseNotes.md) (if applicable)
- [ ] Updated documentation (if applicable)
- [ ] Updated [Copilot instructions](.github/copilot-instructions.md)
(if build, architecture, or conventions changed)

## 📋 Issue Type

- [ ] Bug fix
- [x] Feature
- [ ] Task

###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/winget-cli/pull/6410)

Co-authored-by: Demitrius Nelon <denelon@outlook.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3701d64a-96ba-42f1-be59-b4e7d2a2820a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agentic duplicate-surfacing workflow to flag likely duplicate issues for maintainer review

2 participants