feat(rank): personalized ranking that learns from your clicks (Android A1)#48
Merged
Merged
Conversation
…d A1) Port the desktop click-personalization feature to Android (in-app learning, owner-gated server apply, and the opt-in UI), with a model and JSON format identical to the desktop app so a profile moves between devices. - engine/rank/Personalization.kt: a Beta-Bernoulli per-domain and per-(query-term x domain) click model fed by the position-bias-resistant "clicked over skipped-above" signal. Bounded boost (0.5x to 2x), epsilon-greedy exploration, cold-start gates, time decay, and eviction caps. Serializes to the portable beta_bernoulli_v1 JSON; a cross-platform fixture test loads a desktop-produced model and reproduces its boosts. - data/prefs/PersonalizationPreferences.kt: persists the model encrypted in the same store as the ranking rules (key ranking.personalization), fail-soft and absent when the vault is locked. - Apply pass runs in MetaSearchResultProvider between the sort and DomainRanker (so PIN/RAISE/BLOCK win). In-app results always personalize; the served path only does so for the loopback owner, so a network visitor gets engine order and never the owner's bubble. - Native clicks train the model via SearchViewModel.onResultOpened, using the displayed order for the skip-above signal; only when enabled. - Opt-in and recommended: a setup-wizard step and a Result-ranking settings toggle, plus Export / Import / Reset of the portable model. The wizard now re-appears once after a feature update (onboarding_version gate). A2 will add owner-only learning from clicks on the served browser page. Gate green: compileDebug, ktlint, lint, assembleDebug, unit tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 2, 2026
Merged
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.
What
Ports the desktop click-personalization feature to Android: in-app learning + owner-gated server apply + the opt-in UI, with a model and JSON format identical to the desktop app (already shipped in SearchMob-Desktop 26.06.00) so a learned profile moves between devices. This is A1; A2 will add owner-only learning from clicks on the served browser page (the
/clickroute).Algorithm (parity with desktop)
beta_bernoulli_v1JSON. A cross-platform fixture test loads a model produced by the desktop Python code and reproduces its exact boosts.Privacy / safety
ranking.personalization); absent without error when the vault is locked.Seams
Apply pass in
MetaSearchResultProvider(between sort andDomainRanker); native training viaSearchViewModel.onResultOpened; opt-in flag inPreferencesRepository; UI in the onboarding wizard +SettingsScreen.Tests
ktlint,lint,assembleDebug, and unit tests green. New: full model math/skip-above/decay/caps/clamp/cold-start/epsilon/JSON round-trip + the cross-platform desktop fixture; ViewModel native-training (records when enabled, nothing when off); updated the onboarding page-count and provider-fake signatures.🤖 Generated with Claude Code