From a212bde51b424c61e6c2caa5b6bc7f9e0f8c25a1 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 18 Feb 2026 15:16:22 +0100 Subject: [PATCH] Warn when jurors lack profile data in AI assignment preview Shows warning with juror names when they have no expertise tags or bio, so admin can ask them to onboard before committing assignments. Co-Authored-By: Claude Opus 4.6 --- src/server/routers/roundAssignment.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/server/routers/roundAssignment.ts b/src/server/routers/roundAssignment.ts index 6286e27..ed4d3f5 100644 --- a/src/server/routers/roundAssignment.ts +++ b/src/server/routers/roundAssignment.ts @@ -190,9 +190,21 @@ export const roundAssignmentRouter = router({ const assignedProjectIds = new Set(assignments.map((a) => a.projectId)) + // Warn about jurors without profile data + const warnings: string[] = result.error ? [result.error] : [] + const incompleteJurors = jurors.filter( + (j) => (!j.expertiseTags || j.expertiseTags.length === 0) && !j.bio + ) + if (incompleteJurors.length > 0) { + const names = incompleteJurors.map((j) => j.name || 'Unknown').join(', ') + warnings.push( + `${incompleteJurors.length} juror(s) have no expertise tags or bio (${names}). Their assignments are based on workload balance only — consider asking them to complete their profile first.` + ) + } + return { assignments, - warnings: result.error ? [result.error] : [], + warnings, stats: { totalProjects: projects.length, totalJurors: jurors.length,