Skip to content

Make trust score an absolute 0-100 scale instead of relative-to-max#2

Open
wwhitehead wants to merge 1 commit into
PhilipRosedale:mainfrom
wwhitehead:trust-score-absolute-scale
Open

Make trust score an absolute 0-100 scale instead of relative-to-max#2
wwhitehead wants to merge 1 commit into
PhilipRosedale:mainfrom
wwhitehead:trust-score-absolute-scale

Conversation

@wwhitehead

Copy link
Copy Markdown

Problem

The displayed trust score divides combined_raw by the caller's maximum across all their contacts. That has three side effects:

  • The top contact always shows 100, even if they have a single stale vouch.
  • Every contact's score silently shifts whenever an unrelated contact gains or loses vouch weight.
  • The same number means different things for different users, so scores aren't comparable.

Change

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 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 — new c_score_half_raw constant + the scale, documented in the same style as the time-decay block. max_combined_raw is 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.sql in the Supabase SQL editor — it only replaces the two functions; no schema changes.

Note on calibration

The half-point constant 4.0 is a calibration choice made against the default weights. If typical production combined_raw values run higher or lower, this is the knob to move — happy to adjust it against real data.

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).
@wwhitehead

wwhitehead commented Jul 2, 2026

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant