{"record":{"id":"c6561445c8d994c1","repo":"Yeachan-Heo/oh-my-codex","slug":"formatcodexgoalreconciliation-reconciliation-c65614","errorCode":null,"errorMessage":"${formatCodexGoalReconciliation(reconciliation)}${taskScopedRequirement}${remediation}","messagePattern":"\\$\\{formatCodexGoalReconciliation\\(reconciliation\\)\\}\\$\\{taskScopedRequirement\\}\\$\\{remediation\\}","errorType":"exception","errorClass":"UltragoalError","httpStatus":null,"severity":"error","filePath":"src/ultragoal/artifacts.ts","lineNumber":1926,"sourceCode":"            status: 'complete',\n            completedAt: now,\n            evidence: assertNonEmpty(options.evidence, '--evidence'),\n            codexGoal: options.codexGoal,\n          };\n        }\n      } else {\n        const taskScopedRequirement = aggregateMode && snapshot?.status === 'complete' && Boolean(snapshot.objective)\n          ? ' Completed task-scoped aggregate reconciliation requires the checkpoint goal to be the active in-progress OMX goal, evidence that names that active OMX goal id, names .omx/ultragoal/goals.json or ledger.jsonl, includes completed implementation plus validation/review evidence, and a get_goal objective that maps to the ultragoal brief.'\n          : '';\n        const remediation = reconciliation.snapshot.available\n          && reconciliation.snapshot.status === 'complete'\n          && Boolean(reconciliation.snapshot.objective)\n          && normalizeObjective(reconciliation.snapshot.objective ?? '') !== normalizeObjective(expectedObjective)\n          ? ` ${buildCompletedLegacyGoalRemediation(goal)}`\n          : reconciliation.snapshot.unavailableReason === 'db_schema_context_error'\n            ? ` ${buildUnavailableCodexGoalRemediation(goal)}`\n          : '';\n        throw new UltragoalError(`${formatCodexGoalReconciliation(reconciliation)}${taskScopedRequirement}${remediation}`);\n      }\n    }\n    if (\n      aggregateMode\n      && canPersistNormalFinalAggregateCompletion(\n        plan,\n        goal,\n        finalRunCheckpoint,\n        options.allowActiveFinalCodexGoal,\n      )\n    ) {\n      normalFinalAggregateCompletion = {\n        status: 'complete',\n        completedAt: now,\n        evidence: assertNonEmpty(options.evidence, '--evidence'),\n        codexGoal: options.codexGoal,\n      };\n    }","sourceCodeStart":1908,"sourceCodeEnd":1944,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/ultragoal/artifacts.ts#L1908-L1944","documentation":"The Codex goal reconciliation for a completion checkpoint failed; the thrown message concatenates formatCodexGoalReconciliation(reconciliation), a task-scoped requirement note, and remediation guidance (completed-legacy-goal remediation or db_schema_context_error remediation) explaining what mismatched and how to fix it.","triggerScenarios":"A completion checkpoint where reconcileCodexGoalSnapshot returns ok: false — e.g. the Codex goal status/objective doesn't satisfy the required allowedStatuses/requireSnapshot/requireComplete options for final or aggregate completion.","commonSituations":"Completing a goal while the Codex goal is still active or has a mismatched objective; legacy completed goals blocking create_goal; get_goal unavailable due to DB/schema/context errors during final completion.","solutions":["Read the embedded reconciliation detail: it states the actual snapshot status/objective vs what was required","Bring the Codex goal to the required state (finish it, or re-align objectives) and re-run get_goal before completing","If get_goal is failing with a DB/schema/context error, follow the included buildUnavailableCodexGoalRemediation guidance for that goal"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (e) { if (e instanceof UltragoalError) { const rec = formatCodexGoalReconciliation?.(null); console.error(e.message); /* message contains remediation steps */ await reconcileCodexAndRetry(); } }","preventionTips":["Run get_goal and satisfy the required statuses before completing","Read the embedded remediation text — it names the exact next action for both legacy-goal and db_schema_context_error cases"],"tags":["ultragoal","codex","reconciliation","completion"],"backgroundTag":"reconciliation-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}