Make trust score an absolute 0-100 scale instead of relative-to-max#2
Open
wwhitehead wants to merge 1 commit into
Open
Make trust score an absolute 0-100 scale instead of relative-to-max#2wwhitehead wants to merge 1 commit into
wwhitehead wants to merge 1 commit into
Conversation
The displayed trust score was normalized against the caller's highest
combined_raw, which had three problems:
- The top contact always showed 100, even with a single stale vouch.
- Every contact's score shifted whenever an unrelated contact gained
or lost vouch weight.
- The same number meant different things for different users.
The score now maps combined_raw onto a fixed saturating scale:
score = 100 * (1 - 2^(-combined_raw / 4))
Each additional 4.0 of combined vouch weight closes half the remaining
distance to 100 -- the same halving convention as the existing 2-year
time-decay half-life, applied to vouch mass instead of age. With default
weights, two fresh direct vouches score 50, four score 75, and strong
ties approach 100 asymptotically.
The contact list ring (js/contacts.js) previously mirrored the
relative normalization against the max of visible rows; it now uses the
same absolute formula, so the list and the Contact Details ring always
agree. max_combined_raw is still returned by the RPC for transparency
but no longer feeds the score.
To apply: re-run sql/contact-details-schema.sql in the Supabase SQL
editor (it only replaces the two functions; no schema changes).
Author
|
BTW I really like where you're going with this. I saw a few other things as I was going thru the repo and the docs. I'll follow up when i have something a little more solid. This is going to be pretty cool. |
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.
Problem
The displayed trust score divides
combined_rawby the caller's maximum across all their contacts. That has three side effects:Change
The score now maps
combined_rawonto a fixed saturating scale:Each additional 4.0 of combined vouch weight closes half the remaining distance to 100 — the same halving convention as the existing 2-year time-decay half-life, applied to vouch mass instead of age. With the default 2/1/3 weights: two fresh direct vouches score 50, four score 75, and strong ties approach 100 asymptotically. A contact's score now depends only on vouches involving that contact, so it is stable and comparable.
sql/contact-details-schema.sql— newc_score_half_rawconstant + the scale, documented in the same style as the time-decay block.max_combined_rawis still returned for transparency but no longer feeds the score.js/contacts.js— the contact-list trust ring previously mirrored the relative normalization against the max of visible rows; it now uses the identical absolute formula (trustScoreFromRaw), so the list and the Contact Details ring always agree.js/contact-details.js— Trust Details dialog copy updated to describe the fixed scale.To apply
Re-run
sql/contact-details-schema.sqlin the Supabase SQL editor — it only replaces the two functions; no schema changes.Note on calibration
The half-point constant
4.0is a calibration choice made against the default weights. If typical productioncombined_rawvalues run higher or lower, this is the knob to move — happy to adjust it against real data.