{"record":{"id":"7cf693a7a8603ab5","repo":"Yeachan-Heo/oh-my-codex","slug":"sandbox-md-frontmatter-evaluator-command-is-requir","errorCode":null,"errorMessage":"sandbox.md frontmatter evaluator.command is required.","messagePattern":"sandbox\\.md frontmatter evaluator\\.command is required\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/autoresearch/contracts.ts","lineNumber":166,"sourceCode":"  const { frontmatter, body } = extractFrontmatter(content);\n  const parsedFrontmatter = parseSimpleYamlFrontmatter(frontmatter);\n  const evaluatorRaw = parsedFrontmatter.evaluator;\n\n  if (!evaluatorRaw || typeof evaluatorRaw !== 'object' || Array.isArray(evaluatorRaw)) {\n    throw contractError(EVALUATOR_BLOCK_ERROR);\n  }\n\n  const evaluator = evaluatorRaw as { command?: unknown; format?: unknown; keep_policy?: unknown };\n  const command = typeof evaluator.command === 'string'\n    ? evaluator.command.trim()\n    : '';\n  const format = typeof evaluator.format === 'string'\n    ? evaluator.format.trim().toLowerCase()\n    : '';\n  const keepPolicy = parseKeepPolicy(evaluator.keep_policy);\n\n  if (!command) {\n    throw contractError(EVALUATOR_COMMAND_ERROR);\n  }\n  if (!format) {\n    throw contractError(EVALUATOR_FORMAT_REQUIRED_ERROR);\n  }\n  if (format !== 'json') {\n    throw contractError(EVALUATOR_FORMAT_JSON_ERROR);\n  }\n\n  return {\n    frontmatter: parsedFrontmatter,\n    evaluator: {\n      command,\n      format: 'json',\n      ...(keepPolicy ? { keep_policy: keepPolicy } : {}),\n    },\n    body,\n  };\n}","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/autoresearch/contracts.ts#L148-L184","documentation":"parseSandboxContract throws EVALUATOR_COMMAND_ERROR when the evaluator block exists but its command is missing or trims to an empty string. evaluator.command is the executable command the sandbox runs to evaluate results, so an empty value makes the contract unusable.","triggerScenarios":"Frontmatter with an evaluator block but no 'command:' key, 'command:' with no value, or 'command: \"   \"' (whitespace only, trimmed to empty).","commonSituations":"Authoring sandbox.md and forgetting the command; placeholder text left as empty; indentation mistakes that put command at the wrong nesting level so it never lands in the evaluator object.","solutions":["Add 'command: <shell command>' nested under evaluator, e.g. 'command: ./evaluate.sh'.","Verify the command line is indented under the evaluator section (one level).","Ensure the value is non-empty after trimming."],"exampleFix":"# before\nevaluator:\n  format: json\n\n# after\nevaluator:\n  command: ./evaluate.sh\n  format: json","handlingStrategy":"validation","validationCode":"function evaluatorCommandPresent(content: string): boolean {\n  return /^[ \\t]+command:\\s*\\S+/m.test(content);\n}","typeGuard":"const hasCommand = (ev: { command?: unknown }): boolean =>\n  typeof ev.command === 'string' && ev.command.trim().length > 0;","tryCatchPattern":"try {\n  parseSandboxContract(content);\n} catch (err) {\n  if ((err as Error).message.includes('evaluator.command is required')) {\n    // add non-empty 'command:' under the evaluator section\n  }\n  throw err;\n}","preventionTips":["Always include evaluator.command with the real eval command.","Nest command under evaluator with one-level indentation.","Run parseSandboxContract on sandbox.md files in CI."],"tags":["yaml","frontmatter","evaluator","required-field"],"backgroundTag":"missing-required-field","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}