From 5393d08634cd37e6d876b35500a07cb839cd8524 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 14 Aug 2026 13:22:32 +0000 Subject: [PATCH 1/2] Initial plan From 4c8f51e5d194d982cb0e3a83592a19babe0ef587 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 14 Aug 2026 13:28:04 +0000 Subject: [PATCH 2/2] Add fixer freshness/live-leg gate and register new skip reasons Co-authored-by: kotlarmilos <11523312+kotlarmilos@users.noreply.github.com> --- .github/workflows/ci-failure-fix.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-failure-fix.md b/.github/workflows/ci-failure-fix.md index acffd37fb5605c..35a89c8f69aa05 100644 --- a/.github/workflows/ci-failure-fix.md +++ b/.github/workflows/ci-failure-fix.md @@ -181,11 +181,15 @@ Persist each KBE's dedup verdict to `/tmp/gh-aw/agent/dedup/.txt` so later For each surviving KBE, locate the failure and a likely cause. 1. **Reproduce the signature.** From the `Build:` link, walk the AzDO timeline (`/builds/{id}/timeline?api-version=7.1`, reconstruct via `parentId`), find the failing task/Helix work item, and `curl -s "$log_url" | tee /tmp/gh-aw/agent/failure_.log`. Confirm the KBE's `Error Message` substring actually appears in the log. If it does not, the KBE may be stale or already fixed -> `-> skipped: signature no longer reproduces in cited build`. -2. **Locate the failing test/source.** From the test name or compile error, find the owning file(s) at `HEAD`. Read them. For build breaks, read the failing compile unit and the cited error code/line. -3. **Identify the regression-introducing change (attribution gates).** Prefer the *first-bad-commit* range over raw `git blame`: +2. **Freshness and live-leg gate (mandatory, before any fix attempt).** A KBE only deserves a fix if the failure still happens, on a leg that still runs, with the bug still present at `HEAD`. Run all three checks; the first one that trips ends this KBE with the recorded skip — no PR, no loop-in comment. + - **Recent occurrence.** List recent completed builds of the KBE's definition (`/builds?definitions=&statusFilter=completed&%24top=20&api-version=7.1`) and check the signature against the newest ones, alongside any Build Analysis occurrence data already in the KBE body. If the most recent occurrence is older than 14 days, the failure was almost certainly fixed or retired already -> `-> skipped: no occurrence in last 14d, likely already fixed or retired`. + - **Live leg.** Confirm the leg from `Build error leg or test failing:` still runs: it appears in the timeline of the most recent completed build of that definition, and its job/queue/platform is still defined in the pipeline YAML at `HEAD` (`eng/pipelines/**`). Retired legs (removed Mono mobile or wasm legs, deleted queues, dropped OS images) cannot be fixed by a PR -> `-> skipped: failing leg retired, no longer runs at HEAD`. + - **Fix already landed.** Read the failing source at `HEAD` and `git log --oneline --since= -- `. If a merged change already removed the faulty code path, or the KBE cites a fix PR that has since merged, the KBE is stale -> `-> skipped: fix already present at HEAD; KBE stale`. +3. **Locate the failing test/source.** From the test name or compile error, find the owning file(s) at `HEAD`. Read them. For build breaks, read the failing compile unit and the cited error code/line. +4. **Identify the regression-introducing change (attribution gates).** Prefer the *first-bad-commit* range over raw `git blame`: - Anchor on the KBE's `First build it occurred` commit/date. `git log --oneline --since= -- ` to find candidate PRs that touched the failing file/function/test before the first failing build. - **Exclude** formatting-only, bulk-rename, file-move, dependency-bump, container-digest, and bot/codeflow commits (authors like `dotnet-maestro[bot]`, `github-actions[bot]`, codeflow merges) unless clearly causal. - - Require **>= 2 evidence points** before attributing to an author: (a) the failure first appears after their merge, (b) their change touched the failing file/function/test, (c) the change is topically related to the failure (same API/area). + - Require **>= 2 evidence points** before attributing to an author: (a) the failure first appears after their merge, (b) their change touched the failing file/function/test, (c) the change is topically related to the failure (same API/area). - If confidence is high, record at most ONE likely author handle. If confidence is low, record the candidate as a "possible related PR" link with NO author handle. ### Step 5 — Decide: confident fix, help-wanted PR, or loop-in comment @@ -285,7 +289,7 @@ Per KBE, append one outcome line to `/tmp/gh-aw/agent/coverage.txt`: `` is one of: `fix-PR #aw_` (confident), `help-PR #aw_` (needs review), `loopin-comment #`, `skipped: `. -Recognized skip reasons (reuse these phrasings so the feedback workflow's aggregation stays stable): `not yet area-labeled`, `KBE too fresh, defer to next run`, `open fix PR # already exists`, `fix PR # already merged; KBE may be stale`, `prior fix PR # closed without merge within 30d`, `human PR # already addressing`, `author already engaged on #`, `loop-in comment already posted`, `signature no longer reproduces in cited build`, `candidate fix already present in source`, `no producible diff (JIT/GC/security/API/infra) — comment`, `cap reached`, `integrity-filtered candidate, needs human review`. The list is non-exhaustive but additions SHOULD reuse one of these phrasings. +Recognized skip reasons (reuse these phrasings so the feedback workflow's aggregation stays stable): `not yet area-labeled`, `KBE too fresh, defer to next run`, `open fix PR # already exists`, `fix PR # already merged; KBE may be stale`, `prior fix PR # closed without merge within 30d`, `human PR # already addressing`, `author already engaged on #`, `loop-in comment already posted`, `signature no longer reproduces in cited build`, `no occurrence in last 14d, likely already fixed or retired`, `failing leg retired, no longer runs at HEAD`, `fix already present at HEAD; KBE stale`, `candidate fix already present in source`, `no producible diff (JIT/GC/security/API/infra) — comment`, `cap reached`, `integrity-filtered candidate, needs human review`. The list is non-exhaustive but additions SHOULD reuse one of these phrasings. At end of run, print this table to the agent log: