{"version":3,"file":"orchestrator-drift-error.mjs","names":[],"sources":["../../../../../../../ai/src/errors/orchestrator-drift-error.ts"],"sourcesContent":["import type { AIErrorOptions } from \"./ai-error\";\nimport type { ErrorCategory } from \"./error-category.type\";\nimport { OrchestratorFailedError } from \"./orchestrator-failed-error\";\n\nexport type OrchestratorDriftErrorOptions = AIErrorOptions & {\n  /** Signature recorded on the loaded checkpoint. */\n  savedSignature: string;\n  /** Signature computed from the current orchestrator definition. */\n  currentSignature: string;\n  /** The session whose checkpoint drifted. */\n  sessionId: string;\n};\n\n/**\n * Phase 2 drift guard (orchestrator.md §3 / §10). `execute()` or\n * `resume()` loaded a checkpoint whose structural fingerprint does not\n * match the current orchestrator definition (name + intents map +\n * route/router presence + evaluate presence + initialAgent +\n * maxIterations + iterate flag + historyWindow shape — §10.1).\n *\n * The turn is refused synchronously — nothing dispatches — and the dev\n * decides how to recover: discard the session, migrate the persisted\n * state, or pass `{ force: true }` to accept the new signature on the\n * next persisted checkpoint.\n *\n * Mirrors `SupervisorDriftError` / `WorkflowDriftError` — same\n * rationale, orchestrator scope. The orchestrator signature does NOT\n * aggregate the internal supervisor's signature (§10.1); internal-\n * supervisor drift surfaces only on `iterate: true` resume via the\n * supervisor's own drift check.\n */\nexport class OrchestratorDriftError extends OrchestratorFailedError {\n  public static readonly defaultCategory: ErrorCategory = \"drift\";\n\n  public readonly savedSignature: string;\n  public readonly currentSignature: string;\n  public readonly sessionId: string;\n\n  public constructor(message: string, options: OrchestratorDriftErrorOptions) {\n    super(message, options, \"ORCHESTRATOR_DRIFT\");\n    this.name = \"OrchestratorDriftError\";\n    this.savedSignature = options.savedSignature;\n    this.currentSignature = options.currentSignature;\n    this.sessionId = options.sessionId;\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+BA,IAAa,yBAAb,cAA4C,wBAAwB;;yBACV;;CAMxD,AAAO,YAAY,SAAiB,SAAwC;EAC1E,MAAM,SAAS,SAAS,oBAAoB;EAC5C,KAAK,OAAO;EACZ,KAAK,iBAAiB,QAAQ;EAC9B,KAAK,mBAAmB,QAAQ;EAChC,KAAK,YAAY,QAAQ;CAC3B;AACF"}