feat: side panel shows per-juror baseline and balanced contribution

Extends the ranking router's roundEvaluationScores response with
per-juror grading stats (mean, stddev, count) plus the round's overall
mean/stddev. The side-sheet juror rows render 'typical X.XX →
contributes Y.YY' next to each Score badge whenever balanced is on,
making the z-rescaling visible per individual rather than only as a
project-level number.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt
2026-04-27 13:24:34 +02:00
parent 664a682585
commit ee68f8af41
2 changed files with 36 additions and 1 deletions

View File

@@ -537,6 +537,19 @@ export const rankingRouter = router({
}
}
return { byProject, balanced }
// Per-juror grading stats so the side panel can render each juror's
// personal baseline and rescaled contribution.
const jurorStats: Record<string, { mean: number; stddev: number; count: number }> = {}
for (const [userId, s] of balanceCtx.jurorStats.entries()) {
jurorStats[userId] = { mean: s.mean, stddev: s.stddev, count: s.count }
}
return {
byProject,
balanced,
jurorStats,
overallMean: balanceCtx.overallMean,
overallStddev: balanceCtx.overallStddev,
}
}),
})