{"record":{"id":"3f91b55faec5f320","repo":"Yeachan-Heo/oh-my-codex","slug":"formatcodexgoalreconciliation-reconciliation-3f91b5","errorCode":null,"errorMessage":"formatCodexGoalReconciliation(reconciliation)","messagePattern":"formatCodexGoalReconciliation\\(reconciliation\\)","errorType":"exception","errorClass":"UltragoalError","httpStatus":null,"severity":"error","filePath":"src/ultragoal/artifacts.ts","lineNumber":2110,"sourceCode":"  if (!isFinalRunCompletionCandidate(plan, goal)) {\n    throw new UltragoalError(`Cannot record final review blockers for ${goal.id}; it is not the only unresolved ultragoal story.`);\n  }\n\n  const now = iso(options.now);\n  const expectedObjective = expectedCodexObjective(plan, goal);\n  const aggregateMode = codexGoalMode(plan) === 'aggregate';\n  const reconciliation = reconcileCodexGoalSnapshot(\n    options.codexGoal === undefined ? null : parseCodexGoalSnapshot(options.codexGoal),\n    {\n      expectedObjective,\n      acceptedObjectives: aggregateMode ? compatibleCodexObjectives(plan) : undefined,\n      allowedStatuses: ['active'],\n      requireSnapshot: true,\n      requireComplete: false,\n    },\n  );\n  if (!reconciliation.ok) {\n    throw new UltragoalError(formatCodexGoalReconciliation(reconciliation));\n  }\n\n  const addedGoal = appendGoalToPlan(plan, { ...options, now: options.now, resolvesReviewBlockedGoalId: goal.id });\n  goal.status = 'review_blocked';\n  goal.reviewBlockedAt = now;\n  goal.updatedAt = now;\n  goal.completedAt = undefined;\n  goal.failedAt = undefined;\n  goal.failureReason = undefined;\n  goal.evidence = options.evidence;\n  goal.reviewBlockerResolution = {\n    resolverGoalId: addedGoal.id,\n    status: 'pending',\n    evidence: options.evidence,\n  };\n  if (plan.activeGoalId === goal.id) delete plan.activeGoalId;\n  plan.updatedAt = now;\n","sourceCodeStart":2092,"sourceCodeEnd":2128,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/ultragoal/artifacts.ts#L2092-L2128","documentation":"The Codex goal snapshot reconciliation required for recording final review blockers failed (allowedStatuses ['active'], snapshot required, completion not required). The formatted reconciliation message from formatCodexGoalReconciliation describes the exact mismatch — typically the snapshot is missing, unavailable, or the Codex goal is not active.","triggerScenarios":"Calling recordFinalReviewBlockers where reconcileCodexGoalSnapshot fails because --codex-goal-json is missing/unavailable or the Codex goal status isn't 'active'.","commonSituations":"Forgetting to pass a fresh get_goal snapshot; the Codex goal already completed or blocked before review blockers were recorded; get_goal errors during final review.","solutions":["Run Codex get_goal, confirm the goal is still 'active', and pass the snapshot JSON","If the goal is no longer active, record the appropriate completion/blocked checkpoint instead of review blockers","Read formatCodexGoalReconciliation output embedded in the message for the precise mismatch"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const snap = parseCodexGoalSnapshot(options.codexGoal);\nif (!snap?.available || snap.status !== 'active') { await refreshGetGoal(); }","typeGuard":"const isActiveSnapshot = (s: any) => Boolean(s?.available) && s?.status === 'active';","tryCatchPattern":null,"preventionTips":["Always attach a fresh active get_goal snapshot when recording blockers","Re-check goal status right before the call to avoid races"],"tags":["ultragoal","codex","reconciliation","review-blockers"],"backgroundTag":"reconciliation-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}