{"record":{"id":"432157d18704a61e","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-or-invalid-verdict-expected-pass-fail","errorCode":null,"errorMessage":"Missing or invalid --verdict; expected pass, fail, or blocked.","messagePattern":"Missing or invalid --verdict; expected pass, fail, or blocked\\.","errorType":"validation","errorClass":"AutoresearchGoalError","httpStatus":null,"severity":"error","filePath":"src/cli/autoresearch-goal.ts","lineNumber":80,"sourceCode":"function positionalText(args: readonly string[]): string {\n  const valueTaking = new Set(['--topic', '--rubric', '--critic-command', '--slug', '--verdict', '--evidence', '--summary', '--artifact', '--codex-goal-json']);\n  const words: string[] = [];\n  for (let i = 0; i < args.length; i++) {\n    const arg = args[i];\n    if (valueTaking.has(arg)) { i += 1; continue; }\n    if (arg.startsWith('--')) continue;\n    words.push(arg);\n  }\n  return words.join(' ').trim();\n}\n\nfunction printJson(value: unknown): void {\n  console.log(JSON.stringify(value, null, 2));\n}\n\nfunction parseVerdict(value: string | undefined): AutoresearchGoalVerdict {\n  if (value === 'pass' || value === 'fail' || value === 'blocked') return value;\n  throw new AutoresearchGoalError('Missing or invalid --verdict; expected pass, fail, or blocked.');\n}\n\nexport async function autoresearchGoalCommand(args: string[]): Promise<void> {\n  const command = args[0] ?? 'help';\n  const rest = args.slice(1);\n  const json = hasFlag(rest, '--json');\n  const cwd = process.cwd();\n\n  try {\n    if (command === 'help' || command === '--help' || command === '-h') {\n      console.log(AUTORESEARCH_GOAL_HELP);\n      return;\n    }\n\n    if (command === 'create' || command === 'init') {\n      const topic = readValue(rest, '--topic') ?? positionalText(rest);\n      const rubric = await readMaybeFile(readValue(rest, '--rubric'));\n      const mission = await createAutoresearchGoal(cwd, {","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/autoresearch-goal.ts#L62-L98","documentation":"parseVerdict() only accepts exactly one of the strings pass, fail, or blocked. Any other value (or a missing --verdict) throws this AutoresearchGoalError during the verdict/checkpoint subcommand.","triggerScenarios":"Calling `omx autoresearch-goal verdict --slug X --verdict <v>` where v is not exactly 'pass'/'fail'/'blocked' — e.g. 'passed', 'ok', 'PASS' (case-sensitive), or omitting --verdict (readValue returns undefined). Also triggered when --verdict's value slot is a following flag, though that raises error 108 first.","commonSituations":"Writing 'passed' instead of 'pass', capitalized verdicts from UI labels, or forgetting the verdict flag entirely when recording a checkpoint.","solutions":["Use exactly one of: --verdict pass, --verdict fail, --verdict blocked (lowercase)","If the verdict is missing, decide the outcome first — the command is meaningless without it","Prefer the --verdict=pass inline form to avoid flag-value parsing issues"],"exampleFix":"// before\nomx autoresearch-goal verdict --slug g1 --verdict passed\n// after\nomx autoresearch-goal verdict --slug g1 --verdict pass","handlingStrategy":"validation","validationCode":"const VERDICTS = ['pass','fail','blocked'] as const;\nconst v = argv.verdict;\nif (!VERDICTS.includes(v)) throw new UsageError(`--verdict must be one of ${VERDICTS.join('|')}`);","typeGuard":"const isVerdict = (v: unknown): v is 'pass'|'fail'|'blocked' => v==='pass'||v==='fail'||v==='blocked';","tryCatchPattern":"try { await verdict(...); } catch (e) { if (e.message.includes('--verdict')) printVerdictUsage(); else throw e; }","preventionTips":["Lowercase and trim verdict strings from UI before passing to CLI","Map friendly labels to the three canonical verdicts in wrappers"],"tags":["cli","invalid-enum-value","verdict"],"backgroundTag":"invalid-enum-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}