{"record":{"id":"251ce192656d2eea","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-objective","errorCode":null,"errorMessage":"Missing --objective.","messagePattern":"Missing --objective\\.","errorType":"exception","errorClass":"UltragoalError","httpStatus":null,"severity":"error","filePath":"src/cli/ultragoal.ts","lineNumber":439,"sourceCode":"          reason: reconciliation.snapshot.unavailableReason,\n          message: 'Codex goal DB/schema/context is unavailable; artifact-backed Ultragoal status remains available, but strict Codex goal completion reconciliation is deferred.',\n        }\n        : undefined;\n      if (json) printJson({ plan, summary: summarizeUltragoalPlan(plan), reconciliation, codexGoalFallback });\n      else {\n        printStatus(plan);\n        if (codexGoalFallback) console.log(`codex goal fallback: ${codexGoalFallback.message}`);\n        if (reconciliation && !reconciliation.ok) console.log(`codex goal warning: ${formatCodexGoalReconciliation(reconciliation)}`);\n        else if (reconciliation?.warnings.length) console.log(`codex goal warning: ${formatCodexGoalReconciliation(reconciliation)}`);\n      }\n      return;\n    }\n\n    if (command === 'add-goal') {\n      const title = readValue(rest, '--title');\n      const objective = readValue(rest, '--objective');\n      if (!title?.trim()) throw new UltragoalError('Missing --title.');\n      if (!objective?.trim()) throw new UltragoalError('Missing --objective.');\n      const result = await addUltragoalGoal(cwd, { title, objective, evidence: readValue(rest, '--evidence') });\n      if (json) printJson({ ok: true, plan: result.plan, addedGoal: result.goal, summary: summarizeUltragoalPlan(result.plan) });\n      else {\n        console.log(`ultragoal added goal: ${result.goal.id}`);\n        printStatus(result.plan);\n      }\n      return;\n    }\n\n    if (command === 'steer') {\n      const proposalText = readValue(rest, '--proposal');\n      const source = readValue(rest, '--source');\n      if (proposalText) {\n        const parsed = assertPlainObject(await readJsonInput(proposalText, '--proposal'), '--proposal');\n        const proposal = normalizeSteeringProposal({ ...parsed, source: source ?? parsed.source }, proposalText);\n        const result = await steerUltragoal(cwd, proposal, { directiveText: proposalText });\n        printSteerResult(proposal, result, json);\n        if (!result.accepted) process.exitCode = 1;","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/ultragoal.ts#L421-L457","documentation":"The add-goal subcommand requires --objective (trimmed non-empty) alongside --title; the objective describes the measurable completion criterion for the new goal. Missing or whitespace-only objective aborts before any state is written.","triggerScenarios":"`omx ultragoal add-goal --title 'X'` without --objective, or `--objective \"\"` / whitespace-only value.","commonSituations":"Splitting title/objective mentally into one field; empty variable expansion in scripts; interactive drafting where objective was left for later.","solutions":["Add `--objective \"...\"` describing the done-criteria","Guard scripts with `--objective \"${OBJ:?set OBJ}\"`"],"exampleFix":"# before\nomx ultragoal add-goal --title 'DB migration'\n# Error: Missing --objective.\n\n# after\nomx ultragoal add-goal --title 'DB migration' --objective 'schema v2 migrated with zero-downtime cutover'","handlingStrategy":"validation","validationCode":"if (!objective?.trim()) { console.error('--objective required'); process.exit(2); }","typeGuard":"function isNonEmptyString(v: string | undefined | null): v is string {\n  return typeof v === 'string' && v.trim().length > 0;\n}","tryCatchPattern":null,"preventionTips":["Write objectives as verifiable done-criteria up front","Validate required flag pairs together before invoking the CLI"],"tags":["cli","ultragoal","missing-argument"],"backgroundTag":"missing-required-cli-flag","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}