fix: backfill binaryDecision, fix boolean criterion lookup, add assign buttons
All checks were successful
Build and Push Docker Image / build (push) Successful in 10m9s
All checks were successful
Build and Push Docker Image / build (push) Successful in 10m9s
- Backfilled 166 evaluations' binaryDecision from criterionScoresJson on production DB - Fixed roundEvaluationScores and ai-ranking to look in EvaluationForm.criteriaJson instead of round.configJson for the boolean "Move to the Next Stage?" criterion - Added advanceMode (count/threshold) toggle to round config Advancement Targets - Added "Assign to Jurors" button on Unassigned Projects section and Projects tab bulk bar Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -247,17 +247,11 @@ function anonymizeProjectsForRanking(
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the boolean criterion ID for "Move to the Next Stage?" from round config.
|
||||
* Returns null if no such criterion exists.
|
||||
* Find the boolean criterion ID for "Move to the Next Stage?" from criteria definitions.
|
||||
* Accepts criteria from EvaluationForm.criteriaJson (preferred) or round configJson (legacy).
|
||||
*/
|
||||
function findBooleanCriterionId(roundConfig: Record<string, unknown> | null): string | null {
|
||||
if (!roundConfig) return null
|
||||
const criteria = (roundConfig.criteria ?? roundConfig.evaluationCriteria ?? []) as Array<{
|
||||
id: string
|
||||
label: string
|
||||
type?: string
|
||||
}>
|
||||
const boolCriterion = criteria.find(
|
||||
function findBooleanCriterionId(criterionDefs: Array<{ id: string; label: string; type?: string }>): string | null {
|
||||
const boolCriterion = criterionDefs.find(
|
||||
(c) => c.type === 'boolean' && c.label?.toLowerCase().includes('move to the next stage'),
|
||||
)
|
||||
return boolCriterion?.id ?? null
|
||||
@@ -593,7 +587,6 @@ export async function fetchAndRankCategory(
|
||||
])
|
||||
|
||||
const roundConfig = round.configJson as Record<string, unknown> | null
|
||||
const boolCriterionId = findBooleanCriterionId(roundConfig)
|
||||
|
||||
// Parse evaluation config for criteria weights
|
||||
const evalConfig = roundConfig as EvaluationConfig | null
|
||||
@@ -603,6 +596,7 @@ export async function fetchAndRankCategory(
|
||||
const criterionDefs: CriterionDef[] = evalForm?.criteriaJson
|
||||
? (evalForm.criteriaJson as unknown as CriterionDef[])
|
||||
: []
|
||||
const boolCriterionId = findBooleanCriterionId(criterionDefs)
|
||||
const numericCriterionIds = new Set(
|
||||
criterionDefs.filter((d) => !d.type || d.type === 'numeric').map((d) => d.id),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user