Repository navigation
Triage: a defined team mapping is exhaustive - #339
Conversation
Step 3 closed the board-metadata taxonomy ("if the instructions define
none, select none") but left the team taxonomy open, treating CODEOWNERS
as an independent authority. A team label on the menu could therefore be
selected because CODEOWNERS pointed at the owning GitHub team, with no
instruction authorizing it.
Make the two rules consistent: when the instructions define a team
mapping, never select a team label the mapping does not name, and select
no team label when CODEOWNERS names a team the mapping does not map.
Repos with no team mapping are unaffected, so docs-eng-team, oblt-aw,
and docs-actions-test-caller keep their current behavior.
Applied to both issue-triage and issue-auto-triage, which shared the
identical rule. Prompt-only change; locks recompiled with gh-aw v0.88.7.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sandbox A/B: the rule changes behaviorTested as an A/B in Each run was classified from its own
Control leak, run
It reached the right conclusion — the mapping does not cover docs-engineering — and then overrode it, using the safe-outputs allow-list as a competing authority. That is a third side door I had not considered when I opened this: not CODEOWNERS, not the repository label list, but the safe-outputs config surfaced in the prompt. This rule closes it, because it makes the mapping exhaustive rather than any particular menu. Treatment passes for contrast — decoys plainly on the menu, no team label applied:
The second is the sharper one: a get-started issue is exactly what the old six-team mapping routed to Honest limitsSmall n — 2 treatment and 3 control usable samples, one observed leak. This shows the rule prevents a leak that demonstrably happens without it; it does not establish a leak rate. Four of six treatment runs were discarded because the agent never fetched the decoys, which is the same underlying flakiness described in the issue linked below. Corrections to this PR's original description
I also want to flag that the caller-side fix in elastic/docs-content#8297 is not made redundant by this. Its resolution table was cited by name by the agent in run Marking ready for review. |
There was a problem hiding this comment.
Approved — no actionable issues found in this PR.
What is this? | From workflow: PR Review
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
Fixes #340. Step 1 asked the agent to list the repository's labels and treat the result as the menu. Across nine sandbox runs it did that four different ways: full enumeration, partial confirmation, inference from other issues' labels, and reading the safe-outputs config. One of those menus contained a label that does not exist in the repository. Move the fetch out of the agent. A pre-agent step runs gh label list and writes the result to /tmp/gh-aw/agent/label-menu.txt, one name per line. Step 1 now reads that file, forbids rebuilding the menu any other way, and falls back to the GitHub read tools only if the file is missing. Applied to both issue-triage and issue-auto-triage. Compiled with gh-aw v0.88.7, zero warnings. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Second commit (7c1bf80): fix for #340The A/B above burned four of six treatment runs because the agent never fetched the decoy labels. #340 documents why: Step 1 asked the agent to enumerate the repository's labels, and it did that four different ways across nine runs, one of which produced a menu containing a label that does not exist in the repo. This commit moves the fetch out of the agent entirely. A pre-agent step in the Why a file and not prompt interpolation: gh-aw renders the prompt in the Blast radius: every triage and auto-triage caller, since the step runs unconditionally. It needs only Both READMEs updated. Testing in the sandbox next — success criterion is every run's log showing the file read and the full menu, no discards. |
There was a problem hiding this comment.
Requesting changes.
What is this? | From workflow: PR Review
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
Sandbox results for the #340 fix (commit 7c1bf80)Four runs on this branch — two manual (
Zero discards. Before this commit, four of six treatment runs had to be thrown out because the agent never loaded the decoy labels; here every run read the complete 33-label menu via exactly one Menu-file read and Both sandbox callers are back on |
Review caught that gh label list --limit 500 would hand the agent a non-empty but truncated menu on repositories with more than 500 labels, while Step 1 promises the file is complete and skips the fallback whenever it is non-empty. Use gh api --paginate so every page is read. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Sandbox check for bf3b457 (the pagination change), manual |
Review caught that "any existing label is eligible" contradicted the new exhaustive team-mapping rule in Step 3. Co-Authored-By: Claude Fable 5.1 <[email protected]>
While rewriting the docs-content team mapping down to three teams (elastic/docs-content#8297), I hit a gap in Step 3 of the triage prompt that the caller-side fix could only paper over.
Step 3 closes the board-metadata taxonomy:
But it leaves the team taxonomy open:
For board metadata the instructions are the sole authority. For team, CODEOWNERS is an independent authority. So
@elastic/docs-engineeringin CODEOWNERS plusTeam:DocsEngon the label menu is a perfectly legitimate match that no instruction ever authorized — and a repo that has deliberately narrowed its team set has no way to say "not that one."I think the asymmetry is unintentional rather than deliberate, so this makes the two rules consistent. When the instructions define a team mapping, the mapping is exhaustive: never select a team label it does not name, and select no team label when CODEOWNERS names a team the mapping does not map.
Blast radius
Deliberately narrow. The rule binds only when the instructions define a team mapping, so repos without one are untouched:
docs-triage.yml,docs-ai-menu.yml)docs-triage.yml,docs-auto-triage.yml)docs-aw-ai-menu.yml)Applied to both
issue-triageandissue-auto-triage, which carried the identical rule. Prompt-only: the lock diff is the metadata hash plus oneGH_AW_PROMPT_CONTENTline, with no frontmatter change. Locks recompiled with the pinned gh-aw v0.88.7, no warnings.Why it is worth doing even though the caller fix works
I shipped the docs-content mapping with three overlapping prose guardrails — a "never select a retired team label" sentence naming all seven, a CODEOWNERS-team-to-label resolution table, and a "never substitute a retired label" sentence. A five-issue sandbox battery passed clean, so the prose works today. But it is prose, on Haiku, and the enumeration names seven labels that will be wrong the moment someone adds an eighth.
With this rule in place, the per-repo files can drop the enumeration entirely and just list the teams they do use.
Testing
The sandbox is currently sitting in an ablated state on purpose: bare three-row mapping, no prose guardrails, and
Team:DocsEng/Team:Ingest/Team:Projectsleft on the menu as decoys. That is the ideal test bed for this rule specifically. I am pointingtest-manual-triage.ymlat this branch and re-running the two leak-path issues — a CI build crash that CODEOWNERS routes to@elastic/docs-engineering, and a get-started issue it routes to@elastic/core-docs. If they come back with no team label using only the bare mapping, that isolates this change as the cause.I will post the run IDs and requested labels here before marking this ready.
🤖 Generated with Claude Code
Related to #398