{"record":{"id":"2ba42694d5f3da7d","repo":"Yeachan-Heo/oh-my-codex","slug":"cannot-advance-autopilot-from-ralplan-to-ultragoal","errorCode":null,"errorMessage":"Cannot advance Autopilot from ralplan to ultragoal with forged handoff evidence (${forged.join('; ')}); durable planning artifacts, sequential Architect and Critic approvals, and a bound execution handoff are required.","messagePattern":"Cannot advance Autopilot from ralplan to ultragoal with forged handoff evidence \\((.+?)\\); durable planning artifacts, sequential Architect and Critic approvals, and a bound execution handoff are required\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/autopilot/completion-gate.ts","lineNumber":216,"sourceCode":"  const gate = objectRecord(rawGate);\n  const execution = objectRecord(rawExecution);\n  requireObjectShape(gate.ralplan_architect_review, 'ralplan_architect_review');\n  requireObjectShape(gate.ralplan_critic_review, 'ralplan_critic_review');\n  const architect = objectRecord(gate.ralplan_architect_review);\n  const critic = objectRecord(gate.ralplan_critic_review);\n  const requireInteger = (value: unknown, label: string): void => {\n    if (present(value) && exactInteger(value) === null) forged.push(`${label} must be an integer`);\n  };\n  requireInteger(architect.sequence_index, 'architect sequence_index');\n  requireInteger(critic.sequence_index, 'critic sequence_index');\n  requireInteger(architect.review_cycle ?? architect.iteration, 'architect review_cycle');\n  requireInteger(critic.review_cycle ?? critic.iteration, 'critic review_cycle');\n  requireInteger(execution.review_cycle, 'execution review_cycle');\n  if (present(execution.authorized_at) && !validIsoTimestamp(execution.authorized_at)) {\n    forged.push('execution authorized_at must be an ISO-8601 timestamp');\n  }\n  if (forged.length === 0) return;\n  throw new Error(\n    'Cannot advance Autopilot from ralplan to ultragoal with forged handoff evidence '\n    + `(${forged.join('; ')}); durable planning artifacts, sequential Architect and Critic `\n    + 'approvals, and a bound execution handoff are required.',\n  );\n}\n\nfunction hasRalplanHandoff(state: JsonObject): boolean {\n  const handoffs = objectRecord(stateField(state, 'handoff_artifacts'));\n  const ralplan = objectRecord(handoffs.ralplan);\n  const gate = objectRecord(stateField(state, 'ralplan_consensus_gate'));\n  const execution = objectRecord(stateField(state, 'ralplan_execution_handoff'));\n  const planPath = ralplan.plan_path ?? ralplan.prd_path;\n  const planExists = existingRepoArtifact(state, planPath, ['plans/']);\n  const reviews = approvedReview(gate.ralplan_architect_review, 'architect')\n    && approvedReview(gate.ralplan_critic_review, 'critic');\n  const architect = objectRecord(gate.ralplan_architect_review);\n  const critic = objectRecord(gate.ralplan_critic_review);\n  const authorized = execution.authorized === true || execution.authorized_by_user === true;","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/autopilot/completion-gate.ts#L198-L234","documentation":"The worker pane is live with the right PID but its @omx_team_pane_owner tag doesn't match the expected team incarnation id. The owner tag ties a pane to a specific team-session incarnation; a mismatch means the pane belongs to an older or different team session, and operating on it would cross session boundaries.","triggerScenarios":"Worker-pane operations after the team session was recreated (new incarnation id) while panes from the old session survived, or after the owner option was cleared/overwritten.","commonSituations":"Session restore flows that reuse old panes, two team sessions sharing a server, or tmux config that wipes user options on certain events.","solutions":["Recreate the team session so surviving panes are retagged with the new incarnation id","Explicitly kill leftover panes from prior sessions before creating a new one","Check `tmux show-option -qv -p -t <pane> @omx_team_pane_owner` against the expected id","Ensure only one team session manages a given set of panes"],"exampleFix":"# inspect the tag vs expected incarnation\ntmux show-option -qv -p -t %4 @omx_team_pane_owner","handlingStrategy":"validation","validationCode":"const owner = execSync(`tmux show-option -qv -p -t ${workerPaneId} @omx_team_pane_owner`).toString().trim(); if (owner !== expectedTeamOwnerId) halt();","typeGuard":null,"tryCatchPattern":"catch (err) { if (/worker pane incarnation changed/.test(err.message)) { recreateTeamSession(); } }","preventionTips":["Kill leftover panes before creating new sessions","One team session per pane set","Re-tag surviving panes via library APIs after recreation"],"tags":["tmux","ownership","session-conflict","worker"],"backgroundTag":"tmux-pane-ownership-mismatch","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}