fix(taste): rejected preferences must carry rejection-strength confidence#1777
Open
jbetala7 wants to merge 1 commit into
Open
fix(taste): rejected preferences must carry rejection-strength confidence#1777jbetala7 wants to merge 1 commit into
jbetala7 wants to merge 1 commit into
Conversation
…ence bumpPref() computed confidence as approved_count/(total+1) for both buckets. Rejected-bucket entries never gain approvals, so their confidence was pinned to 0 — making `show` print "conf 0.00" for every rejection, the rejection ranking a no-op, and the taste-drift warning (opp.confidence >= 0.6) unreachable through real CLI use. Compute confidence from this bucket's own count. Approved-bucket behavior is unchanged (total == approved_count there); rejected entries now reflect rejection strength. Fixes garrytan#1776 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repro / observed problem
In
bin/gstack-taste-update, every preference in arejectedbucket is permanently stored withconfidence: 0, regardless of how many times the value is rejected. On upstream main (19770ea):Root cause
bumpPref()computed confidence as approval rate for both buckets:The approved and rejected lists are disjoint, so a rejected-bucket entry only ever gets
rejected_countincremented —approved_countstays 0 andconfidenceis always0. That broke three things:showprintsconf 0.00for every rejection.showranks rejections byconfidence * rejected_count=0for all, so the top-3 is insertion order, not the strongest rejections.opp.confidence >= 0.6) is unreachable through real CLI use. The existing test only passed it by hand-seedingconfidence: 0.8viawriteProfile, with a comment admitting the natural value is0/5.Fix
Compute confidence from this bucket's own count:
Approved-bucket confidence is unchanged (there
total === approved_count, soapproved_count/(total+1)is identical). Rejected entries now reflect rejection strength, socrimson(3 rejections) → 0.75 andbeige(1) → 0.50, the ranking orders by strength, and the drift warning fires after enough real rejections.Testing
bun test test/taste-engine.test.ts— 22 pass (19 existing + 3 new). Added:repeated rejections raise rejected confidence toward 1(5 rejections → 5/6)show ranks rejections by strength, not insertion orderdrift warning fires from real CLI rejections (no seeding)All three fail on main and pass with this change. Verified
git diff --checkclean andgit merge-tree --write-tree HEAD origin/mainmerges cleanly.Fixes #1776