{"challengeId":"max-cut","entry":"verifier.mjs","sha256":"53d50cee47ac4b7ca91a924e4ae9d6c58569a87d2d84c7b6f41c6ea9961addfb","scoreDirection":"maximize","scoreLabel":"cut weight","seedPolicy":{"mode":"fixed","testCount":1},"source":"// Frozen verifier for max-cut. Self-contained (no imports). The weighted graph\n// below (24 nodes) IS the instance — protected but readable. The agent splits the\n// nodes into two sides (0/1) and scores the total weight of edges that CROSS the\n// split (the \"cut\"). Max-Cut is the canonical NP-hard problem that quantum\n// optimizers (QAOA) benchmark on, and is exactly the ground state of an Ising\n// spin glass. Pure integer arithmetic — deterministic; seedPolicy \"fixed\".\n\nconst N = 24;\nconst EDGES = [\n  [0, 1, 2], [0, 5, 1], [0, 7, 3], [1, 2, 1], [1, 9, 2], [2, 3, 3], [2, 11, 1], [3, 4, 2],\n  [3, 13, 1], [4, 5, 3], [4, 15, 2], [5, 6, 1], [5, 17, 2], [6, 7, 2], [6, 19, 1], [7, 8, 3],\n  [7, 21, 1], [8, 9, 1], [8, 23, 2], [9, 10, 2], [10, 11, 3], [10, 0, 1], [11, 12, 1], [12, 13, 2],\n  [12, 2, 1], [13, 14, 3], [14, 15, 1], [14, 4, 2], [15, 16, 2], [16, 17, 1], [16, 6, 3], [17, 18, 2],\n  [18, 19, 1], [18, 8, 1], [19, 20, 3], [20, 21, 1], [20, 10, 2], [21, 22, 2], [22, 23, 1], [22, 12, 3],\n  [23, 0, 2], [1, 13, 1], [3, 15, 2], [5, 19, 1], [7, 17, 2], [9, 21, 1], [11, 23, 3], [2, 14, 1],\n];\n\nfunction gate(name, pass, detail) { return { name, pass, detail }; }\nfunction bad(name, detail) { return { ok: false, score: null, gates: [gate(name, false, detail)], behavior: {}, logs: [] }; }\n\nexport function verify(ctx) {\n  const side = ctx.solution && typeof ctx.solution === 'object' ? ctx.solution.side : undefined;\n  if (!Array.isArray(side) || side.length !== N) {\n    return bad('structure', `expected { side: [${N} values, each 0 or 1] }`);\n  }\n  for (const s of side) {\n    if (s !== 0 && s !== 1) return bad('structure', `each side must be 0 or 1; got ${String(s)}`);\n  }\n  let cut = 0;\n  let total = 0;\n  for (const [u, v, w] of EDGES) {\n    total += w;\n    if (side[u] !== side[v]) cut += w;\n  }\n  return {\n    ok: true,\n    score: cut,\n    gates: [gate('valid-partition', true, `cut weight ${cut} of ${total} total across ${EDGES.length} edges`)],\n    behavior: { cut, nodes: N },\n    logs: [`cut weight=${cut}`],\n  };\n}\n"}