Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/services/operator-dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@ export async function buildOperatorDashboardPayload(
// contributor via GET /v1/internal/fairness/contributors/:login instead.
label: "Contributor fairness flags",
value: String(contributorFairnessFlagCount),
delta: contributorFairnessFlagCount > 0 ? `${contributorGateEval.rows.length} contributor(s) evaluated` : "no outliers detected",
// contributorGateEval.rows is one row per (login, project) -- the SAME login active on two repos
// contributes two rows, so this counts evaluated rows, not unique contributors (that count lives on
// the "Global contributor fairness flags" tile below, via blendedContributorGateEval's per-login fold).
delta: contributorFairnessFlagCount > 0 ? `${contributorGateEval.rows.length} (login, project) row(s) evaluated` : "no outliers detected",
},
{
// #global-contributor-trust: the cross-repo blended counterpart -- one row per LOGIN (pooled across
Expand Down
6 changes: 4 additions & 2 deletions test/unit/operator-dashboard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,12 @@ describe("operator dashboard payload", () => {

const payload = await buildOperatorDashboardPayload(env);
expect(payload.metrics).toEqual(
expect.arrayContaining([expect.objectContaining({ label: "Contributor fairness flags", value: "1", delta: "3 contributor(s) evaluated" })]),
expect.arrayContaining([expect.objectContaining({ label: "Contributor fairness flags", value: "1", delta: "3 (login, project) row(s) evaluated" })]),
);
// #global-contributor-trust: every login here touches exactly one project, so the blended fold degenerates
// to the same per-login numbers as the per-project fold -- same outlier, same evaluated count.
// to the same per-login numbers as the per-project fold -- same outlier, same evaluated count. Here the
// "3 contributor(s)" wording IS accurate (unlike the per-project tile above): blendedContributorGateEval
// folds by login alone, so its row count genuinely is a count of unique contributors.
expect(payload.metrics).toEqual(
expect.arrayContaining([expect.objectContaining({ label: "Global contributor fairness flags", value: "1", delta: "3 contributor(s) evaluated" })]),
);
Expand Down