Skip to content

Commit 21b1ec7

Browse files
jankratochvilczCopilotCopilot
authored
Dreaming: enforce reviewer intersection (discussion participant AND kitten member) (#14383)
## Context: validating the reviewers + multi-PR change After #14373 merged, I triggered a live Dreaming run ([29432875878](https://github.com/dotnet/msbuild/actions/runs/29432875878)) to validate the new behavior. Results: - ✅ **Multi-PR worked** — the run opened **two atomic PRs**, each touching a single file with a distinct theme (#14381 logging instructions, #14382 expert-reviewer agent). Exactly the intended one-pattern-per-PR shape. - ✅ **Reviewer section rendered** on both, with the softened "please assign" wording. - ❌ **One reviewer was wrong.** #14382 listed `@baronfel`, who is **not** on the `@dotnet/kitten` roster (`gh api orgs/dotnet/teams/kitten/memberships/baronfel` → 404) **and** was not in that PR's cited discussion (only `@jankratochvilcz` was). The agent invented a plausible-sounding name instead of strictly filtering. (#14381's `@rainersigwald` was correct — active kitten member and the actual reviewer.) ## Fix Tighten Step 5b so a reviewer qualifies **only if the login is in BOTH**: 1. the fetched `orgs/dotnet/teams/kitten/members` output, **and** 2. that pattern's actual discussion-participant list. Plus explicit guardrails: - **Never** add a name from memory / general knowledge of "who works on MSBuild" / because it seems plausible. - A **pre-emit self-check**: before emitting each PR, verify every `@`-mention on the reviewers line is in both lists; drop any that fail. - When in doubt, prefer the `@dotnet/kitten` fallback over guessing an individual. ## Scope Only the Dreaming workflow prompt + recompiled lock (1-line lock change: the embedded prompt hash/text). Compiles clean (0/0). This directly closes the gap the validation run exposed. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jankratochvilcz <2202487+jankratochvilcz@users.noreply.github.com>
1 parent 6fd50b8 commit 21b1ec7

2 files changed

Lines changed: 93 additions & 30 deletions

File tree

‎.github/workflows/dreaming.agent.lock.yml‎

Lines changed: 73 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.github/workflows/dreaming.agent.md‎

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,21 @@ For **each** PR you open, identify the people who were actually involved in the
253253
PR's pattern (from the participant list you kept in Step 2) and @-mention them so a maintainer can assign
254254
them:
255255

256-
1. **Fetch the core team roster once** for the run:
256+
1. **Fetch the core team roster once** for the run and keep the exact output:
257257
`gh api orgs/dotnet/teams/kitten/members --jq '.[].login'` (the `@dotnet/kitten` team is the MSBuild
258-
CODEOWNERS team — a small, curated set, currently ~8 people, *not* the whole org). Keep only this
259-
PR's participants whose login is in that roster. Drop everyone else, plus bots and the PR authors
260-
themselves. Do **not** use GitHub's `authorAssociation` for this — `MEMBER` means any dotnet-org
261-
member and is far too broad. If the token can't read team membership (the call errors/returns empty),
262-
skip individual selection and use the `@dotnet/kitten` fallback in step 2.
258+
CODEOWNERS team — a small, curated set, currently ~8 people, *not* the whole org). A login qualifies
259+
as a reviewer **only if it satisfies BOTH conditions**: (a) it is in the participant list you actually
260+
collected in Steps 1–2 for *this* pattern, **and** (b) it appears verbatim in the roster output above
261+
**or** is on the explicit allow-list below.
262+
Drop everyone who fails either check, plus bots and the PR authors themselves. **Never** add a name
263+
from memory, from general knowledge of "who works on .NET/MSBuild", or because it seems plausible — if
264+
a login is not in both lists and not on the allow-list, it does not go in the PR. Do **not** use
265+
GitHub's `authorAssociation` for this — `MEMBER` means any dotnet-org member and is far too broad. If
266+
the token can't read team membership (the call errors/returns empty), skip individual selection and use
267+
the `@dotnet/kitten` fallback in step 2.
268+
**Explicit allow-list (always eligible regardless of `@dotnet/kitten` roster membership, if they
269+
participated in the pattern's discussions):**
270+
- `@baronfel` — team PM (Chet Husk)
263271
2. **Cap at 2.** If more than two qualify, pick the two most engaged in that pattern's threads (most
264272
comments / the ones who requested the changes). If exactly one qualifies, name one. If **none**
265273
qualify, fall back to the core-team handle `@dotnet/kitten` (verified team slug `kitten`).
@@ -276,6 +284,12 @@ them:
276284
Use real `@`-mentions (or `@dotnet/kitten` for the fallback). This is the one place contributor names
277285
belong — never put them in the learning-atom content itself (guardrail 5).
278286

287+
**Before emitting each PR, self-check the reviewers line:** every `@`-mention in it (other than the
288+
`@dotnet/kitten` fallback) must be a login that appears in either (a) the `orgs/dotnet/teams/kitten/members`
289+
output you fetched or (b) the explicit allow-list in step 1 above — **and** in that pattern's
290+
discussion-participant list. If any name fails, remove it. When in doubt, prefer the `@dotnet/kitten`
291+
fallback over guessing an individual.
292+
279293
## Reminders
280294

281295
- You may only change the four learning-atom targets; the `allowed-files` allowlist enforces this, but

0 commit comments

Comments
 (0)