{"record":{"id":"17d4500a75f06798","repo":"Yeachan-Heo/oh-my-codex","slug":"blocked-ultragoal-checkpoint-is-only-for-a-differe","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"exception","errorClass":"UltragoalError","httpStatus":null,"severity":"error","filePath":"src/ultragoal/artifacts.ts","lineNumber":1850,"sourceCode":"      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\n        ? 'Completed aggregate Codex goal is already terminal while the repo-native microgoal remains in progress; recorded a non-terminal safe-recovery blocker to avoid repeating an impossible checkpoint loop.'\n        : undefined,\n    });\n    return plan;","sourceCodeStart":1832,"sourceCodeEnd":1868,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/ultragoal/artifacts.ts#L1832-L1868","documentation":"The Codex snapshot is 'complete' but it matches this goal's expected objective and is not a safe completed aggregate blocker. A completed matching goal means the work finished, so a blocked checkpoint for it is contradictory — blocked checkpoints on completed Codex goals are only allowed when the completed goal is a different legacy goal, or when an aggregate Codex goal is complete/unreconcilable while the repo-native microgoal remains in progress (isSafeCompletedAggregateBlockerSnapshot).","triggerScenarios":"Passing a 'complete' snapshot whose objective matches the current goal, while isSafeCompletedAggregateBlockerSnapshot(plan, goal, snapshot, evidence) returns false.","commonSituations":"The Codex goal for this ultragoal already completed but the operator tries to record it as blocked; aggregate-mode plans where the aggregate goal completed but the microgoal reconciliation preconditions aren't met.","solutions":["Record a 'complete' checkpoint instead — the matching Codex goal is finished","If this is the aggregate-blocker scenario, provide the evidence/preconditions isSafeCompletedAggregateBlockerSnapshot requires (aggregate complete + unreconcilable + microgoal in progress)","Clear or re-create goals so the completed goal is no longer ambiguously matching"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (snap.status === 'complete' && blockedSnapshotMatchesExpected && !isSafeCompletedAggregateBlockerSnapshot(plan, goal, snap, evidence)) { recordCompleteInstead(); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["A completed matching Codex goal means complete the ultragoal, not block it","Understand the aggregate-blocker preconditions before using blocked on complete snapshots"],"tags":["ultragoal","codex","aggregate","blocked","reconciliation"],"backgroundTag":"invalid-state-transition","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}