From bf0cb78d19c7675876ec227915a42a8c2d83a7bf Mon Sep 17 00:00:00 2001 From: Jesse Zhang Date: Fri, 17 Jul 2026 01:46:31 +0100 Subject: [PATCH] validate-data: handle agent-kind cases (turf-war) Port the agent-kind skip + agentName check from the site validator so turf-war runs (private policy, no public artifact) pass instead of erroring. Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/validate-data.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/validate-data.ts b/scripts/validate-data.ts index 0b6f376..474a9a0 100644 --- a/scripts/validate-data.ts +++ b/scripts/validate-data.ts @@ -96,6 +96,10 @@ for (const f of readdirSync(modelsDir).filter((f) => f.endsWith('.json'))) { if (run?.contributor !== undefined && (typeof run.contributor !== 'string' || !run.contributor.trim())) { errors.push(`models/${f}: ${where}.contributor must be a non-empty GitHub username`) } + const agentName = (run as { agentName?: unknown })?.agentName + if (agentName !== undefined && (typeof agentName !== 'string' || !agentName.trim() || agentName.length > 20)) { + errors.push(`models/${f}: ${where}.agentName must be a short non-empty string (max 20 chars)`) + } if (caseKind.get(caseId) === 'react') { // React case: the artifact is a full project directory, not a file. const dirName = (typeof run?.file === 'string' && run.file) || caseId @@ -113,7 +117,15 @@ for (const f of readdirSync(modelsDir).filter((f) => f.endsWith('.json'))) { } return } - const file = (typeof run?.file === 'string' && run.file) || `${caseId}.${caseKind.get(caseId)}` + const kind = caseKind.get(caseId) + if (kind === 'agent') { + // Agent policies are deliberately NOT public (anti-scouting): the run + // entry registers the combo for the roster/board, but the artifact + // lives on the private referee side, so there is nothing to check + // under outputs/ here. + return + } + const file = (typeof run?.file === 'string' && run.file) || `${caseId}.${kind}` if (seenFiles.has(file)) { errors.push(`models/${f}: ${where} resolves to the same artifact "${file}" as another variant — extra variants must set a distinct "file"`) }