dotnet / dotnet/runtime

[ci-scan-feedback] Fix fixer self-dedup blinded by integrity gate (duplicate [ci-fix] artifacts)

Open
#132,919 1 comment 0 reactions 0 assignees View on GitHub
agentic-workflows area-Infrastructure untriaged
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

## Triggering signals

- **#131981 & #131515 → KBE #131382** — two `[ci-fix]` `kind: help` PRs opened for the same KBE. Maintainer `kotlarmilos` on #131981: *"Duplicate #131515."* ([#131981](https://github.com/dotnet/runtime/pull/131981), [#131515](https://github.com/dotnet/runtime/pull/131515))
- **#129651 & #129523 → KBE #128890** — duplicate `[ci-fix]` PRs. Maintainer `vcsjones`: *"duplicate of #129523."* ([#129651](https://github.com/dotnet/runtime/pull/129651))
- **#129385** — a single `[ci-scan]` KBE carries **two** `ci-fix` hand-off comments (2026-06-19 legacy + 2026-08-09), violating Hard rule 5 ("at most one loop-in comment per KBE"). ([#129385](https://github.com/dotnet/runtime/issues/129385))

Root cause: the fixer's Step 3 self-dedup enumerates its OWN prior `[ci-fix]` PRs and hand-off comments through the integrity-gated `github` MCP (`min-integrity: approved`). Those artifacts are authored by `github-actions[bot]` (association `CONTRIBUTOR`), so every one is silently `[Filtered]`. The dedup map is built blind, and the workflow re-files a duplicate PR or posts a second hand-off.

## Proposed edits

- `.github/workflows/ci-failure-fix.md` (Step 3, dedup preamble) — add a rule that first-party `[ci-fix]` PRs / hand-off comments must be enumerated with ungated `gh` (the workflow's own outputs are not maintainer content), keep the integrity-gated `github` MCP only for maintainer-authored signals, and **fail closed** (emit nothing) when a self-dedup read can't complete.
- `.github/workflows/ci-failure-fix.md` (Step 3, check 6) — enumerate prior hand-off comments via ungated `gh api .../comments`; fail closed on read failure.
- `.github/workflows/ci-failure-fix.md` (`tools.bash` allowlist) — add `gh`, scoped by comment to first-party self-dedup enumeration only; NOT for reading maintainer-supplied content.

## Expected behavior change

The next fixer run will build a complete self-dedup map from its own prior artifacts instead of a blind one, so it will stop opening a second `[ci-fix]` PR or a second hand-off comment for a KBE it has already handled. When a self-dedup read cannot be verified, the run defers rather than risking a duplicate. Maintainer-supplied content continues to pass through the integrity gate unchanged.

> [!NOTE]
> This PR was generated by an AI agent (GitHub Copilot).

> Generated by [CI Outer-Loop Failure Scanner — Feedback](https://github.com/dotnet/runtime/actions/runs/33253668646) · opus48 · 436.4 AIC · ⌖ 27.2 AIC · ⊞ 20.6K · [◷](https://github.com/search?q=repo%3Adotnet%2Fruntime+%22gh-aw-workflow-id%3A+ci-failure-scan-feedback%22&type=pullrequests)

---

> [!NOTE]
> This was originally intended as a pull request, but the git push operation failed.
>
> **Original error:** The process '/usr/bin/git' failed with exit code 1
>
> **Workflow Run:** [View run details and download bundle artifact](https://github.com/dotnet/runtime/actions/runs/33253668646)
>
> The bundle file is available in the `agent` artifact in the workflow run linked above.

To create a pull request with the changes:

```sh
# Download the artifact from the workflow run
gh run download 33253668646 -n agent -D /tmp/agent-33253668646

# Fetch the bundle into a temporary ref, then update the local branch
git fetch /tmp/agent-33253668646/aw-ci-scan-feedback-fixer-selfdedup-gate.bundle refs/heads/ci-scan-feedback/fixer-selfdedup-gate:refs/bundles/create-pr-ci-scan-feedback-fixer-selfdedup-gate-367423584055b653-0e53fba2
git update-ref refs/heads/ci-scan-feedback/fixer-selfdedup-gate-367423584055b653 refs/bundles/create-pr-ci-scan-feedback-fixer-selfdedup-gate-367423584055b653-0e53fba2
git checkout ci-scan-feedback/fixer-selfdedup-gate-367423584055b653
# Ensure the working tree matches the updated branch
git reset --hard
# Remove the temporary bundle ref
git update-ref -d refs/bundles/create-pr-ci-scan-feedback-fixer-selfdedup-gate-367423584055b653-0e53fba2

# Push the branch to origin
git push origin ci-scan-feedback/fixer-selfdedup-gate-367423584055b653

# Create the pull request
gh pr create --title '[ci-scan-feedback] Fix fixer self-dedup blinded by integrity gate (duplicate [ci-fix] artifacts)' --base main --head ci-scan-feedback/fixer-selfdedup-gate-367423584055b653 --repo dotnet/runtime
```

Contributor guide

Open the contributing guide

Research direction

Start with .github/workflows/ci-failure-fix.md and read Step 3, its dedup preamble, check 6, and the tools.bash allowlist. Trace how first-party [ci-fix] PRs and hand-off comments are enumerated, then verify that self-dedup reads fail closed while maintainer-authored signals remain integrity-gated. Done means the workflow cannot emit a duplicate PR or hand-off when self-dedup data is unavailable or already contains the artifact.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, github-actions, shell
Domain
ci-cd, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.