Skip to content

Have the built-in policy pick one of two competing labels, not both or neither - #241

Merged
danielchalmers merged 1 commit into
mainfrom
c/builtin-prompt-labels-c2c496
Nov 9, 2026
Merged

danielchalmers merged 1 commit into
mainfrom
c/builtin-prompt-labels-c2c496

Conversation

@danielchalmers

Copy link
Copy Markdown
Owner

Why

On Haiku, the built-in policy got two label decisions wrong, both on pull requests that sit between two labels such as bug and enhancement:

  • Both labels. Teichos 139 ("Center the block page") got enhancement and bug, because its body has a "Fix:" section. "Add every repository label…" (AutoTriage 224) asks for every label with strong support and says nothing about labels that compete.
  • No label. Teichos 143 ("Make Go back a real history step so Forward returns to the block page") got nothing. Its summary said "The PR is a bug fix, but it is not clearly a report of something not working… The evidence is not clear enough to add 'bug' or 'enhancement' with confidence". Being unsure which of two labels fits better became a reason to add neither.

What

One line is added to the built-in policy, right after "Add every repository label…":

Where names and descriptions make labels alternatives to each other, an item takes only one of them: when more than one could fit, add the best fit alone, and add it even when the choice between them is close.

  • Still generic. It names no kinds and no authors. Which labels are alternatives is read from each repository's own label names and descriptions.
  • Only when more than one could fit. An item that fits no label, such as a CI or installer change, still gets none.
  • Nothing else changes. "Strongly supports" and the last line stay as they are.

Measurements

These are dry replays on claude-haiku-5-5: 846 calls, nothing written to GitHub. Each item was rebuilt as the bot first saw it, with its labels, title, body and timeline as of that moment, and run through the action's own prompts, schema and client. "Old" is the policy on main.

Both labels

Old New
Teichos 139, 20 runs bug and enhancement in 16 enhancement alone in 20
Teichos 148, 20 runs both in 10, enhancement alone in 10 one label in 20 (bug 12, enhancement 8)
Every run of the old and new policy both in 27 of 362 both in 0 of 362

No label

Teichos 143 itself didn't reproduce. Old and new both add bug in 40 of 40 runs, 20 of them on the production run's saved prompt, so that miss was a rare one.

The same miss does show up across 20 pull requests that the bot labeled bug or enhancement and the owner kept, from Teichos, DesktopClock, Network-Monitor, RadialActions, SentryDeck and Nuntia, at 8 runs each:

160 runs Old New
Nothing added 11 (6.9%) 3 (1.9%)
The label the owner kept 147 (91.9%) 151 (94.4%)
The other of the two 2 6

The old misses read like the production one. On DesktopClock 192: "The bug and enhancement labels both plausibly fit, but neither is clearly justified over the other".

Labels that are right today

  • 17 other kept labels (issues, documentation, dependencies), 3 runs each: 50 of 51 as kept before, where the odd one added both labels to DesktopClock 178, and 51 of 51 after.
  • Teichos 146, which the owner had already labeled: nothing added in 20 of 20, before and after.
  • 14 items nobody labeled, mostly installer, CI and refactoring pull requests, 3 runs each: nothing added in 21 of 42 before and 19 of 42 after.

Three Nuntia pull requests are left out. Their kept label is github_actions, which is archived now, so neither policy can add it.

A second variant also shortened the last line to "If no new label fits…". It fixed the same items but labeled more of the 14 unlabeled ones, with nothing added in only 16 of 42, so it isn't in this PR.

Verification

  • npm run verify passes, with 331 tests.
  • A new test asserts the line.
  • The bundle differs from main only by the added sentence, which is the wording that was measured.

Risk

  • A close call can land on the other label. "The other of the two" went from 2 to 6 of 160 runs. Half of those are Teichos 142, which got bug in 3 of 8 runs where the owner kept enhancement.
  • One label where two were wanted. Teichos 148 kept both labels and now gets one. A repository that wants both can say so in the labels' descriptions, but that wasn't measured.
  • Small numbers. The no-label result is 11 against 3 of 160 runs.

…r neither

"Add every repository label the item strongly supports" put both `bug` and `enhancement` on pull requests that sit between the two, and on a close call Haiku sometimes added neither.
One added line says an item takes only one of the labels that their names and descriptions make alternatives to each other: the best fit, even when the choice is close.
@github-actions github-actions Bot added the bug Something isn't working label Nov 9, 2026
@danielchalmers
danielchalmers merged commit 2226349 into main Nov 9, 2026
5 checks passed
@danielchalmers
danielchalmers deleted the c/builtin-prompt-labels-c2c496 branch November 9, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant