{"challengeId":"graph-color","entry":"verifier.mjs","sha256":"53250d76a46a69b3001f72ff8d2c573a0745f9f76b84b018b49a4762a4b8231c","scoreDirection":"minimize","scoreLabel":"colors","seedPolicy":{"mode":"fixed","testCount":1},"source":"// Frozen verifier for graph-color. Self-contained (no imports). The graph below\n// (20 nodes, fixed edge list) IS the instance — it lives in this protected file\n// so agents can READ it to color, but cannot change it. The agent's build()\n// returns { colors: [c0, c1, ..., c19] }, one non-negative integer per node.\n// Verification: confirm it is a PROPER coloring (no edge joins two equal colors),\n// then score = the number of DISTINCT colors used (minimize). Pure integer logic,\n// no hidden input, nothing to overfit — seedPolicy.mode is \"fixed\".\n\nconst N = 20;\nconst EDGES = [\n  [0, 1], [0, 2], [0, 3], [1, 2], [1, 4], [2, 5], [3, 4], [3, 6],\n  [4, 7], [5, 6], [5, 8], [6, 9], [7, 8], [7, 10], [8, 11], [9, 10],\n  [9, 12], [10, 13], [11, 12], [11, 14], [12, 15], [13, 14], [13, 16],\n  [14, 17], [15, 16], [15, 18], [16, 19], [17, 18], [18, 19], [0, 19],\n  [1, 15], [2, 17], [3, 11], [4, 12], [5, 16], [6, 18], [7, 13], [8, 14],\n  [9, 19], [10, 0],\n];\n\nfunction gate(name, pass, detail) {\n  return { name, pass, detail };\n}\nfunction bad(name, detail) {\n  return { ok: false, score: null, gates: [gate(name, false, detail)], behavior: {}, logs: [] };\n}\n\nexport function verify(ctx) {\n  const sol = ctx.solution;\n  const colors = sol && typeof sol === 'object' ? sol.colors : undefined;\n  if (!Array.isArray(colors) || colors.length !== N) {\n    return bad('structure', `expected { colors: [${N} non-negative integers, one per node] }`);\n  }\n  for (const c of colors) {\n    if (!Number.isInteger(c) || c < 0) {\n      return bad('structure', `every color must be a non-negative integer; got ${String(c)}`);\n    }\n  }\n  for (const [u, v] of EDGES) {\n    if (colors[u] === colors[v]) {\n      return bad('proper-coloring', `nodes ${u} and ${v} are connected but share color ${colors[u]}`);\n    }\n  }\n  const used = new Set(colors).size;\n  return {\n    ok: true,\n    score: used,\n    gates: [gate('proper-coloring', true, `no edge joins two equal colors across ${EDGES.length} edges`)],\n    behavior: { colors: used, nodes: N },\n    logs: [`proper coloring with ${used} distinct colors over ${N} nodes`],\n  };\n}\n"}