Skip to content

Elemental Showdown: the scoring function (#161) - #172

Merged
jacobcheatley merged 1 commit into
feat/160-cast-vote-tugfrom
feat/161-scoring-function
Sep 22, 2026
Merged

jacobcheatley merged 1 commit into
feat/160-cast-vote-tugfrom
feat/161-scoring-function

Conversation

@jacobcheatley

@jacobcheatley jacobcheatley commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Closes #161. Part of #158.

scoreMatchup turns a Matchup's three sums (count, sum(value), sum(value²)) into a typed score: Effectiveness, Confidence, the shrunk mean m, polarisation P and the selection weight, with the prior and every cut as a named constant. mirrorEffectiveness reads a call from the higher-id Element's side, and headlineFor gives the reveal's headline kind for a Voter's Vote. Pure and browser-safe; zero Votes score as faint Neutral from the prior alone.

Verification

Pure tests on both sides of every cut (|m| at 0.5 and 1.5, P at 0.6, h at 0.25 and 0.5) using crowds built from real Votes so the sums cannot disagree, plus the headline at 1, 4 and 5 Votes and at distances 0, 1 and 2. bun run check and bun run test green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AVEtgjCoEbaNHrYfzyCRNH

@jacobcheatley
jacobcheatley added this pull request to stack #182 September 22, 2026 00:37
@jacobcheatley jacobcheatley changed the title Elemental Showdown: score a Matchup from its three sums Elemental Showdown: the scoring function (#161) Sep 22, 2026
@jacobcheatley
jacobcheatley marked this pull request as ready for review September 22, 2026 00:38
One pure function turns a Matchup's count, sum(value) and sum(value²)
into the numbers the reveal, the Stats, the Stories and Matchup
selection all read: its Effectiveness from the lower-id Element's side,
its Confidence, the shrunk mean Vote, the polarisation and the selection
weight. The Dirichlet-multinomial posterior behind them, the prior, the
cuts and the verdict gate live here by name and nowhere else.

A Matchup nobody has voted on needs no special case: the prior alone
scores it as faint Neutral. Mirroring turns the lower-id Element's call
into the higher-id one's, and the headline reads the Voter's own Vote
against the crowd's step once the Matchup has enough Votes to have one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AVEtgjCoEbaNHrYfzyCRNH
@jacobcheatley
jacobcheatley force-pushed the feat/161-scoring-function branch from 53d77f8 to db1f9e4 Compare September 22, 2026 01:08
@jacobcheatley
jacobcheatley merged commit 4b010c9 into main Sep 22, 2026
14 checks passed
@jacobcheatley
jacobcheatley deleted the feat/161-scoring-function branch September 22, 2026 06:13
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.

Elemental Showdown: the scoring function

1 participant