{"challengeId":"dna-assembly","entry":"verifier.mjs","sha256":"d7800ed92c177f2abafc00a6348477bfccdfcd9569760cfaaf2f66d399a914d7","scoreDirection":"minimize","scoreLabel":"bases","seedPolicy":{"mode":"fixed","testCount":1},"source":"// Frozen verifier for dna-assembly. Self-contained (no imports). The fragments\n// below are short DNA reads pulled from one underlying sequence. The agent submits\n// a single \"superstring\" that must CONTAIN every fragment as a substring; the\n// score is its length (shorter wins). This is the Shortest Common Superstring\n// problem — the NP-hard core of genome assembly, where overlapping reads are\n// merged back into the original sequence. Pure string logic; deterministic;\n// seedPolicy \"fixed\".\n\nconst FRAGMENTS = [\n  'ACGTTGCAACGT', 'GCAACGTGGCAT', 'GTGGCATTACGG', 'ATTACGGACTGA', 'GGACTGACATTG',\n  'GACATTGCCAAT', 'TGCCAATGCAGG', 'ATGCAGGTTACC', 'GGTTACCGATCG', 'CCGATCGTTAGC', 'TCGTTAGCACTG',\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 s = ctx.solution && typeof ctx.solution === 'object' ? ctx.solution.superstring : undefined;\n  if (typeof s !== 'string' || !/^[ACGT]+$/.test(s)) {\n    return bad('structure', 'expected { superstring: \"<non-empty string over A/C/G/T>\" }');\n  }\n  if (s.length > 5000) return bad('structure', 'superstring must be at most 5000 bases');\n  const missing = FRAGMENTS.filter((f) => !s.includes(f));\n  if (missing.length) {\n    return bad('coverage', `superstring is missing ${missing.length} fragment(s), e.g. ${missing.slice(0, 3).join(', ')}`);\n  }\n  return {\n    ok: true,\n    score: s.length,\n    gates: [gate('covers-all-fragments', true, `contains all ${FRAGMENTS.length} fragments in ${s.length} bases`)],\n    behavior: { length: s.length, fragments: FRAGMENTS.length },\n    logs: [`superstring length=${s.length}`],\n  };\n}\n"}