@resolveio/server-lib 22.3.144 → 22.3.146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/util/ai-runner-manager-autopilot.d.ts +20 -0
- package/util/ai-runner-manager-autopilot.js +32 -0
- package/util/ai-runner-manager-autopilot.js.map +1 -1
- package/util/ai-runner-manager-policy.d.ts +113 -0
- package/util/ai-runner-manager-policy.js +771 -36
- package/util/ai-runner-manager-policy.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/util/ai-runner-manager-policy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgaA,0FAiBC;AAED,oFAUC;AAiBD,wEAcC;AAED,8FAwDC;AAwKD,oGAkDC;AA2ED,kGAoEC;AAyDD,wGA0GC;AAED,wGAWC;AAsCD,8GAqDC;AAgBD,oFAmGC;AAuBD,kFA2RC;AAuDD,wEAqGC;AAt1CD,SAAS,SAAS,CAAC,KAAU,EAAE,GAAU;IAAV,oBAAA,EAAA,UAAU;IACxC,OAAO,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,SAAS,CAAC,MAAW,EAAE,KAAU,EAAE,GAAS;;IAArB,sBAAA,EAAA,UAAU;IAAE,oBAAA,EAAA,SAAS;IACpD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,CAAC;IACX,CAAC;IACD,IAAM,MAAM,GAAa,EAAE,CAAC;;QAC5B,KAAoB,IAAA,WAAA,SAAA,MAAM,CAAA,8BAAA,kDAAE,CAAC;YAAxB,IAAM,KAAK,mBAAA;YACf,IAAM,UAAU,GAA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,YAAY,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;QACpC,OAAO,QAAQ,CAAC,aAAa,EAAE,qDAAqD,EAAE;YACrF,oBAAoB,EAAE,KAAK;SAC3B,CAAC,CAAC;IACJ,CAAC;IACD,IAAI,WAAW,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACzC,OAAO,QAAQ,CAAC,UAAU,EAAE,WAAW;YACrC,CAAC,CAAC,gDAAgD;YAClD,CAAC,CAAC,oCAAoC,EAAE;YACzC,qBAAqB,EAAE,IAAI;SAC3B,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC,UAAU,EAAE,yCAAyC,CAAC,CAAC;AACxE,CAAC","file":"ai-runner-manager-policy.js","sourcesContent":["export type ResolveIOAIManagerAction =\n\t| 'continue'\n\t| 'retry_infra'\n\t| 'reset_loop_budget'\n\t| 'park_repeated_failure'\n\t| 'park_ping_pong'\n\t| 'manual_handoff';\n\nexport interface ResolveIOAIManagerFailureRecord {\n\toutcome?: string;\n\tlane?: string;\n\tstepType?: string;\n\tfailureClass?: string;\n\tblocker?: string;\n\tblockerFingerprint?: string;\n\tevidenceHash?: string;\n\tchangedFiles?: string[];\n\tartifactPaths?: string[];\n\tsummary?: string;\n\trecordedAt?: Date | string;\n}\n\nexport type ResolveIOAIManagerRecoveryClass =\n\t| 'advance_after_proof'\n\t| 'diagnosis_only'\n\t| 'diagnosis_revision'\n\t| 'infra_repair'\n\t| 'compile_repair'\n\t| 'journey_contract_repair'\n\t| 'business_proof_repair'\n\t| 'release_repair'\n\t| 'product_code_repair'\n\t| 'blocked_until_new_evidence'\n\t| 'manual_handoff'\n\t| 'continue';\n\nexport interface ResolveIOAIManagerRecoveryPlan {\n\trecoveryClass: ResolveIOAIManagerRecoveryClass;\n\tlane: string;\n\tstepType: string;\n\tnextActionLabel: string;\n\tobjective: string;\n\tallowedAction: string;\n\tproductRepairAllowed: boolean;\n\texpensiveModelAllowed: boolean;\n\tmaxAttemptsBeforePark: number;\n\tfiniteSteps: string[];\n\trequiredEvidence: string[];\n\tloopResetEvidence: string[];\n\tforbiddenActions: string[];\n\tnotes: string[];\n}\n\nexport type ResolveIOAIManagerRecoveryCheckpointStatus =\n\t| 'active'\n\t| 'parked'\n\t| 'manual_handoff'\n\t| 'complete';\n\nexport interface ResolveIOAIManagerRecoveryCheckpoint {\n\tcheckpointId: string;\n\trecoveryClass: ResolveIOAIManagerRecoveryClass;\n\tstatus: ResolveIOAIManagerRecoveryCheckpointStatus;\n\tlane: string;\n\tstepType: string;\n\tallowedAction: string;\n\tproductRepairAllowed: boolean;\n\texpensiveModelAllowed: boolean;\n\tattempts: number;\n\tmaxAttemptsBeforePark: number;\n\tblockerFingerprint: string;\n\tevidenceHash: string;\n\tchangedFiles: string[];\n\tartifactPaths: string[];\n\trequiredEvidence: string[];\n\tloopResetEvidence: string[];\n\tforbiddenActions: string[];\n\tobjective: string;\n\tnextActionLabel: string;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\nexport type ResolveIOAIManagerRecoveryEvidenceProbeStepKind =\n\t| 'read_only_diagnosis'\n\t| 'rerun_same_gate'\n\t| 'infra_preflight'\n\t| 'compile_check'\n\t| 'route_probe'\n\t| 'business_assertion'\n\t| 'journey_validation'\n\t| 'release_status'\n\t| 'diff_scope_check'\n\t| 'operator_review';\n\nexport interface ResolveIOAIManagerRecoveryEvidenceProbeStep {\n\tid: string;\n\tkind: ResolveIOAIManagerRecoveryEvidenceProbeStepKind;\n\tlabel: string;\n\tobjective: string;\n\trequired: boolean;\n\tcommandHint?: string;\n\tartifactExpectation: string;\n\tsuccessSignal: string;\n}\n\nexport interface ResolveIOAIManagerRecoveryEvidenceProbe {\n\tprobeId: string;\n\tcheckpointId: string;\n\trecoveryClass: ResolveIOAIManagerRecoveryClass;\n\tlane: string;\n\tstepType: string;\n\tobjective: string;\n\tevidenceOnly: boolean;\n\tproductRepairAllowed: boolean;\n\texpensiveModelAllowed: boolean;\n\tevidenceHashBefore: string;\n\tblockerFingerprint: string;\n\tsteps: ResolveIOAIManagerRecoveryEvidenceProbeStep[];\n\trequiredArtifacts: string[];\n\tacceptanceEvidence: string[];\n\tstopConditions: string[];\n\tloopResetEvidence: string[];\n\tcreatedAt: string;\n}\n\nexport type ResolveIOAIManagerRecoveryAutomationMode =\n\t| 'advance'\n\t| 'collect_evidence'\n\t| 'read_only_diagnosis'\n\t| 'repair_infra'\n\t| 'repair_compile'\n\t| 'repair_journey_contract'\n\t| 'repair_business_assertion'\n\t| 'repair_release'\n\t| 'targeted_product_repair'\n\t| 'manual_review'\n\t| 'continue_gate';\n\nexport interface ResolveIOAIManagerRecoveryActionRetryPolicy {\n\tallowImmediateRetry: boolean;\n\trequireNewEvidence: boolean;\n\tresetLoopWhen: string[];\n\tstopWhen: string[];\n}\n\nexport interface ResolveIOAIManagerRecoveryActionPacket {\n\tactionId: string;\n\tcheckpointId: string;\n\tprobeId: string;\n\trecoveryClass: ResolveIOAIManagerRecoveryClass;\n\tmode: ResolveIOAIManagerRecoveryAutomationMode;\n\tlabel: string;\n\tlane: string;\n\tstepType: string;\n\tprimaryStepKind: ResolveIOAIManagerRecoveryEvidenceProbeStepKind | 'none';\n\tobjective: string;\n\tevidenceOnly: boolean;\n\tautoRunnable: boolean;\n\tproductRepairAllowed: boolean;\n\texpensiveModelAllowed: boolean;\n\tcanResetLoopAfterEvidence: boolean;\n\tmaxAttemptsBeforePark: number;\n\trequiredArtifacts: string[];\n\tnextCommands: string[];\n\tsuccessCriteria: string[];\n\tretryPolicy: ResolveIOAIManagerRecoveryActionRetryPolicy;\n\tblockedReason?: string;\n\tcreatedAt: string;\n}\n\nexport type ResolveIOAIManagerRecoveryActionDispatchAction =\n\t| 'run_evidence_probe'\n\t| 'run_read_only_diagnosis'\n\t| 'run_infra_repair'\n\t| 'run_compile_repair'\n\t| 'run_journey_contract_repair'\n\t| 'run_business_assertion_repair'\n\t| 'run_release_repair'\n\t| 'run_targeted_product_repair'\n\t| 'advance'\n\t| 'continue_gate'\n\t| 'park_manual';\n\nexport type ResolveIOAIManagerRecoveryActionDispatchStatus =\n\t| 'queued'\n\t| 'started'\n\t| 'completed'\n\t| 'failed'\n\t| 'parked';\n\nexport interface ResolveIOAIManagerRecoveryActionDispatchRecord {\n\tdispatchId: string;\n\tactionId: string;\n\tcheckpointId: string;\n\tprobeId: string;\n\tmode: ResolveIOAIManagerRecoveryAutomationMode;\n\tdispatchAction: ResolveIOAIManagerRecoveryActionDispatchAction;\n\tstatus: ResolveIOAIManagerRecoveryActionDispatchStatus;\n\tevidenceHash: string;\n\tblockerFingerprint: string;\n\tproductRepairAllowed: boolean;\n\texpensiveModelAllowed: boolean;\n\treason: string;\n\tartifactPaths: string[];\n\tstartedAt?: string;\n\tcompletedAt?: string;\n\tcreatedAt: string;\n}\n\nexport interface ResolveIOAIManagerRecoveryActionDispatchInput {\n\taction?: ResolveIOAIManagerRecoveryActionPacket;\n\thistory?: ResolveIOAIManagerRecoveryActionDispatchRecord[];\n\tcurrent?: ResolveIOAIManagerFailureRecord;\n\toperatorApproved?: boolean;\n\tnow?: Date | string;\n}\n\nexport interface ResolveIOAIManagerRecoveryActionDispatchDecision {\n\tdispatchAction: ResolveIOAIManagerRecoveryActionDispatchAction;\n\tallowed: boolean;\n\treason: string;\n\tstatus: ResolveIOAIManagerRecoveryActionDispatchStatus;\n\tcanRunProductRepair: boolean;\n\tcanRunExpensiveModel: boolean;\n\tshouldRecordDispatch: boolean;\n\trequiresNewEvidence: boolean;\n\tnewEvidence: boolean;\n\tdispatchRecord?: ResolveIOAIManagerRecoveryActionDispatchRecord;\n}\n\nexport type ResolveIOAIManagerRecoveryExecutionPhase =\n\t| 'evidence'\n\t| 'diagnosis'\n\t| 'infra'\n\t| 'compile'\n\t| 'journey'\n\t| 'business_proof'\n\t| 'release'\n\t| 'product_repair'\n\t| 'advance'\n\t| 'manual';\n\nexport interface ResolveIOAIManagerRecoveryExecutionDirectiveInput {\n\taction?: ResolveIOAIManagerRecoveryActionPacket;\n\tdispatchDecision?: ResolveIOAIManagerRecoveryActionDispatchDecision;\n\tcurrent?: ResolveIOAIManagerFailureRecord;\n\tsurface?: string;\n\tnow?: Date | string;\n}\n\nexport interface ResolveIOAIManagerRecoveryExecutionDirective {\n\tdirectiveId: string;\n\tsurface: string;\n\tdispatchAction: ResolveIOAIManagerRecoveryActionDispatchAction;\n\tphase: ResolveIOAIManagerRecoveryExecutionPhase;\n\tallowed: boolean;\n\tstatus: ResolveIOAIManagerRecoveryActionDispatchStatus;\n\treason: string;\n\tlane: string;\n\tstepType: string;\n\tnextActionLabel: string;\n\trerunReason: string;\n\tevidenceOnly: boolean;\n\tautoRunnable: boolean;\n\tproductRepairAllowed: boolean;\n\texpensiveModelAllowed: boolean;\n\tcanRunProductRepair: boolean;\n\tcanRunExpensiveModel: boolean;\n\tcanResetLoopAfterEvidence: boolean;\n\trequiresNewEvidence: boolean;\n\tnewEvidence: boolean;\n\tmaxAttemptsBeforePark: number;\n\trequiredArtifacts: string[];\n\tnextCommands: string[];\n\tsuccessCriteria: string[];\n\tforbiddenActions: string[];\n\tdispatchRecord?: ResolveIOAIManagerRecoveryActionDispatchRecord;\n\tcreatedAt: string;\n}\n\nexport interface ResolveIOAIManagerRecoveryCheckpointInput {\n\tplan: ResolveIOAIManagerRecoveryPlan;\n\tcurrent?: ResolveIOAIManagerFailureRecord;\n\tpreviousCheckpoint?: ResolveIOAIManagerRecoveryCheckpoint;\n\tnow?: Date | string;\n}\n\nexport type ResolveIOAIManagerRecoveryGateAction =\n\t| 'allow'\n\t| 'collect_new_evidence'\n\t| 'reject_action'\n\t| 'manual_handoff'\n\t| 'complete';\n\nexport interface ResolveIOAIManagerRecoveryGateInput {\n\tcheckpoint: ResolveIOAIManagerRecoveryCheckpoint;\n\tcurrent?: ResolveIOAIManagerFailureRecord;\n\tproposedAction?: string;\n\toperatorApproved?: boolean;\n\tnow?: Date | string;\n}\n\nexport interface ResolveIOAIManagerRecoveryGateDecision {\n\taction: ResolveIOAIManagerRecoveryGateAction;\n\treason: string;\n\tcanRunProductRepair: boolean;\n\tcanRunExpensiveModel: boolean;\n\tshouldResetLoopBudget: boolean;\n\tshouldIncrementAttempt: boolean;\n\tnewEvidence: boolean;\n\tblockerFingerprint: string;\n\tevidenceHash: string;\n\tmissingEvidence: string[];\n\tcheckpoint: ResolveIOAIManagerRecoveryCheckpoint;\n}\n\nexport interface ResolveIOAIManagerRecoveryEvidenceProbeInput {\n\tcheckpoint: ResolveIOAIManagerRecoveryCheckpoint;\n\tcurrent?: ResolveIOAIManagerFailureRecord;\n\tnow?: Date | string;\n}\n\nexport interface ResolveIOAIManagerRecoveryActionPacketInput {\n\tplan?: ResolveIOAIManagerRecoveryPlan;\n\tcheckpoint: ResolveIOAIManagerRecoveryCheckpoint;\n\tprobe?: ResolveIOAIManagerRecoveryEvidenceProbe;\n\tcurrent?: ResolveIOAIManagerFailureRecord;\n\tnow?: Date | string;\n}\n\nexport interface ResolveIOAIManagerRecoveryPlanInput {\n\taction?: ResolveIOAIManagerAction | string;\n\treason?: string;\n\tfailureClass?: string;\n\tlane?: string;\n\tstepType?: string;\n\tblocker?: string;\n\tsameFailureCount?: number;\n\tpingPongCount?: number;\n\tnewEvidence?: boolean;\n\tproductRepairFailure?: boolean;\n\tchangedFiles?: string[];\n\tartifactPaths?: string[];\n\tmaxSameFailureRepeats?: number;\n}\n\nexport interface ResolveIOAIManagerPolicyInput {\n\thistory?: ResolveIOAIManagerFailureRecord[];\n\tcurrent?: ResolveIOAIManagerFailureRecord;\n\tmaxSameFailureRepeats?: number;\n\tmaxPingPongTransitions?: number;\n\tinfraFailureClasses?: string[];\n\tignoredFailureClasses?: string[];\n}\n\nexport interface ResolveIOAIManagerPolicyDecision {\n\taction: ResolveIOAIManagerAction;\n\treason: string;\n\tfailureClass: string;\n\tblockerFingerprint: string;\n\tevidenceHash: string;\n\tsameFailureCount: number;\n\tpingPongCount: number;\n\tnewEvidence: boolean;\n\tloopBudgetShouldReset: boolean;\n\tproductRepairFailure: boolean;\n\trecoveryPlan: ResolveIOAIManagerRecoveryPlan;\n\trecoveryCheckpoint: ResolveIOAIManagerRecoveryCheckpoint;\n\trecoveryEvidenceProbe: ResolveIOAIManagerRecoveryEvidenceProbe;\n\trecoveryAction: ResolveIOAIManagerRecoveryActionPacket;\n}\n\nfunction cleanText(value: any, max = 2000): string {\n\treturn String(value || '').replace(/\\s+/g, ' ').trim().slice(0, max);\n}\n\nfunction cleanList(values: any, limit = 40, max = 500): string[] {\n\tif (!Array.isArray(values)) {\n\t\treturn [];\n\t}\n\tconst result: string[] = [];\n\tfor (const value of values) {\n\t\tconst normalized = cleanText(value, max);\n\t\tif (normalized && !result.includes(normalized)) {\n\t\t\tresult.push(normalized);\n\t\t}\n\t\tif (result.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn result;\n}\n\nfunction isoNow(value?: Date | string): string {\n\tif (value instanceof Date) {\n\t\treturn value.toISOString();\n\t}\n\tconst parsed = value ? new Date(value) : new Date();\n\tif (Number.isFinite(parsed.getTime())) {\n\t\treturn parsed.toISOString();\n\t}\n\treturn new Date().toISOString();\n}\n\nfunction stableHash(prefix: string, value: any): string {\n\tconst normalized = typeof value === 'string'\n\t\t? cleanText(value, 12000)\n\t\t: JSON.stringify(value || {});\n\tlet hash = 0;\n\tfor (let index = 0; index < normalized.length; index += 1) {\n\t\thash = ((hash << 5) - hash + normalized.charCodeAt(index)) | 0;\n\t}\n\treturn `${prefix}-${Math.abs(hash).toString(36) || '0'}`;\n}\n\nexport function normalizeResolveIOAIManagerFailureClass(value: any): string {\n\tconst normalized = cleanText(value, 80)\n\t\t.toLowerCase()\n\t\t.replace(/[\\s-]+/g, '_');\n\tif (!normalized) {\n\t\treturn 'unknown';\n\t}\n\tif (/^(qa_infra|infrastructure|harness|puppeteer|chrome|mongo|port|startup)$/.test(normalized)) {\n\t\treturn 'infra';\n\t}\n\tif (/^(build|compile|typescript|tsc|angular_build|ng_build)$/.test(normalized)) {\n\t\treturn 'compile';\n\t}\n\tif (/^(false_pass|route_only|missing_business_proof)$/.test(normalized)) {\n\t\treturn 'business';\n\t}\n\treturn normalized.slice(0, 80);\n}\n\nexport function fingerprintResolveIOAIManagerBlocker(value: any): string {\n\tconst normalized = cleanText(value, 4000)\n\t\t.toLowerCase()\n\t\t.replace(/[a-f0-9]{16,}/g, '<id>')\n\t\t.replace(/\\b\\d{2,}\\b/g, '<n>')\n\t\t.replace(/\\bline\\s+<n>\\b/g, 'line <n>')\n\t\t.replace(/https?:\\/\\/\\S+/g, '<url>')\n\t\t.replace(/\\s+/g, ' ')\n\t\t.trim();\n\treturn stableHash('mgr-blocker', normalized);\n}\n\nfunction resolveResolveIOAIManagerBlockerFingerprint(\n\trecord: ResolveIOAIManagerFailureRecord | undefined,\n\tfallback?: any\n): string {\n\tconst blockerText = cleanText(record?.blocker || record?.summary, 4000);\n\tif (blockerText) {\n\t\treturn fingerprintResolveIOAIManagerBlocker(blockerText);\n\t}\n\tconst explicit = cleanText(record?.blockerFingerprint, 120);\n\tif (explicit) {\n\t\treturn explicit;\n\t}\n\treturn fingerprintResolveIOAIManagerBlocker(fallback || '');\n}\n\nexport function hashResolveIOAIManagerEvidence(record: ResolveIOAIManagerFailureRecord | undefined): string {\n\tif (!record) {\n\t\treturn stableHash('mgr-evidence', '');\n\t}\n\tconst explicit = cleanText(record.evidenceHash, 120);\n\tif (explicit) {\n\t\treturn explicit;\n\t}\n\treturn stableHash('mgr-evidence', {\n\t\tfailureClass: normalizeResolveIOAIManagerFailureClass(record.failureClass),\n\t\tblocker: cleanText(record.blocker || record.summary, 2000),\n\t\tchangedFiles: cleanList(record.changedFiles, 80, 500).sort(),\n\t\tartifactPaths: cleanList(record.artifactPaths, 80, 500).sort()\n\t});\n}\n\nexport function buildResolveIOAIManagerRecoveryCheckpoint(\n\tinput: ResolveIOAIManagerRecoveryCheckpointInput\n): ResolveIOAIManagerRecoveryCheckpoint {\n\tconst plan = input.plan;\n\tconst current = input.current || {};\n\tconst blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current, plan.objective);\n\tconst evidenceHash = hashResolveIOAIManagerEvidence(current);\n\tconst changedFiles = cleanList(current.changedFiles, 80, 500);\n\tconst artifactPaths = cleanList(current.artifactPaths, 80, 500);\n\tconst previous = input.previousCheckpoint;\n\tconst sameCheckpointBase = previous\n\t\t&& previous.recoveryClass === plan.recoveryClass\n\t\t&& previous.lane === plan.lane\n\t\t&& previous.stepType === plan.stepType\n\t\t&& previous.blockerFingerprint === blockerFingerprint\n\t\t&& previous.evidenceHash === evidenceHash;\n\tconst attempts = sameCheckpointBase ? Math.max(0, Number(previous.attempts || 0)) + 1 : 1;\n\tconst status: ResolveIOAIManagerRecoveryCheckpointStatus = plan.recoveryClass === 'manual_handoff'\n\t\t? 'manual_handoff'\n\t\t: plan.recoveryClass === 'blocked_until_new_evidence'\n\t\t\t? 'parked'\n\t\t\t: plan.recoveryClass === 'advance_after_proof'\n\t\t\t\t? 'complete'\n\t\t\t\t: 'active';\n\tconst now = isoNow(input.now);\n\tconst checkpointId = stableHash('mgr-recovery', {\n\t\trecoveryClass: plan.recoveryClass,\n\t\tlane: plan.lane,\n\t\tstepType: plan.stepType,\n\t\tallowedAction: plan.allowedAction,\n\t\tblockerFingerprint,\n\t\tevidenceHash\n\t});\n\treturn {\n\t\tcheckpointId,\n\t\trecoveryClass: plan.recoveryClass,\n\t\tstatus,\n\t\tlane: plan.lane,\n\t\tstepType: plan.stepType,\n\t\tallowedAction: plan.allowedAction,\n\t\tproductRepairAllowed: plan.productRepairAllowed,\n\t\texpensiveModelAllowed: plan.expensiveModelAllowed,\n\t\tattempts,\n\t\tmaxAttemptsBeforePark: plan.maxAttemptsBeforePark,\n\t\tblockerFingerprint,\n\t\tevidenceHash,\n\t\tchangedFiles,\n\t\tartifactPaths,\n\t\trequiredEvidence: cleanList(plan.requiredEvidence, 40, 500),\n\t\tloopResetEvidence: cleanList(plan.loopResetEvidence, 40, 500),\n\t\tforbiddenActions: cleanList(plan.forbiddenActions, 40, 500),\n\t\tobjective: cleanText(plan.objective, 1000),\n\t\tnextActionLabel: cleanText(plan.nextActionLabel, 160),\n\t\tcreatedAt: sameCheckpointBase && previous?.createdAt ? previous.createdAt : now,\n\t\tupdatedAt: now\n\t};\n}\n\nfunction makeRecoveryEvidenceProbeStep(\n\tid: string,\n\tkind: ResolveIOAIManagerRecoveryEvidenceProbeStepKind,\n\tlabel: string,\n\tobjective: string,\n\tartifactExpectation: string,\n\tsuccessSignal: string,\n\toptions: Partial<Pick<ResolveIOAIManagerRecoveryEvidenceProbeStep, 'required' | 'commandHint'>> = {}\n): ResolveIOAIManagerRecoveryEvidenceProbeStep {\n\treturn {\n\t\tid,\n\t\tkind,\n\t\tlabel,\n\t\tobjective: cleanText(objective, 1000),\n\t\trequired: options.required !== false,\n\t\t...(options.commandHint ? { commandHint: cleanText(options.commandHint, 500) } : {}),\n\t\tartifactExpectation: cleanText(artifactExpectation, 500),\n\t\tsuccessSignal: cleanText(successSignal, 500)\n\t};\n}\n\nfunction recoveryEvidenceProbeStepsFor(\n\tcheckpoint: ResolveIOAIManagerRecoveryCheckpoint\n): ResolveIOAIManagerRecoveryEvidenceProbeStep[] {\n\tconst base = [\n\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t'snapshot_current_blocker',\n\t\t\t'rerun_same_gate',\n\t\t\t'Snapshot Current Blocker',\n\t\t\t'Capture the current blocker, failure class, evidence hash, changed files, and artifact paths before any new repair.',\n\t\t\t'runner-evidence/current-blocker.json',\n\t\t\t'Snapshot includes the same checkpointId, blockerFingerprint, and evidenceHashBefore.'\n\t\t)\n\t];\n\tif (checkpoint.recoveryClass === 'diagnosis_only' || checkpoint.recoveryClass === 'diagnosis_revision') {\n\t\treturn [\n\t\t\t...base,\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'collect_read_only_root_cause_evidence',\n\t\t\t\t'read_only_diagnosis',\n\t\t\t\t'Collect Read-Only Root-Cause Evidence',\n\t\t\t\tcheckpoint.recoveryClass === 'diagnosis_revision'\n\t\t\t\t\t? 'Collect new evidence that proves the current owner_files or failing_path is wrong before broadening scope.'\n\t\t\t\t\t: 'Reproduce or classify the issue and record the exact customer complaint, expected result, observed result, route/module, and account context.',\n\t\t\t\t'runner-evidence/diagnosis-readonly.md',\n\t\t\t\t'Evidence supports one falsifiable accepted hypothesis and at least one rejected alternative.'\n\t\t\t),\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'validate_diagnosis_gate',\n\t\t\t\t'read_only_diagnosis',\n\t\t\t\t'Validate Diagnosis Gate',\n\t\t\t\t'Validate issue_case, accepted_hypothesis, rejected_alternatives, failing_path, owner_files, and before/action/after proof_plan.',\n\t\t\t\t'runner-evidence/diagnosis-gate.json',\n\t\t\t\t'Diagnosis gate validates before product-code repair is allowed.'\n\t\t\t)\n\t\t];\n\t}\n\tif (checkpoint.recoveryClass === 'infra_repair') {\n\t\treturn [\n\t\t\t...base,\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'run_infra_preflight',\n\t\t\t\t'infra_preflight',\n\t\t\t\t'Run Infra Preflight',\n\t\t\t\t'Check Puppeteer/Chrome, ports, Mongo/settings, cache state, startup commands, and server/client process health.',\n\t\t\t\t'runner-evidence/infra-preflight.log',\n\t\t\t\t'The same infra gate either passes or returns a new infra blocker hash.',\n\t\t\t\t{ commandHint: 'runner preflight: puppeteer/chrome/mongo/ports/startup' }\n\t\t\t)\n\t\t];\n\t}\n\tif (checkpoint.recoveryClass === 'compile_repair') {\n\t\treturn [\n\t\t\t...base,\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'rerun_compile_gate',\n\t\t\t\t'compile_check',\n\t\t\t\t'Rerun Compile Gate',\n\t\t\t\t'Rerun the same deterministic compile/build command and capture the first actionable error.',\n\t\t\t\t'runner-evidence/compile.log',\n\t\t\t\t'Compile passes or the first failing error changes.',\n\t\t\t\t{ commandHint: 'same finite build/compile command from the failed gate' }\n\t\t\t)\n\t\t];\n\t}\n\tif (checkpoint.recoveryClass === 'journey_contract_repair') {\n\t\treturn [\n\t\t\t...base,\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'validate_journey_contract',\n\t\t\t\t'journey_validation',\n\t\t\t\t'Validate Journey Contract',\n\t\t\t\t'Validate docs/APP_JOURNEY_CONTRACT.md has first/next/last workflow, route/action/method mapping, seeded data story, completion states, and QA assertions.',\n\t\t\t\t'runner-evidence/journey-contract-validation.json',\n\t\t\t\t'Journey contract validates before build tasks continue.'\n\t\t\t),\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'verify_hub_workflow_mapping',\n\t\t\t\t'journey_validation',\n\t\t\t\t'Verify Hub Workflow Mapping',\n\t\t\t\t'Confirm the hub CTA and screen sequence implement the journey contract instead of link-only navigation.',\n\t\t\t\t'runner-evidence/hub-workflow-map.json',\n\t\t\t\t'Primary hub action maps to a real route/action/method/calculation and next state.'\n\t\t\t)\n\t\t];\n\t}\n\tif (checkpoint.recoveryClass === 'business_proof_repair' || checkpoint.recoveryClass === 'product_code_repair') {\n\t\treturn [\n\t\t\t...base,\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'rerun_business_assertion',\n\t\t\t\t'business_assertion',\n\t\t\t\t'Rerun Business Assertion',\n\t\t\t\t'Run the exact issue/app promise proof and capture before/action/after DOM/data evidence.',\n\t\t\t\t'runner-evidence/business-assertion.json',\n\t\t\t\t'Business assertion passes, or the observed failure changes with a new artifact path.'\n\t\t\t),\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'check_diff_scope',\n\t\t\t\t'diff_scope_check',\n\t\t\t\t'Check Diff Scope',\n\t\t\t\t'Compare changed files against the current diagnosis/journey owner scope before another code repair.',\n\t\t\t\t'runner-evidence/diff-scope.json',\n\t\t\t\t'Changed files are in scope, or diagnosis/journey scope is revised with evidence.'\n\t\t\t)\n\t\t];\n\t}\n\tif (checkpoint.recoveryClass === 'release_repair') {\n\t\treturn [\n\t\t\t...base,\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'collect_release_status',\n\t\t\t\t'release_status',\n\t\t\t\t'Collect Release Status',\n\t\t\t\t'Collect publish/deploy/build-instance/domain/CloudFront status and the last actionable deploy error.',\n\t\t\t\t'runner-evidence/release-status.json',\n\t\t\t\t'Release gate passes or returns a new release blocker hash without product-code repair.'\n\t\t\t)\n\t\t];\n\t}\n\tif (checkpoint.recoveryClass === 'manual_handoff') {\n\t\treturn [\n\t\t\t...base,\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'operator_review_checkpoint',\n\t\t\t\t'operator_review',\n\t\t\t\t'Operator Review Checkpoint',\n\t\t\t\t'Expose budget, blocker, evidence hash, and the minimum policy/scope change needed before another expensive loop.',\n\t\t\t\t'runner-evidence/operator-review.json',\n\t\t\t\t'Operator approves a new scope/policy or provides new external evidence.'\n\t\t\t)\n\t\t];\n\t}\n\treturn [\n\t\t...base,\n\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t'rerun_same_deterministic_gate',\n\t\t\t'rerun_same_gate',\n\t\t\t'Rerun Same Deterministic Gate',\n\t\t\t'Rerun the exact failed check and capture new logs/artifacts without changing product code first.',\n\t\t\t'runner-evidence/retry-gate.log',\n\t\t\t'Gate passes, or evidenceHash/blockerFingerprint/artifactPaths change.'\n\t\t)\n\t];\n}\n\nexport function buildResolveIOAIManagerRecoveryEvidenceProbe(\n\tinput: ResolveIOAIManagerRecoveryEvidenceProbeInput\n): ResolveIOAIManagerRecoveryEvidenceProbe {\n\tconst checkpoint = input.checkpoint;\n\tconst now = isoNow(input.now);\n\tconst steps = recoveryEvidenceProbeStepsFor(checkpoint);\n\tconst requiredArtifacts = Array.from(new Set(steps\n\t\t.filter((step) => step.required)\n\t\t.map((step) => step.artifactExpectation)\n\t\t.filter(Boolean)));\n\treturn {\n\t\tprobeId: stableHash('mgr-probe', {\n\t\t\tcheckpointId: checkpoint.checkpointId,\n\t\t\trecoveryClass: checkpoint.recoveryClass,\n\t\t\tevidenceHash: checkpoint.evidenceHash,\n\t\t\tblockerFingerprint: checkpoint.blockerFingerprint\n\t\t}),\n\t\tcheckpointId: checkpoint.checkpointId,\n\t\trecoveryClass: checkpoint.recoveryClass,\n\t\tlane: checkpoint.lane,\n\t\tstepType: checkpoint.stepType,\n\t\tobjective: checkpoint.status === 'parked'\n\t\t\t? 'Collect new evidence before any additional expensive model/code repair.'\n\t\t\t: cleanText(checkpoint.objective, 1000),\n\t\tevidenceOnly: checkpoint.status === 'parked'\n\t\t\t|| checkpoint.recoveryClass === 'diagnosis_only'\n\t\t\t|| checkpoint.recoveryClass === 'diagnosis_revision'\n\t\t\t|| checkpoint.recoveryClass === 'infra_repair'\n\t\t\t|| checkpoint.recoveryClass === 'compile_repair'\n\t\t\t|| checkpoint.recoveryClass === 'release_repair',\n\t\tproductRepairAllowed: checkpoint.productRepairAllowed && checkpoint.status !== 'parked',\n\t\texpensiveModelAllowed: checkpoint.expensiveModelAllowed && checkpoint.status !== 'parked',\n\t\tevidenceHashBefore: checkpoint.evidenceHash,\n\t\tblockerFingerprint: checkpoint.blockerFingerprint,\n\t\tsteps,\n\t\trequiredArtifacts,\n\t\tacceptanceEvidence: Array.from(new Set([\n\t\t\t...checkpoint.requiredEvidence,\n\t\t\t...checkpoint.loopResetEvidence,\n\t\t\t...steps.map((step) => step.successSignal)\n\t\t].map((entry) => cleanText(entry, 500)).filter(Boolean))).slice(0, 30),\n\t\tstopConditions: Array.from(new Set([\n\t\t\t...checkpoint.forbiddenActions,\n\t\t\t'no new evidence hash',\n\t\t\t'no new artifact path',\n\t\t\t'product-code repair requested while evidenceOnly is true'\n\t\t].map((entry) => cleanText(entry, 500)).filter(Boolean))).slice(0, 30),\n\t\tloopResetEvidence: checkpoint.loopResetEvidence,\n\t\tcreatedAt: now\n\t};\n}\n\nfunction recoveryAutomationModeFor(\n\tcheckpoint: ResolveIOAIManagerRecoveryCheckpoint\n): ResolveIOAIManagerRecoveryAutomationMode {\n\tif (checkpoint.status === 'manual_handoff' || checkpoint.recoveryClass === 'manual_handoff') {\n\t\treturn 'manual_review';\n\t}\n\tif (checkpoint.status === 'complete' || checkpoint.recoveryClass === 'advance_after_proof') {\n\t\treturn 'advance';\n\t}\n\tif (checkpoint.status === 'parked' || checkpoint.recoveryClass === 'blocked_until_new_evidence') {\n\t\treturn 'collect_evidence';\n\t}\n\tif (checkpoint.recoveryClass === 'diagnosis_only' || checkpoint.recoveryClass === 'diagnosis_revision') {\n\t\treturn 'read_only_diagnosis';\n\t}\n\tif (checkpoint.recoveryClass === 'infra_repair') {\n\t\treturn 'repair_infra';\n\t}\n\tif (checkpoint.recoveryClass === 'compile_repair') {\n\t\treturn 'repair_compile';\n\t}\n\tif (checkpoint.recoveryClass === 'journey_contract_repair') {\n\t\treturn 'repair_journey_contract';\n\t}\n\tif (checkpoint.recoveryClass === 'business_proof_repair') {\n\t\treturn 'repair_business_assertion';\n\t}\n\tif (checkpoint.recoveryClass === 'release_repair') {\n\t\treturn 'repair_release';\n\t}\n\tif (checkpoint.recoveryClass === 'product_code_repair') {\n\t\treturn 'targeted_product_repair';\n\t}\n\treturn 'continue_gate';\n}\n\nfunction recoveryActionLabelFor(mode: ResolveIOAIManagerRecoveryAutomationMode, checkpoint: ResolveIOAIManagerRecoveryCheckpoint): string {\n\tconst explicit = cleanText(checkpoint.nextActionLabel, 120);\n\tif (explicit && mode !== 'collect_evidence') {\n\t\treturn explicit;\n\t}\n\tconst labels: Record<ResolveIOAIManagerRecoveryAutomationMode, string> = {\n\t\tadvance: 'Advance To Next Gate',\n\t\tcollect_evidence: 'Collect New Evidence',\n\t\tread_only_diagnosis: 'Run Diagnosis Evidence Pass',\n\t\trepair_infra: 'Repair Infra Gate',\n\t\trepair_compile: 'Repair Compile Gate',\n\t\trepair_journey_contract: 'Repair Journey Contract',\n\t\trepair_business_assertion: 'Repair Business Proof',\n\t\trepair_release: 'Repair Release Gate',\n\t\ttargeted_product_repair: 'Run Targeted Repair',\n\t\tmanual_review: 'Manual Review',\n\t\tcontinue_gate: 'Continue Current Gate'\n\t};\n\treturn labels[mode];\n}\n\nfunction recoveryActionAutoRunnable(\n\tmode: ResolveIOAIManagerRecoveryAutomationMode,\n\tprobe: ResolveIOAIManagerRecoveryEvidenceProbe\n): boolean {\n\tif (mode === 'manual_review') {\n\t\treturn false;\n\t}\n\tif (mode === 'advance' || mode === 'continue_gate') {\n\t\treturn true;\n\t}\n\tif (mode === 'targeted_product_repair' || mode === 'read_only_diagnosis' || mode === 'repair_journey_contract' || mode === 'repair_business_assertion') {\n\t\treturn true;\n\t}\n\treturn probe.steps.some((step) => step.commandHint || step.kind === 'rerun_same_gate' || step.kind === 'release_status' || step.kind === 'diff_scope_check');\n}\n\nexport function buildResolveIOAIManagerRecoveryActionPacket(\n\tinput: ResolveIOAIManagerRecoveryActionPacketInput\n): ResolveIOAIManagerRecoveryActionPacket {\n\tconst checkpoint = input.checkpoint;\n\tconst probe = input.probe || buildResolveIOAIManagerRecoveryEvidenceProbe({\n\t\tcheckpoint,\n\t\tcurrent: input.current,\n\t\tnow: input.now\n\t});\n\tconst mode = recoveryAutomationModeFor(checkpoint);\n\tconst primaryStep = probe.steps.find((step) => step.required && step.id !== 'snapshot_current_blocker')\n\t\t|| probe.steps.find((step) => step.required)\n\t\t|| probe.steps[0];\n\tconst evidenceOnly = probe.evidenceOnly || mode === 'collect_evidence' || mode === 'repair_infra' || mode === 'repair_compile' || mode === 'repair_release';\n\tconst requireNewEvidence = mode === 'collect_evidence'\n\t\t|| checkpoint.status === 'parked'\n\t\t|| checkpoint.attempts >= checkpoint.maxAttemptsBeforePark;\n\tconst stopWhen = Array.from(new Set([\n\t\t...probe.stopConditions,\n\t\t...(requireNewEvidence ? ['same blocker fingerprint and same evidence hash after probe'] : [])\n\t].map((entry) => cleanText(entry, 500)).filter(Boolean))).slice(0, 30);\n\tconst resetLoopWhen = Array.from(new Set([\n\t\t...checkpoint.loopResetEvidence,\n\t\t...probe.loopResetEvidence,\n\t\t...(requireNewEvidence ? ['changed evidence hash', 'new artifact path'] : [])\n\t].map((entry) => cleanText(entry, 500)).filter(Boolean))).slice(0, 30);\n\tconst nextCommands = probe.steps\n\t\t.map((step) => cleanText(step.commandHint || `${step.kind}:${step.id}`, 500))\n\t\t.filter(Boolean)\n\t\t.slice(0, 12);\n\tconst now = isoNow(input.now);\n\treturn {\n\t\tactionId: stableHash('mgr-action', {\n\t\t\tcheckpointId: checkpoint.checkpointId,\n\t\t\tprobeId: probe.probeId,\n\t\t\tmode,\n\t\t\tevidenceHash: checkpoint.evidenceHash,\n\t\t\tblockerFingerprint: checkpoint.blockerFingerprint\n\t\t}),\n\t\tcheckpointId: checkpoint.checkpointId,\n\t\tprobeId: probe.probeId,\n\t\trecoveryClass: checkpoint.recoveryClass,\n\t\tmode,\n\t\tlabel: recoveryActionLabelFor(mode, checkpoint),\n\t\tlane: checkpoint.lane,\n\t\tstepType: checkpoint.stepType,\n\t\tprimaryStepKind: primaryStep?.kind || 'none',\n\t\tobjective: mode === 'collect_evidence'\n\t\t\t? probe.objective\n\t\t\t: cleanText(checkpoint.objective || probe.objective, 1000),\n\t\tevidenceOnly,\n\t\tautoRunnable: recoveryActionAutoRunnable(mode, probe),\n\t\tproductRepairAllowed: checkpoint.productRepairAllowed && !evidenceOnly && checkpoint.status !== 'parked',\n\t\texpensiveModelAllowed: checkpoint.expensiveModelAllowed && checkpoint.status !== 'parked',\n\t\tcanResetLoopAfterEvidence: resetLoopWhen.length > 0,\n\t\tmaxAttemptsBeforePark: checkpoint.maxAttemptsBeforePark,\n\t\trequiredArtifacts: probe.requiredArtifacts.slice(0, 20),\n\t\tnextCommands,\n\t\tsuccessCriteria: probe.acceptanceEvidence.slice(0, 20),\n\t\tretryPolicy: {\n\t\t\tallowImmediateRetry: checkpoint.status !== 'parked' && mode !== 'manual_review',\n\t\t\trequireNewEvidence,\n\t\t\tresetLoopWhen,\n\t\t\tstopWhen\n\t\t},\n\t\t...(mode === 'collect_evidence' ? { blockedReason: 'Manager parked this loop until the recovery action records new evidence.' } : {}),\n\t\tcreatedAt: now\n\t};\n}\n\nfunction dispatchActionForMode(mode: ResolveIOAIManagerRecoveryAutomationMode): ResolveIOAIManagerRecoveryActionDispatchAction {\n\tconst map: Record<ResolveIOAIManagerRecoveryAutomationMode, ResolveIOAIManagerRecoveryActionDispatchAction> = {\n\t\tadvance: 'advance',\n\t\tcollect_evidence: 'run_evidence_probe',\n\t\tread_only_diagnosis: 'run_read_only_diagnosis',\n\t\trepair_infra: 'run_infra_repair',\n\t\trepair_compile: 'run_compile_repair',\n\t\trepair_journey_contract: 'run_journey_contract_repair',\n\t\trepair_business_assertion: 'run_business_assertion_repair',\n\t\trepair_release: 'run_release_repair',\n\t\ttargeted_product_repair: 'run_targeted_product_repair',\n\t\tmanual_review: 'park_manual',\n\t\tcontinue_gate: 'continue_gate'\n\t};\n\treturn map[mode] || 'park_manual';\n}\n\nfunction buildRecoveryDispatchRecord(\n\taction: ResolveIOAIManagerRecoveryActionPacket,\n\tdispatchAction: ResolveIOAIManagerRecoveryActionDispatchAction,\n\tstatus: ResolveIOAIManagerRecoveryActionDispatchStatus,\n\treason: string,\n\tcurrent?: ResolveIOAIManagerFailureRecord,\n\tnow?: Date | string\n): ResolveIOAIManagerRecoveryActionDispatchRecord {\n\tconst evidenceHash = current?.evidenceHash || action.checkpointId || action.actionId;\n\tconst blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current, action.objective);\n\tconst artifactPaths = cleanList(current?.artifactPaths, 20, 500);\n\tconst createdAt = isoNow(now);\n\treturn {\n\t\tdispatchId: stableHash('mgr-dispatch', {\n\t\t\tactionId: action.actionId,\n\t\t\tdispatchAction,\n\t\t\tevidenceHash,\n\t\t\tblockerFingerprint,\n\t\t\tstatus\n\t\t}),\n\t\tactionId: action.actionId,\n\t\tcheckpointId: action.checkpointId,\n\t\tprobeId: action.probeId,\n\t\tmode: action.mode,\n\t\tdispatchAction,\n\t\tstatus,\n\t\tevidenceHash,\n\t\tblockerFingerprint,\n\t\tproductRepairAllowed: action.productRepairAllowed && dispatchAction === 'run_targeted_product_repair',\n\t\texpensiveModelAllowed: action.expensiveModelAllowed && dispatchAction !== 'run_evidence_probe',\n\t\treason,\n\t\tartifactPaths,\n\t\t...(status === 'started' ? { startedAt: createdAt } : {}),\n\t\t...(status === 'completed' ? { completedAt: createdAt } : {}),\n\t\tcreatedAt\n\t};\n}\n\nexport function decideResolveIOAIManagerRecoveryActionDispatch(\n\tinput: ResolveIOAIManagerRecoveryActionDispatchInput\n): ResolveIOAIManagerRecoveryActionDispatchDecision {\n\tconst action = input.action;\n\tconst history = Array.isArray(input.history) ? input.history.filter(Boolean).slice(-50) : [];\n\tconst current = input.current || {};\n\tif (!action) {\n\t\treturn {\n\t\t\tdispatchAction: 'park_manual',\n\t\t\tallowed: false,\n\t\t\treason: 'recovery_dispatch_missing_action',\n\t\t\tstatus: 'parked',\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldRecordDispatch: false,\n\t\t\trequiresNewEvidence: true,\n\t\t\tnewEvidence: false\n\t\t};\n\t}\n\tconst dispatchAction = dispatchActionForMode(action.mode);\n\tconst evidenceHash = current.evidenceHash || action.checkpointId || action.actionId;\n\tconst blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current, action.objective);\n\tconst sameActionHistory = history.filter((entry) => entry.actionId === action.actionId);\n\tconst sameEvidenceHistory = sameActionHistory.filter((entry) => entry.evidenceHash === evidenceHash\n\t\t&& entry.blockerFingerprint === blockerFingerprint);\n\tconst activeDispatch = sameEvidenceHistory.find((entry) => entry.status === 'queued' || entry.status === 'started');\n\tconst completedDispatch = sameEvidenceHistory.find((entry) => entry.status === 'completed' || entry.status === 'failed');\n\tconst newEvidence = sameActionHistory.length > 0 && sameEvidenceHistory.length === 0;\n\tconst requiresNewEvidence = action.retryPolicy.requireNewEvidence === true;\n\tconst manualOnly = action.mode === 'manual_review' || !action.autoRunnable;\n\tconst productDispatch = dispatchAction === 'run_targeted_product_repair';\n\tconst expensiveDispatch = !['run_evidence_probe', 'advance', 'continue_gate', 'park_manual'].includes(dispatchAction);\n\tif (manualOnly && input.operatorApproved !== true) {\n\t\tconst record = buildRecoveryDispatchRecord(action, 'park_manual', 'parked', 'recovery_dispatch_requires_manual_review', current, input.now);\n\t\treturn {\n\t\t\tdispatchAction: 'park_manual',\n\t\t\tallowed: false,\n\t\t\treason: record.reason,\n\t\t\tstatus: 'parked',\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldRecordDispatch: true,\n\t\t\trequiresNewEvidence,\n\t\t\tnewEvidence,\n\t\t\tdispatchRecord: record\n\t\t};\n\t}\n\tif (productDispatch && action.productRepairAllowed !== true) {\n\t\tconst record = buildRecoveryDispatchRecord(action, 'park_manual', 'parked', 'recovery_dispatch_product_repair_not_allowed', current, input.now);\n\t\treturn {\n\t\t\tdispatchAction: 'park_manual',\n\t\t\tallowed: false,\n\t\t\treason: record.reason,\n\t\t\tstatus: 'parked',\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldRecordDispatch: true,\n\t\t\trequiresNewEvidence: true,\n\t\t\tnewEvidence,\n\t\t\tdispatchRecord: record\n\t\t};\n\t}\n\tif (activeDispatch) {\n\t\treturn {\n\t\t\tdispatchAction: 'park_manual',\n\t\t\tallowed: false,\n\t\t\treason: 'recovery_dispatch_already_running_for_same_evidence',\n\t\t\tstatus: 'parked',\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldRecordDispatch: false,\n\t\t\trequiresNewEvidence: true,\n\t\t\tnewEvidence: false\n\t\t};\n\t}\n\tif (completedDispatch && requiresNewEvidence && !newEvidence) {\n\t\tconst record = buildRecoveryDispatchRecord(action, 'park_manual', 'parked', 'recovery_dispatch_same_evidence_already_attempted', current, input.now);\n\t\treturn {\n\t\t\tdispatchAction: 'park_manual',\n\t\t\tallowed: false,\n\t\t\treason: record.reason,\n\t\t\tstatus: 'parked',\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldRecordDispatch: true,\n\t\t\trequiresNewEvidence: true,\n\t\t\tnewEvidence: false,\n\t\t\tdispatchRecord: record\n\t\t};\n\t}\n\tconst status: ResolveIOAIManagerRecoveryActionDispatchStatus = dispatchAction === 'advance' || dispatchAction === 'continue_gate'\n\t\t? 'completed'\n\t\t: 'started';\n\tconst record = buildRecoveryDispatchRecord(action, dispatchAction, status, 'recovery_dispatch_allowed', current, input.now);\n\treturn {\n\t\tdispatchAction,\n\t\tallowed: true,\n\t\treason: 'recovery_dispatch_allowed',\n\t\tstatus,\n\t\tcanRunProductRepair: productDispatch && action.productRepairAllowed === true,\n\t\tcanRunExpensiveModel: expensiveDispatch && action.expensiveModelAllowed === true,\n\t\tshouldRecordDispatch: true,\n\t\trequiresNewEvidence,\n\t\tnewEvidence,\n\t\tdispatchRecord: record\n\t};\n}\n\nexport function appendResolveIOAIManagerRecoveryActionDispatch(\n\thistory: ResolveIOAIManagerRecoveryActionDispatchRecord[] | undefined,\n\trecord: ResolveIOAIManagerRecoveryActionDispatchRecord | undefined,\n\tlimit = 50\n): ResolveIOAIManagerRecoveryActionDispatchRecord[] {\n\tconst existing = Array.isArray(history) ? history.filter(Boolean) : [];\n\tif (!record) {\n\t\treturn existing.slice(-limit);\n\t}\n\tconst deduped = existing.filter((entry) => entry.dispatchId !== record.dispatchId);\n\treturn [...deduped, record].slice(-limit);\n}\n\nfunction recoveryExecutionPhaseForDispatch(\n\tdispatchAction: ResolveIOAIManagerRecoveryActionDispatchAction\n): ResolveIOAIManagerRecoveryExecutionPhase {\n\tconst map: Record<ResolveIOAIManagerRecoveryActionDispatchAction, ResolveIOAIManagerRecoveryExecutionPhase> = {\n\t\trun_evidence_probe: 'evidence',\n\t\trun_read_only_diagnosis: 'diagnosis',\n\t\trun_infra_repair: 'infra',\n\t\trun_compile_repair: 'compile',\n\t\trun_journey_contract_repair: 'journey',\n\t\trun_business_assertion_repair: 'business_proof',\n\t\trun_release_repair: 'release',\n\t\trun_targeted_product_repair: 'product_repair',\n\t\tadvance: 'advance',\n\t\tcontinue_gate: 'advance',\n\t\tpark_manual: 'manual'\n\t};\n\treturn map[dispatchAction] || 'manual';\n}\n\nfunction recoveryDirectiveReason(\n\taction: ResolveIOAIManagerRecoveryActionPacket | undefined,\n\tdecision: ResolveIOAIManagerRecoveryActionDispatchDecision,\n\tcurrent?: ResolveIOAIManagerFailureRecord\n): string {\n\tconst blocker = cleanText(current?.blocker || current?.summary || '', 260);\n\tconst label = cleanText(action?.label, 120) || decision.dispatchAction;\n\tconst objective = cleanText(action?.objective, 260);\n\treturn [\n\t\t`MANAGER_RECOVERY:${decision.dispatchAction}`,\n\t\t`label=${label}`,\n\t\tdecision.reason ? `reason=${decision.reason}` : '',\n\t\tblocker ? `blocker=${blocker}` : '',\n\t\tobjective ? `objective=${objective}` : ''\n\t].filter(Boolean).join(' | ');\n}\n\nexport function buildResolveIOAIManagerRecoveryExecutionDirective(\n\tinput: ResolveIOAIManagerRecoveryExecutionDirectiveInput\n): ResolveIOAIManagerRecoveryExecutionDirective {\n\tconst action = input.action;\n\tconst dispatchDecision = input.dispatchDecision || decideResolveIOAIManagerRecoveryActionDispatch({\n\t\taction,\n\t\tcurrent: input.current,\n\t\tnow: input.now\n\t});\n\tconst dispatchAction = dispatchDecision.dispatchAction;\n\tconst now = isoNow(input.now);\n\tconst phase = recoveryExecutionPhaseForDispatch(dispatchAction);\n\tconst lane = cleanText(action?.lane || input.current?.lane || '', 120);\n\tconst stepType = cleanText(action?.stepType || input.current?.stepType || '', 120);\n\tconst rerunReason = recoveryDirectiveReason(action, dispatchDecision, input.current);\n\tconst surface = cleanText(input.surface || 'runner', 120);\n\treturn {\n\t\tdirectiveId: stableHash('mgr-directive', {\n\t\t\tsurface,\n\t\t\tactionId: action?.actionId || '',\n\t\t\tdispatchAction,\n\t\t\treason: dispatchDecision.reason,\n\t\t\tevidenceHash: dispatchDecision.dispatchRecord?.evidenceHash || input.current?.evidenceHash || ''\n\t\t}),\n\t\tsurface,\n\t\tdispatchAction,\n\t\tphase,\n\t\tallowed: dispatchDecision.allowed,\n\t\tstatus: dispatchDecision.status,\n\t\treason: dispatchDecision.reason,\n\t\tlane,\n\t\tstepType,\n\t\tnextActionLabel: cleanText(action?.label, 160) || dispatchAction,\n\t\trerunReason,\n\t\tevidenceOnly: action?.evidenceOnly !== false || dispatchAction === 'run_evidence_probe',\n\t\tautoRunnable: action?.autoRunnable === true,\n\t\tproductRepairAllowed: action?.productRepairAllowed === true,\n\t\texpensiveModelAllowed: action?.expensiveModelAllowed === true,\n\t\tcanRunProductRepair: dispatchDecision.canRunProductRepair,\n\t\tcanRunExpensiveModel: dispatchDecision.canRunExpensiveModel,\n\t\tcanResetLoopAfterEvidence: action?.canResetLoopAfterEvidence === true,\n\t\trequiresNewEvidence: dispatchDecision.requiresNewEvidence,\n\t\tnewEvidence: dispatchDecision.newEvidence,\n\t\tmaxAttemptsBeforePark: Math.max(1, Number(action?.maxAttemptsBeforePark || 1) || 1),\n\t\trequiredArtifacts: cleanList(action?.requiredArtifacts, 20, 500),\n\t\tnextCommands: cleanList(action?.nextCommands, 20, 500),\n\t\tsuccessCriteria: cleanList(action?.successCriteria, 20, 500),\n\t\tforbiddenActions: action?.productRepairAllowed === true\n\t\t\t? []\n\t\t\t: ['Do not run product-code repair from this directive unless canRunProductRepair is true.'],\n\t\t...(dispatchDecision.dispatchRecord ? { dispatchRecord: dispatchDecision.dispatchRecord } : {}),\n\t\tcreatedAt: now\n\t};\n}\n\nfunction listHasNewEntry(current: string[], previous: string[]): boolean {\n\tconst existing = new Set(previous.map((entry) => cleanText(entry, 500)).filter(Boolean));\n\treturn current.some((entry) => {\n\t\tconst normalized = cleanText(entry, 500);\n\t\treturn !!normalized && !existing.has(normalized);\n\t});\n}\n\nfunction proposedActionIsProductRepair(value: any): boolean {\n\tconst normalized = cleanText(value, 120);\n\treturn /product|code|repair|build|business|journey|workflow/i.test(normalized)\n\t\t&& !/infra|compile|diagnosis|manual|evidence|release|publish/i.test(normalized);\n}\n\nexport function decideResolveIOAIManagerRecoveryGate(\n\tinput: ResolveIOAIManagerRecoveryGateInput\n): ResolveIOAIManagerRecoveryGateDecision {\n\tconst checkpoint = input.checkpoint;\n\tconst hasCurrent = !!input.current;\n\tconst current = input.current || {};\n\tconst blockerFingerprint = hasCurrent\n\t\t? resolveResolveIOAIManagerBlockerFingerprint(current, checkpoint.objective)\n\t\t: checkpoint.blockerFingerprint;\n\tconst evidenceHash = hasCurrent ? hashResolveIOAIManagerEvidence(current) : checkpoint.evidenceHash;\n\tconst changedFiles = hasCurrent ? cleanList(current.changedFiles, 80, 500) : checkpoint.changedFiles;\n\tconst artifactPaths = hasCurrent ? cleanList(current.artifactPaths, 80, 500) : checkpoint.artifactPaths;\n\tconst evidenceChanged = evidenceHash !== checkpoint.evidenceHash\n\t\t|| blockerFingerprint !== checkpoint.blockerFingerprint\n\t\t|| listHasNewEntry(changedFiles, checkpoint.changedFiles)\n\t\t|| listHasNewEntry(artifactPaths, checkpoint.artifactPaths);\n\tconst proposedAction = cleanText(input.proposedAction || checkpoint.allowedAction, 120);\n\tconst productRepairRequested = proposedActionIsProductRepair(proposedAction);\n\tconst missingEvidence = checkpoint.requiredEvidence.filter((required) => {\n\t\tconst normalized = cleanText(required, 120).toLowerCase();\n\t\tif (!normalized) {\n\t\t\treturn false;\n\t\t}\n\t\tif (/artifact|log|proof|gate|evidence/.test(normalized)) {\n\t\t\treturn !artifactPaths.length && !current.evidenceHash;\n\t\t}\n\t\tif (/diff|changed files|owner|scope|file/.test(normalized)) {\n\t\t\treturn !changedFiles.length;\n\t\t}\n\t\treturn false;\n\t});\n\tconst makeDecision = (\n\t\taction: ResolveIOAIManagerRecoveryGateAction,\n\t\treason: string,\n\t\toverrides: Partial<ResolveIOAIManagerRecoveryGateDecision> = {}\n\t): ResolveIOAIManagerRecoveryGateDecision => ({\n\t\taction,\n\t\treason,\n\t\tcanRunProductRepair: checkpoint.productRepairAllowed,\n\t\tcanRunExpensiveModel: checkpoint.expensiveModelAllowed,\n\t\tshouldResetLoopBudget: false,\n\t\tshouldIncrementAttempt: action === 'allow',\n\t\tnewEvidence: evidenceChanged,\n\t\tblockerFingerprint,\n\t\tevidenceHash,\n\t\tmissingEvidence,\n\t\tcheckpoint: {\n\t\t\t...checkpoint,\n\t\t\tupdatedAt: isoNow(input.now)\n\t\t},\n\t\t...overrides\n\t});\n\n\tif (checkpoint.status === 'complete') {\n\t\treturn makeDecision('complete', 'recovery_gate_checkpoint_already_complete', {\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldIncrementAttempt: false\n\t\t});\n\t}\n\tif (checkpoint.status === 'manual_handoff' && input.operatorApproved !== true) {\n\t\treturn makeDecision('manual_handoff', 'recovery_gate_manual_handoff_requires_operator_approval', {\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldIncrementAttempt: false\n\t\t});\n\t}\n\tif (productRepairRequested && !checkpoint.productRepairAllowed) {\n\t\treturn makeDecision('reject_action', 'recovery_gate_product_repair_not_allowed_for_checkpoint', {\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldIncrementAttempt: false\n\t\t});\n\t}\n\tif (checkpoint.status === 'parked' && !evidenceChanged) {\n\t\treturn makeDecision('collect_new_evidence', 'recovery_gate_parked_until_new_evidence', {\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldIncrementAttempt: false\n\t\t});\n\t}\n\tif (checkpoint.attempts >= checkpoint.maxAttemptsBeforePark && !evidenceChanged) {\n\t\treturn makeDecision('collect_new_evidence', 'recovery_gate_attempt_limit_requires_new_evidence', {\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldIncrementAttempt: false\n\t\t});\n\t}\n\tif (evidenceChanged) {\n\t\tconst currentFailureClass = normalizeResolveIOAIManagerFailureClass(current.failureClass);\n\t\tconst currentCanRunProductRepair = checkpoint.productRepairAllowed\n\t\t\t|| !/^(infra|compile|diagnosis|release)$/i.test(currentFailureClass);\n\t\treturn makeDecision('allow', 'recovery_gate_new_evidence_unblocks_retry', {\n\t\t\tcanRunProductRepair: currentCanRunProductRepair,\n\t\t\tcanRunExpensiveModel: checkpoint.expensiveModelAllowed || currentCanRunProductRepair,\n\t\t\tshouldResetLoopBudget: true\n\t\t});\n\t}\n\treturn makeDecision('allow', 'recovery_gate_action_allowed');\n}\n\nfunction failureKey(record: ResolveIOAIManagerFailureRecord | undefined): string {\n\tif (!record) {\n\t\treturn '';\n\t}\n\tconst failureClass = normalizeResolveIOAIManagerFailureClass(record.failureClass);\n\tconst blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(record);\n\treturn `${cleanText(record.lane, 80)}:${cleanText(record.stepType, 80)}:${failureClass}:${blockerFingerprint}`;\n}\n\nfunction failureEvidenceKey(record: ResolveIOAIManagerFailureRecord | undefined): string {\n\treturn `${failureKey(record)}:${hashResolveIOAIManagerEvidence(record)}`;\n}\n\nfunction isPassingOutcome(record: ResolveIOAIManagerFailureRecord | undefined): boolean {\n\treturn /^(pass|accepted|ready_to_publish|published|ready_for_merge|complete|completed)$/i.test(cleanText(record?.outcome, 80));\n}\n\nfunction isManualOutcome(record: ResolveIOAIManagerFailureRecord | undefined): boolean {\n\treturn /^(manual_handoff|park_manual|stopped)$/i.test(cleanText(record?.outcome, 80));\n}\n\nexport function buildResolveIOAIManagerRecoveryPlan(input: ResolveIOAIManagerRecoveryPlanInput = {}): ResolveIOAIManagerRecoveryPlan {\n\tconst action = cleanText(input.action, 80) || 'continue';\n\tconst reason = cleanText(input.reason, 240);\n\tconst failureClass = normalizeResolveIOAIManagerFailureClass(input.failureClass);\n\tconst lane = cleanText(input.lane, 80) || 'supervisor';\n\tconst stepType = cleanText(input.stepType, 80) || 'unknown';\n\tconst blocker = cleanText(input.blocker, 700);\n\tconst changedFiles = cleanList(input.changedFiles, 12, 240);\n\tconst artifactPaths = cleanList(input.artifactPaths, 12, 240);\n\tconst maxAttemptsBeforePark = Math.max(1, Number(input.maxSameFailureRepeats || 3) || 3);\n\tconst commonNotes = [\n\t\treason ? `policy_reason=${reason}` : '',\n\t\tblocker ? `blocker=${blocker}` : '',\n\t\tchangedFiles.length ? `changed_files=${changedFiles.join(', ')}` : '',\n\t\tartifactPaths.length ? `artifacts=${artifactPaths.join(', ')}` : ''\n\t].filter(Boolean);\n\tconst base: Omit<ResolveIOAIManagerRecoveryPlan, 'recoveryClass' | 'nextActionLabel' | 'objective' | 'allowedAction' | 'productRepairAllowed' | 'expensiveModelAllowed' | 'finiteSteps' | 'requiredEvidence' | 'loopResetEvidence' | 'forbiddenActions'> = {\n\t\tlane,\n\t\tstepType,\n\t\tmaxAttemptsBeforePark,\n\t\tnotes: commonNotes\n\t};\n\tconst makePlan = (\n\t\trecoveryClass: ResolveIOAIManagerRecoveryClass,\n\t\tnextActionLabel: string,\n\t\tobjective: string,\n\t\tallowedAction: string,\n\t\tproductRepairAllowed: boolean,\n\t\texpensiveModelAllowed: boolean,\n\t\tfiniteSteps: string[],\n\t\trequiredEvidence: string[],\n\t\tloopResetEvidence: string[],\n\t\tforbiddenActions: string[]\n\t): ResolveIOAIManagerRecoveryPlan => ({\n\t\t...base,\n\t\trecoveryClass,\n\t\tnextActionLabel,\n\t\tobjective,\n\t\tallowedAction,\n\t\tproductRepairAllowed,\n\t\texpensiveModelAllowed,\n\t\tfiniteSteps,\n\t\trequiredEvidence,\n\t\tloopResetEvidence,\n\t\tforbiddenActions\n\t});\n\tif (action === 'reset_loop_budget') {\n\t\treturn makePlan(\n\t\t\t'advance_after_proof',\n\t\t\t'Advance After Proof',\n\t\t\t'Checkpoint the passing evidence and move to the next required gate.',\n\t\t\t'advance_to_next_gate',\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\t[\n\t\t\t\t'Record the passing artifact, changed files, and gate result.',\n\t\t\t\t'Reset the loop counter because a real gate passed.',\n\t\t\t\t'Select the next unmet deterministic gate instead of repeating the previous repair.'\n\t\t\t],\n\t\t\t['passing gate record', 'artifact or log proving the passed check'],\n\t\t\t['new passing gate result', 'new business proof artifact'],\n\t\t\t['rerun the same repair after a pass', 'mark accepted without the required downstream gate']\n\t\t);\n\t}\n\tif (action === 'manual_handoff') {\n\t\treturn makePlan(\n\t\t\t'manual_handoff',\n\t\t\t'Manual Review',\n\t\t\t'Stop autonomous repair and expose the blocker, evidence, and last safe state.',\n\t\t\t'manual_review_only',\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\t[\n\t\t\t\t'Freeze further product-code edits.',\n\t\t\t\t'Show the blocker fingerprint, evidence hash, and prior attempts.',\n\t\t\t\t'Require a human edit to classification, scope, or retry policy before another model/code loop.'\n\t\t\t],\n\t\t\t['blocker fingerprint', 'evidence hash', 'attempt history'],\n\t\t\t['manual policy change', 'new external evidence'],\n\t\t\t['start another automatic model repair', 'hide the failed evidence']\n\t\t);\n\t}\n\tif (action === 'budget_stop') {\n\t\treturn makePlan(\n\t\t\t'manual_handoff',\n\t\t\t'Budget Stop Review',\n\t\t\t'Stop autonomous model/code loops until a cheaper scoped next action is selected.',\n\t\t\t'budget_review_only',\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\t[\n\t\t\t\t'Freeze further model repair loops.',\n\t\t\t\t'Show the prompt/token/runtime budget that tripped the guard.',\n\t\t\t\t'Select a cheaper deterministic gate, infra repair, diagnosis revision, or manual scope edit before resuming.'\n\t\t\t],\n\t\t\t['budget guard reason', 'latest prompt estimate', 'last blocker/evidence hash'],\n\t\t\t['manual scope reduction', 'new deterministic evidence', 'approved budget policy change'],\n\t\t\t['start another broad model prompt', 'reset budget without new evidence', 'hide cost context']\n\t\t);\n\t}\n\tif (failureClass === 'diagnosis' || stepType === 'diagnosis_gate') {\n\t\treturn makePlan(\n\t\t\t'diagnosis_only',\n\t\t\t'Run Diagnosis Gate',\n\t\t\t'Produce a falsifiable root-cause diagnosis before any repair.',\n\t\t\t'read_only_diagnosis',\n\t\t\tfalse,\n\t\t\ttrue,\n\t\t\t[\n\t\t\t\t'Reproduce or explicitly classify the customer issue.',\n\t\t\t\t'Accept one falsifiable hypothesis and record rejected alternatives.',\n\t\t\t\t'Identify the frontend/backend/shared failing path.',\n\t\t\t\t'Select a small owner_files set.',\n\t\t\t\t'Define exact before/action/after business proof.'\n\t\t\t],\n\t\t\t['issue_case', 'accepted_hypothesis', 'rejected_alternatives', 'failing_path', 'owner_files', 'proof_plan'],\n\t\t\t['new reproduction artifact', 'new query/log/code evidence', 'validated diagnosis gate'],\n\t\t\t['edit product code', 'run broad repo repair', 'accept route-load evidence as success']\n\t\t);\n\t}\n\tif (failureClass === 'owner_scope' || failureClass === 'out_of_scope' || /out.?of.?scope|owner_files/i.test(reason)) {\n\t\treturn makePlan(\n\t\t\t'diagnosis_revision',\n\t\t\t'Revise Diagnosis Scope',\n\t\t\t'Revise owner_files only when new evidence proves the current scope is wrong.',\n\t\t\t'diagnosis_revision_only',\n\t\t\tfalse,\n\t\t\ttrue,\n\t\t\t[\n\t\t\t\t'Compare changed files against the diagnosis owner_files.',\n\t\t\t\t'Collect evidence proving why the new file is in the failing path.',\n\t\t\t\t'Update accepted_hypothesis, failing_path, owner_files, and proof_plan together.',\n\t\t\t\t'Resume repair only after the revised gate validates.'\n\t\t\t],\n\t\t\t['out-of-scope file list', 'new failing-path evidence', 'revalidated diagnosis gate'],\n\t\t\t['revised owner_files with evidence', 'new business proof requirement'],\n\t\t\t['keep broad edits without diagnosis', 'add convenience refactors', 'continue repair outside owner_files']\n\t\t);\n\t}\n\tif (action === 'retry_infra') {\n\t\tconst isCompile = failureClass === 'compile';\n\t\treturn makePlan(\n\t\t\tisCompile ? 'compile_repair' : 'infra_repair',\n\t\t\tisCompile ? 'Repair Compile Gate' : 'Repair Infra Gate',\n\t\t\tisCompile\n\t\t\t\t? 'Fix the deterministic compile/build blocker before spending another product repair loop.'\n\t\t\t\t: 'Fix the deterministic harness/browser/server/Mongo blocker before product repair.',\n\t\t\tisCompile ? 'compile_repair_only' : 'infra_repair_only',\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tisCompile\n\t\t\t\t? [\n\t\t\t\t\t'Read the exact compile/build log and identify the first actionable error.',\n\t\t\t\t\t'Fix missing dependency, stale artifact, command, cache, or type wiring required by the compile gate.',\n\t\t\t\t\t'Rerun the same finite compile command.',\n\t\t\t\t\t'Return the compile log artifact and status.'\n\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t'Run preflight for Puppeteer, Chrome executable, ports, Mongo/settings, and startup command.',\n\t\t\t\t\t'Repair only the failing harness/environment item.',\n\t\t\t\t\t'Rerun the same infra check.',\n\t\t\t\t\t'Return the infra log and pass/fail status.'\n\t\t\t\t],\n\t\t\tisCompile\n\t\t\t\t? ['compile command', 'compile log artifact', 'first failing error fixed or still failing']\n\t\t\t\t: ['preflight command', 'infra log artifact', 'specific repaired environment item'],\n\t\t\t['same check now passes', 'new infra/compile blocker hash'],\n\t\t\t['run product-code model repair', 'count this as product failure', 'accept route/business success without the compile/infra gate']\n\t\t);\n\t}\n\tif (action === 'park_repeated_failure' || action === 'park_ping_pong') {\n\t\treturn makePlan(\n\t\t\t'blocked_until_new_evidence',\n\t\t\taction === 'park_ping_pong' ? 'Park Ping-Pong Loop' : 'Park Repeated Failure',\n\t\t\t'Stop the current loop until new evidence changes the diagnosis, route, or repair target.',\n\t\t\t'collect_new_evidence_only',\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\t[\n\t\t\t\t'Do not rerun the same prompt or same repair.',\n\t\t\t\t'Show the repeated blocker and evidence hash.',\n\t\t\t\t'Collect a new artifact: failing DOM state, stack trace, network response, Mongo delta, compile log, or revised diagnosis.',\n\t\t\t\t'Reset the loop only after the new evidence hash changes.'\n\t\t\t],\n\t\t\t['same failure count', 'blocker fingerprint', 'evidence hash'],\n\t\t\t['changed evidence hash', 'new artifact path', 'revised diagnosis or journey contract'],\n\t\t\t['alternate between two failed patches', 'increase loop budget without evidence', 'hide the park reason']\n\t\t);\n\t}\n\tif (failureClass === 'journey') {\n\t\treturn makePlan(\n\t\t\t'journey_contract_repair',\n\t\t\t'Repair Journey Contract',\n\t\t\t'Fix the first/next/last workflow contract before app code work continues.',\n\t\t\t'journey_contract_repair',\n\t\t\tfalse,\n\t\t\ttrue,\n\t\t\t[\n\t\t\t\t'Open docs/APP_JOURNEY_CONTRACT.md.',\n\t\t\t\t'Define first_screen, north_star_workflow, screen_sequence, data_story, completion_states, and qa_assertions.',\n\t\t\t\t'Ensure each CTA maps to an action, route, method, calculation, or state transition.',\n\t\t\t\t'Validate that sample data can drive the promised workflow.'\n\t\t\t],\n\t\t\t['validated journey_contract JSON', 'CTA-to-action mapping', 'workflow QA assertions'],\n\t\t\t['journey validation passes', 'new workflow QA rows generated'],\n\t\t\t['build empty routes', 'add link-only dashboard actions', 'defer workflow design to wow pass']\n\t\t);\n\t}\n\tif (failureClass === 'release') {\n\t\treturn makePlan(\n\t\t\t'release_repair',\n\t\t\t'Repair Release Gate',\n\t\t\t'Repair deploy/publish/sample-data release evidence without rewriting working app flow.',\n\t\t\t'release_repair_only',\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\t[\n\t\t\t\t'Read the deploy/publish/sample-data log.',\n\t\t\t\t'Identify whether the blocker is domain, asset, seed data, route, permission, or CDN.',\n\t\t\t\t'Repair the release artifact/config/seed issue.',\n\t\t\t\t'Rerun only the failed release gate.'\n\t\t\t],\n\t\t\t['deploy or publish log', 'sample-data status', 'failed release gate rerun'],\n\t\t\t['release gate passes', 'new release blocker hash'],\n\t\t\t['change core workflow after business QA passed', 'mark accepted from scorecard only', 'rerun full builder loop']\n\t\t);\n\t}\n\tif (failureClass === 'business' || failureClass === 'qa_evidence' || failureClass === 'route') {\n\t\treturn makePlan(\n\t\t\t'business_proof_repair',\n\t\t\t'Repair Business Proof',\n\t\t\t'Fix the exact failing workflow assertion and prove before/action/after behavior.',\n\t\t\t'business_repair',\n\t\t\ttrue,\n\t\t\ttrue,\n\t\t\t[\n\t\t\t\t'Open the failing QA row or proof_plan.',\n\t\t\t\t'Trace the UI action to method/publication/query/calculation.',\n\t\t\t\t'Patch the smallest owner or workflow files.',\n\t\t\t\t'Rerun only the failed business assertion.',\n\t\t\t\t'Record DOM/data/Mongo/artifact proof.'\n\t\t\t],\n\t\t\t['failing assertion', 'action trace', 'business proof artifact'],\n\t\t\t['business assertion passes', 'new failed assertion with new evidence'],\n\t\t\t['treat route load as success', 'rerun unrelated QA rows first', 'accept scorecard-only evidence']\n\t\t);\n\t}\n\tif (input.productRepairFailure !== false || failureClass === 'product_code') {\n\t\treturn makePlan(\n\t\t\t'product_code_repair',\n\t\t\t'Run Targeted Product Repair',\n\t\t\t'Repair the current product-code blocker with the smallest scoped edit and immediate proof.',\n\t\t\t'targeted_product_repair',\n\t\t\ttrue,\n\t\t\ttrue,\n\t\t\t[\n\t\t\t\t'Inspect the current blocker, artifacts, changed files, and owner/workflow scope.',\n\t\t\t\t'Form one small repair hypothesis.',\n\t\t\t\t'Patch only files justified by the active diagnosis or journey contract.',\n\t\t\t\t'Rerun the smallest failed gate.',\n\t\t\t\t'Record new evidence before any additional loop.'\n\t\t\t],\n\t\t\t['owner/workflow scope', 'repair diff', 'failed gate rerun artifact'],\n\t\t\t['new evidence hash', 'same gate passes'],\n\t\t\t['broad repo search-and-edit', 'rerun the same prompt without inspecting artifacts', 'change unrelated UI polish']\n\t\t);\n\t}\n\treturn makePlan(\n\t\t'continue',\n\t\t'Continue Current Gate',\n\t\t'Continue the current lane because no blocking loop or infra condition was detected.',\n\t\t'continue',\n\t\tfalse,\n\t\tfalse,\n\t\t[\n\t\t\t'Use the active lane memory.',\n\t\t\t'Run the next finite gate.',\n\t\t\t'Record artifacts and evidence hash.'\n\t\t],\n\t\t['active lane memory', 'finite gate artifact'],\n\t\t['new gate result', 'new artifact path'],\n\t\t['spawn duplicate runners', 'advance without evidence']\n\t);\n}\n\nfunction collectOpenTail(records: ResolveIOAIManagerFailureRecord[]): ResolveIOAIManagerFailureRecord[] {\n\tconst tail: ResolveIOAIManagerFailureRecord[] = [];\n\tfor (let index = records.length - 1; index >= 0; index -= 1) {\n\t\tconst record = records[index];\n\t\tif (isPassingOutcome(record)) {\n\t\t\tbreak;\n\t\t}\n\t\ttail.unshift(record);\n\t}\n\treturn tail;\n}\n\nfunction countSameFailure(records: ResolveIOAIManagerFailureRecord[], current: ResolveIOAIManagerFailureRecord): number {\n\tconst currentKey = failureEvidenceKey(current);\n\tlet count = 0;\n\tfor (let index = records.length - 1; index >= 0; index -= 1) {\n\t\tconst record = records[index];\n\t\tif (isPassingOutcome(record)) {\n\t\t\tbreak;\n\t\t}\n\t\tif (failureEvidenceKey(record) !== currentKey) {\n\t\t\tbreak;\n\t\t}\n\t\tcount += 1;\n\t}\n\treturn count;\n}\n\nfunction countPingPong(records: ResolveIOAIManagerFailureRecord[], current: ResolveIOAIManagerFailureRecord): number {\n\tconst tail = collectOpenTail(records).filter((record) => {\n\t\treturn cleanText(record.lane, 80) === cleanText(current.lane, 80)\n\t\t\t&& cleanText(record.stepType, 80) === cleanText(current.stepType, 80);\n\t});\n\tif (tail.length < 4) {\n\t\treturn 0;\n\t}\n\tconst keys = tail.map(failureKey).filter(Boolean);\n\tconst last = keys.slice(-6);\n\tif (last.length < 4) {\n\t\treturn 0;\n\t}\n\tconst distinct = Array.from(new Set(last));\n\tif (distinct.length !== 2) {\n\t\treturn 0;\n\t}\n\tfor (let index = 2; index < last.length; index += 1) {\n\t\tif (last[index] !== last[index - 2]) {\n\t\t\treturn 0;\n\t\t}\n\t}\n\treturn last.length - 1;\n}\n\nexport function decideResolveIOAIManagerPolicy(input: ResolveIOAIManagerPolicyInput): ResolveIOAIManagerPolicyDecision {\n\tconst history = Array.isArray(input.history) ? input.history : [];\n\tconst current = input.current || history[history.length - 1] || {};\n\tconst failureClass = normalizeResolveIOAIManagerFailureClass(current.failureClass);\n\tconst blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current);\n\tconst evidenceHash = hashResolveIOAIManagerEvidence(current);\n\tconst previous = history.length > 1 ? history[history.length - 2] : undefined;\n\tconst previousSameFailure = previous && failureKey(previous) === failureKey(current);\n\tconst previousEvidenceHash = previousSameFailure ? hashResolveIOAIManagerEvidence(previous) : '';\n\tconst newEvidence = !!previousSameFailure && !!previousEvidenceHash && previousEvidenceHash !== evidenceHash;\n\tconst sameFailureCount = countSameFailure(history, current);\n\tconst pingPongCount = countPingPong(history, current);\n\tconst maxSameFailureRepeats = Math.max(1, Number(input.maxSameFailureRepeats || 3) || 3);\n\tconst maxPingPongTransitions = Math.max(3, Number(input.maxPingPongTransitions || 3) || 3);\n\tconst infraClasses = new Set((input.infraFailureClasses || ['infra', 'compile']).map(normalizeResolveIOAIManagerFailureClass));\n\tconst ignoredClasses = new Set((input.ignoredFailureClasses || []).map(normalizeResolveIOAIManagerFailureClass));\n\tconst base = {\n\t\tfailureClass,\n\t\tblockerFingerprint,\n\t\tevidenceHash,\n\t\tsameFailureCount,\n\t\tpingPongCount,\n\t\tnewEvidence,\n\t\tloopBudgetShouldReset: false,\n\t\tproductRepairFailure: !infraClasses.has(failureClass) && !ignoredClasses.has(failureClass)\n\t};\n\tconst withPlan = (\n\t\taction: ResolveIOAIManagerAction,\n\t\treason: string,\n\t\toverrides: Partial<Omit<ResolveIOAIManagerPolicyDecision, 'action' | 'reason' | 'recoveryPlan' | 'recoveryCheckpoint'>> = {}\n\t): ResolveIOAIManagerPolicyDecision => {\n\t\tconst merged = {\n\t\t\t...base,\n\t\t\t...overrides\n\t\t};\n\t\tconst recoveryPlan = buildResolveIOAIManagerRecoveryPlan({\n\t\t\taction,\n\t\t\treason,\n\t\t\tfailureClass: merged.failureClass,\n\t\t\tlane: current.lane,\n\t\t\tstepType: current.stepType,\n\t\t\tblocker: current.blocker || current.summary,\n\t\t\tsameFailureCount: merged.sameFailureCount,\n\t\t\tpingPongCount: merged.pingPongCount,\n\t\t\tnewEvidence: merged.newEvidence,\n\t\t\tproductRepairFailure: merged.productRepairFailure,\n\t\t\tchangedFiles: current.changedFiles,\n\t\t\tartifactPaths: current.artifactPaths,\n\t\t\tmaxSameFailureRepeats\n\t\t});\n\t\tconst recoveryCheckpoint = buildResolveIOAIManagerRecoveryCheckpoint({\n\t\t\tplan: recoveryPlan,\n\t\t\tcurrent\n\t\t});\n\t\tconst recoveryEvidenceProbe = buildResolveIOAIManagerRecoveryEvidenceProbe({\n\t\t\tcheckpoint: recoveryCheckpoint,\n\t\t\tcurrent\n\t\t});\n\t\treturn {\n\t\t\t...merged,\n\t\t\taction,\n\t\t\treason,\n\t\t\trecoveryPlan,\n\t\t\trecoveryCheckpoint,\n\t\t\trecoveryEvidenceProbe,\n\t\t\trecoveryAction: buildResolveIOAIManagerRecoveryActionPacket({\n\t\t\t\tplan: recoveryPlan,\n\t\t\t\tcheckpoint: recoveryCheckpoint,\n\t\t\t\tprobe: recoveryEvidenceProbe,\n\t\t\t\tcurrent\n\t\t\t})\n\t\t};\n\t};\n\tif (isPassingOutcome(current)) {\n\t\treturn withPlan('reset_loop_budget', 'manager_policy_progress_passed', {\n\t\t\tloopBudgetShouldReset: true,\n\t\t\tproductRepairFailure: false\n\t\t});\n\t}\n\tif (isManualOutcome(current)) {\n\t\treturn withPlan('manual_handoff', 'manager_policy_manual_or_stopped');\n\t}\n\tif (pingPongCount >= maxPingPongTransitions) {\n\t\treturn withPlan('park_ping_pong', 'manager_policy_ping_pong_failure_loop');\n\t}\n\tif (sameFailureCount >= maxSameFailureRepeats && !newEvidence) {\n\t\treturn withPlan('park_repeated_failure', 'manager_policy_same_failure_without_new_evidence');\n\t}\n\tif (infraClasses.has(failureClass)) {\n\t\treturn withPlan('retry_infra', 'manager_policy_infra_failure_routes_to_infra_repair', {\n\t\t\tproductRepairFailure: false\n\t\t});\n\t}\n\tif (newEvidence || !previousSameFailure) {\n\t\treturn withPlan('continue', newEvidence\n\t\t\t\t? 'manager_policy_new_evidence_resets_loop_budget'\n\t\t\t\t: 'manager_policy_new_failure_or_lane', {\n\t\t\tloopBudgetShouldReset: true\n\t\t});\n\t}\n\treturn withPlan('continue', 'manager_policy_retry_below_repeat_limit');\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/util/ai-runner-manager-policy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+rBA,0GAuFC;AAED,oFA8CC;AAwBD,0FAiBC;AAED,oFAUC;AAiBD,wEAcC;AAED,8FAwDC;AAwKD,oGAkDC;AA2ED,kGAmFC;AAyDD,wGA0GC;AAED,wGAWC;AAsCD,8GAyDC;AAkCD,wFAoEC;AAQD,oFAyHC;AAuBD,kFA2RC;AAyED,wEAyHC;AAwFD,kGAsPC;AAvoED,SAAS,SAAS,CAAC,KAAU,EAAE,GAAU;IAAV,oBAAA,EAAA,UAAU;IACxC,OAAO,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,SAAS,CAAC,MAAW,EAAE,KAAU,EAAE,GAAS;;IAArB,sBAAA,EAAA,UAAU;IAAE,oBAAA,EAAA,SAAS;IACpD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,CAAC;IACX,CAAC;IACD,IAAM,MAAM,GAAa,EAAE,CAAC;;QAC5B,KAAoB,IAAA,WAAA,SAAA,MAAM,CAAA,8BAAA,kDAAE,CAAC;YAAxB,IAAM,KAAK,mBAAA;YACf,IAAM,UAAU,GAAG,SAAS,CAAC,KAA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AAK,wBAAwB;eACvE,sBAAsB,CAAC,sBAAsB,KAAK,IAAI;eACtD,sBAAsB,CAAC,iBAAiB,KAAK,KAAK;QACtD,MAAM,EAAE,sBAAsB,CAAC,iBAAiB;QAChD,MAAM,EAAE,sBAAsB,CAAC,MAAM;QACrC,aAAa,EAAE,gBAAgB;QAC/B,cAAc,EAAE,oBAAoB;QACpC,gBAAgB,EAAE,oBAAoB;QACtC,wBAAwB,EAAE,oBAAoB;QAC9C,oBAAoB,EAAE,KAAK;QAC3B,qBAAqB,EAAE,KAAK;QAC5B,gBAAgB,EAAE,KAAK;QACvB,gBAAgB,EAAE,MAAM;QACxB,WAAW,EAAE,IAAI;QACjB,iBAAiB,EAAE,sBAAsB,CAAC,iBAAiB;QAC3D,OAAO,EAAE,EAAE,aAAa,EAAE,sBAAsB,EAAE;KAClD,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACd,CAAC","file":"ai-runner-manager-policy.js","sourcesContent":["export type ResolveIOAIManagerAction =\n\t| 'continue'\n\t| 'retry_infra'\n\t| 'reset_loop_budget'\n\t| 'park_repeated_failure'\n\t| 'park_ping_pong'\n\t| 'manual_handoff';\n\nexport interface ResolveIOAIManagerFailureRecord {\n\toutcome?: string;\n\tlane?: string;\n\tstepType?: string;\n\tfailureClass?: string;\n\tblocker?: string;\n\tblockerFingerprint?: string;\n\tevidenceHash?: string;\n\tchangedFiles?: string[];\n\tartifactPaths?: string[];\n\tsummary?: string;\n\trecordedAt?: Date | string;\n}\n\nexport type ResolveIOAIManagerEvidenceStrength = 'none' | 'weak' | 'material' | 'proof';\n\nexport interface ResolveIOAIManagerEvidenceAssessment {\n\tchanged: boolean;\n\tmaterial: boolean;\n\tstrength: ResolveIOAIManagerEvidenceStrength;\n\tsignals: string[];\n\tevidenceHash: string;\n\tblockerFingerprint: string;\n}\n\nexport type ResolveIOAIManagerRecoveryClass =\n\t| 'advance_after_proof'\n\t| 'diagnosis_only'\n\t| 'diagnosis_revision'\n\t| 'infra_repair'\n\t| 'compile_repair'\n\t| 'journey_contract_repair'\n\t| 'business_proof_repair'\n\t| 'release_repair'\n\t| 'product_code_repair'\n\t| 'blocked_until_new_evidence'\n\t| 'manual_handoff'\n\t| 'continue';\n\nexport interface ResolveIOAIManagerRecoveryPlan {\n\trecoveryClass: ResolveIOAIManagerRecoveryClass;\n\tlane: string;\n\tstepType: string;\n\tnextActionLabel: string;\n\tobjective: string;\n\tallowedAction: string;\n\tproductRepairAllowed: boolean;\n\texpensiveModelAllowed: boolean;\n\tmaxAttemptsBeforePark: number;\n\tfiniteSteps: string[];\n\trequiredEvidence: string[];\n\tloopResetEvidence: string[];\n\tforbiddenActions: string[];\n\tnotes: string[];\n}\n\nexport type ResolveIOAIManagerRecoveryCheckpointStatus =\n\t| 'active'\n\t| 'parked'\n\t| 'manual_handoff'\n\t| 'complete';\n\nexport interface ResolveIOAIManagerRecoveryCheckpoint {\n\tcheckpointId: string;\n\trecoveryClass: ResolveIOAIManagerRecoveryClass;\n\tstatus: ResolveIOAIManagerRecoveryCheckpointStatus;\n\tlane: string;\n\tstepType: string;\n\tallowedAction: string;\n\tproductRepairAllowed: boolean;\n\texpensiveModelAllowed: boolean;\n\tattempts: number;\n\tmaxAttemptsBeforePark: number;\n\tblockerFingerprint: string;\n\tevidenceHash: string;\n\tchangedFiles: string[];\n\tartifactPaths: string[];\n\trequiredEvidence: string[];\n\tloopResetEvidence: string[];\n\tforbiddenActions: string[];\n\tobjective: string;\n\tnextActionLabel: string;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\nexport type ResolveIOAIManagerRecoveryEvidenceProbeStepKind =\n\t| 'read_only_diagnosis'\n\t| 'rerun_same_gate'\n\t| 'infra_preflight'\n\t| 'compile_check'\n\t| 'route_probe'\n\t| 'business_assertion'\n\t| 'journey_validation'\n\t| 'release_status'\n\t| 'diff_scope_check'\n\t| 'operator_review';\n\nexport interface ResolveIOAIManagerRecoveryEvidenceProbeStep {\n\tid: string;\n\tkind: ResolveIOAIManagerRecoveryEvidenceProbeStepKind;\n\tlabel: string;\n\tobjective: string;\n\trequired: boolean;\n\tcommandHint?: string;\n\tartifactExpectation: string;\n\tsuccessSignal: string;\n}\n\nexport interface ResolveIOAIManagerRecoveryEvidenceProbe {\n\tprobeId: string;\n\tcheckpointId: string;\n\trecoveryClass: ResolveIOAIManagerRecoveryClass;\n\tlane: string;\n\tstepType: string;\n\tobjective: string;\n\tevidenceOnly: boolean;\n\tproductRepairAllowed: boolean;\n\texpensiveModelAllowed: boolean;\n\tevidenceHashBefore: string;\n\tblockerFingerprint: string;\n\tsteps: ResolveIOAIManagerRecoveryEvidenceProbeStep[];\n\trequiredArtifacts: string[];\n\tacceptanceEvidence: string[];\n\tstopConditions: string[];\n\tloopResetEvidence: string[];\n\tcreatedAt: string;\n}\n\nexport type ResolveIOAIManagerRecoveryAutomationMode =\n\t| 'advance'\n\t| 'collect_evidence'\n\t| 'read_only_diagnosis'\n\t| 'repair_infra'\n\t| 'repair_compile'\n\t| 'repair_journey_contract'\n\t| 'repair_business_assertion'\n\t| 'repair_release'\n\t| 'targeted_product_repair'\n\t| 'manual_review'\n\t| 'continue_gate';\n\nexport interface ResolveIOAIManagerRecoveryActionRetryPolicy {\n\tallowImmediateRetry: boolean;\n\trequireNewEvidence: boolean;\n\tresetLoopWhen: string[];\n\tstopWhen: string[];\n}\n\nexport type ResolveIOAIManagerHotfixFirstReleaseAction =\n\t| 'wait_for_active_deploy'\n\t| 'block_duplicate_deploy'\n\t| 'review_force_deploy'\n\t| 'hotfix_release_artifact'\n\t| 'deploy_new_artifact_after_release_gate'\n\t| 'build_artifact_first';\n\nexport type ResolveIOAIManagerHotfixChannel =\n\t| 'static_ui'\n\t| 'backend_js'\n\t| 'config'\n\t| 'seed_data'\n\t| 'cache_invalidation'\n\t| 'service_restart'\n\t| 'release_artifact'\n\t| 'force_deploy_review'\n\t| 'new_artifact_deploy'\n\t| 'artifact_build';\n\nexport interface ResolveIOAIManagerHotfixPlanStep {\n\tid: string;\n\tlabel: string;\n\tchannel: ResolveIOAIManagerHotfixChannel;\n\tsafeToAutoRun: boolean;\n\trequiresFullDeploy: boolean;\n\trequiredEvidence: string[];\n\tsuccessEvidence: string[];\n\tblockedBy: string[];\n}\n\nexport interface ResolveIOAIManagerHotfixPlan {\n\tplanId: string;\n\tlabel: string;\n\trecommendedChannel: ResolveIOAIManagerHotfixChannel;\n\treason: string;\n\tfullDeployAvoided: boolean;\n\tsteps: ResolveIOAIManagerHotfixPlanStep[];\n\tacceptanceEvidence: string[];\n\tescalationTriggers: string[];\n}\n\nexport interface ResolveIOAIManagerHotfixFirstReleasePolicyInput {\n\tsurface?: string;\n\tactiveDeploy?: boolean;\n\tdeployFingerprint?: string;\n\tlastDeployFingerprint?: string;\n\tdeployStatus?: string;\n\tpublishStatus?: string;\n\tsampleDataStatus?: string;\n\tforceDeploy?: boolean;\n\thasNewArtifact?: boolean;\n}\n\nexport interface ResolveIOAIManagerHotfixFirstReleasePolicy {\n\tpolicy: 'hotfix_first';\n\tsurface: string;\n\trecommendedAction: ResolveIOAIManagerHotfixFirstReleaseAction;\n\tlabel: string;\n\treason: string;\n\thotfixPreferred: boolean;\n\tfullDeployAllowed: boolean;\n\tduplicateDeployBlocked: boolean;\n\tforceDeployRequiredToRepeat: boolean;\n\tstatuses: {\n\t\tdeploy: string;\n\t\tpublish: string;\n\t\tsampleData: string;\n\t};\n\tfingerprints: {\n\t\tcurrent: string;\n\t\tlast: string;\n\t\tmatchesLast: boolean;\n\t};\n\thotfixPlan: ResolveIOAIManagerHotfixPlan;\n\tallowedActions: string[];\n\tforbiddenActions: string[];\n\trequiredEvidence: string[];\n}\n\nexport interface ResolveIOAIManagerRecoveryActionPacket {\n\tactionId: string;\n\tcheckpointId: string;\n\tprobeId: string;\n\trecoveryClass: ResolveIOAIManagerRecoveryClass;\n\tmode: ResolveIOAIManagerRecoveryAutomationMode;\n\tlabel: string;\n\tlane: string;\n\tstepType: string;\n\tprimaryStepKind: ResolveIOAIManagerRecoveryEvidenceProbeStepKind | 'none';\n\tobjective: string;\n\tevidenceOnly: boolean;\n\tautoRunnable: boolean;\n\tproductRepairAllowed: boolean;\n\texpensiveModelAllowed: boolean;\n\tcanResetLoopAfterEvidence: boolean;\n\tmaxAttemptsBeforePark: number;\n\trequiredArtifacts: string[];\n\tnextCommands: string[];\n\tsuccessCriteria: string[];\n\tretryPolicy: ResolveIOAIManagerRecoveryActionRetryPolicy;\n\treleasePolicy?: ResolveIOAIManagerHotfixFirstReleasePolicy;\n\tblockedReason?: string;\n\tcreatedAt: string;\n}\n\nexport type ResolveIOAIManagerRecoveryActionDispatchAction =\n\t| 'run_evidence_probe'\n\t| 'run_read_only_diagnosis'\n\t| 'run_infra_repair'\n\t| 'run_compile_repair'\n\t| 'run_journey_contract_repair'\n\t| 'run_business_assertion_repair'\n\t| 'run_release_repair'\n\t| 'run_targeted_product_repair'\n\t| 'advance'\n\t| 'continue_gate'\n\t| 'park_manual';\n\nexport interface ResolveIOAIManagerAutoDispatchPolicyInput {\n\tdispatchAction?: ResolveIOAIManagerRecoveryActionDispatchAction | string;\n\tdirective?: Partial<ResolveIOAIManagerRecoveryExecutionDirective>;\n\taction?: Partial<ResolveIOAIManagerRecoveryActionPacket>;\n\tincludeJourneyContractRepair?: boolean;\n\tincludeReleaseRepair?: boolean;\n\tincludeBusinessProofRepair?: boolean;\n\tincludeProductRepair?: boolean;\n}\n\nexport type ResolveIOAIManagerRecoveryActionDispatchStatus =\n\t| 'queued'\n\t| 'started'\n\t| 'completed'\n\t| 'failed'\n\t| 'parked';\n\nexport interface ResolveIOAIManagerRecoveryActionDispatchRecord {\n\tdispatchId: string;\n\tactionId: string;\n\tcheckpointId: string;\n\tprobeId: string;\n\tmode: ResolveIOAIManagerRecoveryAutomationMode;\n\tdispatchAction: ResolveIOAIManagerRecoveryActionDispatchAction;\n\tstatus: ResolveIOAIManagerRecoveryActionDispatchStatus;\n\tevidenceHash: string;\n\tblockerFingerprint: string;\n\tproductRepairAllowed: boolean;\n\texpensiveModelAllowed: boolean;\n\treason: string;\n\tartifactPaths: string[];\n\tstartedAt?: string;\n\tcompletedAt?: string;\n\tcreatedAt: string;\n}\n\nexport interface ResolveIOAIManagerRecoveryActionDispatchInput {\n\taction?: ResolveIOAIManagerRecoveryActionPacket;\n\thistory?: ResolveIOAIManagerRecoveryActionDispatchRecord[];\n\tcurrent?: ResolveIOAIManagerFailureRecord;\n\toperatorApproved?: boolean;\n\tnow?: Date | string;\n}\n\nexport interface ResolveIOAIManagerRecoveryActionDispatchDecision {\n\tdispatchAction: ResolveIOAIManagerRecoveryActionDispatchAction;\n\tallowed: boolean;\n\treason: string;\n\tstatus: ResolveIOAIManagerRecoveryActionDispatchStatus;\n\tcanRunProductRepair: boolean;\n\tcanRunExpensiveModel: boolean;\n\tshouldRecordDispatch: boolean;\n\trequiresNewEvidence: boolean;\n\tnewEvidence: boolean;\n\tdispatchRecord?: ResolveIOAIManagerRecoveryActionDispatchRecord;\n}\n\nexport type ResolveIOAIManagerRecoveryExecutionPhase =\n\t| 'evidence'\n\t| 'diagnosis'\n\t| 'infra'\n\t| 'compile'\n\t| 'journey'\n\t| 'business_proof'\n\t| 'release'\n\t| 'product_repair'\n\t| 'advance'\n\t| 'manual';\n\nexport interface ResolveIOAIManagerRecoveryExecutionDirectiveInput {\n\taction?: ResolveIOAIManagerRecoveryActionPacket;\n\tdispatchDecision?: ResolveIOAIManagerRecoveryActionDispatchDecision;\n\tcurrent?: ResolveIOAIManagerFailureRecord;\n\tsurface?: string;\n\tnow?: Date | string;\n}\n\nexport interface ResolveIOAIManagerRecoveryExecutionDirective {\n\tdirectiveId: string;\n\tsurface: string;\n\tdispatchAction: ResolveIOAIManagerRecoveryActionDispatchAction;\n\tphase: ResolveIOAIManagerRecoveryExecutionPhase;\n\tallowed: boolean;\n\tstatus: ResolveIOAIManagerRecoveryActionDispatchStatus;\n\treason: string;\n\tlane: string;\n\tstepType: string;\n\tnextActionLabel: string;\n\trerunReason: string;\n\tevidenceOnly: boolean;\n\tautoRunnable: boolean;\n\tproductRepairAllowed: boolean;\n\texpensiveModelAllowed: boolean;\n\tcanRunProductRepair: boolean;\n\tcanRunExpensiveModel: boolean;\n\tcanResetLoopAfterEvidence: boolean;\n\trequiresNewEvidence: boolean;\n\tnewEvidence: boolean;\n\tmaxAttemptsBeforePark: number;\n\trequiredArtifacts: string[];\n\tnextCommands: string[];\n\tsuccessCriteria: string[];\n\tforbiddenActions: string[];\n\tdispatchRecord?: ResolveIOAIManagerRecoveryActionDispatchRecord;\n\treleasePolicy?: ResolveIOAIManagerHotfixFirstReleasePolicy;\n\tcreatedAt: string;\n}\n\nexport interface ResolveIOAIManagerRecoveryCheckpointInput {\n\tplan: ResolveIOAIManagerRecoveryPlan;\n\tcurrent?: ResolveIOAIManagerFailureRecord;\n\tpreviousCheckpoint?: ResolveIOAIManagerRecoveryCheckpoint;\n\tnow?: Date | string;\n}\n\nexport type ResolveIOAIManagerRecoveryGateAction =\n\t| 'allow'\n\t| 'collect_new_evidence'\n\t| 'reject_action'\n\t| 'manual_handoff'\n\t| 'complete';\n\nexport interface ResolveIOAIManagerRecoveryGateInput {\n\tcheckpoint: ResolveIOAIManagerRecoveryCheckpoint;\n\tcurrent?: ResolveIOAIManagerFailureRecord;\n\tproposedAction?: string;\n\toperatorApproved?: boolean;\n\tnow?: Date | string;\n}\n\nexport interface ResolveIOAIManagerRecoveryGateDecision {\n\taction: ResolveIOAIManagerRecoveryGateAction;\n\treason: string;\n\tcanRunProductRepair: boolean;\n\tcanRunExpensiveModel: boolean;\n\tshouldResetLoopBudget: boolean;\n\tshouldIncrementAttempt: boolean;\n\tnewEvidence: boolean;\n\tmaterialEvidence: boolean;\n\tevidenceStrength: ResolveIOAIManagerEvidenceStrength;\n\tevidenceSignals: string[];\n\tblockerFingerprint: string;\n\tevidenceHash: string;\n\tmissingEvidence: string[];\n\tcheckpoint: ResolveIOAIManagerRecoveryCheckpoint;\n}\n\nexport interface ResolveIOAIManagerRecoveryEvidenceProbeInput {\n\tcheckpoint: ResolveIOAIManagerRecoveryCheckpoint;\n\tcurrent?: ResolveIOAIManagerFailureRecord;\n\tnow?: Date | string;\n}\n\nexport interface ResolveIOAIManagerRecoveryActionPacketInput {\n\tplan?: ResolveIOAIManagerRecoveryPlan;\n\tcheckpoint: ResolveIOAIManagerRecoveryCheckpoint;\n\tprobe?: ResolveIOAIManagerRecoveryEvidenceProbe;\n\tcurrent?: ResolveIOAIManagerFailureRecord;\n\tnow?: Date | string;\n}\n\nexport interface ResolveIOAIManagerRecoveryPlanInput {\n\taction?: ResolveIOAIManagerAction | string;\n\treason?: string;\n\tfailureClass?: string;\n\tlane?: string;\n\tstepType?: string;\n\tblocker?: string;\n\tsameFailureCount?: number;\n\tpingPongCount?: number;\n\tnewEvidence?: boolean;\n\tproductRepairFailure?: boolean;\n\tchangedFiles?: string[];\n\tartifactPaths?: string[];\n\tmaxSameFailureRepeats?: number;\n}\n\nexport interface ResolveIOAIManagerPolicyInput {\n\thistory?: ResolveIOAIManagerFailureRecord[];\n\tcurrent?: ResolveIOAIManagerFailureRecord;\n\tmaxSameFailureRepeats?: number;\n\tmaxPingPongTransitions?: number;\n\tinfraFailureClasses?: string[];\n\tignoredFailureClasses?: string[];\n}\n\nexport interface ResolveIOAIManagerPolicyDecision {\n\taction: ResolveIOAIManagerAction;\n\treason: string;\n\tfailureClass: string;\n\tblockerFingerprint: string;\n\tevidenceHash: string;\n\tsameFailureCount: number;\n\tpingPongCount: number;\n\tnewEvidence: boolean;\n\tmaterialEvidence: boolean;\n\tevidenceStrength: ResolveIOAIManagerEvidenceStrength;\n\tevidenceSignals: string[];\n\tloopBudgetShouldReset: boolean;\n\tproductRepairFailure: boolean;\n\trecoveryPlan: ResolveIOAIManagerRecoveryPlan;\n\trecoveryCheckpoint: ResolveIOAIManagerRecoveryCheckpoint;\n\trecoveryEvidenceProbe: ResolveIOAIManagerRecoveryEvidenceProbe;\n\trecoveryAction: ResolveIOAIManagerRecoveryActionPacket;\n}\n\nexport interface ResolveIOAIManagerRecoveryReplayMatrixInput {\n\tsurface?: string;\n\tincludeJourneyContractRepair?: boolean;\n\tincludeReleaseRepair?: boolean;\n\tincludeProductRepair?: boolean;\n\tmaxSameFailureRepeats?: number;\n}\n\nexport interface ResolveIOAIManagerRecoveryReplayCase {\n\tcaseId: string;\n\tsurface: string;\n\tpass: boolean;\n\taction: string;\n\treason: string;\n\trecoveryClass: string;\n\tdispatchAction: string;\n\tsafeAutoDispatch: boolean;\n\texpectedSafeAutoDispatch: boolean;\n\tproductRepairAllowed: boolean;\n\tloopBudgetShouldReset: boolean;\n\tmaterialEvidence: boolean;\n\tevidenceStrength: ResolveIOAIManagerEvidenceStrength;\n\thotfixFirst?: boolean;\n\tfullDeployAllowed?: boolean;\n\tdetails?: Record<string, any>;\n}\n\nfunction cleanText(value: any, max = 2000): string {\n\treturn String(value || '').replace(/\\s+/g, ' ').trim().slice(0, max);\n}\n\nfunction cleanList(values: any, limit = 40, max = 500): string[] {\n\tif (!Array.isArray(values)) {\n\t\treturn [];\n\t}\n\tconst result: string[] = [];\n\tfor (const value of values) {\n\t\tconst normalized = cleanText(value, max);\n\t\tif (normalized && !result.includes(normalized)) {\n\t\t\tresult.push(normalized);\n\t\t}\n\t\tif (result.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn result;\n}\n\nfunction releaseStatusIsBlocked(value: string): boolean {\n\treturn /fail|error|blocked|missing|empty|not ready|not_ready|denied|invalid|timeout|stale/i.test(value);\n}\n\nfunction releaseStatusIsTerminalDeploy(value: string): boolean {\n\treturn /requested|queued|in.?progress|completed|complete|success|succeeded|pass|passed|published|deployed|failed|error|blocked/i.test(value);\n}\n\nfunction buildReleaseAllowedActions(action: ResolveIOAIManagerHotfixFirstReleaseAction): string[] {\n\tif (action === 'wait_for_active_deploy') {\n\t\treturn ['wait_for_current_deploy_result', 'collect_current_deploy_log', 'refresh_release_snapshot'];\n\t}\n\tif (action === 'block_duplicate_deploy') {\n\t\treturn ['collect_existing_deploy_evidence', 'hotfix_release_artifact', 'request_force_deploy_with_reason'];\n\t}\n\tif (action === 'review_force_deploy') {\n\t\treturn ['verify_force_deploy_reason', 'rerun_failed_release_gate_once', 'record_force_deploy_evidence'];\n\t}\n\tif (action === 'deploy_new_artifact_after_release_gate') {\n\t\treturn ['verify_new_artifact_fingerprint', 'run_release_gate_once', 'record_publish_deploy_evidence'];\n\t}\n\tif (action === 'build_artifact_first') {\n\t\treturn ['build_missing_release_artifact', 'record_artifact_fingerprint', 'run_release_gate_once'];\n\t}\n\treturn ['hotfix_live_runner_or_release_artifact', 'rerun_failed_release_gate_only', 'record_release_evidence'];\n}\n\nfunction hotfixStep(\n\tid: string,\n\tlabel: string,\n\tchannel: ResolveIOAIManagerHotfixChannel,\n\toptions: {\n\t\tsafeToAutoRun?: boolean;\n\t\trequiresFullDeploy?: boolean;\n\t\trequiredEvidence?: string[];\n\t\tsuccessEvidence?: string[];\n\t\tblockedBy?: string[];\n\t} = {}\n): ResolveIOAIManagerHotfixPlanStep {\n\treturn {\n\t\tid,\n\t\tlabel,\n\t\tchannel,\n\t\tsafeToAutoRun: options.safeToAutoRun === true,\n\t\trequiresFullDeploy: options.requiresFullDeploy === true,\n\t\trequiredEvidence: options.requiredEvidence || [],\n\t\tsuccessEvidence: options.successEvidence || [],\n\t\tblockedBy: options.blockedBy || []\n\t};\n}\n\nfunction buildHotfixFirstReleasePlan(input: {\n\taction: ResolveIOAIManagerHotfixFirstReleaseAction;\n\tsurface: string;\n\treason: string;\n\treleaseBlocked: boolean;\n}): ResolveIOAIManagerHotfixPlan {\n\tconst surface = cleanText(input.surface || 'runner', 80)\n\t\t.toLowerCase()\n\t\t.replace(/[^a-z0-9]+/g, '_')\n\t\t.replace(/^_+|_+$/g, '') || 'runner';\n\tconst commonAcceptance = [\n\t\t'failed release gate is rerun once and passes',\n\t\t'artifact fingerprint or hotfix evidence is recorded',\n\t\t'operator console shows no active duplicate deploy blocker'\n\t];\n\tif (input.action === 'wait_for_active_deploy') {\n\t\treturn {\n\t\t\tplanId: `${surface}:wait_for_active_deploy`,\n\t\t\tlabel: 'Wait For Active Deploy',\n\t\t\trecommendedChannel: 'release_artifact',\n\t\t\treason: input.reason,\n\t\t\tfullDeployAvoided: true,\n\t\t\tsteps: [\n\t\t\t\thotfixStep('collect_active_deploy_log', 'Collect active deploy log', 'release_artifact', {\n\t\t\t\t\tsafeToAutoRun: true,\n\t\t\t\t\trequiredEvidence: ['active deploy id or release operation id'],\n\t\t\t\t\tsuccessEvidence: ['terminal deploy status and release log captured']\n\t\t\t\t})\n\t\t\t],\n\t\t\tacceptanceEvidence: commonAcceptance,\n\t\t\tescalationTriggers: ['active deploy exceeds timeout', 'active deploy fails without a release log']\n\t\t};\n\t}\n\tif (input.action === 'deploy_new_artifact_after_release_gate') {\n\t\treturn {\n\t\t\tplanId: `${surface}:deploy_new_artifact_after_release_gate`,\n\t\t\tlabel: 'Deploy New Artifact After Release Gate',\n\t\t\trecommendedChannel: 'new_artifact_deploy',\n\t\t\treason: input.reason,\n\t\t\tfullDeployAvoided: false,\n\t\t\tsteps: [\n\t\t\t\thotfixStep('verify_new_artifact_fingerprint', 'Verify new artifact fingerprint', 'new_artifact_deploy', {\n\t\t\t\t\tsafeToAutoRun: true,\n\t\t\t\t\trequiresFullDeploy: true,\n\t\t\t\t\trequiredEvidence: ['current artifact fingerprint differs from last deployed fingerprint'],\n\t\t\t\t\tsuccessEvidence: ['release gate permits one full deploy']\n\t\t\t\t})\n\t\t\t],\n\t\t\tacceptanceEvidence: [\n\t\t\t\t'new artifact fingerprint recorded',\n\t\t\t\t'release gate passed before full deploy',\n\t\t\t\t'deploy/publish result recorded'\n\t\t\t],\n\t\t\tescalationTriggers: ['artifact fingerprint matches last deploy', 'release gate fails']\n\t\t};\n\t}\n\tif (input.action === 'build_artifact_first') {\n\t\treturn {\n\t\t\tplanId: `${surface}:build_artifact_first`,\n\t\t\tlabel: 'Build Artifact First',\n\t\t\trecommendedChannel: 'artifact_build',\n\t\t\treason: input.reason,\n\t\t\tfullDeployAvoided: true,\n\t\t\tsteps: [\n\t\t\t\thotfixStep('build_once_record_fingerprint', 'Build once and record fingerprint', 'artifact_build', {\n\t\t\t\t\tsafeToAutoRun: false,\n\t\t\t\t\trequiredEvidence: ['missing artifact fingerprint', 'release gate reason for building'],\n\t\t\t\t\tsuccessEvidence: ['artifact fingerprint recorded before any deploy']\n\t\t\t\t})\n\t\t\t],\n\t\t\tacceptanceEvidence: ['artifact fingerprint exists', 'no deploy queued before release gate'],\n\t\t\tescalationTriggers: ['build repeats without a new fingerprint', 'build failure lacks compile log']\n\t\t};\n\t}\n\tif (input.action === 'review_force_deploy') {\n\t\treturn {\n\t\t\tplanId: `${surface}:review_force_deploy`,\n\t\t\tlabel: 'Review Force Deploy',\n\t\t\trecommendedChannel: 'force_deploy_review',\n\t\t\treason: input.reason,\n\t\t\tfullDeployAvoided: false,\n\t\t\tsteps: [\n\t\t\t\thotfixStep('verify_force_deploy_reason', 'Verify force deploy reason', 'force_deploy_review', {\n\t\t\t\t\trequiredEvidence: ['explicit force_deploy reason', 'why hotfix cannot resolve the release blocker'],\n\t\t\t\t\tsuccessEvidence: ['one allowed deploy attempt is recorded with reason']\n\t\t\t\t})\n\t\t\t],\n\t\t\tacceptanceEvidence: ['force deploy evidence recorded', 'duplicate fingerprint exception is auditable'],\n\t\t\tescalationTriggers: ['force deploy reason is empty', 'same force deploy fails twice']\n\t\t};\n\t}\n\treturn {\n\t\tplanId: `${surface}:${input.action}`,\n\t\tlabel: input.action === 'block_duplicate_deploy' ? 'Hotfix Or Force Deploy' : 'Hotfix Release Artifact',\n\t\trecommendedChannel: input.releaseBlocked ? 'release_artifact' : 'static_ui',\n\t\treason: input.reason,\n\t\tfullDeployAvoided: true,\n\t\tsteps: [\n\t\t\thotfixStep('static_ui_hotfix', 'Static UI hotfix', 'static_ui', {\n\t\t\t\tsafeToAutoRun: true,\n\t\t\t\trequiredEvidence: ['built dist path', 'target S3 bucket and CloudFront distribution', 'changed frontend bundle or asset list'],\n\t\t\t\tsuccessEvidence: ['S3 upload result', 'CloudFront invalidation id', 'public bundle contains expected hotfix marker']\n\t\t\t}),\n\t\t\thotfixStep('backend_js_hotfix', 'Backend JS hotfix', 'backend_js', {\n\t\t\t\trequiredEvidence: ['compiled JS artifact path', 'target backend host', 'diff limited to runner/operator code'],\n\t\t\t\tsuccessEvidence: ['remote file checksum', 'service restart or process reload evidence', 'self-test passes']\n\t\t\t}),\n\t\t\thotfixStep('config_seed_cache_restart', 'Config, seed, cache, or restart repair', 'config', {\n\t\t\t\tsafeToAutoRun: true,\n\t\t\t\trequiredEvidence: ['exact config/seed/cache key or process name', 'why no product artifact changed'],\n\t\t\t\tsuccessEvidence: ['release gate rerun result', 'operator console release snapshot refreshed']\n\t\t\t})\n\t\t],\n\t\tacceptanceEvidence: commonAcceptance,\n\t\tescalationTriggers: [\n\t\t\t'hotfix changes customer-facing product code outside the release artifact',\n\t\t\t'same release gate fails twice after hotfix evidence',\n\t\t\t'force deploy is requested without a reason'\n\t\t]\n\t};\n}\n\nexport function buildResolveIOAIManagerHotfixFirstReleasePolicy(\n\tinput: ResolveIOAIManagerHotfixFirstReleasePolicyInput = {}\n): ResolveIOAIManagerHotfixFirstReleasePolicy {\n\tconst surface = cleanText(input.surface || 'runner', 120);\n\tconst deployStatus = cleanText(input.deployStatus, 160);\n\tconst publishStatus = cleanText(input.publishStatus, 160);\n\tconst sampleDataStatus = cleanText(input.sampleDataStatus, 160);\n\tconst deployFingerprint = cleanText(input.deployFingerprint, 240);\n\tconst lastDeployFingerprint = cleanText(input.lastDeployFingerprint, 240);\n\tconst fingerprintMatchesLast = !!deployFingerprint && !!lastDeployFingerprint && deployFingerprint === lastDeployFingerprint;\n\tconst releaseBlocked = [deployStatus, publishStatus, sampleDataStatus].some(releaseStatusIsBlocked);\n\tconst duplicateDeployBlocked = fingerprintMatchesLast\n\t\t&& input.forceDeploy !== true\n\t\t&& releaseStatusIsTerminalDeploy([deployStatus, publishStatus].filter(Boolean).join(' '));\n\tlet recommendedAction: ResolveIOAIManagerHotfixFirstReleaseAction = 'hotfix_release_artifact';\n\tlet label = 'Hotfix Release Artifact';\n\tlet reason = 'Repair the live runner/operator code, release config, domain, seed-data, or release artifact and rerun only the failed release gate.';\n\tlet fullDeployAllowed = false;\n\tif (input.activeDeploy === true) {\n\t\trecommendedAction = 'wait_for_active_deploy';\n\t\tlabel = 'Wait For Active Deploy';\n\t\treason = 'A deploy is already queued or running; collect that result before spending another deploy cycle.';\n\t}\n\telse if (duplicateDeployBlocked) {\n\t\trecommendedAction = 'block_duplicate_deploy';\n\t\tlabel = 'Block Duplicate Deploy';\n\t\treason = 'The same artifact fingerprint already has release status; hotfix or provide explicit force_deploy evidence before rerunning it.';\n\t}\n\telse if (fingerprintMatchesLast && input.forceDeploy === true) {\n\t\trecommendedAction = 'review_force_deploy';\n\t\tlabel = 'Review Force Deploy';\n\t\treason = 'force_deploy was explicitly requested for a repeated artifact; require a reason and rerun only the failed release gate.';\n\t\tfullDeployAllowed = true;\n\t}\n\telse if (input.hasNewArtifact === false && !releaseBlocked) {\n\t\trecommendedAction = 'build_artifact_first';\n\t\tlabel = 'Build Artifact First';\n\t\treason = 'No release artifact fingerprint is available yet; build once, record the fingerprint, and avoid repeated deploys.';\n\t}\n\telse if (input.hasNewArtifact === true && !releaseBlocked) {\n\t\trecommendedAction = 'deploy_new_artifact_after_release_gate';\n\t\tlabel = 'Deploy New Artifact After Release Gate';\n\t\treason = 'A new artifact can be deployed after the release gate proves the artifact is new and ready.';\n\t\tfullDeployAllowed = true;\n\t}\n\tconst allowedActions = buildReleaseAllowedActions(recommendedAction);\n\tconst hotfixPlan = buildHotfixFirstReleasePlan({\n\t\taction: recommendedAction,\n\t\tsurface,\n\t\treason,\n\t\treleaseBlocked\n\t});\n\treturn {\n\t\tpolicy: 'hotfix_first',\n\t\tsurface,\n\t\trecommendedAction,\n\t\tlabel,\n\t\treason,\n\t\thotfixPreferred: recommendedAction !== 'deploy_new_artifact_after_release_gate' && recommendedAction !== 'review_force_deploy',\n\t\tfullDeployAllowed,\n\t\tduplicateDeployBlocked,\n\t\tforceDeployRequiredToRepeat: true,\n\t\tstatuses: {\n\t\t\tdeploy: deployStatus,\n\t\t\tpublish: publishStatus,\n\t\t\tsampleData: sampleDataStatus\n\t\t},\n\t\tfingerprints: {\n\t\t\tcurrent: deployFingerprint,\n\t\t\tlast: lastDeployFingerprint,\n\t\t\tmatchesLast: fingerprintMatchesLast\n\t\t},\n\t\thotfixPlan,\n\t\tallowedActions,\n\t\tforbiddenActions: [\n\t\t\t'rerun full builder loop for a release-only blocker',\n\t\t\t'queue duplicate deploy without force_deploy evidence',\n\t\t\t'publish/deploy again before reading the failed release log',\n\t\t\t'change core workflow after business proof passed unless release evidence proves it is required'\n\t\t],\n\t\trequiredEvidence: [\n\t\t\t'failed release gate log or active deploy result',\n\t\t\t'deploy artifact fingerprint comparison',\n\t\t\t'hotfix/config/seed/domain change evidence when no new product artifact is needed',\n\t\t\t'force_deploy reason when repeating the same fingerprint'\n\t\t]\n\t};\n}\n\nexport function isResolveIOAIManagerSafeAutoDispatch(\n\tinput: ResolveIOAIManagerAutoDispatchPolicyInput | ResolveIOAIManagerRecoveryActionDispatchAction | string | undefined\n): boolean {\n\tconst normalizedInput = typeof input === 'string'\n\t\t? { dispatchAction: input }\n\t\t: (input || {});\n\tconst dispatchAction = cleanText(normalizedInput.dispatchAction || normalizedInput.directive?.dispatchAction, 120);\n\tconst directiveAllowed = normalizedInput.directive?.allowed;\n\tconst actionAutoRunnable = normalizedInput.action?.autoRunnable;\n\tconst productRepairAllowed = normalizedInput.directive?.canRunProductRepair === true\n\t\t|| normalizedInput.directive?.productRepairAllowed === true\n\t\t|| normalizedInput.action?.productRepairAllowed === true;\n\tconst expensiveModelAllowed = normalizedInput.directive?.canRunExpensiveModel === true\n\t\t|| normalizedInput.directive?.expensiveModelAllowed === true\n\t\t|| normalizedInput.action?.expensiveModelAllowed === true;\n\tif (!dispatchAction || dispatchAction === 'park_manual') {\n\t\treturn false;\n\t}\n\tif (directiveAllowed === false || actionAutoRunnable === false) {\n\t\treturn false;\n\t}\n\tif ([\n\t\t'run_evidence_probe',\n\t\t'run_read_only_diagnosis',\n\t\t'run_infra_repair',\n\t\t'run_compile_repair'\n\t].includes(dispatchAction)) {\n\t\treturn true;\n\t}\n\tif (dispatchAction === 'run_release_repair') {\n\t\treturn normalizedInput.includeReleaseRepair !== false;\n\t}\n\tif (dispatchAction === 'run_journey_contract_repair') {\n\t\treturn normalizedInput.includeJourneyContractRepair !== false && productRepairAllowed !== true;\n\t}\n\tif (dispatchAction === 'run_business_assertion_repair') {\n\t\treturn normalizedInput.includeBusinessProofRepair === true\n\t\t\t&& productRepairAllowed !== true\n\t\t\t&& expensiveModelAllowed !== true;\n\t}\n\tif (dispatchAction === 'run_targeted_product_repair') {\n\t\treturn normalizedInput.includeProductRepair === true\n\t\t\t&& productRepairAllowed === true\n\t\t\t&& expensiveModelAllowed !== true;\n\t}\n\treturn dispatchAction === 'advance' || dispatchAction === 'continue_gate';\n}\n\nfunction isoNow(value?: Date | string): string {\n\tif (value instanceof Date) {\n\t\treturn value.toISOString();\n\t}\n\tconst parsed = value ? new Date(value) : new Date();\n\tif (Number.isFinite(parsed.getTime())) {\n\t\treturn parsed.toISOString();\n\t}\n\treturn new Date().toISOString();\n}\n\nfunction stableHash(prefix: string, value: any): string {\n\tconst normalized = typeof value === 'string'\n\t\t? cleanText(value, 12000)\n\t\t: JSON.stringify(value || {});\n\tlet hash = 0;\n\tfor (let index = 0; index < normalized.length; index += 1) {\n\t\thash = ((hash << 5) - hash + normalized.charCodeAt(index)) | 0;\n\t}\n\treturn `${prefix}-${Math.abs(hash).toString(36) || '0'}`;\n}\n\nexport function normalizeResolveIOAIManagerFailureClass(value: any): string {\n\tconst normalized = cleanText(value, 80)\n\t\t.toLowerCase()\n\t\t.replace(/[\\s-]+/g, '_');\n\tif (!normalized) {\n\t\treturn 'unknown';\n\t}\n\tif (/^(qa_infra|infrastructure|harness|puppeteer|chrome|mongo|port|startup)$/.test(normalized)) {\n\t\treturn 'infra';\n\t}\n\tif (/^(build|compile|typescript|tsc|angular_build|ng_build)$/.test(normalized)) {\n\t\treturn 'compile';\n\t}\n\tif (/^(false_pass|route_only|missing_business_proof)$/.test(normalized)) {\n\t\treturn 'business';\n\t}\n\treturn normalized.slice(0, 80);\n}\n\nexport function fingerprintResolveIOAIManagerBlocker(value: any): string {\n\tconst normalized = cleanText(value, 4000)\n\t\t.toLowerCase()\n\t\t.replace(/[a-f0-9]{16,}/g, '<id>')\n\t\t.replace(/\\b\\d{2,}\\b/g, '<n>')\n\t\t.replace(/\\bline\\s+<n>\\b/g, 'line <n>')\n\t\t.replace(/https?:\\/\\/\\S+/g, '<url>')\n\t\t.replace(/\\s+/g, ' ')\n\t\t.trim();\n\treturn stableHash('mgr-blocker', normalized);\n}\n\nfunction resolveResolveIOAIManagerBlockerFingerprint(\n\trecord: ResolveIOAIManagerFailureRecord | undefined,\n\tfallback?: any\n): string {\n\tconst blockerText = cleanText(record?.blocker || record?.summary, 4000);\n\tif (blockerText) {\n\t\treturn fingerprintResolveIOAIManagerBlocker(blockerText);\n\t}\n\tconst explicit = cleanText(record?.blockerFingerprint, 120);\n\tif (explicit) {\n\t\treturn explicit;\n\t}\n\treturn fingerprintResolveIOAIManagerBlocker(fallback || '');\n}\n\nexport function hashResolveIOAIManagerEvidence(record: ResolveIOAIManagerFailureRecord | undefined): string {\n\tif (!record) {\n\t\treturn stableHash('mgr-evidence', '');\n\t}\n\tconst explicit = cleanText(record.evidenceHash, 120);\n\tif (explicit) {\n\t\treturn explicit;\n\t}\n\treturn stableHash('mgr-evidence', {\n\t\tfailureClass: normalizeResolveIOAIManagerFailureClass(record.failureClass),\n\t\tblocker: cleanText(record.blocker || record.summary, 2000),\n\t\tchangedFiles: cleanList(record.changedFiles, 80, 500).sort(),\n\t\tartifactPaths: cleanList(record.artifactPaths, 80, 500).sort()\n\t});\n}\n\nexport function buildResolveIOAIManagerRecoveryCheckpoint(\n\tinput: ResolveIOAIManagerRecoveryCheckpointInput\n): ResolveIOAIManagerRecoveryCheckpoint {\n\tconst plan = input.plan;\n\tconst current = input.current || {};\n\tconst blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current, plan.objective);\n\tconst evidenceHash = hashResolveIOAIManagerEvidence(current);\n\tconst changedFiles = cleanList(current.changedFiles, 80, 500);\n\tconst artifactPaths = cleanList(current.artifactPaths, 80, 500);\n\tconst previous = input.previousCheckpoint;\n\tconst sameCheckpointBase = previous\n\t\t&& previous.recoveryClass === plan.recoveryClass\n\t\t&& previous.lane === plan.lane\n\t\t&& previous.stepType === plan.stepType\n\t\t&& previous.blockerFingerprint === blockerFingerprint\n\t\t&& previous.evidenceHash === evidenceHash;\n\tconst attempts = sameCheckpointBase ? Math.max(0, Number(previous.attempts || 0)) + 1 : 1;\n\tconst status: ResolveIOAIManagerRecoveryCheckpointStatus = plan.recoveryClass === 'manual_handoff'\n\t\t? 'manual_handoff'\n\t\t: plan.recoveryClass === 'blocked_until_new_evidence'\n\t\t\t? 'parked'\n\t\t\t: plan.recoveryClass === 'advance_after_proof'\n\t\t\t\t? 'complete'\n\t\t\t\t: 'active';\n\tconst now = isoNow(input.now);\n\tconst checkpointId = stableHash('mgr-recovery', {\n\t\trecoveryClass: plan.recoveryClass,\n\t\tlane: plan.lane,\n\t\tstepType: plan.stepType,\n\t\tallowedAction: plan.allowedAction,\n\t\tblockerFingerprint,\n\t\tevidenceHash\n\t});\n\treturn {\n\t\tcheckpointId,\n\t\trecoveryClass: plan.recoveryClass,\n\t\tstatus,\n\t\tlane: plan.lane,\n\t\tstepType: plan.stepType,\n\t\tallowedAction: plan.allowedAction,\n\t\tproductRepairAllowed: plan.productRepairAllowed,\n\t\texpensiveModelAllowed: plan.expensiveModelAllowed,\n\t\tattempts,\n\t\tmaxAttemptsBeforePark: plan.maxAttemptsBeforePark,\n\t\tblockerFingerprint,\n\t\tevidenceHash,\n\t\tchangedFiles,\n\t\tartifactPaths,\n\t\trequiredEvidence: cleanList(plan.requiredEvidence, 40, 500),\n\t\tloopResetEvidence: cleanList(plan.loopResetEvidence, 40, 500),\n\t\tforbiddenActions: cleanList(plan.forbiddenActions, 40, 500),\n\t\tobjective: cleanText(plan.objective, 1000),\n\t\tnextActionLabel: cleanText(plan.nextActionLabel, 160),\n\t\tcreatedAt: sameCheckpointBase && previous?.createdAt ? previous.createdAt : now,\n\t\tupdatedAt: now\n\t};\n}\n\nfunction makeRecoveryEvidenceProbeStep(\n\tid: string,\n\tkind: ResolveIOAIManagerRecoveryEvidenceProbeStepKind,\n\tlabel: string,\n\tobjective: string,\n\tartifactExpectation: string,\n\tsuccessSignal: string,\n\toptions: Partial<Pick<ResolveIOAIManagerRecoveryEvidenceProbeStep, 'required' | 'commandHint'>> = {}\n): ResolveIOAIManagerRecoveryEvidenceProbeStep {\n\treturn {\n\t\tid,\n\t\tkind,\n\t\tlabel,\n\t\tobjective: cleanText(objective, 1000),\n\t\trequired: options.required !== false,\n\t\t...(options.commandHint ? { commandHint: cleanText(options.commandHint, 500) } : {}),\n\t\tartifactExpectation: cleanText(artifactExpectation, 500),\n\t\tsuccessSignal: cleanText(successSignal, 500)\n\t};\n}\n\nfunction recoveryEvidenceProbeStepsFor(\n\tcheckpoint: ResolveIOAIManagerRecoveryCheckpoint\n): ResolveIOAIManagerRecoveryEvidenceProbeStep[] {\n\tconst base = [\n\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t'snapshot_current_blocker',\n\t\t\t'rerun_same_gate',\n\t\t\t'Snapshot Current Blocker',\n\t\t\t'Capture the current blocker, failure class, evidence hash, changed files, and artifact paths before any new repair.',\n\t\t\t'runner-evidence/current-blocker.json',\n\t\t\t'Snapshot includes the same checkpointId, blockerFingerprint, and evidenceHashBefore.'\n\t\t)\n\t];\n\tif (checkpoint.recoveryClass === 'diagnosis_only' || checkpoint.recoveryClass === 'diagnosis_revision') {\n\t\treturn [\n\t\t\t...base,\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'collect_read_only_root_cause_evidence',\n\t\t\t\t'read_only_diagnosis',\n\t\t\t\t'Collect Read-Only Root-Cause Evidence',\n\t\t\t\tcheckpoint.recoveryClass === 'diagnosis_revision'\n\t\t\t\t\t? 'Collect new evidence that proves the current owner_files or failing_path is wrong before broadening scope.'\n\t\t\t\t\t: 'Reproduce or classify the issue and record the exact customer complaint, expected result, observed result, route/module, and account context.',\n\t\t\t\t'runner-evidence/diagnosis-readonly.md',\n\t\t\t\t'Evidence supports one falsifiable accepted hypothesis and at least one rejected alternative.'\n\t\t\t),\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'validate_diagnosis_gate',\n\t\t\t\t'read_only_diagnosis',\n\t\t\t\t'Validate Diagnosis Gate',\n\t\t\t\t'Validate issue_case, accepted_hypothesis, rejected_alternatives, failing_path, owner_files, and before/action/after proof_plan.',\n\t\t\t\t'runner-evidence/diagnosis-gate.json',\n\t\t\t\t'Diagnosis gate validates before product-code repair is allowed.'\n\t\t\t)\n\t\t];\n\t}\n\tif (checkpoint.recoveryClass === 'infra_repair') {\n\t\treturn [\n\t\t\t...base,\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'run_infra_preflight',\n\t\t\t\t'infra_preflight',\n\t\t\t\t'Run Infra Preflight',\n\t\t\t\t'Check Puppeteer/Chrome, ports, Mongo/settings, cache state, startup commands, and server/client process health.',\n\t\t\t\t'runner-evidence/infra-preflight.log',\n\t\t\t\t'The same infra gate either passes or returns a new infra blocker hash.',\n\t\t\t\t{ commandHint: 'runner preflight: puppeteer/chrome/mongo/ports/startup' }\n\t\t\t)\n\t\t];\n\t}\n\tif (checkpoint.recoveryClass === 'compile_repair') {\n\t\treturn [\n\t\t\t...base,\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'rerun_compile_gate',\n\t\t\t\t'compile_check',\n\t\t\t\t'Rerun Compile Gate',\n\t\t\t\t'Rerun the same deterministic compile/build command and capture the first actionable error.',\n\t\t\t\t'runner-evidence/compile.log',\n\t\t\t\t'Compile passes or the first failing error changes.',\n\t\t\t\t{ commandHint: 'same finite build/compile command from the failed gate' }\n\t\t\t)\n\t\t];\n\t}\n\tif (checkpoint.recoveryClass === 'journey_contract_repair') {\n\t\treturn [\n\t\t\t...base,\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'validate_journey_contract',\n\t\t\t\t'journey_validation',\n\t\t\t\t'Validate Journey Contract',\n\t\t\t\t'Validate docs/APP_JOURNEY_CONTRACT.md has first/next/last workflow, route/action/method mapping, seeded data story, completion states, and QA assertions.',\n\t\t\t\t'runner-evidence/journey-contract-validation.json',\n\t\t\t\t'Journey contract validates before build tasks continue.'\n\t\t\t),\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'verify_hub_workflow_mapping',\n\t\t\t\t'journey_validation',\n\t\t\t\t'Verify Hub Workflow Mapping',\n\t\t\t\t'Confirm the hub CTA and screen sequence implement the journey contract instead of link-only navigation.',\n\t\t\t\t'runner-evidence/hub-workflow-map.json',\n\t\t\t\t'Primary hub action maps to a real route/action/method/calculation and next state.'\n\t\t\t)\n\t\t];\n\t}\n\tif (checkpoint.recoveryClass === 'business_proof_repair' || checkpoint.recoveryClass === 'product_code_repair') {\n\t\treturn [\n\t\t\t...base,\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'rerun_business_assertion',\n\t\t\t\t'business_assertion',\n\t\t\t\t'Rerun Business Assertion',\n\t\t\t\t'Run the exact issue/app promise proof and capture before/action/after DOM/data evidence.',\n\t\t\t\t'runner-evidence/business-assertion.json',\n\t\t\t\t'Business assertion passes, or the observed failure changes with a new artifact path.'\n\t\t\t),\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'check_diff_scope',\n\t\t\t\t'diff_scope_check',\n\t\t\t\t'Check Diff Scope',\n\t\t\t\t'Compare changed files against the current diagnosis/journey owner scope before another code repair.',\n\t\t\t\t'runner-evidence/diff-scope.json',\n\t\t\t\t'Changed files are in scope, or diagnosis/journey scope is revised with evidence.'\n\t\t\t)\n\t\t];\n\t}\n\tif (checkpoint.recoveryClass === 'release_repair') {\n\t\treturn [\n\t\t\t...base,\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'collect_release_status',\n\t\t\t\t'release_status',\n\t\t\t\t'Collect Release Status',\n\t\t\t\t'Collect publish/deploy/build-instance/domain/CloudFront status and the last actionable deploy error.',\n\t\t\t\t'runner-evidence/release-status.json',\n\t\t\t\t'Release gate passes or returns a new release blocker hash without product-code repair.'\n\t\t\t)\n\t\t];\n\t}\n\tif (checkpoint.recoveryClass === 'manual_handoff') {\n\t\treturn [\n\t\t\t...base,\n\t\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t\t'operator_review_checkpoint',\n\t\t\t\t'operator_review',\n\t\t\t\t'Operator Review Checkpoint',\n\t\t\t\t'Expose budget, blocker, evidence hash, and the minimum policy/scope change needed before another expensive loop.',\n\t\t\t\t'runner-evidence/operator-review.json',\n\t\t\t\t'Operator approves a new scope/policy or provides new external evidence.'\n\t\t\t)\n\t\t];\n\t}\n\treturn [\n\t\t...base,\n\t\tmakeRecoveryEvidenceProbeStep(\n\t\t\t'rerun_same_deterministic_gate',\n\t\t\t'rerun_same_gate',\n\t\t\t'Rerun Same Deterministic Gate',\n\t\t\t'Rerun the exact failed check and capture new logs/artifacts without changing product code first.',\n\t\t\t'runner-evidence/retry-gate.log',\n\t\t\t'Gate passes, or evidenceHash/blockerFingerprint/artifactPaths change.'\n\t\t)\n\t];\n}\n\nexport function buildResolveIOAIManagerRecoveryEvidenceProbe(\n\tinput: ResolveIOAIManagerRecoveryEvidenceProbeInput\n): ResolveIOAIManagerRecoveryEvidenceProbe {\n\tconst checkpoint = input.checkpoint;\n\tconst now = isoNow(input.now);\n\tconst steps = recoveryEvidenceProbeStepsFor(checkpoint);\n\tconst requiredArtifacts = Array.from(new Set(steps\n\t\t.filter((step) => step.required)\n\t\t.map((step) => step.artifactExpectation)\n\t\t.filter(Boolean)));\n\treturn {\n\t\tprobeId: stableHash('mgr-probe', {\n\t\t\tcheckpointId: checkpoint.checkpointId,\n\t\t\trecoveryClass: checkpoint.recoveryClass,\n\t\t\tevidenceHash: checkpoint.evidenceHash,\n\t\t\tblockerFingerprint: checkpoint.blockerFingerprint\n\t\t}),\n\t\tcheckpointId: checkpoint.checkpointId,\n\t\trecoveryClass: checkpoint.recoveryClass,\n\t\tlane: checkpoint.lane,\n\t\tstepType: checkpoint.stepType,\n\t\tobjective: checkpoint.status === 'parked'\n\t\t\t? 'Collect new evidence before any additional expensive model/code repair.'\n\t\t\t: cleanText(checkpoint.objective, 1000),\n\t\tevidenceOnly: checkpoint.status === 'parked'\n\t\t\t|| checkpoint.recoveryClass === 'diagnosis_only'\n\t\t\t|| checkpoint.recoveryClass === 'diagnosis_revision'\n\t\t\t|| checkpoint.recoveryClass === 'infra_repair'\n\t\t\t|| checkpoint.recoveryClass === 'compile_repair'\n\t\t\t|| checkpoint.recoveryClass === 'release_repair',\n\t\tproductRepairAllowed: checkpoint.productRepairAllowed && checkpoint.status !== 'parked',\n\t\texpensiveModelAllowed: checkpoint.expensiveModelAllowed && checkpoint.status !== 'parked',\n\t\tevidenceHashBefore: checkpoint.evidenceHash,\n\t\tblockerFingerprint: checkpoint.blockerFingerprint,\n\t\tsteps,\n\t\trequiredArtifacts,\n\t\tacceptanceEvidence: Array.from(new Set([\n\t\t\t...checkpoint.requiredEvidence,\n\t\t\t...checkpoint.loopResetEvidence,\n\t\t\t...steps.map((step) => step.successSignal)\n\t\t].map((entry) => cleanText(entry, 500)).filter(Boolean))).slice(0, 30),\n\t\tstopConditions: Array.from(new Set([\n\t\t\t...checkpoint.forbiddenActions,\n\t\t\t'no new evidence hash',\n\t\t\t'no new artifact path',\n\t\t\t'product-code repair requested while evidenceOnly is true'\n\t\t].map((entry) => cleanText(entry, 500)).filter(Boolean))).slice(0, 30),\n\t\tloopResetEvidence: checkpoint.loopResetEvidence,\n\t\tcreatedAt: now\n\t};\n}\n\nfunction recoveryAutomationModeFor(\n\tcheckpoint: ResolveIOAIManagerRecoveryCheckpoint\n): ResolveIOAIManagerRecoveryAutomationMode {\n\tif (checkpoint.status === 'manual_handoff' || checkpoint.recoveryClass === 'manual_handoff') {\n\t\treturn 'manual_review';\n\t}\n\tif (checkpoint.status === 'complete' || checkpoint.recoveryClass === 'advance_after_proof') {\n\t\treturn 'advance';\n\t}\n\tif (checkpoint.status === 'parked' || checkpoint.recoveryClass === 'blocked_until_new_evidence') {\n\t\treturn 'collect_evidence';\n\t}\n\tif (checkpoint.recoveryClass === 'diagnosis_only' || checkpoint.recoveryClass === 'diagnosis_revision') {\n\t\treturn 'read_only_diagnosis';\n\t}\n\tif (checkpoint.recoveryClass === 'infra_repair') {\n\t\treturn 'repair_infra';\n\t}\n\tif (checkpoint.recoveryClass === 'compile_repair') {\n\t\treturn 'repair_compile';\n\t}\n\tif (checkpoint.recoveryClass === 'journey_contract_repair') {\n\t\treturn 'repair_journey_contract';\n\t}\n\tif (checkpoint.recoveryClass === 'business_proof_repair') {\n\t\treturn 'repair_business_assertion';\n\t}\n\tif (checkpoint.recoveryClass === 'release_repair') {\n\t\treturn 'repair_release';\n\t}\n\tif (checkpoint.recoveryClass === 'product_code_repair') {\n\t\treturn 'targeted_product_repair';\n\t}\n\treturn 'continue_gate';\n}\n\nfunction recoveryActionLabelFor(mode: ResolveIOAIManagerRecoveryAutomationMode, checkpoint: ResolveIOAIManagerRecoveryCheckpoint): string {\n\tconst explicit = cleanText(checkpoint.nextActionLabel, 120);\n\tif (explicit && mode !== 'collect_evidence') {\n\t\treturn explicit;\n\t}\n\tconst labels: Record<ResolveIOAIManagerRecoveryAutomationMode, string> = {\n\t\tadvance: 'Advance To Next Gate',\n\t\tcollect_evidence: 'Collect New Evidence',\n\t\tread_only_diagnosis: 'Run Diagnosis Evidence Pass',\n\t\trepair_infra: 'Repair Infra Gate',\n\t\trepair_compile: 'Repair Compile Gate',\n\t\trepair_journey_contract: 'Repair Journey Contract',\n\t\trepair_business_assertion: 'Repair Business Proof',\n\t\trepair_release: 'Repair Release Gate',\n\t\ttargeted_product_repair: 'Run Targeted Repair',\n\t\tmanual_review: 'Manual Review',\n\t\tcontinue_gate: 'Continue Current Gate'\n\t};\n\treturn labels[mode];\n}\n\nfunction recoveryActionAutoRunnable(\n\tmode: ResolveIOAIManagerRecoveryAutomationMode,\n\tprobe: ResolveIOAIManagerRecoveryEvidenceProbe\n): boolean {\n\tif (mode === 'manual_review') {\n\t\treturn false;\n\t}\n\tif (mode === 'advance' || mode === 'continue_gate') {\n\t\treturn true;\n\t}\n\tif (mode === 'targeted_product_repair' || mode === 'read_only_diagnosis' || mode === 'repair_journey_contract' || mode === 'repair_business_assertion') {\n\t\treturn true;\n\t}\n\treturn probe.steps.some((step) => step.commandHint || step.kind === 'rerun_same_gate' || step.kind === 'release_status' || step.kind === 'diff_scope_check');\n}\n\nexport function buildResolveIOAIManagerRecoveryActionPacket(\n\tinput: ResolveIOAIManagerRecoveryActionPacketInput\n): ResolveIOAIManagerRecoveryActionPacket {\n\tconst checkpoint = input.checkpoint;\n\tconst probe = input.probe || buildResolveIOAIManagerRecoveryEvidenceProbe({\n\t\tcheckpoint,\n\t\tcurrent: input.current,\n\t\tnow: input.now\n\t});\n\tconst mode = recoveryAutomationModeFor(checkpoint);\n\tconst primaryStep = probe.steps.find((step) => step.required && step.id !== 'snapshot_current_blocker')\n\t\t|| probe.steps.find((step) => step.required)\n\t\t|| probe.steps[0];\n\tconst evidenceOnly = probe.evidenceOnly || mode === 'collect_evidence' || mode === 'repair_infra' || mode === 'repair_compile' || mode === 'repair_release';\n\tconst requireNewEvidence = mode === 'collect_evidence'\n\t\t|| checkpoint.status === 'parked'\n\t\t|| checkpoint.attempts >= checkpoint.maxAttemptsBeforePark;\n\tconst stopWhen = Array.from(new Set([\n\t\t...probe.stopConditions,\n\t\t...(requireNewEvidence ? ['same blocker fingerprint and same evidence hash after probe'] : [])\n\t].map((entry) => cleanText(entry, 500)).filter(Boolean))).slice(0, 30);\n\tconst resetLoopWhen = Array.from(new Set([\n\t\t...checkpoint.loopResetEvidence,\n\t\t...probe.loopResetEvidence,\n\t\t...(requireNewEvidence ? [\n\t\t\t'new material evidence: changed blocker, validated diagnosis/journey, business proof, compile/infra/release proof, or new actionable trace',\n\t\t\t'weak hash-only evidence does not reset the loop'\n\t\t] : [])\n\t].map((entry) => cleanText(entry, 500)).filter(Boolean))).slice(0, 30);\n\tconst nextCommands = probe.steps\n\t\t.map((step) => cleanText(step.commandHint || `${step.kind}:${step.id}`, 500))\n\t\t.filter(Boolean)\n\t\t.slice(0, 12);\n\tconst releasePolicy = mode === 'repair_release'\n\t\t? buildResolveIOAIManagerHotfixFirstReleasePolicy({\n\t\t\tsurface: 'manager_recovery',\n\t\t\tdeployStatus: checkpoint.stepType,\n\t\t\tpublishStatus: checkpoint.lane\n\t\t})\n\t\t: undefined;\n\tconst now = isoNow(input.now);\n\treturn {\n\t\tactionId: stableHash('mgr-action', {\n\t\t\tcheckpointId: checkpoint.checkpointId,\n\t\t\tprobeId: probe.probeId,\n\t\t\tmode,\n\t\t\tevidenceHash: checkpoint.evidenceHash,\n\t\t\tblockerFingerprint: checkpoint.blockerFingerprint\n\t\t}),\n\t\tcheckpointId: checkpoint.checkpointId,\n\t\tprobeId: probe.probeId,\n\t\trecoveryClass: checkpoint.recoveryClass,\n\t\tmode,\n\t\tlabel: recoveryActionLabelFor(mode, checkpoint),\n\t\tlane: checkpoint.lane,\n\t\tstepType: checkpoint.stepType,\n\t\tprimaryStepKind: primaryStep?.kind || 'none',\n\t\tobjective: mode === 'collect_evidence'\n\t\t\t? probe.objective\n\t\t\t: cleanText(checkpoint.objective || probe.objective, 1000),\n\t\tevidenceOnly,\n\t\tautoRunnable: recoveryActionAutoRunnable(mode, probe),\n\t\tproductRepairAllowed: checkpoint.productRepairAllowed && !evidenceOnly && checkpoint.status !== 'parked',\n\t\texpensiveModelAllowed: checkpoint.expensiveModelAllowed && checkpoint.status !== 'parked',\n\t\tcanResetLoopAfterEvidence: resetLoopWhen.length > 0,\n\t\tmaxAttemptsBeforePark: checkpoint.maxAttemptsBeforePark,\n\t\trequiredArtifacts: probe.requiredArtifacts.slice(0, 20),\n\t\tnextCommands: releasePolicy\n\t\t\t? Array.from(new Set([...nextCommands, ...releasePolicy.allowedActions])).slice(0, 12)\n\t\t\t: nextCommands,\n\t\tsuccessCriteria: releasePolicy\n\t\t\t? Array.from(new Set([...probe.acceptanceEvidence, ...releasePolicy.requiredEvidence])).slice(0, 20)\n\t\t\t: probe.acceptanceEvidence.slice(0, 20),\n\t\tretryPolicy: {\n\t\t\tallowImmediateRetry: checkpoint.status !== 'parked' && mode !== 'manual_review',\n\t\t\trequireNewEvidence,\n\t\t\tresetLoopWhen,\n\t\t\tstopWhen\n\t\t},\n\t\t...(releasePolicy ? { releasePolicy } : {}),\n\t\t...(mode === 'collect_evidence' ? { blockedReason: 'Manager parked this loop until the recovery action records new evidence.' } : {}),\n\t\tcreatedAt: now\n\t};\n}\n\nfunction dispatchActionForMode(mode: ResolveIOAIManagerRecoveryAutomationMode): ResolveIOAIManagerRecoveryActionDispatchAction {\n\tconst map: Record<ResolveIOAIManagerRecoveryAutomationMode, ResolveIOAIManagerRecoveryActionDispatchAction> = {\n\t\tadvance: 'advance',\n\t\tcollect_evidence: 'run_evidence_probe',\n\t\tread_only_diagnosis: 'run_read_only_diagnosis',\n\t\trepair_infra: 'run_infra_repair',\n\t\trepair_compile: 'run_compile_repair',\n\t\trepair_journey_contract: 'run_journey_contract_repair',\n\t\trepair_business_assertion: 'run_business_assertion_repair',\n\t\trepair_release: 'run_release_repair',\n\t\ttargeted_product_repair: 'run_targeted_product_repair',\n\t\tmanual_review: 'park_manual',\n\t\tcontinue_gate: 'continue_gate'\n\t};\n\treturn map[mode] || 'park_manual';\n}\n\nfunction buildRecoveryDispatchRecord(\n\taction: ResolveIOAIManagerRecoveryActionPacket,\n\tdispatchAction: ResolveIOAIManagerRecoveryActionDispatchAction,\n\tstatus: ResolveIOAIManagerRecoveryActionDispatchStatus,\n\treason: string,\n\tcurrent?: ResolveIOAIManagerFailureRecord,\n\tnow?: Date | string\n): ResolveIOAIManagerRecoveryActionDispatchRecord {\n\tconst evidenceHash = current?.evidenceHash || action.checkpointId || action.actionId;\n\tconst blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current, action.objective);\n\tconst artifactPaths = cleanList(current?.artifactPaths, 20, 500);\n\tconst createdAt = isoNow(now);\n\treturn {\n\t\tdispatchId: stableHash('mgr-dispatch', {\n\t\t\tactionId: action.actionId,\n\t\t\tdispatchAction,\n\t\t\tevidenceHash,\n\t\t\tblockerFingerprint,\n\t\t\tstatus\n\t\t}),\n\t\tactionId: action.actionId,\n\t\tcheckpointId: action.checkpointId,\n\t\tprobeId: action.probeId,\n\t\tmode: action.mode,\n\t\tdispatchAction,\n\t\tstatus,\n\t\tevidenceHash,\n\t\tblockerFingerprint,\n\t\tproductRepairAllowed: action.productRepairAllowed && dispatchAction === 'run_targeted_product_repair',\n\t\texpensiveModelAllowed: action.expensiveModelAllowed && dispatchAction !== 'run_evidence_probe',\n\t\treason,\n\t\tartifactPaths,\n\t\t...(status === 'started' ? { startedAt: createdAt } : {}),\n\t\t...(status === 'completed' ? { completedAt: createdAt } : {}),\n\t\tcreatedAt\n\t};\n}\n\nexport function decideResolveIOAIManagerRecoveryActionDispatch(\n\tinput: ResolveIOAIManagerRecoveryActionDispatchInput\n): ResolveIOAIManagerRecoveryActionDispatchDecision {\n\tconst action = input.action;\n\tconst history = Array.isArray(input.history) ? input.history.filter(Boolean).slice(-50) : [];\n\tconst current = input.current || {};\n\tif (!action) {\n\t\treturn {\n\t\t\tdispatchAction: 'park_manual',\n\t\t\tallowed: false,\n\t\t\treason: 'recovery_dispatch_missing_action',\n\t\t\tstatus: 'parked',\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldRecordDispatch: false,\n\t\t\trequiresNewEvidence: true,\n\t\t\tnewEvidence: false\n\t\t};\n\t}\n\tconst dispatchAction = dispatchActionForMode(action.mode);\n\tconst evidenceHash = current.evidenceHash || action.checkpointId || action.actionId;\n\tconst blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current, action.objective);\n\tconst sameActionHistory = history.filter((entry) => entry.actionId === action.actionId);\n\tconst sameEvidenceHistory = sameActionHistory.filter((entry) => entry.evidenceHash === evidenceHash\n\t\t&& entry.blockerFingerprint === blockerFingerprint);\n\tconst activeDispatch = sameEvidenceHistory.find((entry) => entry.status === 'queued' || entry.status === 'started');\n\tconst completedDispatch = sameEvidenceHistory.find((entry) => entry.status === 'completed' || entry.status === 'failed');\n\tconst newEvidence = sameActionHistory.length > 0 && sameEvidenceHistory.length === 0;\n\tconst requiresNewEvidence = action.retryPolicy.requireNewEvidence === true;\n\tconst manualOnly = action.mode === 'manual_review' || !action.autoRunnable;\n\tconst productDispatch = dispatchAction === 'run_targeted_product_repair';\n\tconst expensiveDispatch = !['run_evidence_probe', 'advance', 'continue_gate', 'park_manual'].includes(dispatchAction);\n\tif (manualOnly && input.operatorApproved !== true) {\n\t\tconst record = buildRecoveryDispatchRecord(action, 'park_manual', 'parked', 'recovery_dispatch_requires_manual_review', current, input.now);\n\t\treturn {\n\t\t\tdispatchAction: 'park_manual',\n\t\t\tallowed: false,\n\t\t\treason: record.reason,\n\t\t\tstatus: 'parked',\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldRecordDispatch: true,\n\t\t\trequiresNewEvidence,\n\t\t\tnewEvidence,\n\t\t\tdispatchRecord: record\n\t\t};\n\t}\n\tif (productDispatch && action.productRepairAllowed !== true) {\n\t\tconst record = buildRecoveryDispatchRecord(action, 'park_manual', 'parked', 'recovery_dispatch_product_repair_not_allowed', current, input.now);\n\t\treturn {\n\t\t\tdispatchAction: 'park_manual',\n\t\t\tallowed: false,\n\t\t\treason: record.reason,\n\t\t\tstatus: 'parked',\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldRecordDispatch: true,\n\t\t\trequiresNewEvidence: true,\n\t\t\tnewEvidence,\n\t\t\tdispatchRecord: record\n\t\t};\n\t}\n\tif (activeDispatch) {\n\t\treturn {\n\t\t\tdispatchAction: 'park_manual',\n\t\t\tallowed: false,\n\t\t\treason: 'recovery_dispatch_already_running_for_same_evidence',\n\t\t\tstatus: 'parked',\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldRecordDispatch: false,\n\t\t\trequiresNewEvidence: true,\n\t\t\tnewEvidence: false\n\t\t};\n\t}\n\tif (completedDispatch && requiresNewEvidence && !newEvidence) {\n\t\tconst record = buildRecoveryDispatchRecord(action, 'park_manual', 'parked', 'recovery_dispatch_same_evidence_already_attempted', current, input.now);\n\t\treturn {\n\t\t\tdispatchAction: 'park_manual',\n\t\t\tallowed: false,\n\t\t\treason: record.reason,\n\t\t\tstatus: 'parked',\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldRecordDispatch: true,\n\t\t\trequiresNewEvidence: true,\n\t\t\tnewEvidence: false,\n\t\t\tdispatchRecord: record\n\t\t};\n\t}\n\tconst status: ResolveIOAIManagerRecoveryActionDispatchStatus = dispatchAction === 'advance' || dispatchAction === 'continue_gate'\n\t\t? 'completed'\n\t\t: 'started';\n\tconst record = buildRecoveryDispatchRecord(action, dispatchAction, status, 'recovery_dispatch_allowed', current, input.now);\n\treturn {\n\t\tdispatchAction,\n\t\tallowed: true,\n\t\treason: 'recovery_dispatch_allowed',\n\t\tstatus,\n\t\tcanRunProductRepair: productDispatch && action.productRepairAllowed === true,\n\t\tcanRunExpensiveModel: expensiveDispatch && action.expensiveModelAllowed === true,\n\t\tshouldRecordDispatch: true,\n\t\trequiresNewEvidence,\n\t\tnewEvidence,\n\t\tdispatchRecord: record\n\t};\n}\n\nexport function appendResolveIOAIManagerRecoveryActionDispatch(\n\thistory: ResolveIOAIManagerRecoveryActionDispatchRecord[] | undefined,\n\trecord: ResolveIOAIManagerRecoveryActionDispatchRecord | undefined,\n\tlimit = 50\n): ResolveIOAIManagerRecoveryActionDispatchRecord[] {\n\tconst existing = Array.isArray(history) ? history.filter(Boolean) : [];\n\tif (!record) {\n\t\treturn existing.slice(-limit);\n\t}\n\tconst deduped = existing.filter((entry) => entry.dispatchId !== record.dispatchId);\n\treturn [...deduped, record].slice(-limit);\n}\n\nfunction recoveryExecutionPhaseForDispatch(\n\tdispatchAction: ResolveIOAIManagerRecoveryActionDispatchAction\n): ResolveIOAIManagerRecoveryExecutionPhase {\n\tconst map: Record<ResolveIOAIManagerRecoveryActionDispatchAction, ResolveIOAIManagerRecoveryExecutionPhase> = {\n\t\trun_evidence_probe: 'evidence',\n\t\trun_read_only_diagnosis: 'diagnosis',\n\t\trun_infra_repair: 'infra',\n\t\trun_compile_repair: 'compile',\n\t\trun_journey_contract_repair: 'journey',\n\t\trun_business_assertion_repair: 'business_proof',\n\t\trun_release_repair: 'release',\n\t\trun_targeted_product_repair: 'product_repair',\n\t\tadvance: 'advance',\n\t\tcontinue_gate: 'advance',\n\t\tpark_manual: 'manual'\n\t};\n\treturn map[dispatchAction] || 'manual';\n}\n\nfunction recoveryDirectiveReason(\n\taction: ResolveIOAIManagerRecoveryActionPacket | undefined,\n\tdecision: ResolveIOAIManagerRecoveryActionDispatchDecision,\n\tcurrent?: ResolveIOAIManagerFailureRecord\n): string {\n\tconst blocker = cleanText(current?.blocker || current?.summary || '', 260);\n\tconst label = cleanText(action?.label, 120) || decision.dispatchAction;\n\tconst objective = cleanText(action?.objective, 260);\n\treturn [\n\t\t`MANAGER_RECOVERY:${decision.dispatchAction}`,\n\t\t`label=${label}`,\n\t\tdecision.reason ? `reason=${decision.reason}` : '',\n\t\tblocker ? `blocker=${blocker}` : '',\n\t\tobjective ? `objective=${objective}` : ''\n\t].filter(Boolean).join(' | ');\n}\n\nexport function buildResolveIOAIManagerRecoveryExecutionDirective(\n\tinput: ResolveIOAIManagerRecoveryExecutionDirectiveInput\n): ResolveIOAIManagerRecoveryExecutionDirective {\n\tconst action = input.action;\n\tconst dispatchDecision = input.dispatchDecision || decideResolveIOAIManagerRecoveryActionDispatch({\n\t\taction,\n\t\tcurrent: input.current,\n\t\tnow: input.now\n\t});\n\tconst dispatchAction = dispatchDecision.dispatchAction;\n\tconst now = isoNow(input.now);\n\tconst phase = recoveryExecutionPhaseForDispatch(dispatchAction);\n\tconst lane = cleanText(action?.lane || input.current?.lane || '', 120);\n\tconst stepType = cleanText(action?.stepType || input.current?.stepType || '', 120);\n\tconst rerunReason = recoveryDirectiveReason(action, dispatchDecision, input.current);\n\tconst surface = cleanText(input.surface || 'runner', 120);\n\treturn {\n\t\tdirectiveId: stableHash('mgr-directive', {\n\t\t\tsurface,\n\t\t\tactionId: action?.actionId || '',\n\t\t\tdispatchAction,\n\t\t\treason: dispatchDecision.reason,\n\t\t\tevidenceHash: dispatchDecision.dispatchRecord?.evidenceHash || input.current?.evidenceHash || ''\n\t\t}),\n\t\tsurface,\n\t\tdispatchAction,\n\t\tphase,\n\t\tallowed: dispatchDecision.allowed,\n\t\tstatus: dispatchDecision.status,\n\t\treason: dispatchDecision.reason,\n\t\tlane,\n\t\tstepType,\n\t\tnextActionLabel: cleanText(action?.label, 160) || dispatchAction,\n\t\trerunReason,\n\t\tevidenceOnly: action?.evidenceOnly !== false || dispatchAction === 'run_evidence_probe',\n\t\tautoRunnable: action?.autoRunnable === true,\n\t\tproductRepairAllowed: action?.productRepairAllowed === true,\n\t\texpensiveModelAllowed: action?.expensiveModelAllowed === true,\n\t\tcanRunProductRepair: dispatchDecision.canRunProductRepair,\n\t\tcanRunExpensiveModel: dispatchDecision.canRunExpensiveModel,\n\t\tcanResetLoopAfterEvidence: action?.canResetLoopAfterEvidence === true,\n\t\trequiresNewEvidence: dispatchDecision.requiresNewEvidence,\n\t\tnewEvidence: dispatchDecision.newEvidence,\n\t\tmaxAttemptsBeforePark: Math.max(1, Number(action?.maxAttemptsBeforePark || 1) || 1),\n\t\trequiredArtifacts: cleanList(action?.requiredArtifacts, 20, 500),\n\t\tnextCommands: cleanList(action?.nextCommands, 20, 500),\n\t\tsuccessCriteria: cleanList(action?.successCriteria, 20, 500),\n\t\tforbiddenActions: action?.productRepairAllowed === true\n\t\t\t? []\n\t\t\t: Array.from(new Set([\n\t\t\t\t'Do not run product-code repair from this directive unless canRunProductRepair is true.',\n\t\t\t\t...(action?.releasePolicy?.forbiddenActions || [])\n\t\t\t])).slice(0, 20),\n\t\t...(dispatchDecision.dispatchRecord ? { dispatchRecord: dispatchDecision.dispatchRecord } : {}),\n\t\t...(action?.releasePolicy ? { releasePolicy: action.releasePolicy } : {}),\n\t\tcreatedAt: now\n\t};\n}\n\nfunction newListEntries(current: string[], previous: string[]): string[] {\n\tconst existing = new Set(previous.map((entry) => cleanText(entry, 500)).filter(Boolean));\n\treturn current\n\t\t.map((entry) => cleanText(entry, 500))\n\t\t.filter((entry) => entry && !existing.has(entry));\n}\n\nfunction recordLane(value: any): string {\n\treturn cleanText(value?.lane, 80);\n}\n\nfunction recordStepType(value: any): string {\n\treturn cleanText(value?.stepType, 80);\n}\n\nfunction recordFailureClass(value: any): string {\n\tconst valueText = cleanText(value?.failureClass, 80);\n\treturn valueText ? normalizeResolveIOAIManagerFailureClass(valueText) : '';\n}\n\nfunction materialEvidenceText(record: ResolveIOAIManagerFailureRecord | undefined, paths: string[] = []): string {\n\treturn [\n\t\tcleanText(record?.blocker, 1200),\n\t\tcleanText(record?.summary, 1200),\n\t\t...paths.map((path) => cleanText(path, 500))\n\t].filter(Boolean).join(' ').toLowerCase();\n}\n\nfunction hasMaterialEvidenceLanguage(text: string): boolean {\n\treturn /(business|assertion|proof|before|after|dom|trace|stack|network|mongo|query|diff|scope|diagnosis|journey|contract|workflow|compile|build|preflight|infra|chrome|puppeteer|release|publish|deploy|sample|seed|route|auth|hydration|performance|slow|owner|root.?cause|repro|pdf|export|upload|import|filter|invoice|saved|calculated|comparison|report)/i.test(text);\n}\n\nexport function assessResolveIOAIManagerEvidenceChange(\n\tprevious: (ResolveIOAIManagerFailureRecord | ResolveIOAIManagerRecoveryCheckpoint | undefined),\n\tcurrent: ResolveIOAIManagerFailureRecord | undefined,\n\tfallbackObjective?: string\n): ResolveIOAIManagerEvidenceAssessment {\n\tconst currentRecord = current || {};\n\tconst previousRecord = previous as any;\n\tconst previousEvidenceHash = previousRecord ? cleanText(previousRecord.evidenceHash, 160) || hashResolveIOAIManagerEvidence(previousRecord) : '';\n\tconst currentEvidenceHash = hashResolveIOAIManagerEvidence(currentRecord);\n\tconst previousBlockerFingerprint = previousRecord\n\t\t? cleanText(previousRecord.blockerFingerprint, 160) || resolveResolveIOAIManagerBlockerFingerprint(previousRecord, fallbackObjective)\n\t\t: '';\n\tconst currentBlockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(currentRecord, fallbackObjective);\n\tconst previousChangedFiles = cleanList(previousRecord?.changedFiles, 80, 500);\n\tconst currentChangedFiles = cleanList(currentRecord.changedFiles, 80, 500);\n\tconst previousArtifactPaths = cleanList(previousRecord?.artifactPaths, 80, 500);\n\tconst currentArtifactPaths = cleanList(currentRecord.artifactPaths, 80, 500);\n\tconst addedChangedFiles = newListEntries(currentChangedFiles, previousChangedFiles);\n\tconst addedArtifactPaths = newListEntries(currentArtifactPaths, previousArtifactPaths);\n\tconst signals: string[] = [];\n\tif (previousEvidenceHash && currentEvidenceHash !== previousEvidenceHash) {\n\t\tsignals.push('evidence_hash_changed');\n\t}\n\tif (previousBlockerFingerprint && currentBlockerFingerprint !== previousBlockerFingerprint) {\n\t\tsignals.push('blocker_fingerprint_changed');\n\t}\n\tif (recordLane(previousRecord) && recordLane(previousRecord) !== recordLane(currentRecord)) {\n\t\tsignals.push('lane_changed');\n\t}\n\tif (recordStepType(previousRecord) && recordStepType(previousRecord) !== recordStepType(currentRecord)) {\n\t\tsignals.push('step_type_changed');\n\t}\n\tif (recordFailureClass(previousRecord) && recordFailureClass(previousRecord) !== recordFailureClass(currentRecord)) {\n\t\tsignals.push('failure_class_changed');\n\t}\n\tif (addedChangedFiles.length) {\n\t\tsignals.push('changed_files_added');\n\t}\n\tif (addedArtifactPaths.length) {\n\t\tsignals.push('artifact_paths_added');\n\t}\n\tif (isPassingOutcome(currentRecord)) {\n\t\tsignals.push('passing_outcome');\n\t}\n\tconst changed = signals.length > 0;\n\tconst evidenceText = materialEvidenceText(currentRecord, addedArtifactPaths);\n\tconst pathOrSummaryHasMaterialSignal = hasMaterialEvidenceLanguage(evidenceText);\n\tconst proof = signals.includes('passing_outcome');\n\tconst structuralChange = signals.some((signal) => /blocker_fingerprint_changed|lane_changed|step_type_changed|failure_class_changed/.test(signal));\n\tconst materialArtifact = addedArtifactPaths.length > 0 && pathOrSummaryHasMaterialSignal;\n\tconst materialChangedFiles = addedChangedFiles.length > 0\n\t\t&& /diagnosis|owner|scope|diff|root.?cause|failing path|stack|trace|business|proof|compile|release|deploy|workflow|journey/i.test(evidenceText);\n\tconst material = proof || structuralChange || materialArtifact || materialChangedFiles;\n\tconst strength: ResolveIOAIManagerEvidenceStrength = proof\n\t\t? 'proof'\n\t\t: material\n\t\t\t? 'material'\n\t\t\t: changed\n\t\t\t\t? 'weak'\n\t\t\t\t: 'none';\n\treturn {\n\t\tchanged,\n\t\tmaterial,\n\t\tstrength,\n\t\tsignals,\n\t\tevidenceHash: currentEvidenceHash,\n\t\tblockerFingerprint: currentBlockerFingerprint\n\t};\n}\n\nfunction proposedActionIsProductRepair(value: any): boolean {\n\tconst normalized = cleanText(value, 120);\n\treturn /product|code|repair|build|business|journey|workflow/i.test(normalized)\n\t\t&& !/infra|compile|diagnosis|manual|evidence|release|publish/i.test(normalized);\n}\n\nexport function decideResolveIOAIManagerRecoveryGate(\n\tinput: ResolveIOAIManagerRecoveryGateInput\n): ResolveIOAIManagerRecoveryGateDecision {\n\tconst checkpoint = input.checkpoint;\n\tconst hasCurrent = !!input.current;\n\tconst current = input.current || {};\n\tconst assessment = hasCurrent\n\t\t? assessResolveIOAIManagerEvidenceChange(checkpoint, current, checkpoint.objective)\n\t\t: {\n\t\t\tchanged: false,\n\t\t\tmaterial: false,\n\t\t\tstrength: 'none' as ResolveIOAIManagerEvidenceStrength,\n\t\t\tsignals: [],\n\t\t\tevidenceHash: checkpoint.evidenceHash,\n\t\t\tblockerFingerprint: checkpoint.blockerFingerprint\n\t\t};\n\tconst blockerFingerprint = assessment.blockerFingerprint;\n\tconst evidenceHash = assessment.evidenceHash;\n\tconst changedFiles = hasCurrent ? cleanList(current.changedFiles, 80, 500) : checkpoint.changedFiles;\n\tconst artifactPaths = hasCurrent ? cleanList(current.artifactPaths, 80, 500) : checkpoint.artifactPaths;\n\tconst evidenceChanged = assessment.changed;\n\tconst proposedAction = cleanText(input.proposedAction || checkpoint.allowedAction, 120);\n\tconst productRepairRequested = proposedActionIsProductRepair(proposedAction);\n\tconst missingEvidence = checkpoint.requiredEvidence.filter((required) => {\n\t\tconst normalized = cleanText(required, 120).toLowerCase();\n\t\tif (!normalized) {\n\t\t\treturn false;\n\t\t}\n\t\tif (/artifact|log|proof|gate|evidence/.test(normalized)) {\n\t\t\treturn !artifactPaths.length && !current.evidenceHash;\n\t\t}\n\t\tif (/diff|changed files|owner|scope|file/.test(normalized)) {\n\t\t\treturn !changedFiles.length;\n\t\t}\n\t\treturn false;\n\t});\n\tconst makeDecision = (\n\t\taction: ResolveIOAIManagerRecoveryGateAction,\n\t\treason: string,\n\t\toverrides: Partial<ResolveIOAIManagerRecoveryGateDecision> = {}\n\t): ResolveIOAIManagerRecoveryGateDecision => ({\n\t\taction,\n\t\treason,\n\t\tcanRunProductRepair: checkpoint.productRepairAllowed,\n\t\tcanRunExpensiveModel: checkpoint.expensiveModelAllowed,\n\t\tshouldResetLoopBudget: false,\n\t\tshouldIncrementAttempt: action === 'allow',\n\t\tnewEvidence: evidenceChanged,\n\t\tmaterialEvidence: assessment.material,\n\t\tevidenceStrength: assessment.strength,\n\t\tevidenceSignals: assessment.signals,\n\t\tblockerFingerprint,\n\t\tevidenceHash,\n\t\tmissingEvidence,\n\t\tcheckpoint: {\n\t\t\t...checkpoint,\n\t\t\tupdatedAt: isoNow(input.now)\n\t\t},\n\t\t...overrides\n\t});\n\n\tif (checkpoint.status === 'complete') {\n\t\treturn makeDecision('complete', 'recovery_gate_checkpoint_already_complete', {\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldIncrementAttempt: false\n\t\t});\n\t}\n\tif (checkpoint.status === 'manual_handoff' && input.operatorApproved !== true) {\n\t\treturn makeDecision('manual_handoff', 'recovery_gate_manual_handoff_requires_operator_approval', {\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldIncrementAttempt: false\n\t\t});\n\t}\n\tif (productRepairRequested && !checkpoint.productRepairAllowed) {\n\t\treturn makeDecision('reject_action', 'recovery_gate_product_repair_not_allowed_for_checkpoint', {\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldIncrementAttempt: false\n\t\t});\n\t}\n\tif (checkpoint.status === 'parked' && !evidenceChanged) {\n\t\treturn makeDecision('collect_new_evidence', 'recovery_gate_parked_until_new_evidence', {\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldIncrementAttempt: false\n\t\t});\n\t}\n\tif (checkpoint.status === 'parked' && evidenceChanged && !assessment.material) {\n\t\treturn makeDecision('collect_new_evidence', 'recovery_gate_weak_evidence_requires_material_signal', {\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldIncrementAttempt: false\n\t\t});\n\t}\n\tif (checkpoint.attempts >= checkpoint.maxAttemptsBeforePark && !evidenceChanged) {\n\t\treturn makeDecision('collect_new_evidence', 'recovery_gate_attempt_limit_requires_new_evidence', {\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldIncrementAttempt: false\n\t\t});\n\t}\n\tif (checkpoint.attempts >= checkpoint.maxAttemptsBeforePark && evidenceChanged && !assessment.material) {\n\t\treturn makeDecision('collect_new_evidence', 'recovery_gate_attempt_limit_requires_material_evidence', {\n\t\t\tcanRunProductRepair: false,\n\t\t\tcanRunExpensiveModel: false,\n\t\t\tshouldIncrementAttempt: false\n\t\t});\n\t}\n\tif (evidenceChanged) {\n\t\tconst currentFailureClass = normalizeResolveIOAIManagerFailureClass(current.failureClass);\n\t\tconst currentCanRunProductRepair = checkpoint.productRepairAllowed\n\t\t\t|| !/^(infra|compile|diagnosis|release)$/i.test(currentFailureClass);\n\t\treturn makeDecision('allow', 'recovery_gate_new_material_evidence_unblocks_retry', {\n\t\t\tcanRunProductRepair: currentCanRunProductRepair,\n\t\t\tcanRunExpensiveModel: checkpoint.expensiveModelAllowed || currentCanRunProductRepair,\n\t\t\tshouldResetLoopBudget: true\n\t\t});\n\t}\n\treturn makeDecision('allow', 'recovery_gate_action_allowed');\n}\n\nfunction failureKey(record: ResolveIOAIManagerFailureRecord | undefined): string {\n\tif (!record) {\n\t\treturn '';\n\t}\n\tconst failureClass = normalizeResolveIOAIManagerFailureClass(record.failureClass);\n\tconst blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(record);\n\treturn `${cleanText(record.lane, 80)}:${cleanText(record.stepType, 80)}:${failureClass}:${blockerFingerprint}`;\n}\n\nfunction failureEvidenceKey(record: ResolveIOAIManagerFailureRecord | undefined): string {\n\treturn `${failureKey(record)}:${hashResolveIOAIManagerEvidence(record)}`;\n}\n\nfunction isPassingOutcome(record: ResolveIOAIManagerFailureRecord | undefined): boolean {\n\treturn /^(pass|accepted|ready_to_publish|published|ready_for_merge|complete|completed)$/i.test(cleanText(record?.outcome, 80));\n}\n\nfunction isManualOutcome(record: ResolveIOAIManagerFailureRecord | undefined): boolean {\n\treturn /^(manual_handoff|park_manual|stopped)$/i.test(cleanText(record?.outcome, 80));\n}\n\nexport function buildResolveIOAIManagerRecoveryPlan(input: ResolveIOAIManagerRecoveryPlanInput = {}): ResolveIOAIManagerRecoveryPlan {\n\tconst action = cleanText(input.action, 80) || 'continue';\n\tconst reason = cleanText(input.reason, 240);\n\tconst failureClass = normalizeResolveIOAIManagerFailureClass(input.failureClass);\n\tconst lane = cleanText(input.lane, 80) || 'supervisor';\n\tconst stepType = cleanText(input.stepType, 80) || 'unknown';\n\tconst blocker = cleanText(input.blocker, 700);\n\tconst changedFiles = cleanList(input.changedFiles, 12, 240);\n\tconst artifactPaths = cleanList(input.artifactPaths, 12, 240);\n\tconst maxAttemptsBeforePark = Math.max(1, Number(input.maxSameFailureRepeats || 3) || 3);\n\tconst commonNotes = [\n\t\treason ? `policy_reason=${reason}` : '',\n\t\tblocker ? `blocker=${blocker}` : '',\n\t\tchangedFiles.length ? `changed_files=${changedFiles.join(', ')}` : '',\n\t\tartifactPaths.length ? `artifacts=${artifactPaths.join(', ')}` : ''\n\t].filter(Boolean);\n\tconst base: Omit<ResolveIOAIManagerRecoveryPlan, 'recoveryClass' | 'nextActionLabel' | 'objective' | 'allowedAction' | 'productRepairAllowed' | 'expensiveModelAllowed' | 'finiteSteps' | 'requiredEvidence' | 'loopResetEvidence' | 'forbiddenActions'> = {\n\t\tlane,\n\t\tstepType,\n\t\tmaxAttemptsBeforePark,\n\t\tnotes: commonNotes\n\t};\n\tconst makePlan = (\n\t\trecoveryClass: ResolveIOAIManagerRecoveryClass,\n\t\tnextActionLabel: string,\n\t\tobjective: string,\n\t\tallowedAction: string,\n\t\tproductRepairAllowed: boolean,\n\t\texpensiveModelAllowed: boolean,\n\t\tfiniteSteps: string[],\n\t\trequiredEvidence: string[],\n\t\tloopResetEvidence: string[],\n\t\tforbiddenActions: string[]\n\t): ResolveIOAIManagerRecoveryPlan => ({\n\t\t...base,\n\t\trecoveryClass,\n\t\tnextActionLabel,\n\t\tobjective,\n\t\tallowedAction,\n\t\tproductRepairAllowed,\n\t\texpensiveModelAllowed,\n\t\tfiniteSteps,\n\t\trequiredEvidence,\n\t\tloopResetEvidence,\n\t\tforbiddenActions\n\t});\n\tif (action === 'reset_loop_budget') {\n\t\treturn makePlan(\n\t\t\t'advance_after_proof',\n\t\t\t'Advance After Proof',\n\t\t\t'Checkpoint the passing evidence and move to the next required gate.',\n\t\t\t'advance_to_next_gate',\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\t[\n\t\t\t\t'Record the passing artifact, changed files, and gate result.',\n\t\t\t\t'Reset the loop counter because a real gate passed.',\n\t\t\t\t'Select the next unmet deterministic gate instead of repeating the previous repair.'\n\t\t\t],\n\t\t\t['passing gate record', 'artifact or log proving the passed check'],\n\t\t\t['new passing gate result', 'new business proof artifact'],\n\t\t\t['rerun the same repair after a pass', 'mark accepted without the required downstream gate']\n\t\t);\n\t}\n\tif (action === 'manual_handoff') {\n\t\treturn makePlan(\n\t\t\t'manual_handoff',\n\t\t\t'Manual Review',\n\t\t\t'Stop autonomous repair and expose the blocker, evidence, and last safe state.',\n\t\t\t'manual_review_only',\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\t[\n\t\t\t\t'Freeze further product-code edits.',\n\t\t\t\t'Show the blocker fingerprint, evidence hash, and prior attempts.',\n\t\t\t\t'Require a human edit to classification, scope, or retry policy before another model/code loop.'\n\t\t\t],\n\t\t\t['blocker fingerprint', 'evidence hash', 'attempt history'],\n\t\t\t['manual policy change', 'new external evidence'],\n\t\t\t['start another automatic model repair', 'hide the failed evidence']\n\t\t);\n\t}\n\tif (action === 'budget_stop') {\n\t\treturn makePlan(\n\t\t\t'manual_handoff',\n\t\t\t'Budget Stop Review',\n\t\t\t'Stop autonomous model/code loops until a cheaper scoped next action is selected.',\n\t\t\t'budget_review_only',\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\t[\n\t\t\t\t'Freeze further model repair loops.',\n\t\t\t\t'Show the prompt/token/runtime budget that tripped the guard.',\n\t\t\t\t'Select a cheaper deterministic gate, infra repair, diagnosis revision, or manual scope edit before resuming.'\n\t\t\t],\n\t\t\t['budget guard reason', 'latest prompt estimate', 'last blocker/evidence hash'],\n\t\t\t['manual scope reduction', 'new deterministic evidence', 'approved budget policy change'],\n\t\t\t['start another broad model prompt', 'reset budget without new evidence', 'hide cost context']\n\t\t);\n\t}\n\tif (failureClass === 'diagnosis' || stepType === 'diagnosis_gate') {\n\t\treturn makePlan(\n\t\t\t'diagnosis_only',\n\t\t\t'Run Diagnosis Gate',\n\t\t\t'Produce a falsifiable root-cause diagnosis before any repair.',\n\t\t\t'read_only_diagnosis',\n\t\t\tfalse,\n\t\t\ttrue,\n\t\t\t[\n\t\t\t\t'Reproduce or explicitly classify the customer issue.',\n\t\t\t\t'Accept one falsifiable hypothesis and record rejected alternatives.',\n\t\t\t\t'Identify the frontend/backend/shared failing path.',\n\t\t\t\t'Select a small owner_files set.',\n\t\t\t\t'Define exact before/action/after business proof.'\n\t\t\t],\n\t\t\t['issue_case', 'accepted_hypothesis', 'rejected_alternatives', 'failing_path', 'owner_files', 'proof_plan'],\n\t\t\t['new reproduction artifact', 'new query/log/code evidence', 'validated diagnosis gate'],\n\t\t\t['edit product code', 'run broad repo repair', 'accept route-load evidence as success']\n\t\t);\n\t}\n\tif (failureClass === 'owner_scope' || failureClass === 'out_of_scope' || /out.?of.?scope|owner_files/i.test(reason)) {\n\t\treturn makePlan(\n\t\t\t'diagnosis_revision',\n\t\t\t'Revise Diagnosis Scope',\n\t\t\t'Revise owner_files only when new evidence proves the current scope is wrong.',\n\t\t\t'diagnosis_revision_only',\n\t\t\tfalse,\n\t\t\ttrue,\n\t\t\t[\n\t\t\t\t'Compare changed files against the diagnosis owner_files.',\n\t\t\t\t'Collect evidence proving why the new file is in the failing path.',\n\t\t\t\t'Update accepted_hypothesis, failing_path, owner_files, and proof_plan together.',\n\t\t\t\t'Resume repair only after the revised gate validates.'\n\t\t\t],\n\t\t\t['out-of-scope file list', 'new failing-path evidence', 'revalidated diagnosis gate'],\n\t\t\t['revised owner_files with evidence', 'new business proof requirement'],\n\t\t\t['keep broad edits without diagnosis', 'add convenience refactors', 'continue repair outside owner_files']\n\t\t);\n\t}\n\tif (action === 'retry_infra') {\n\t\tconst isCompile = failureClass === 'compile';\n\t\treturn makePlan(\n\t\t\tisCompile ? 'compile_repair' : 'infra_repair',\n\t\t\tisCompile ? 'Repair Compile Gate' : 'Repair Infra Gate',\n\t\t\tisCompile\n\t\t\t\t? 'Fix the deterministic compile/build blocker before spending another product repair loop.'\n\t\t\t\t: 'Fix the deterministic harness/browser/server/Mongo blocker before product repair.',\n\t\t\tisCompile ? 'compile_repair_only' : 'infra_repair_only',\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tisCompile\n\t\t\t\t? [\n\t\t\t\t\t'Read the exact compile/build log and identify the first actionable error.',\n\t\t\t\t\t'Fix missing dependency, stale artifact, command, cache, or type wiring required by the compile gate.',\n\t\t\t\t\t'Rerun the same finite compile command.',\n\t\t\t\t\t'Return the compile log artifact and status.'\n\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t'Run preflight for Puppeteer, Chrome executable, ports, Mongo/settings, and startup command.',\n\t\t\t\t\t'Repair only the failing harness/environment item.',\n\t\t\t\t\t'Rerun the same infra check.',\n\t\t\t\t\t'Return the infra log and pass/fail status.'\n\t\t\t\t],\n\t\t\tisCompile\n\t\t\t\t? ['compile command', 'compile log artifact', 'first failing error fixed or still failing']\n\t\t\t\t: ['preflight command', 'infra log artifact', 'specific repaired environment item'],\n\t\t\t['same check now passes', 'new infra/compile blocker hash'],\n\t\t\t['run product-code model repair', 'count this as product failure', 'accept route/business success without the compile/infra gate']\n\t\t);\n\t}\n\tif (action === 'park_repeated_failure' || action === 'park_ping_pong') {\n\t\treturn makePlan(\n\t\t\t'blocked_until_new_evidence',\n\t\t\taction === 'park_ping_pong' ? 'Park Ping-Pong Loop' : 'Park Repeated Failure',\n\t\t\t'Stop the current loop until new evidence changes the diagnosis, route, or repair target.',\n\t\t\t'collect_new_evidence_only',\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\t[\n\t\t\t\t'Do not rerun the same prompt or same repair.',\n\t\t\t\t'Show the repeated blocker and evidence hash.',\n\t\t\t\t'Collect a new artifact: failing DOM state, stack trace, network response, Mongo delta, compile log, or revised diagnosis.',\n\t\t\t\t'Reset the loop only after material evidence changes the blocker, proof, diagnosis, journey, or actionable trace.'\n\t\t\t],\n\t\t\t['same failure count', 'blocker fingerprint', 'evidence hash'],\n\t\t\t['changed blocker fingerprint', 'business/compile/infra/release proof artifact', 'revised diagnosis or journey contract', 'new actionable trace or data delta'],\n\t\t\t['alternate between two failed patches', 'increase loop budget without evidence', 'hide the park reason']\n\t\t);\n\t}\n\tif (failureClass === 'journey') {\n\t\treturn makePlan(\n\t\t\t'journey_contract_repair',\n\t\t\t'Repair Journey Contract',\n\t\t\t'Fix the first/next/last workflow contract before app code work continues.',\n\t\t\t'journey_contract_repair',\n\t\t\tfalse,\n\t\t\ttrue,\n\t\t\t[\n\t\t\t\t'Open docs/APP_JOURNEY_CONTRACT.md.',\n\t\t\t\t'Define first_screen, north_star_workflow, screen_sequence, data_story, completion_states, and qa_assertions.',\n\t\t\t\t'Ensure each CTA maps to an action, route, method, calculation, or state transition.',\n\t\t\t\t'Validate that sample data can drive the promised workflow.'\n\t\t\t],\n\t\t\t['validated journey_contract JSON', 'CTA-to-action mapping', 'workflow QA assertions'],\n\t\t\t['journey validation passes', 'new workflow QA rows generated'],\n\t\t\t['build empty routes', 'add link-only dashboard actions', 'defer workflow design to wow pass']\n\t\t);\n\t}\n\tif (failureClass === 'release') {\n\t\treturn makePlan(\n\t\t\t'release_repair',\n\t\t\t'Repair Release Gate',\n\t\t\t'Repair deploy/publish/sample-data release evidence with a hotfix-first path before any repeated full deploy.',\n\t\t\t'release_repair_only',\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\t[\n\t\t\t\t'Read the deploy/publish/sample-data log.',\n\t\t\t\t'Identify whether the blocker is domain, asset, seed data, route, permission, or CDN.',\n\t\t\t\t'Prefer backend hotfix, release config, domain, cache, or seed-data repair when the product artifact already has business proof.',\n\t\t\t\t'Rerun only the failed release gate.'\n\t\t\t],\n\t\t\t['deploy or publish log', 'sample-data status', 'failed release gate rerun'],\n\t\t\t['release gate passes', 'new release blocker hash'],\n\t\t\t['change core workflow after business QA passed', 'mark accepted from scorecard only', 'rerun full builder loop', 'repeat deploy of same artifact without force_deploy evidence']\n\t\t);\n\t}\n\tif (failureClass === 'business' || failureClass === 'qa_evidence' || failureClass === 'route') {\n\t\treturn makePlan(\n\t\t\t'business_proof_repair',\n\t\t\t'Repair Business Proof',\n\t\t\t'Fix the exact failing workflow assertion and prove before/action/after behavior.',\n\t\t\t'business_repair',\n\t\t\ttrue,\n\t\t\ttrue,\n\t\t\t[\n\t\t\t\t'Open the failing QA row or proof_plan.',\n\t\t\t\t'Trace the UI action to method/publication/query/calculation.',\n\t\t\t\t'Patch the smallest owner or workflow files.',\n\t\t\t\t'Rerun only the failed business assertion.',\n\t\t\t\t'Record DOM/data/Mongo/artifact proof.'\n\t\t\t],\n\t\t\t['failing assertion', 'action trace', 'business proof artifact'],\n\t\t\t['business assertion passes', 'new failed assertion with new evidence'],\n\t\t\t['treat route load as success', 'rerun unrelated QA rows first', 'accept scorecard-only evidence']\n\t\t);\n\t}\n\tif (input.productRepairFailure !== false || failureClass === 'product_code') {\n\t\treturn makePlan(\n\t\t\t'product_code_repair',\n\t\t\t'Run Targeted Product Repair',\n\t\t\t'Repair the current product-code blocker with the smallest scoped edit and immediate proof.',\n\t\t\t'targeted_product_repair',\n\t\t\ttrue,\n\t\t\ttrue,\n\t\t\t[\n\t\t\t\t'Inspect the current blocker, artifacts, changed files, and owner/workflow scope.',\n\t\t\t\t'Form one small repair hypothesis.',\n\t\t\t\t'Patch only files justified by the active diagnosis or journey contract.',\n\t\t\t\t'Rerun the smallest failed gate.',\n\t\t\t\t'Record new evidence before any additional loop.'\n\t\t\t],\n\t\t\t['owner/workflow scope', 'repair diff', 'failed gate rerun artifact'],\n\t\t\t['new evidence hash', 'same gate passes'],\n\t\t\t['broad repo search-and-edit', 'rerun the same prompt without inspecting artifacts', 'change unrelated UI polish']\n\t\t);\n\t}\n\treturn makePlan(\n\t\t'continue',\n\t\t'Continue Current Gate',\n\t\t'Continue the current lane because no blocking loop or infra condition was detected.',\n\t\t'continue',\n\t\tfalse,\n\t\tfalse,\n\t\t[\n\t\t\t'Use the active lane memory.',\n\t\t\t'Run the next finite gate.',\n\t\t\t'Record artifacts and evidence hash.'\n\t\t],\n\t\t['active lane memory', 'finite gate artifact'],\n\t\t['new gate result', 'new artifact path'],\n\t\t['spawn duplicate runners', 'advance without evidence']\n\t);\n}\n\nfunction collectOpenTail(records: ResolveIOAIManagerFailureRecord[]): ResolveIOAIManagerFailureRecord[] {\n\tconst tail: ResolveIOAIManagerFailureRecord[] = [];\n\tfor (let index = records.length - 1; index >= 0; index -= 1) {\n\t\tconst record = records[index];\n\t\tif (isPassingOutcome(record)) {\n\t\t\tbreak;\n\t\t}\n\t\ttail.unshift(record);\n\t}\n\treturn tail;\n}\n\nfunction countSameFailure(records: ResolveIOAIManagerFailureRecord[], current: ResolveIOAIManagerFailureRecord): number {\n\tconst currentKey = failureKey(current);\n\tlet count = 0;\n\tfor (let index = records.length - 1; index >= 0; index -= 1) {\n\t\tconst record = records[index];\n\t\tif (isPassingOutcome(record)) {\n\t\t\tbreak;\n\t\t}\n\t\tif (failureKey(record) !== currentKey) {\n\t\t\tbreak;\n\t\t}\n\t\tcount += 1;\n\t}\n\treturn count;\n}\n\nfunction previousRecordForPolicy(\n\thistory: ResolveIOAIManagerFailureRecord[],\n\tcurrent: ResolveIOAIManagerFailureRecord,\n\tcurrentWasExplicit: boolean\n): ResolveIOAIManagerFailureRecord | undefined {\n\tif (!history.length) {\n\t\treturn undefined;\n\t}\n\tif (!currentWasExplicit) {\n\t\treturn history.length > 1 ? history[history.length - 2] : undefined;\n\t}\n\tconst last = history[history.length - 1];\n\tif (failureEvidenceKey(last) === failureEvidenceKey(current)) {\n\t\treturn history.length > 1 ? history[history.length - 2] : undefined;\n\t}\n\treturn last;\n}\n\nfunction countPingPong(records: ResolveIOAIManagerFailureRecord[], current: ResolveIOAIManagerFailureRecord): number {\n\tconst tail = collectOpenTail(records).filter((record) => {\n\t\treturn cleanText(record.lane, 80) === cleanText(current.lane, 80)\n\t\t\t&& cleanText(record.stepType, 80) === cleanText(current.stepType, 80);\n\t});\n\tif (tail.length < 4) {\n\t\treturn 0;\n\t}\n\tconst keys = tail.map(failureKey).filter(Boolean);\n\tconst last = keys.slice(-6);\n\tif (last.length < 4) {\n\t\treturn 0;\n\t}\n\tconst distinct = Array.from(new Set(last));\n\tif (distinct.length !== 2) {\n\t\treturn 0;\n\t}\n\tfor (let index = 2; index < last.length; index += 1) {\n\t\tif (last[index] !== last[index - 2]) {\n\t\t\treturn 0;\n\t\t}\n\t}\n\treturn last.length - 1;\n}\n\nexport function decideResolveIOAIManagerPolicy(input: ResolveIOAIManagerPolicyInput): ResolveIOAIManagerPolicyDecision {\n\tconst history = Array.isArray(input.history) ? input.history : [];\n\tconst currentWasExplicit = !!input.current;\n\tconst current = input.current || history[history.length - 1] || {};\n\tconst failureClass = normalizeResolveIOAIManagerFailureClass(current.failureClass);\n\tconst blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current);\n\tconst evidenceHash = hashResolveIOAIManagerEvidence(current);\n\tconst previous = previousRecordForPolicy(history, current, currentWasExplicit);\n\tconst previousSameFailure = previous && failureKey(previous) === failureKey(current);\n\tconst evidenceAssessment = previousSameFailure\n\t\t? assessResolveIOAIManagerEvidenceChange(previous, current)\n\t\t: {\n\t\t\tchanged: false,\n\t\t\tmaterial: false,\n\t\t\tstrength: 'none' as ResolveIOAIManagerEvidenceStrength,\n\t\t\tsignals: [],\n\t\t\tevidenceHash,\n\t\t\tblockerFingerprint\n\t\t};\n\tconst newEvidence = !!previousSameFailure && evidenceAssessment.changed;\n\tconst sameFailureCount = countSameFailure(history, current);\n\tconst pingPongCount = countPingPong(history, current);\n\tconst maxSameFailureRepeats = Math.max(1, Number(input.maxSameFailureRepeats || 3) || 3);\n\tconst maxPingPongTransitions = Math.max(3, Number(input.maxPingPongTransitions || 3) || 3);\n\tconst infraClasses = new Set((input.infraFailureClasses || ['infra', 'compile']).map(normalizeResolveIOAIManagerFailureClass));\n\tconst ignoredClasses = new Set((input.ignoredFailureClasses || []).map(normalizeResolveIOAIManagerFailureClass));\n\tconst base = {\n\t\tfailureClass,\n\t\tblockerFingerprint,\n\t\tevidenceHash,\n\t\tsameFailureCount,\n\t\tpingPongCount,\n\t\tnewEvidence,\n\t\tmaterialEvidence: evidenceAssessment.material,\n\t\tevidenceStrength: evidenceAssessment.strength,\n\t\tevidenceSignals: evidenceAssessment.signals,\n\t\tloopBudgetShouldReset: false,\n\t\tproductRepairFailure: !infraClasses.has(failureClass) && !ignoredClasses.has(failureClass)\n\t};\n\tconst withPlan = (\n\t\taction: ResolveIOAIManagerAction,\n\t\treason: string,\n\t\toverrides: Partial<Omit<ResolveIOAIManagerPolicyDecision, 'action' | 'reason' | 'recoveryPlan' | 'recoveryCheckpoint'>> = {}\n\t): ResolveIOAIManagerPolicyDecision => {\n\t\tconst merged = {\n\t\t\t...base,\n\t\t\t...overrides\n\t\t};\n\t\tconst recoveryPlan = buildResolveIOAIManagerRecoveryPlan({\n\t\t\taction,\n\t\t\treason,\n\t\t\tfailureClass: merged.failureClass,\n\t\t\tlane: current.lane,\n\t\t\tstepType: current.stepType,\n\t\t\tblocker: current.blocker || current.summary,\n\t\t\tsameFailureCount: merged.sameFailureCount,\n\t\t\tpingPongCount: merged.pingPongCount,\n\t\t\tnewEvidence: merged.newEvidence,\n\t\t\tproductRepairFailure: merged.productRepairFailure,\n\t\t\tchangedFiles: current.changedFiles,\n\t\t\tartifactPaths: current.artifactPaths,\n\t\t\tmaxSameFailureRepeats\n\t\t});\n\t\tconst recoveryCheckpoint = buildResolveIOAIManagerRecoveryCheckpoint({\n\t\t\tplan: recoveryPlan,\n\t\t\tcurrent\n\t\t});\n\t\tconst recoveryEvidenceProbe = buildResolveIOAIManagerRecoveryEvidenceProbe({\n\t\t\tcheckpoint: recoveryCheckpoint,\n\t\t\tcurrent\n\t\t});\n\t\treturn {\n\t\t\t...merged,\n\t\t\taction,\n\t\t\treason,\n\t\t\trecoveryPlan,\n\t\t\trecoveryCheckpoint,\n\t\t\trecoveryEvidenceProbe,\n\t\t\trecoveryAction: buildResolveIOAIManagerRecoveryActionPacket({\n\t\t\t\tplan: recoveryPlan,\n\t\t\t\tcheckpoint: recoveryCheckpoint,\n\t\t\t\tprobe: recoveryEvidenceProbe,\n\t\t\t\tcurrent\n\t\t\t})\n\t\t};\n\t};\n\tif (isPassingOutcome(current)) {\n\t\treturn withPlan('reset_loop_budget', 'manager_policy_progress_passed', {\n\t\t\tloopBudgetShouldReset: true,\n\t\t\tproductRepairFailure: false\n\t\t});\n\t}\n\tif (isManualOutcome(current)) {\n\t\treturn withPlan('manual_handoff', 'manager_policy_manual_or_stopped');\n\t}\n\tif (pingPongCount >= maxPingPongTransitions) {\n\t\treturn withPlan('park_ping_pong', 'manager_policy_ping_pong_failure_loop');\n\t}\n\tif (sameFailureCount >= maxSameFailureRepeats && !evidenceAssessment.material) {\n\t\treturn withPlan('park_repeated_failure', newEvidence\n\t\t\t? 'manager_policy_same_failure_with_weak_evidence'\n\t\t\t: 'manager_policy_same_failure_without_new_evidence');\n\t}\n\tif (infraClasses.has(failureClass)) {\n\t\treturn withPlan('retry_infra', 'manager_policy_infra_failure_routes_to_infra_repair', {\n\t\t\tproductRepairFailure: false\n\t\t});\n\t}\n\tif (newEvidence || !previousSameFailure) {\n\t\tif (newEvidence && !evidenceAssessment.material) {\n\t\t\treturn withPlan('continue', 'manager_policy_weak_evidence_does_not_reset_loop_budget');\n\t\t}\n\t\treturn withPlan('continue', newEvidence\n\t\t\t\t? 'manager_policy_new_material_evidence_resets_loop_budget'\n\t\t\t\t: 'manager_policy_new_failure_or_lane', {\n\t\t\tloopBudgetShouldReset: true,\n\t\t\tmaterialEvidence: newEvidence ? true : base.materialEvidence,\n\t\t\tevidenceStrength: newEvidence ? evidenceAssessment.strength : base.evidenceStrength\n\t\t});\n\t}\n\treturn withPlan('continue', 'manager_policy_retry_below_repeat_limit');\n}\n\nfunction buildReplayDirectiveFromPlan(input: {\n\tsurface: string;\n\tplan: ResolveIOAIManagerRecoveryPlan;\n\tcurrent: ResolveIOAIManagerFailureRecord;\n\tnow?: Date | string;\n}): ResolveIOAIManagerRecoveryExecutionDirective {\n\tconst checkpoint = buildResolveIOAIManagerRecoveryCheckpoint({\n\t\tplan: input.plan,\n\t\tcurrent: input.current,\n\t\tnow: input.now\n\t});\n\tconst probe = buildResolveIOAIManagerRecoveryEvidenceProbe({\n\t\tcheckpoint,\n\t\tcurrent: input.current,\n\t\tnow: input.now\n\t});\n\tconst action = buildResolveIOAIManagerRecoveryActionPacket({\n\t\tplan: input.plan,\n\t\tcheckpoint,\n\t\tprobe,\n\t\tcurrent: input.current,\n\t\tnow: input.now\n\t});\n\tconst dispatch = decideResolveIOAIManagerRecoveryActionDispatch({\n\t\taction,\n\t\tcurrent: input.current,\n\t\tnow: input.now\n\t});\n\treturn buildResolveIOAIManagerRecoveryExecutionDirective({\n\t\taction,\n\t\tdispatchDecision: dispatch,\n\t\tcurrent: input.current,\n\t\tsurface: input.surface,\n\t\tnow: input.now\n\t});\n}\n\nfunction replayCaseFromDirective(input: {\n\tcaseId: string;\n\tsurface: string;\n\taction: string;\n\treason: string;\n\tdirective: ResolveIOAIManagerRecoveryExecutionDirective;\n\texpectedSafeAutoDispatch: boolean;\n\tpass: boolean;\n\tloopBudgetShouldReset?: boolean;\n\tmaterialEvidence?: boolean;\n\tevidenceStrength?: ResolveIOAIManagerEvidenceStrength;\n\tdetails?: Record<string, any>;\n}): ResolveIOAIManagerRecoveryReplayCase {\n\tconst directive = input.directive;\n\tconst safeAutoDispatch = isResolveIOAIManagerSafeAutoDispatch({\n\t\tdispatchAction: directive.dispatchAction,\n\t\tdirective,\n\t\tincludeJourneyContractRepair: input.expectedSafeAutoDispatch && directive.dispatchAction === 'run_journey_contract_repair',\n\t\tincludeReleaseRepair: input.expectedSafeAutoDispatch && directive.dispatchAction === 'run_release_repair',\n\t\tincludeProductRepair: false\n\t});\n\treturn {\n\t\tcaseId: input.caseId,\n\t\tsurface: input.surface,\n\t\tpass: input.pass && safeAutoDispatch === input.expectedSafeAutoDispatch,\n\t\taction: input.action,\n\t\treason: input.reason,\n\t\trecoveryClass: cleanText(directive.dispatchRecord?.mode || directive.phase, 120),\n\t\tdispatchAction: directive.dispatchAction,\n\t\tsafeAutoDispatch,\n\t\texpectedSafeAutoDispatch: input.expectedSafeAutoDispatch,\n\t\tproductRepairAllowed: directive.canRunProductRepair === true,\n\t\tloopBudgetShouldReset: input.loopBudgetShouldReset === true,\n\t\tmaterialEvidence: input.materialEvidence === true,\n\t\tevidenceStrength: input.evidenceStrength || 'none',\n\t\t...(directive.releasePolicy ? {\n\t\t\thotfixFirst: directive.releasePolicy.policy === 'hotfix_first',\n\t\t\tfullDeployAllowed: directive.releasePolicy.fullDeployAllowed\n\t\t} : {}),\n\t\tdetails: {\n\t\t\tphase: directive.phase,\n\t\t\tallowed: directive.allowed,\n\t\t\treason: directive.reason,\n\t\t\treleasePolicy: directive.releasePolicy,\n\t\t\t...(input.details || {})\n\t\t}\n\t};\n}\n\nexport function buildResolveIOAIManagerRecoveryReplayMatrix(\n\tinput: ResolveIOAIManagerRecoveryReplayMatrixInput = {}\n): ResolveIOAIManagerRecoveryReplayCase[] {\n\tconst surface = cleanText(input.surface || 'runner', 120);\n\tconst maxSameFailureRepeats = Math.max(1, Number(input.maxSameFailureRepeats || 2) || 2);\n\tconst includeReleaseRepair = input.includeReleaseRepair !== false;\n\tconst includeJourneyContractRepair = input.includeJourneyContractRepair !== false;\n\tconst cases: ResolveIOAIManagerRecoveryReplayCase[] = [];\n\tconst infraPolicy = decideResolveIOAIManagerPolicy({\n\t\thistory: [\n\t\t\t{ lane: 'qa', stepType: 'workflow_qa', outcome: 'needs_repair', failureClass: 'infra', blocker: 'Chrome executable missing.', evidenceHash: 'chrome-missing' }\n\t\t],\n\t\tcurrent: { lane: 'qa', stepType: 'workflow_qa', outcome: 'needs_repair', failureClass: 'infra', blocker: 'Chrome executable missing.', evidenceHash: 'chrome-missing' },\n\t\tmaxSameFailureRepeats\n\t});\n\tconst infraDirective = buildResolveIOAIManagerRecoveryExecutionDirective({\n\t\taction: infraPolicy.recoveryAction,\n\t\tcurrent: { lane: 'qa', stepType: 'workflow_qa', outcome: 'needs_repair', failureClass: 'infra', blocker: 'Chrome executable missing.', evidenceHash: 'chrome-missing' },\n\t\tsurface\n\t});\n\tcases.push(replayCaseFromDirective({\n\t\tcaseId: 'infra_routes_to_infra_repair',\n\t\tsurface,\n\t\taction: infraPolicy.action,\n\t\treason: infraPolicy.reason,\n\t\tdirective: infraDirective,\n\t\texpectedSafeAutoDispatch: true,\n\t\tpass: infraPolicy.action === 'retry_infra'\n\t\t\t&& infraPolicy.recoveryPlan.recoveryClass === 'infra_repair'\n\t\t\t&& infraDirective.dispatchAction === 'run_infra_repair'\n\t\t\t&& infraDirective.canRunProductRepair === false,\n\t\tdetails: { recoveryClass: infraPolicy.recoveryPlan.recoveryClass }\n\t}));\n\tconst releasePlan = buildResolveIOAIManagerRecoveryPlan({\n\t\taction: 'continue',\n\t\treason: 'publish failed after business proof',\n\t\tfailureClass: 'release',\n\t\tlane: 'publish',\n\t\tstepType: 'test_deploy',\n\t\tblocker: 'Domain publish failed for the current artifact.'\n\t});\n\tconst releaseCurrent = {\n\t\tlane: 'publish',\n\t\tstepType: 'test_deploy',\n\t\toutcome: 'needs_repair',\n\t\tfailureClass: 'release',\n\t\tblocker: 'Domain publish failed for the current artifact.',\n\t\tevidenceHash: 'release-domain-publish-failed',\n\t\tartifactPaths: ['runner-evidence/release-status.json']\n\t};\n\tconst releaseDirective = buildReplayDirectiveFromPlan({\n\t\tsurface,\n\t\tplan: releasePlan,\n\t\tcurrent: releaseCurrent\n\t});\n\tcases.push(replayCaseFromDirective({\n\t\tcaseId: 'release_uses_hotfix_first_repair',\n\t\tsurface,\n\t\taction: 'continue',\n\t\treason: 'publish failed after business proof',\n\t\tdirective: releaseDirective,\n\t\texpectedSafeAutoDispatch: includeReleaseRepair,\n\t\tpass: releasePlan.recoveryClass === 'release_repair'\n\t\t\t&& releaseDirective.dispatchAction === 'run_release_repair'\n\t\t\t&& releaseDirective.releasePolicy?.policy === 'hotfix_first'\n\t\t\t&& releaseDirective.releasePolicy?.fullDeployAllowed === false\n\t\t\t&& releaseDirective.canRunProductRepair === false,\n\t\tdetails: { recoveryClass: releasePlan.recoveryClass }\n\t}));\n\tconst journeyPlan = buildResolveIOAIManagerRecoveryPlan({\n\t\taction: 'continue',\n\t\treason: 'journey contract missing first next last',\n\t\tfailureClass: 'journey',\n\t\tlane: 'plan',\n\t\tstepType: 'journey_contract',\n\t\tblocker: 'Journey contract does not map the hub CTA to an action.'\n\t});\n\tconst journeyDirective = buildReplayDirectiveFromPlan({\n\t\tsurface,\n\t\tplan: journeyPlan,\n\t\tcurrent: {\n\t\t\tlane: 'plan',\n\t\t\tstepType: 'journey_contract',\n\t\t\toutcome: 'needs_repair',\n\t\t\tfailureClass: 'journey',\n\t\t\tblocker: 'Journey contract does not map the hub CTA to an action.',\n\t\t\tevidenceHash: 'journey-contract-invalid'\n\t\t}\n\t});\n\tcases.push(replayCaseFromDirective({\n\t\tcaseId: 'journey_repair_is_safe_only_for_aicoder_surfaces',\n\t\tsurface,\n\t\taction: 'continue',\n\t\treason: 'journey contract missing first next last',\n\t\tdirective: journeyDirective,\n\t\texpectedSafeAutoDispatch: includeJourneyContractRepair,\n\t\tpass: journeyPlan.recoveryClass === 'journey_contract_repair'\n\t\t\t&& journeyDirective.dispatchAction === 'run_journey_contract_repair'\n\t\t\t&& journeyDirective.canRunProductRepair === false,\n\t\tdetails: { recoveryClass: journeyPlan.recoveryClass }\n\t}));\n\tconst weakPolicy = decideResolveIOAIManagerPolicy({\n\t\thistory: [\n\t\t\t{ lane: 'repair', stepType: 'repair', outcome: 'needs_repair', failureClass: 'product_code', blocker: 'Save action still throws TypeError.', evidenceHash: 'save-before' },\n\t\t\t{ lane: 'repair', stepType: 'repair', outcome: 'needs_repair', failureClass: 'product_code', blocker: 'Save action still throws TypeError.', evidenceHash: 'renamed-hash-only' }\n\t\t],\n\t\tcurrent: { lane: 'repair', stepType: 'repair', outcome: 'needs_repair', failureClass: 'product_code', blocker: 'Save action still throws TypeError.', evidenceHash: 'renamed-hash-only' },\n\t\tmaxSameFailureRepeats\n\t});\n\tconst weakDirective = buildResolveIOAIManagerRecoveryExecutionDirective({\n\t\taction: weakPolicy.recoveryAction,\n\t\tcurrent: { lane: 'repair', stepType: 'repair', outcome: 'needs_repair', failureClass: 'product_code', blocker: 'Save action still throws TypeError.', evidenceHash: 'renamed-hash-only' },\n\t\tsurface\n\t});\n\tcases.push(replayCaseFromDirective({\n\t\tcaseId: 'weak_hash_only_evidence_stays_parked',\n\t\tsurface,\n\t\taction: weakPolicy.action,\n\t\treason: weakPolicy.reason,\n\t\tdirective: weakDirective,\n\t\texpectedSafeAutoDispatch: true,\n\t\tpass: weakPolicy.action === 'park_repeated_failure'\n\t\t\t&& weakPolicy.materialEvidence === false\n\t\t\t&& weakPolicy.loopBudgetShouldReset === false\n\t\t\t&& weakDirective.dispatchAction === 'run_evidence_probe',\n\t\tloopBudgetShouldReset: weakPolicy.loopBudgetShouldReset,\n\t\tmaterialEvidence: weakPolicy.materialEvidence,\n\t\tevidenceStrength: weakPolicy.evidenceStrength,\n\t\tdetails: { evidenceSignals: weakPolicy.evidenceSignals }\n\t}));\n\tconst materialPolicy = decideResolveIOAIManagerPolicy({\n\t\thistory: [\n\t\t\t{ lane: 'repair', stepType: 'repair', outcome: 'needs_repair', failureClass: 'product_code', blocker: 'Save action still throws TypeError.', evidenceHash: 'save-before', artifactPaths: ['qa/save-before.log'] },\n\t\t\t{\n\t\t\t\tlane: 'repair',\n\t\t\t\tstepType: 'repair',\n\t\t\t\toutcome: 'needs_repair',\n\t\t\t\tfailureClass: 'product_code',\n\t\t\t\tblocker: 'Save action still throws TypeError.',\n\t\t\t\tsummary: 'New DOM trace proves the click reaches the method with an undefined id.',\n\t\t\t\tevidenceHash: 'save-dom-trace',\n\t\t\t\tartifactPaths: ['qa/save-before.log', 'qa/save-dom-trace.json']\n\t\t\t}\n\t\t],\n\t\tcurrent: {\n\t\t\tlane: 'repair',\n\t\t\tstepType: 'repair',\n\t\t\toutcome: 'needs_repair',\n\t\t\tfailureClass: 'product_code',\n\t\t\tblocker: 'Save action still throws TypeError.',\n\t\t\tsummary: 'New DOM trace proves the click reaches the method with an undefined id.',\n\t\t\tevidenceHash: 'save-dom-trace',\n\t\t\tartifactPaths: ['qa/save-before.log', 'qa/save-dom-trace.json']\n\t\t},\n\t\tmaxSameFailureRepeats\n\t});\n\tcases.push({\n\t\tcaseId: 'material_evidence_resets_loop_budget',\n\t\tsurface,\n\t\tpass: materialPolicy.action === 'continue'\n\t\t\t&& materialPolicy.materialEvidence === true\n\t\t\t&& materialPolicy.loopBudgetShouldReset === true,\n\t\taction: materialPolicy.action,\n\t\treason: materialPolicy.reason,\n\t\trecoveryClass: materialPolicy.recoveryPlan.recoveryClass,\n\t\tdispatchAction: materialPolicy.recoveryAction.mode,\n\t\tsafeAutoDispatch: false,\n\t\texpectedSafeAutoDispatch: false,\n\t\tproductRepairAllowed: materialPolicy.recoveryAction.productRepairAllowed,\n\t\tloopBudgetShouldReset: materialPolicy.loopBudgetShouldReset,\n\t\tmaterialEvidence: materialPolicy.materialEvidence,\n\t\tevidenceStrength: materialPolicy.evidenceStrength,\n\t\tdetails: { evidenceSignals: materialPolicy.evidenceSignals }\n\t});\n\tconst productPlan = buildResolveIOAIManagerRecoveryPlan({\n\t\taction: 'continue',\n\t\treason: 'business proof still failing',\n\t\tfailureClass: 'product_code',\n\t\tlane: 'repair',\n\t\tstepType: 'repair',\n\t\tblocker: 'Save action still throws TypeError.',\n\t\tproductRepairFailure: true\n\t});\n\tconst productDirective = buildReplayDirectiveFromPlan({\n\t\tsurface,\n\t\tplan: productPlan,\n\t\tcurrent: {\n\t\t\tlane: 'repair',\n\t\t\tstepType: 'repair',\n\t\t\toutcome: 'needs_repair',\n\t\t\tfailureClass: 'product_code',\n\t\t\tblocker: 'Save action still throws TypeError.',\n\t\t\tevidenceHash: 'save-product-repair'\n\t\t}\n\t});\n\tconst productSafe = isResolveIOAIManagerSafeAutoDispatch({\n\t\tdispatchAction: productDirective.dispatchAction,\n\t\tdirective: productDirective,\n\t\tincludeProductRepair: input.includeProductRepair === true\n\t});\n\tcases.push({\n\t\tcaseId: 'product_repair_requires_explicit_operator_policy',\n\t\tsurface,\n\t\tpass: productPlan.recoveryClass === 'product_code_repair'\n\t\t\t&& productDirective.dispatchAction === 'run_targeted_product_repair'\n\t\t\t&& productSafe === false,\n\t\taction: 'continue',\n\t\treason: 'business proof still failing',\n\t\trecoveryClass: productPlan.recoveryClass,\n\t\tdispatchAction: productDirective.dispatchAction,\n\t\tsafeAutoDispatch: productSafe,\n\t\texpectedSafeAutoDispatch: false,\n\t\tproductRepairAllowed: productDirective.canRunProductRepair,\n\t\tloopBudgetShouldReset: false,\n\t\tmaterialEvidence: false,\n\t\tevidenceStrength: 'none',\n\t\tdetails: { phase: productDirective.phase, allowed: productDirective.allowed }\n\t});\n\tconst duplicateReleasePolicy = buildResolveIOAIManagerHotfixFirstReleasePolicy({\n\t\tsurface,\n\t\tdeployFingerprint: `${surface}-artifact-sha`,\n\t\tlastDeployFingerprint: `${surface}-artifact-sha`,\n\t\tdeployStatus: 'completed',\n\t\tpublishStatus: 'published'\n\t});\n\tcases.push({\n\t\tcaseId: 'duplicate_release_fingerprint_blocks_full_deploy',\n\t\tsurface,\n\t\tpass: duplicateReleasePolicy.recommendedAction === 'block_duplicate_deploy'\n\t\t\t&& duplicateReleasePolicy.duplicateDeployBlocked === true\n\t\t\t&& duplicateReleasePolicy.fullDeployAllowed === false,\n\t\taction: duplicateReleasePolicy.recommendedAction,\n\t\treason: duplicateReleasePolicy.reason,\n\t\trecoveryClass: 'release_repair',\n\t\tdispatchAction: 'run_release_repair',\n\t\tsafeAutoDispatch: includeReleaseRepair,\n\t\texpectedSafeAutoDispatch: includeReleaseRepair,\n\t\tproductRepairAllowed: false,\n\t\tloopBudgetShouldReset: false,\n\t\tmaterialEvidence: false,\n\t\tevidenceStrength: 'none',\n\t\thotfixFirst: true,\n\t\tfullDeployAllowed: duplicateReleasePolicy.fullDeployAllowed,\n\t\tdetails: { releasePolicy: duplicateReleasePolicy }\n\t});\n\treturn cases;\n}\n"]}
|