Skip to content

Add a DISTRIBUTION panel: where a card stands among all of GitHub#37

Open
ykdojo wants to merge 7 commits into
Younesfdj:devfrom
ykdojo:upstream-contribution
Open

Add a DISTRIBUTION panel: where a card stands among all of GitHub#37
ykdojo wants to merge 7 commits into
Younesfdj:devfrom
ykdojo:upstream-contribution

Conversation

@ykdojo

@ykdojo ykdojo commented Jul 5, 2026

Copy link
Copy Markdown

This PR adds a small DISTRIBUTION section under the scouting metrics that
shows where a card stands, in the report's existing visual language:

The DISTRIBUTION panel on a scout report

It is a histogram of the overall ratings of 18,107 uniformly random GitHub
accounts, scored with this repo's own engine. Hovering the caption explains
the numbers, using the existing Tip component:

The percentile tooltip

The change: DistributionPanel.tsx (SVG, no new dependencies, reuses the
Section styling and the now-exported Tip), lib/distribution-data.ts
(anonymous per-rating counts for two populations: all accounts, and those
with at least one contribution in the past year), and a small mount in
ResultView.tsx. Four files, ~116 lines.

Methodology: GitHub account ids are sequential and dense, so ids drawn
uniformly at random from [1, 300M] (a ceiling just above the current max id)
give an unbiased sample of all accounts; organizations filtered out. Scoring uses the
real buildCard. 20,000 logins attempted
on 2026-07-03/04; 18,107 scorable (the rest are suspended or spam accounts).

ykdojo added 2 commits July 5, 2026 16:39
A small histogram under the scouting metrics showing the rating
distribution of 18,107 uniformly random GitHub accounts (scored with
this repo's own engine), with the card's overall marked and two
percentile baselines: all of GitHub, and accounts active in the past
year. Data is fully anonymized (per-rating counts only).
@ykdojo ykdojo marked this pull request as ready for review July 6, 2026 00:04
@ykdojo ykdojo marked this pull request as draft July 6, 2026 00:10
@ykdojo ykdojo marked this pull request as ready for review July 6, 2026 00:23
@Younesfdj Younesfdj changed the base branch from master to dev July 7, 2026 00:39
@Younesfdj

Copy link
Copy Markdown
Owner

Hello @ykdojo, Before I merge this, the commits are authored under 14807308+ykdojo@users.noreply.github.com, which resolves to a different account (alisonschwartzlulu), not yours. Is that an alt from your agent tooling? Happy to merge, but I'd rather the attribution point at you.
can you rebase with your real email, or are you fine with me squashing and cleaning up the co-author trailer

@ykdojo

ykdojo commented Jul 7, 2026

Copy link
Copy Markdown
Author

are you fine with me squashing and cleaning up the co-author trailer

Yes, happy with you squashing and cleaning it up later, thanks!

@ykdojo ykdojo force-pushed the upstream-contribution branch from 131def6 to e378297 Compare July 8, 2026 01:01
@ykdojo

ykdojo commented Jul 8, 2026

Copy link
Copy Markdown
Author

should be fixed now

@Younesfdj

Copy link
Copy Markdown
Owner

@ykdojo thank you, will review it in dev
should be available in prod in the next release after review

@Younesfdj

Younesfdj commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Really like this one - the panel fits the report's style and the baked-data approach means zero runtime cost, which is exactly what I want.

One thing before I can merge: can you attach the sampling/scoring script you used to generate distribution-data.ts? The histogram is tied to the current scoring engine, so any time scoring changes I'll need to re-bake the numbers - I have to be able to reproduce them myself. Don't commit it under scripts/ the folder is ignored.

Move the baked histogram out of TypeScript constants into
lib/distribution-data.json; lib/distribution-data.ts becomes a thin typed
re-export so component imports are unchanged. The data itself is untouched
(same n=18,107 sample from 2026-07-04).

Add distribution-runner.ts, which regenerates the JSON from scratch:
uniform random id sampling, the same GraphQL signals the server fetches,
scoring via the repo's own signalsFromPayload + buildCard, aggregated
in memory so only anonymous per-rating counts ever touch disk. A --check
mode scores named logins for comparison against the live site.

Add a vitest suite locking the histogram invariants the panel relies on.
delfinadap and others added 3 commits July 8, 2026 15:53
--sample now defaults to 20,000 attempted accounts, matching the original
run (18,107 scored). Periodic flushes mark the output complete: false; a
plain rerun that finds an interrupted file stops with instructions instead
of silently discarding it, --resume reloads the aggregate and continues
toward the target (keeping the original sample date), and --fresh discards
it explicitly. Resuming is deliberately not automatic so a rerun after a
scoring change cannot mix old and new scores. Errors now exit with a clean
one-line message instead of a stack trace.

The committed snapshot gains the matching metadata (attempted: 20000,
complete: true); counts are byte-identical.
The invariants it locked are only violated by a buggy runner or a hand-edited
JSON; small-sample runs and --check already cover the former at regeneration
time. Keeps the PR to the script and the data.
Make the distribution data scriptable: JSON data + end-to-end runner
@ykdojo

ykdojo commented Jul 8, 2026

Copy link
Copy Markdown
Author

done 9247025

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.

3 participants