{"record":{"id":"32020d57ff69c6a6","repo":"Yeachan-Heo/oh-my-codex","slug":"cannot-record-a-blocked-ultragoal-checkpoint-while","errorCode":null,"errorMessage":"Cannot record a blocked ultragoal checkpoint while the existing Codex goal is ${snapshot.status ?? 'unknown'}; strict objective mismatch protection remains required for active or incomplete goals.","messagePattern":"Cannot record a blocked ultragoal checkpoint while the existing Codex goal is (.+?); strict objective mismatch protection remains required for active or incomplete goals\\.","errorType":"exception","errorClass":"UltragoalError","httpStatus":null,"severity":"error","filePath":"src/ultragoal/artifacts.ts","lineNumber":1846,"sourceCode":"      }\n      const evidence = assertNonEmpty(options.evidence, '--evidence');\n      goal.updatedAt = now;\n      plan.activeGoalId = goal.id;\n      plan.updatedAt = now;\n      await writePlan(cwd, plan);\n      await appendLedger(cwd, {\n        ts: now,\n        event: 'goal_blocked',\n        goalId: goal.id,\n        status: goal.status,\n        evidence,\n        codexGoal: options.codexGoal,\n        message: 'Native Codex goal status is blocked for the matching objective; recorded a non-terminal goal_blocked checkpoint. Continue work without treating this as complete or failed; re-check get_goal when the blocker clears.',\n      });\n      return plan;\n    }\n    if (snapshot.status !== 'complete') {\n      throw new UltragoalError(`Cannot record a blocked ultragoal checkpoint while the existing Codex goal is ${snapshot.status ?? 'unknown'}; strict objective mismatch protection remains required for active or incomplete goals.`);\n    }\n    const safeCompletedAggregateBlocker = isSafeCompletedAggregateBlockerSnapshot(plan, goal, snapshot, options.evidence);\n    if (!safeCompletedAggregateBlocker && blockedSnapshotMatchesExpected) {\n      throw new UltragoalError('Blocked ultragoal checkpoint is only for a different completed legacy Codex goal unless an aggregate Codex goal is already complete and unreconcilable while the active repo-native microgoal remains in progress.');\n    }\n    goal.updatedAt = now;\n    if (safeCompletedAggregateBlocker) goal.failureReason = assertNonEmpty(options.evidence, '--evidence');\n    plan.activeGoalId = goal.id;\n    plan.updatedAt = now;\n    await writePlan(cwd, plan);\n    await appendLedger(cwd, {\n      ts: now,\n      event: 'goal_blocked',\n      goalId: goal.id,\n      status: goal.status,\n      evidence: options.evidence,\n      codexGoal: options.codexGoal,\n      message: safeCompletedAggregateBlocker","sourceCodeStart":1828,"sourceCodeEnd":1864,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/ultragoal/artifacts.ts#L1828-L1864","documentation":"For a blocked checkpoint, the supplied Codex snapshot's status is neither 'blocked' nor 'complete' (or is unknown). Blocked checkpoints against an active/incomplete Codex goal are disallowed because strict objective-mismatch protection still applies to unfinished goals.","triggerScenarios":"Passing a snapshot with status 'active', 'in_progress', or any value other than 'blocked'/'complete' when recording a blocked checkpoint (the 'blocked' native path at 1206 and 'complete' path at 1207-1208 are the only allowed statuses).","commonSituations":"Recording 'blocked' while the Codex goal is still actively running; get_goal returning a new intermediate status after a Codex version update; racing between Codex state changes and the checkpoint call.","solutions":["Wait for the Codex goal to reach 'blocked' or 'complete' and re-fetch the snapshot before recording","If the goal is genuinely still running, don't record a blocked checkpoint yet — poll get_goal","Handle new Codex statuses by mapping them to the closest supported status in your snapshot adapter"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (snap.status !== 'blocked' && snap.status !== 'complete') { await waitForCodexGoalSettlement(); }","typeGuard":"const isSettledStatus = (s: unknown): s is 'blocked' | 'complete' => s === 'blocked' || s === 'complete';","tryCatchPattern":null,"preventionTips":["Poll get_goal until the goal settles before recording blocked checkpoints","Don't record blocked checkpoints while Codex work is still running"],"tags":["ultragoal","codex","status","blocked","state-machine"],"backgroundTag":"invalid-state-transition","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}