{
  "openapi": "3.1.0",
  "info": {
    "title": "i2x Governed Specialist Work API",
    "version": "1.9.0",
    "description": "Customer-visible workflow for commissioning, explicit coverage acceptance, task execution and honest result handling. Extra response metadata is not authority and is not a client-controlled instruction. Local execution routes require the configured customer-local instance; this specification does not assert that every installation exposes every runtime."
  },
  "servers": [
    {
      "url": "/",
      "description": "The current i2x installation origin"
    }
  ],
  "security": [
    {
      "customerSession": []
    }
  ],
  "paths": {
    "/api/projects/{projectId}/verify-hosted": {
      "parameters": [
        {
          "name": "projectId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          }
        }
      ],
      "post": {
        "operationId": "post_queue_hosted_verification",
        "summary": "Queue the approved D3 plan for hosted verification",
        "description": "Requires an owner or maintainer, a matching inspected local source snapshot, and eligible hosted capacity. Review the source and expectedPlanDigest before authorizing the source transfer. Queue acceptance means verification is pending.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "expectedPlanDigest": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$",
                    "description": "Exact approved plan digest. Send this after review to reject a changed plan before packaging or reserving allowance."
                  },
                  "maxSeconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 900,
                    "default": 900,
                    "description": "Maximum hosted allowance to reserve, in seconds."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Run queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "runId",
                    "jobId",
                    "state",
                    "provenance",
                    "candidatePackageDigest"
                  ],
                  "properties": {
                    "runId": {
                      "type": "string"
                    },
                    "jobId": {
                      "type": "string"
                    },
                    "state": {
                      "const": "queued"
                    },
                    "provenance": {
                      "const": "i2x_runner_pending"
                    },
                    "candidatePackageDigest": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{64}$"
                    },
                    "sourceCustody": {
                      "enum": ["encrypted", "artifact_store"]
                    },
                    "sourceExpiresAtEpochSeconds": {
                      "type": ["integer", "null"],
                      "description": "Expiry of the encrypted package. Null indicates this response has no encrypted package deadline."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, digest, or time limit."
          },
          "403": {
            "description": "The current member cannot queue hosted verification."
          },
          "404": {
            "description": "Project unavailable to the current session."
          },
          "409": {
            "description": "Current prerequisites are unmet. HOSTED_PLAN_CHANGED indicates a changed approval. Read and review the new plan before requesting another run."
          },
          "503": {
            "description": "Hosted artifact storage is unavailable."
          }
        }
      }
    },
    "/api/projects/{projectId}/onboarding-api-verification-draft": {
      "parameters": [
        {
          "name": "projectId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          }
        }
      ],
      "post": {
        "operationId": "post_queue_provider_verification_draft",
        "summary": "Queue a D3 draft for the current API-funded project",
        "description": "Use the onboarding digest for the current customer-controlled project. Queueing makes no provider request. A matching retry leaves earlier work available and reuses the same replacement on replay.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderVerificationDraftQueueRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Existing draft",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderVerificationDraftQueue"
                }
              }
            }
          },
          "201": {
            "description": "New draft queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderVerificationDraftQueue"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A freshly verified owner or maintainer session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The project or task is unavailable to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The source, task, provider, or protection scope is unsuitable or changed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/tasks/{taskId}/submit-verification-draft": {
      "parameters": [
        {
          "name": "taskId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          }
        }
      ],
      "post": {
        "operationId": "post_submit_provider_verification_draft",
        "summary": "Submit exact draft checks for human review",
        "description": "Requires a completed provider draft sourced from the current project and protection plan. The pending proposal has no execution or approval authority.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Previously submitted proposal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderVerificationDraftSubmission"
                }
              }
            }
          },
          "201": {
            "description": "New proposal awaiting human review",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderVerificationDraftSubmission"
                }
              }
            }
          },
          "403": {
            "description": "A freshly verified owner or maintainer session is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The project or task is unavailable to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The source, task, provider, or protection scope is unsuitable or changed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/tasks/{taskId}/{provider}-api-execution/source-preview": {
      "parameters": [
        {
          "name": "taskId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        },
        {
          "name": "provider",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "enum": [
              "openai",
              "anthropic",
              "xai"
            ]
          }
        }
      ],
      "post": {
        "operationId": "post_provider_source_preview",
        "summary": "Preview an exact source excerpt for review",
        "description": "Customer-controlled instance only. The run must be bound to the configured provider and the pinned skill must permit source reads. A queued task can be claimed during preview. Preview makes no provider request.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderSourceReadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The bounded excerpt and retained observation identifiers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderSourcePreview"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request fields or acknowledgement",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Fresh owner or maintainer session required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Task unavailable to the current session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The run, provider, source or approval does not match current task state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Provider or workspace configuration unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/tasks/{taskId}/provider-source-approval": {
      "parameters": [
        {
          "name": "taskId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        }
      ],
      "post": {
        "operationId": "post_provider_source_approval",
        "summary": "Approve sending the reviewed excerpt to the named provider",
        "description": "The observation must belong to the current assignment. The approval expires with the verified session or sooner and retains only identifiers and digests.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderSourceApprovalRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Replay of the existing approval",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderSourceApproval"
                }
              }
            }
          },
          "201": {
            "description": "New approval recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderSourceApproval"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request fields or acknowledgement",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Fresh owner or maintainer session required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Task unavailable to the current session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The run, provider, source or approval does not match current task state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/tasks/{taskId}/{provider}-api-execution": {
      "parameters": [
        {
          "name": "taskId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        },
        {
          "name": "provider",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "enum": [
              "openai",
              "anthropic",
              "xai"
            ]
          }
        }
      ],
      "get": {
        "operationId": "get_provider_api_execution",
        "summary": "Read retained provider execution status",
        "responses": {
          "200": {
            "description": "Current task and retained provider-attempt summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderTaskProjection"
                }
              }
            }
          },
          "403": {
            "description": "Fresh owner or maintainer session required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Task unavailable to the current session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Provider or workspace configuration unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_provider_api_execution",
        "summary": "Execute the task using the customer API account",
        "description": "Supply sourceDisclosure for a reviewed excerpt. The approval is consumed before transport. Tasks with mandatory source reads require approved source. Usage is charged by the selected provider. Use GET to inspect an uncertain result.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [],
                "properties": {
                  "sourceDisclosure": {
                    "$ref": "#/components/schemas/ProviderSourceDisclosure"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Governed agent report or failed task",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderTaskResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request fields or acknowledgement",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Fresh owner or maintainer session required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Task unavailable to the current session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The run, provider, source or approval does not match current task state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Provider or workspace configuration unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/runs/{runId}/project-lead-task": {
      "post": {
        "summary": "Queue Project Lead",
        "description": "Human owner/maintainer only. Requires a completed project inspection for this D1 run. Repeating the request returns the latest commissioned task and never silently retries failed work.",
        "operationId": "post_queue_project_lead",
        "responses": {
          "200": {
            "description": "Existing task",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadCommission"
                }
              }
            }
          },
          "201": {
            "description": "Queue Project Lead",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadCommission"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          }
        }
      }
    },
    "/api/runs/{runId}/project-lead-task/retry": {
      "post": {
        "summary": "Retry Project Lead",
        "description": "Human owner/maintainer only. The exact previous task must be the latest failed or cancelled Lead. Coverage must not already be accepted. The original source-bound input is retained and the approved task-attempt budget still applies. Identical requests return the same retry.",
        "operationId": "post_retry_project_lead",
        "responses": {
          "200": {
            "description": "Same retry already queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadCommission"
                }
              }
            }
          },
          "201": {
            "description": "Retry Project Lead",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadCommission"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadRetry"
              }
            }
          }
        }
      }
    },
    "/api/runs/{runId}/coverage-preview": {
      "post": {
        "summary": "Preview specialist coverage",
        "description": "Read-only preview for an owner/maintainer. For D1, complete the Lead first. Omit additionalRoles to discover the Lead recommendation. An explicit list must match it. No specialist tasks are created. D6 previews include repairContext and repairContextDigest. Display the accepted findings, original-run evidence references, protected behaviors and accepted checks before asking for approval.",
        "operationId": "post_preview_specialist_coverage",
        "responses": {
          "200": {
            "description": "Preview specialist coverage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoveragePreview"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoverageRequest"
              }
            }
          }
        }
      }
    },
    "/api/runs/{runId}/coverage-plan": {
      "get": {
        "summary": "Read accepted coverage",
        "description": "Available to current owner, maintainer, approver or viewer.",
        "operationId": "get_read_accepted_coverage",
        "responses": {
          "200": {
            "description": "Read accepted coverage",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "coveragePlan": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "coveragePlan"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ]
      },
      "post": {
        "summary": "Accept specialist coverage",
        "description": "Human owner/maintainer only. Send the exact preview digest and additionalRoles returned by the preview. Coverage and task creation commit together. Changed previews are refused. D6 acceptance requires an accepted open finding and an unchanged repair context; changed context rejects the preview. A repair preview grants no source mutation or verification authority.",
        "operationId": "post_accept_specialist_coverage",
        "responses": {
          "201": {
            "description": "Accept specialist coverage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoverageAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoverageAcceptance"
              }
            }
          }
        }
      }
    },
    "/api/runs/{runId}/specialist-tasks": {
      "get": {
        "summary": "Read specialist progress",
        "description": "Available to current owner, maintainer, approver or viewer. Includes the latest Lead and a bounded Chief QA review. Reports are not independent evidence; historical or unavailable reviews must not be shown as current verified results.",
        "operationId": "get_read_specialist_progress",
        "responses": {
          "200": {
            "description": "Read specialist progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Specialists"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ]
      },
      "post": {
        "summary": "Retry accepted specialist",
        "description": "Human owner/maintainer only. The role must belong to the accepted plan. Active work, reconciliation state and the approved attempt budget constrain retries.",
        "operationId": "post_retry_accepted_specialist",
        "responses": {
          "201": {
            "description": "Retry accepted specialist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpecialistRetry"
              }
            }
          }
        }
      }
    },
    "/api/local/customer-task-operations": {
      "get": {
        "summary": "List local operations",
        "description": "Human owner/maintainer only. Project-scoped operation history; an interrupted operation never inherits a later retry result.",
        "operationId": "get_list_local_operations",
        "responses": {
          "200": {
            "description": "List local operations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationList"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "projectId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ]
      },
      "post": {
        "summary": "Start local task",
        "description": "Fresh human owner/maintainer session on a customer-local i2x instance only. Runs one eligible task using the selected customer-held account. It does not run the whole queue. Setup, entitlement and runtime availability are checked before work starts. A recoverable pre-handoff retry must keep its original scope. The browser first previews the task,then sends taskPreview unchanged. When supplied,the executor rechecks its exact task,input,skill,connector,host and access-selection binding before claiming. A mismatch fails the operation with CUSTOMER_TASK_PREVIEW_CHANGED;no different task is substituted. Legacy clients may omit this optional binding.",
        "operationId": "post_start_local_task",
        "responses": {
          "202": {
            "description": "Start local task",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartOperation"
              }
            }
          }
        }
      }
    },
    "/api/local/customer-task-operations/{operationId}": {
      "get": {
        "summary": "Read local operation",
        "description": "Only the original requesting customer with current project membership can read it. Completion means the report was accepted, not that the software was independently verified. With includeHostRestoration=true, hostRestoration is null until a checked completed journal is available. When present,it binds the recorded restored host to this operation/task/project,connector and exact runtime record. It is past protocol-restoration metadata,not current OS liveness,independent assurance or effect authority.",
        "operationId": "get_read_local_operation",
        "responses": {
          "200": {
            "description": "Read local operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{32}$"
            }
          },
          {
            "name": "includeHostRestoration",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "Opt in to checked past host-restoration metadata. Omit to preserve the existing response shape."
          }
        ]
      }
    },
    "/api/local/customer-task-operations/{operationId}/recover": {
      "post": {
        "summary": "Recover local operation",
        "description": "Fresh human owner/maintainer only. Replays retained recovery state and restores local runtime ownership. Recovery is not permission to repeat ambiguous provider work.",
        "operationId": "post_recover_local_operation",
        "responses": {
          "202": {
            "description": "Recover local operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{32}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectRequest"
              }
            }
          }
        }
      }
    },
    "/api/local/customer-task-operations/{operationId}/cancel": {
      "post": {
        "summary": "Cancel local operation",
        "description": "Fresh human owner/maintainer only. Requests safe cancellation of active local work. Cancellation is available only when the operation exposes a cancellation handle.",
        "operationId": "post_cancel_local_operation",
        "responses": {
          "202": {
            "description": "Cancel local operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{32}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelOperation"
              }
            }
          }
        }
      }
    },
    "/api/local/customer-task-operations/{operationId}/close-task": {
      "get": {
        "summary": "Preview incomplete closure",
        "description": "Fresh original human owner/maintainer only. Requires terminal recovery state, restored host and no other active execution for the task.",
        "operationId": "get_preview_incomplete_closure",
        "responses": {
          "200": {
            "description": "Preview incomplete closure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClosePreview"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{32}$"
            }
          }
        ]
      },
      "post": {
        "summary": "Close incomplete task",
        "description": "Uses the exact runtime digest from the preview. Marks the task cancelled and records a receipt without creating an agent report. Idempotent replay returns the same receipt.",
        "operationId": "post_close_incomplete_task",
        "responses": {
          "200": {
            "description": "Close incomplete task",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CloseResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{32}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CloseTask"
              }
            }
          }
        }
      }
    },
    "/api/local/customer-task-operations/{operationId}/verify": {
      "post": {
        "summary": "Request independent checks",
        "description": "Fresh human owner/maintainer only. Requires this operation to have completed, a matching accepted verification plan and configured verification capacity. Contextual checks cannot verify the whole report. This request grants no release or recovery authority.",
        "operationId": "post_request_independent_checks",
        "responses": {
          "202": {
            "description": "Request independent checks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{32}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerificationRequest"
              }
            }
          }
        }
      }
    },
    "/api/local/customer-task-operations/{operationId}/verification-evidence": {
      "get": {
        "summary": "Read verification evidence",
        "description": "Original requesting customer only. Requires completed matching verification evidence and configured platform signing. Independently verify the returned bundle and current trust before relying on it.",
        "operationId": "get_read_verification_evidence",
        "responses": {
          "200": {
            "description": "Read verification evidence",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current human role or fresh verification is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The requested resource is not available to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A prerequisite, state, source or configuration does not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "A required runtime or evidence service is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{32}$"
            }
          }
        ]
      }
    },
    "/api/projects/{projectId}/onboarding": {
      "get": {
        "summary": "Read the next onboarding action",
        "description": "Read current project, connector and work-order bindings. Display the returned next action; a changed connector never silently changes an existing assignment.",
        "operationId": "get_project_onboarding",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current state or replayed receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectOnboarding"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Human role or fresh verification required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Project unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State changed; refresh before confirming again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/projects/{projectId}/onboarding-commission": {
      "post": {
        "summary": "Commission the current onboarding specialist",
        "description": "An owner or maintainer commissions the current eligible stage using its exact onboardingDigest and a stable idempotencyKey. The selected connector is pinned to the new assignment.",
        "operationId": "post_onboarding_commission",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current state or replayed receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingCommissionResult"
                }
              }
            }
          },
          "201": {
            "description": "New work order created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingCommissionResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Human role or fresh verification required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Project unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State changed; refresh before confirming again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnboardingCommissionRequest"
              }
            }
          }
        }
      }
    },
    "/api/projects/{projectId}/onboarding-connector-replacement": {
      "post": {
        "summary": "Replace a connection-bound onboarding work order",
        "description": "Human owner or maintainer with fresh step-up verification required. Read onboarding first and proceed only for REPLACE_CONNECTOR_WORK_ORDER. Confirm the exact previous task and input digest. i2x derives the new connector and unchanged source/protection scope from current state. The transaction revokes an old queued/active assignment and creates a separate generation. This does not prove that the external CLI process stopped, execute model work, establish verification or authorize release. Retry a lost response with the same key and identical request.",
        "operationId": "post_onboarding_connector_replacement",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current state or replayed receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingReplacementResult"
                }
              }
            }
          },
          "201": {
            "description": "New work order created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingReplacementResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Human role or fresh verification required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Project unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State changed; refresh before confirming again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnboardingReplacementRequest"
              }
            }
          }
        }
      }
    },
    "/api/projects/{projectId}/findings/{findingId}/repair-run": {
      "parameters": [
        {
          "name": "projectId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1
          }
        },
        {
          "name": "findingId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1
          }
        }
      ],
      "post": {
        "operationId": "prepareFindingRepairRun",
        "summary": "Prepare repair analysis from an accepted finding",
        "description": "Human owner or maintainer. Requires an open accepted finding and the latest observed source digest. Creates an access-bound D6 analysis run only. Exact repeats for the same original run return the retained result; changed input under the same key is rejected. Separate coverage review is required before agent tasks exist.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "sourceDigest",
                  "idempotencyKey"
                ],
                "properties": {
                  "sourceDigest": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{16,128}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Retained result for identical request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FindingRepairRun"
                }
              }
            }
          },
          "201": {
            "description": "Analysis run prepared",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FindingRepairRun"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request fields"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Human principal required"
          },
          "404": {
            "description": "Project or finding not accessible"
          },
          "409": {
            "description": "REPAIR_SOURCE_CHANGED, ACCEPTED_OPEN_FINDING_REQUIRED, IDEMPOTENCY_KEY_CONFLICT or access-selection precondition failure"
          }
        }
      }
    },
    "/api/projects/{projectId}/findings/{findingId}/repair-context": {
      "parameters": [
        {
          "name": "projectId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1
          }
        },
        {
          "name": "findingId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1
          }
        }
      ],
      "get": {
        "operationId": "exportLocalRepairContext",
        "summary": "Export current checks for local repair preparation",
        "description": "Requires authenticated human owner or maintainer and an open accepted finding. Private exact check commands may contain paths. This unsigned snapshot grants no write authority and does not prove current permission after download.",
        "responses": {
          "200": {
            "description": "Private repair context",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocalRepairContext"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Human principal required"
          },
          "404": {
            "description": "Project or finding unavailable"
          },
          "405": {
            "description": "Method not allowed"
          },
          "409": {
            "description": "Missing or inconsistent accepted checks"
          }
        }
      }
    },
    "/api/projects/{projectId}/findings/{findingId}/repair-result": {
      "post": {
        "operationId": "submitLocalRepairResult",
        "summary": "Submit a customer-reported local repair candidate for human review",
        "description": "Requires a human owner or maintainer, an open finding, matching original source, current requirements and a fresh inventory of the repaired source. Result digests detect content inconsistency but do not authenticate execution. Does not record an independently verified receipt or clear a hold. Repeated matching candidate submissions by the same principal reuse the proposal. Continuation imports require originalProposal, review and continuationProposal in the optional continuation object. The server verifies original source, exact remaining replacements, partial source and unchanged requirements. It retains result and lineage digests in the audit trail. Prior candidate decisions survive repeated imports.",
        "security": [
          {
            "customerSession": []
          }
        ],
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "findingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "result"
                ],
                "additionalProperties": false,
                "properties": {
                  "result": {
                    "type": "object",
                    "description": "Full i2x-local-repair-workflow/1.0.0 result saved by --result-out. Includes projectId, findingId, sourceDigestBefore, application, requirementsDigest, outcome and resultDigest; independent, releaseAuthorized and recoveryAuthorized must be false."
                  },
                  "continuation": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "originalProposal",
                      "review",
                      "continuationProposal"
                    ],
                    "properties": {
                      "originalProposal": {
                        "type": "object"
                      },
                      "review": {
                        "type": "object"
                      },
                      "continuationProposal": {
                        "type": "object"
                      }
                    },
                    "description": "Required when result.sourceDigestBefore is a partial source rather than the original failed source. Original and continuation proposals must be canonical repair proposals. Review must bind the original patch, operation and observed file states. These are customer declarations, not authenticated execution evidence."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Candidate proposal with actual retained status, replayed indicator, customer_reported provenance, independentlyVerified false, reportedCheckOutcome, optional continuation digest references and effectAuthority none."
          },
          "400": {
            "description": "Malformed or inconsistent result"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Human principal required"
          },
          "404": {
            "description": "Project unavailable"
          },
          "409": {
            "description": "Finding, requirements or source must be refreshed"
          }
        }
      }
    },
    "/api/local/customer-task-preview": {
      "post": {
        "summary": "Review the next eligible customer-local specialist",
        "description": "Human project owner/maintainer on a configured customer-local instance. Returns exact task/skill/input and current connector/access identities without claims, account/model invocation, source content or audit writes. A preview is selection metadata, not evidence or effect authority.",
        "operationId": "post_preview_local_customer_task",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "projectId"
                ],
                "properties": {
                  "projectId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current selection metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "taskPreview"
                  ],
                  "properties": {
                    "taskPreview": {
                      "$ref": "#/components/schemas/TaskPreview"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid project or request shape"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Human session required"
          },
          "404": {
            "description": "Project not available to this owner or maintainer"
          },
          "409": {
            "description": "Customer-local executor, connector, local project or eligible task unavailable"
          }
        }
      }
    },
    "/api/runs/{runId}/task-reports/{taskId}": {
      "get": {
        "summary": "Read one retained specialist report",
        "description": "Project owner,maintainer,approver or viewer only. The task must belong to the requested run. Output,input,skill and policy-completion bindings are checked;completed current-schema outputs are revalidated against evidence IDs from this run. Failed reports remain failed. Pending or invalid reports return no body. Historical means source does not match the latest recorded inventory or no matching inventory is available;matching an inventory is not a live filesystem check. Task inputs,skill configuration and credential configuration are omitted. Reading does not invoke a model,grant effect authority or assess independent verification.",
        "operationId": "get_specialist_task_report",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "taskId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Checked report or explicit pending/unavailable state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "taskReport"
                  ],
                  "properties": {
                    "taskReport": {
                      "$ref": "#/components/schemas/SpecialistTaskReport"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Agent API session denied"
          },
          "404": {
            "description": "Run/project not visible or task not in this run"
          }
        }
      }
    },
    "/api/projects/{projectId}/ci-github-configurations": {
      "parameters": [
        {
          "name": "projectId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "summary": "Read GitHub Actions configurations and retained receipts",
        "description": "Available to project owners, maintainers, approvers and viewers. Receipts stay readable after CI session expiry and carry no independent assurance or effect authority.",
        "operationId": "get_github_ci_configurations_and_receipts",
        "responses": {
          "200": {
            "description": "Project CI configuration and retained receipt list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CiConfigurationRead"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Project unavailable to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/projects/{projectId}/ci-gitlab-configurations": {
      "parameters": [
        {
          "name": "projectId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "summary": "Read GitLab CI configurations and retained receipts",
        "description": "Available to project owners, maintainers, approvers and viewers. Receipts stay readable after CI session expiry and carry no independent assurance or effect authority.",
        "operationId": "get_gitlab_ci_configurations_and_receipts",
        "responses": {
          "200": {
            "description": "Project CI configuration and retained receipt list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CiConfigurationRead"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Project unavailable to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/projects/{projectId}/ci-generic-configurations": {
      "parameters": [
        {
          "name": "projectId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "summary": "Read Generic CI configurations and retained receipts",
        "description": "Available to project owners, maintainers, approvers and viewers. Receipts stay readable after CI session expiry and carry no independent assurance or effect authority.",
        "operationId": "get_generic_ci_configurations_and_receipts",
        "responses": {
          "200": {
            "description": "Project CI configuration and retained receipt list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CiConfigurationRead"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Project unavailable to this session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "customerSession": {
        "type": "http",
        "scheme": "bearer",
        "description": "i2x session token. Never use a Claude/OpenAI account credential here. Browser clients may instead use the application-managed same-origin session and CSRF flow."
      }
    },
    "schemas": {
      "ProviderVerificationDraftQueueRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "onboardingDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "retryTaskId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          }
        },
        "required": [
          "onboardingDigest"
        ]
      },
      "ProviderVerificationDraftQueue": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "const": "i2x-provider-verification-draft-commission/1.0.0"
          },
          "projectId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "runId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "taskId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "provider": {
            "enum": [
              "openai",
              "anthropic",
              "xai"
            ]
          },
          "draftInputDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "queueDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "effectAuthority": {
            "const": "none"
          },
          "replayed": {
            "type": "boolean"
          },
          "attempt": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2
          },
          "retryOfTaskId": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,128}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "version",
          "projectId",
          "runId",
          "taskId",
          "provider",
          "draftInputDigest",
          "queueDigest",
          "effectAuthority",
          "replayed"
        ]
      },
      "ProviderVerificationDraftSubmission": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "projectId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "runId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "taskId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "proposalId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "payloadDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "sourceDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "protectionPlanDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "completionDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "effectAuthority": {
            "const": "none"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "projectId",
          "runId",
          "taskId",
          "proposalId",
          "payloadDigest",
          "sourceDigest",
          "protectionPlanDigest",
          "completionDigest",
          "effectAuthority",
          "replayed"
        ]
      },
      "ProviderSourceReadRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "projectId",
          "sourceDigest",
          "action",
          "path"
        ],
        "properties": {
          "projectId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "sourceDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "action": {
            "const": "read"
          },
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "startLine": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "lineCount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          }
        }
      },
      "ProviderSourceExcerpt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "sourceDigest",
          "path",
          "fileDigest",
          "startLine",
          "endLine",
          "totalLines",
          "text"
        ],
        "properties": {
          "version": {
            "const": "i2x-source-excerpt/1.0.0"
          },
          "sourceDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "path": {
            "type": "string"
          },
          "fileDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "startLine": {
            "type": "integer",
            "minimum": 1
          },
          "endLine": {
            "type": "integer",
            "minimum": 1
          },
          "totalLines": {
            "type": "integer",
            "minimum": 1
          },
          "text": {
            "type": "string"
          }
        }
      },
      "ProviderSourcePreview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "sourceDigest",
          "path",
          "fileDigest",
          "startLine",
          "endLine",
          "totalLines",
          "text",
          "evidence"
        ],
        "properties": {
          "version": {
            "const": "i2x-source-excerpt/1.0.0"
          },
          "sourceDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "path": {
            "type": "string"
          },
          "fileDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "startLine": {
            "type": "integer",
            "minimum": 1
          },
          "endLine": {
            "type": "integer",
            "minimum": 1
          },
          "totalLines": {
            "type": "integer",
            "minimum": 1
          },
          "text": {
            "type": "string"
          },
          "evidence": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "receiptId",
              "resultDigest",
              "provenance",
              "verificationEffect"
            ],
            "properties": {
              "receiptId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "resultDigest": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "provenance": {
                "const": "locally_reported"
              },
              "verificationEffect": {
                "const": "none"
              }
            }
          }
        }
      },
      "ProviderSourceApprovalRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider",
          "request",
          "sourceReceiptId",
          "expectedResultDigest",
          "acknowledgement",
          "idempotencyKey"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "openai",
              "anthropic",
              "xai"
            ]
          },
          "request": {
            "$ref": "#/components/schemas/ProviderSourceReadRequest"
          },
          "sourceReceiptId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "expectedResultDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "acknowledgement": {
            "const": "SEND_THIS_EXCERPT_TO_SELECTED_PROVIDER"
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{16,128}$"
          }
        }
      },
      "ProviderSourceApproval": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "provider",
          "workspaceId",
          "projectId",
          "runId",
          "taskId",
          "assignmentDigest",
          "selectionDigest",
          "sourceDigest",
          "requestDigest",
          "resultDigest",
          "returnedBytes",
          "sourceReceiptId",
          "approvedBy",
          "approvalSessionId",
          "approvedAt",
          "expiresAt",
          "effectAuthority",
          "disclosureDigest"
        ],
        "properties": {
          "version": {
            "const": "i2x-provider-source-disclosure/1.0.0"
          },
          "provider": {
            "type": "string",
            "enum": [
              "openai",
              "anthropic",
              "xai"
            ]
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "projectId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "runId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "taskId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "assignmentDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "selectionDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "sourceDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "requestDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "resultDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "returnedBytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 65536
          },
          "sourceReceiptId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "approvedBy": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "approvalSessionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "approvedAt": {
            "type": "integer",
            "minimum": 0
          },
          "expiresAt": {
            "type": "integer",
            "minimum": 1
          },
          "effectAuthority": {
            "const": "none"
          },
          "disclosureDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        }
      },
      "ProviderSourceDisclosure": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "disclosureDigest",
          "request",
          "excerpt"
        ],
        "properties": {
          "disclosureDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "request": {
            "$ref": "#/components/schemas/ProviderSourceReadRequest"
          },
          "excerpt": {
            "$ref": "#/components/schemas/ProviderSourceExcerpt"
          }
        }
      },
      "ProviderTaskProjection": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "taskId",
          "runId",
          "workspaceId",
          "taskStatus",
          "assurance",
          "independentlyVerified",
          "effectAuthority"
        ],
        "properties": {
          "taskId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "runId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "taskStatus": {
            "type": "string"
          },
          "assurance": {
            "enum": [
              "agent_report_only",
              "none"
            ]
          },
          "independentlyVerified": {
            "const": false
          },
          "effectAuthority": {
            "const": "none"
          },
          "promptReturned": {
            "const": false
          },
          "outputReturned": {
            "const": false
          },
          "credentialReturned": {
            "const": false
          }
        }
      },
      "ProviderTaskResult": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "status",
          "taskId",
          "projection"
        ],
        "properties": {
          "status": {
            "enum": [
              "completed",
              "failed"
            ]
          },
          "taskId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "projection": {
            "$ref": "#/components/schemas/ProviderTaskProjection"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": true
      },
      "Empty": {
        "type": "object",
        "properties": {},
        "required": [],
        "additionalProperties": false
      },
      "LeadRetry": {
        "type": "object",
        "properties": {
          "previousTaskId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "previousTaskId"
        ],
        "additionalProperties": false
      },
      "LeadCommission": {
        "type": "object",
        "properties": {
          "version": {
            "const": "i2x-project-lead-commission/1.0.0"
          },
          "runId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "taskId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "active",
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "inputDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "outputDigest": {
            "type": [
              "string",
              "null"
            ]
          },
          "inventoryDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "effectAuthority": {
            "const": "none"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "version",
          "runId",
          "taskId",
          "status",
          "inputDigest",
          "outputDigest",
          "inventoryDigest",
          "effectAuthority",
          "replayed"
        ],
        "additionalProperties": false
      },
      "CoverageRequest": {
        "type": "object",
        "properties": {
          "changeAreas": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "project_structure",
                "ui",
                "accessibility",
                "api",
                "authentication",
                "authorization",
                "data",
                "persistence",
                "migration",
                "recovery",
                "dependencies",
                "runtime",
                "configuration",
                "performance",
                "concurrency",
                "integration",
                "deployment",
                "failure_repair"
              ]
            },
            "minItems": 1,
            "uniqueItems": true
          },
          "protectedBehaviorKinds": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "browser",
                "api",
                "permission",
                "data",
                "state",
                "session",
                "integration"
              ]
            },
            "uniqueItems": true
          },
          "additionalRoles": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "uniqueItems": true
          }
        },
        "required": [
          "changeAreas"
        ],
        "additionalProperties": false
      },
      "CoverageAcceptance": {
        "type": "object",
        "properties": {
          "changeAreas": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "project_structure",
                "ui",
                "accessibility",
                "api",
                "authentication",
                "authorization",
                "data",
                "persistence",
                "migration",
                "recovery",
                "dependencies",
                "runtime",
                "configuration",
                "performance",
                "concurrency",
                "integration",
                "deployment",
                "failure_repair"
              ]
            },
            "minItems": 1,
            "uniqueItems": true
          },
          "protectedBehaviorKinds": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "browser",
                "api",
                "permission",
                "data",
                "state",
                "session",
                "integration"
              ]
            },
            "uniqueItems": true
          },
          "additionalRoles": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "uniqueItems": true
          },
          "previewDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "changeAreas",
          "previewDigest"
        ],
        "additionalProperties": false
      },
      "CoveragePreview": {
        "type": "object",
        "properties": {
          "version": {
            "const": "i2x-specialist-coverage-preview/1.2.0"
          },
          "runId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "minimumRoles": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "uniqueItems": true
          },
          "additionalRoles": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "uniqueItems": true
          },
          "effectiveRoles": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "uniqueItems": true
          },
          "previewDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "immutable": {
            "const": false
          },
          "repairContext": {
            "$ref": "#/components/schemas/RepairContext"
          },
          "repairContextDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "version",
          "runId",
          "minimumRoles",
          "additionalRoles",
          "effectiveRoles",
          "previewDigest",
          "immutable"
        ],
        "additionalProperties": true
      },
      "CoverageAccepted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "runId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "planDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "tasks": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "required": [
          "id",
          "runId",
          "planDigest",
          "tasks"
        ],
        "additionalProperties": true
      },
      "SpecialistRetry": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "role"
        ],
        "additionalProperties": false
      },
      "SpecialistReview": {
        "type": "object",
        "properties": {
          "version": {
            "const": "i2x-specialist-review/1.0.0"
          },
          "runId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "sourceDigest": {
            "type": "string"
          },
          "assurance": {
            "const": "agent_report_unverified"
          },
          "independentVerification": {
            "const": "not_established"
          },
          "effectAuthority": {
            "const": "none"
          },
          "verificationEffect": {
            "const": "none"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "available",
              "historical",
              "unavailable"
            ]
          },
          "summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "gaps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "taskId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "role": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "failed",
                    "cancelled",
                    "unverified"
                  ]
                }
              },
              "required": [
                "taskId",
                "role",
                "status"
              ],
              "additionalProperties": false
            }
          },
          "reasonCodes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "reviewDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "reportDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "policyCompletionReceiptDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "currentSource": {
            "type": "boolean"
          }
        },
        "required": [
          "version",
          "runId",
          "sourceDigest",
          "assurance",
          "independentVerification",
          "effectAuthority",
          "verificationEffect",
          "status",
          "summary",
          "gaps",
          "reasonCodes",
          "reviewDigest"
        ],
        "additionalProperties": false
      },
      "Specialists": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "tasks": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "requiresProjectLead": {
            "type": "boolean"
          },
          "projectLeadTask": {
            "type": [
              "object",
              "null"
            ]
          },
          "coveragePlan": {
            "type": [
              "object",
              "null"
            ]
          },
          "coverageReconciliation": {
            "type": [
              "object",
              "null"
            ]
          },
          "providerTaskOptions": {
            "description": "Present when the run is bound to the current customer API funding selection.",
            "type": ["object", "null"],
            "additionalProperties": false,
            "required": ["provider", "tasks"],
            "properties": {
              "provider": { "type": "string", "enum": ["openai", "anthropic", "xai"] },
              "tasks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": ["taskId", "minimumSourceReads", "allowsSourcePreview"],
                  "properties": {
                    "taskId": { "type": "string" },
                    "minimumSourceReads": { "type": "integer", "minimum": 0, "maximum": 100 },
                    "allowsSourcePreview": { "type": "boolean" }
                  }
                }
              }
            }
          },
          "eligibleSkills": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "review": {
            "$ref": "#/components/schemas/SpecialistReview"
          }
        },
        "required": [
          "runId",
          "tasks",
          "requiresProjectLead",
          "projectLeadTask",
          "coveragePlan",
          "coverageReconciliation",
          "eligibleSkills",
          "review"
        ],
        "additionalProperties": false
      },
      "Baseline": {
        "type": "object",
        "properties": {
          "root": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096,
            "description": "Absolute customer-local baseline path; only sent to the local i2x instance."
          },
          "sourceDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "confirmation": {
            "const": "APPROVE_BASELINE_FOR_TASK"
          }
        },
        "required": [
          "root",
          "sourceDigest",
          "confirmation"
        ],
        "additionalProperties": false
      },
      "StartOperation": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "baseline": {
            "$ref": "#/components/schemas/Baseline"
          },
          "taskPreview": {
            "$ref": "#/components/schemas/TaskPreview"
          }
        },
        "required": [
          "projectId"
        ],
        "additionalProperties": false
      },
      "ProjectRequest": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "projectId"
        ],
        "additionalProperties": false
      },
      "CancelOperation": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "confirmation": {
            "const": "CANCEL_CUSTOMER_FUNDED_TASK"
          }
        },
        "required": [
          "projectId",
          "confirmation"
        ],
        "additionalProperties": false
      },
      "CloseTask": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "runtimeRecordDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "confirmation": {
            "const": "CLOSE_INCOMPLETE_TASK_WITHOUT_SUCCESS"
          }
        },
        "required": [
          "projectId",
          "runtimeRecordDigest",
          "confirmation"
        ],
        "additionalProperties": false
      },
      "Operation": {
        "type": "object",
        "properties": {
          "version": {
            "const": "i2x-local-customer-task-operation/1.2.0"
          },
          "operationId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{32}$"
          },
          "state": {
            "type": "string",
            "enum": [
              "running",
              "completed",
              "failed",
              "incomplete_recovered",
              "recovery_required"
            ]
          },
          "phase": {
            "type": "string",
            "enum": [
              "preparing",
              "prepared",
              "host_disconnected",
              "agent_executing",
              "agent_result_ready",
              "host_reconnected",
              "completed",
              "failed",
              "incomplete_recovered"
            ]
          },
          "cancellationAvailable": {
            "type": "boolean"
          },
          "cancellationRequested": {
            "type": "boolean"
          },
          "assurance": {
            "type": [
              "object",
              "null"
            ]
          },
          "errorCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "operationDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "effectAuthority": {
            "const": "none"
          },
          "verificationEffect": {
            "const": "none"
          }
        },
        "required": [
          "version",
          "operationId",
          "state",
          "phase",
          "cancellationAvailable",
          "cancellationRequested",
          "assurance",
          "errorCode",
          "operationDigest",
          "effectAuthority",
          "verificationEffect"
        ],
        "additionalProperties": true
      },
      "OperationResult": {
        "type": "object",
        "properties": {
          "operation": {
            "$ref": "#/components/schemas/Operation"
          },
          "hostRestoration": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CustomerTaskHostRestoration"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "operation"
        ],
        "additionalProperties": true
      },
      "OperationList": {
        "type": "object",
        "properties": {
          "operations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Operation"
            }
          },
          "verifications": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "verificationBindings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "operationId": {
                  "type": "string"
                },
                "verification": {
                  "type": "object"
                }
              },
              "required": [
                "operationId",
                "verification"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "operations",
          "verifications",
          "verificationBindings"
        ],
        "additionalProperties": false
      },
      "Closure": {
        "type": "object",
        "properties": {
          "version": {
            "const": "i2x-incomplete-task-closure/1.0.0"
          },
          "executionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "taskId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "runId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "projectId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "runtimeRecordDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "contextDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "assignmentDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "connectorId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "hostInstanceId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "closedBy": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "requestSessionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "actorRole": {
            "type": "string",
            "enum": [
              "owner",
              "maintainer"
            ]
          },
          "closedAtEpochSeconds": {
            "type": "integer",
            "minimum": 0
          },
          "outcome": {
            "const": "cancelled"
          },
          "reason": {
            "const": "customer_closed_incomplete_work"
          },
          "agentReportCreated": {
            "const": false
          },
          "independentVerification": {
            "const": "not_established"
          },
          "effectAuthority": {
            "const": "none"
          },
          "closureDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "version",
          "executionId",
          "taskId",
          "runId",
          "projectId",
          "runtimeRecordDigest",
          "contextDigest",
          "assignmentDigest",
          "connectorId",
          "hostInstanceId",
          "closedBy",
          "requestSessionId",
          "actorRole",
          "closedAtEpochSeconds",
          "outcome",
          "reason",
          "agentReportCreated",
          "independentVerification",
          "effectAuthority",
          "closureDigest"
        ],
        "additionalProperties": false
      },
      "CloseResult": {
        "type": "object",
        "properties": {
          "closure": {
            "$ref": "#/components/schemas/Closure"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "closure",
          "replayed"
        ],
        "additionalProperties": false
      },
      "ClosePreview": {
        "type": "object",
        "properties": {
          "preview": {
            "type": "object",
            "properties": {
              "available": {
                "type": "boolean"
              },
              "executionId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "taskId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "runtimeRecordDigest": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "taskStatus": {
                "type": "string"
              },
              "closure": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Closure"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "effectAuthority": {
                "const": "none"
              }
            },
            "required": [
              "available",
              "executionId",
              "taskId",
              "runtimeRecordDigest",
              "taskStatus",
              "closure",
              "effectAuthority"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "preview"
        ],
        "additionalProperties": false
      },
      "VerificationRequest": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "coverage": {
            "type": "string",
            "enum": [
              "complete",
              "contextual"
            ]
          },
          "coverageReason": {
            "type": "string",
            "minLength": 20,
            "maxLength": 500
          },
          "confirmation": {
            "const": "I_ACKNOWLEDGE_VERIFICATION_COVERAGE"
          },
          "maxSeconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 900
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{16,128}$"
          }
        },
        "required": [
          "projectId",
          "coverage",
          "coverageReason",
          "confirmation",
          "maxSeconds",
          "idempotencyKey"
        ],
        "additionalProperties": false
      },
      "OnboardingCommissionRequest": {
        "type": "object",
        "properties": {
          "onboardingDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{16,128}$"
          }
        },
        "required": [
          "onboardingDigest",
          "idempotencyKey"
        ],
        "additionalProperties": false
      },
      "OnboardingReplacementRequest": {
        "type": "object",
        "properties": {
          "onboardingDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "commissionId": {
            "type": "string",
            "minLength": 1
          },
          "expectedTaskId": {
            "type": "string",
            "minLength": 1
          },
          "expectedTaskInputDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "acknowledgement": {
            "const": "REVOKE_OLD_ASSIGNMENT_AND_CREATE_NEW_WORK_ORDER"
          },
          "diagnosis": {
            "type": "string",
            "minLength": 20,
            "maxLength": 500
          },
          "idempotencyKey": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{16,128}$"
          }
        },
        "required": [
          "onboardingDigest",
          "commissionId",
          "expectedTaskId",
          "expectedTaskInputDigest",
          "acknowledgement",
          "diagnosis",
          "idempotencyKey"
        ],
        "additionalProperties": false
      },
      "OnboardingReplacementResult": {
        "type": "object",
        "properties": {
          "version": {
            "const": "i2x-onboarding-intervention-result/1.0.0"
          },
          "commissionId": {
            "type": "string",
            "minLength": 1
          },
          "interventionDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "generation": {
            "type": "integer",
            "minimum": 2
          },
          "runId": {
            "type": "string",
            "minLength": 1
          },
          "taskId": {
            "type": "string",
            "minLength": 1
          },
          "taskInputDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "attemptNumber": {
            "const": 1
          },
          "status": {
            "const": "queued"
          },
          "effectAuthority": {
            "const": "none"
          },
          "verificationEffect": {
            "const": "none"
          },
          "receiptId": {
            "type": "string",
            "minLength": 1
          },
          "resultDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "version",
          "commissionId",
          "interventionDigest",
          "generation",
          "runId",
          "taskId",
          "taskInputDigest",
          "attemptNumber",
          "status",
          "effectAuthority",
          "verificationEffect",
          "receiptId",
          "resultDigest",
          "replayed"
        ]
      },
      "OnboardingCommissionResult": {
        "type": "object",
        "properties": {
          "version": {
            "const": "i2x-onboarding-commission-result/1.0.0"
          },
          "commissionDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "projectId": {
            "type": "string",
            "minLength": 1
          },
          "stage": {
            "type": "string",
            "minLength": 1
          },
          "runId": {
            "type": "string",
            "minLength": 1
          },
          "taskId": {
            "type": "string",
            "minLength": 1
          },
          "taskInputDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "status": {
            "const": "queued"
          },
          "effectAuthority": {
            "const": "none"
          },
          "verificationEffect": {
            "const": "none"
          },
          "receiptId": {
            "type": "string",
            "minLength": 1
          },
          "resultDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "version",
          "commissionDigest",
          "projectId",
          "stage",
          "runId",
          "taskId",
          "taskInputDigest",
          "status",
          "effectAuthority",
          "verificationEffect",
          "receiptId",
          "resultDigest"
        ]
      },
      "ProjectOnboarding": {
        "type": "object",
        "properties": {
          "version": {
            "const": "i2x-project-onboarding/1.5.0"
          },
          "projectId": {
            "type": "string",
            "minLength": 1
          },
          "workspaceId": {
            "type": "string",
            "minLength": 1
          },
          "onboardingDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "complete": {
            "type": "boolean"
          },
          "connectionBinding": {
            "type": "object",
            "properties": {
              "accessSelectionDigest": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "expectedConnectorProvider": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "connectorId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "connectorSetupDigest": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "accessSelectionDigest",
              "expectedConnectorProvider",
              "connectorId",
              "connectorSetupDigest"
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "title": {
                  "type": "string",
                  "minLength": 1
                },
                "status": {
                  "type": "string",
                  "minLength": 1
                },
                "evidence": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "id",
                "title",
                "status",
                "evidence"
              ]
            }
          },
          "nextAction": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "minLength": 1
              },
              "actor": {
                "type": "string",
                "minLength": 1
              },
              "instruction": {
                "type": "string",
                "minLength": 1
              },
              "endpoint": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "method": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "code",
              "actor",
              "instruction",
              "endpoint",
              "method"
            ]
          },
          "commission": {
            "type": [
              "object",
              "null"
            ]
          },
          "intervention": {
            "type": [
              "object",
              "null"
            ]
          },
          "claims": {
            "type": "object",
            "properties": {
              "sourceUploadedToI2x": {
                "const": false
              },
              "providerSubscriptionProved": {
                "const": false
              },
              "independentVerificationEstablished": {
                "type": "boolean"
              }
            },
            "required": [
              "sourceUploadedToI2x",
              "providerSubscriptionProved",
              "independentVerificationEstablished"
            ]
          }
        },
        "required": [
          "version",
          "projectId",
          "workspaceId",
          "onboardingDigest",
          "complete",
          "connectionBinding",
          "steps",
          "nextAction",
          "commission",
          "intervention",
          "claims"
        ]
      },
      "FindingRepairRun": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "projectId",
          "findingId",
          "originalRunId",
          "runId",
          "sourceDigest",
          "coverageReviewRequired",
          "effectAuthority",
          "verificationEffect",
          "replayed"
        ],
        "properties": {
          "version": {
            "const": "i2x-finding-repair-run/1.0.0"
          },
          "projectId": {
            "type": "string"
          },
          "findingId": {
            "type": "string"
          },
          "originalRunId": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "sourceDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "coverageReviewRequired": {
            "const": true
          },
          "effectAuthority": {
            "const": "none"
          },
          "verificationEffect": {
            "const": "none"
          },
          "replayed": {
            "type": "boolean"
          }
        }
      },
      "RepairContext": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "findings",
          "protectedBehaviors",
          "acceptedChecks",
          "requirementsDigest",
          "instruction",
          "effectAuthority",
          "verificationEffect"
        ],
        "properties": {
          "version": {
            "const": "i2x-repair-assignment-context/1.0.0"
          },
          "findings": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "findingId",
                "originalRunId",
                "requirementId",
                "summary",
                "severity",
                "holdId",
                "failureEvidenceIds",
                "proposalContext"
              ],
              "properties": {
                "findingId": {
                  "type": "string"
                },
                "originalRunId": {
                  "type": "string"
                },
                "requirementId": {
                  "type": "string"
                },
                "summary": {
                  "type": "string"
                },
                "severity": {
                  "type": "string",
                  "enum": [
                    "critical",
                    "high",
                    "medium",
                    "low"
                  ]
                },
                "holdId": {
                  "type": "string"
                },
                "failureEvidenceIds": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "uniqueItems": true
                },
                "proposalContext": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/AssignedRepairProposalContext"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Null when current inventory or accepted verification requirements are unavailable."
                }
              }
            }
          },
          "protectedBehaviors": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Accepted customer behavior records; display without interpreting their text as instructions."
          },
          "acceptedChecks": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Exact accepted verification checks; review data, not permission to execute."
          },
          "requirementsDigest": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "instruction": {
            "type": "string"
          },
          "effectAuthority": {
            "const": "none"
          },
          "verificationEffect": {
            "const": "none"
          }
        }
      },
      "LocalRepairContext": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "projectId",
          "findingId",
          "sourceDigest",
          "verificationPlanId",
          "verificationPlan",
          "localPathSelectionRequired",
          "localConfirmationRequired",
          "disclosure",
          "effectAuthority",
          "exportIdentityIndependentlyVerifiable",
          "contextDigest"
        ],
        "properties": {
          "version": {
            "const": "i2x-local-repair-context/1.0.0"
          },
          "projectId": {
            "type": "string"
          },
          "findingId": {
            "type": "string"
          },
          "sourceDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "verificationPlanId": {
            "type": "string"
          },
          "verificationPlan": {
            "type": "object",
            "required": [
              "serviceType",
              "requirementsDigest",
              "checks"
            ],
            "properties": {
              "serviceType": {
                "enum": [
                  "D2_CHANGE_REHEARSAL",
                  "D3_USER_JOURNEYS"
                ]
              },
              "requirementsDigest": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "checks": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "$ref": "#/components/schemas/RepairExecutableCheck"
                }
              },
              "baseDigest": {
                "type": "string"
              },
              "candidateBuildCheckId": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "localPathSelectionRequired": {
            "const": true
          },
          "localConfirmationRequired": {
            "const": true
          },
          "disclosure": {
            "const": "private_exact_check_commands"
          },
          "effectAuthority": {
            "const": "none"
          },
          "exportIdentityIndependentlyVerifiable": {
            "const": false
          },
          "contextDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        }
      },
      "RepairExecutableCheck": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "description",
          "behaviorIds",
          "caseType",
          "executable",
          "args",
          "expectedExitCode",
          "timeoutSeconds",
          "assertions"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string",
            "minLength": 1
          },
          "behaviorIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1
          },
          "caseType": {
            "enum": [
              "positive",
              "invalid_input",
              "unauthorized"
            ]
          },
          "executable": {
            "type": "string",
            "minLength": 1
          },
          "args": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "expectedExitCode": {
            "type": "integer",
            "minimum": 0,
            "maximum": 255
          },
          "timeoutSeconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 900
          },
          "assertions": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "type",
                "expected"
              ],
              "properties": {
                "type": {
                  "enum": [
                    "stdout_includes",
                    "stdout_equals",
                    "stderr_includes",
                    "stderr_equals"
                  ]
                },
                "expected": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          }
        }
      },
      "AssignedRepairProposalContext": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "projectId",
          "findingId",
          "sourceDigest",
          "verificationPlan",
          "localPathSelectionRequired",
          "localConfirmationRequired",
          "disclosure",
          "effectAuthority",
          "exportIdentityIndependentlyVerifiable",
          "contextDigest"
        ],
        "properties": {
          "version": {
            "const": "i2x-local-repair-context/1.0.0"
          },
          "projectId": {
            "type": "string"
          },
          "findingId": {
            "type": "string"
          },
          "sourceDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "verificationPlan": {
            "type": "object",
            "required": [
              "serviceType",
              "requirementsDigest",
              "checks"
            ],
            "properties": {
              "serviceType": {
                "enum": [
                  "D2_CHANGE_REHEARSAL",
                  "D3_USER_JOURNEYS"
                ]
              },
              "requirementsDigest": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "checks": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "$ref": "#/components/schemas/RepairExecutableCheck"
                }
              },
              "baseDigest": {
                "type": "string"
              },
              "candidateBuildCheckId": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "localPathSelectionRequired": {
            "const": true
          },
          "localConfirmationRequired": {
            "const": true
          },
          "disclosure": {
            "const": "private_exact_check_commands"
          },
          "effectAuthority": {
            "const": "none"
          },
          "exportIdentityIndependentlyVerifiable": {
            "const": false
          },
          "contextDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "description": "Private source-bound proposal context embedded in an assigned finding. The accepted plan row identifier is omitted; the requirements digest binds the check contract."
      },
      "TaskPreview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "projectId",
          "taskId",
          "runId",
          "specialistRole",
          "skillVersionId",
          "inputDigest",
          "taskStatus",
          "connectorId",
          "hostInstanceId",
          "accessSelectionId",
          "provider",
          "version",
          "taskPreviewDigest",
          "claimCreated",
          "modelInvoked",
          "sourceContentReturned",
          "effectAuthority"
        ],
        "properties": {
          "projectId": {
            "type": "string",
            "minLength": 1
          },
          "taskId": {
            "type": "string",
            "minLength": 1
          },
          "runId": {
            "type": "string",
            "minLength": 1
          },
          "specialistRole": {
            "type": "string",
            "minLength": 1
          },
          "skillVersionId": {
            "type": "string",
            "minLength": 1
          },
          "inputDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "taskStatus": {
            "type": "string",
            "minLength": 1
          },
          "connectorId": {
            "type": "string",
            "minLength": 1
          },
          "hostInstanceId": {
            "type": "string",
            "minLength": 1
          },
          "accessSelectionId": {
            "type": "string",
            "minLength": 1
          },
          "provider": {
            "enum": [
              "codex",
              "claude"
            ]
          },
          "version": {
            "const": "i2x-customer-task-preview/1.0.0"
          },
          "taskPreviewDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "claimCreated": {
            "const": false
          },
          "modelInvoked": {
            "const": false
          },
          "sourceContentReturned": {
            "const": false
          },
          "effectAuthority": {
            "const": "none"
          }
        }
      },
      "SpecialistTaskReport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "runId",
          "taskId",
          "sourceDigest",
          "specialistRole",
          "provenance",
          "independentVerification",
          "effectAuthority",
          "verificationEffect",
          "status",
          "report",
          "reasonCodes",
          "projectionDigest"
        ],
        "properties": {
          "version": {
            "const": "i2x-specialist-task-report/1.0.0"
          },
          "runId": {
            "type": "string",
            "minLength": 1
          },
          "taskId": {
            "type": "string",
            "minLength": 1
          },
          "sourceDigest": {
            "type": "string",
            "minLength": 1
          },
          "specialistRole": {
            "type": "string",
            "minLength": 1
          },
          "provenance": {
            "const": "agent_report"
          },
          "independentVerification": {
            "const": "not_assessed_by_report_view"
          },
          "effectAuthority": {
            "const": "none"
          },
          "verificationEffect": {
            "const": "none"
          },
          "status": {
            "enum": [
              "available",
              "historical",
              "pending",
              "unavailable"
            ]
          },
          "report": {
            "type": [
              "object",
              "null"
            ]
          },
          "taskOutcome": {
            "enum": [
              "completed",
              "failed"
            ]
          },
          "skillVersionId": {
            "type": "string",
            "minLength": 1
          },
          "reportDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "policyCompletionReceiptDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "sourceObservationMatches": {
            "type": "boolean"
          },
          "integrity": {
            "const": "checked_retained_bindings"
          },
          "reasonCodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "projectionDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        }
      },
      "CustomerTaskHostRestoration": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "operationId",
          "projectId",
          "taskId",
          "connectorId",
          "hostInstanceId",
          "runtimeRecordDigest",
          "restorationTransitionDigest",
          "currentHostLivenessEstablished",
          "verificationEffect",
          "effectAuthority",
          "restorationDigest"
        ],
        "properties": {
          "version": {
            "const": "i2x-customer-task-host-restoration/1.0.0"
          },
          "operationId": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "taskId": {
            "type": "string"
          },
          "connectorId": {
            "type": "string"
          },
          "hostInstanceId": {
            "type": "string"
          },
          "runtimeRecordDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "restorationTransitionDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "currentHostLivenessEstablished": {
            "const": false
          },
          "verificationEffect": {
            "const": "none"
          },
          "effectAuthority": {
            "const": "none"
          },
          "restorationDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        }
      },
      "RetainedCiReceipt": {
        "type": "object",
        "required": [
          "version",
          "sessionId",
          "configurationId",
          "projectId",
          "sourceDigest",
          "planDigest",
          "evidenceDigest",
          "receiptDigest",
          "checks",
          "outcome",
          "provenance",
          "independentVerificationEstablished",
          "resultAssuranceEstablished",
          "releaseAuthorized",
          "recoveryAuthorized",
          "effectAuthority",
          "receivedAtEpochSeconds"
        ],
        "properties": {
          "version": {
            "type": "string",
            "enum": [
              "i2x-generic-ci-evidence-receipt/1.0.0",
              "i2x-gitlab-ci-evidence-receipt/1.0.0",
              "i2x-github-actions-ci-evidence-receipt/1.1.0"
            ]
          },
          "sessionId": {
            "type": "string",
            "minLength": 1
          },
          "configurationId": {
            "type": "string",
            "minLength": 1
          },
          "projectId": {
            "type": "string",
            "minLength": 1
          },
          "sourceDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "planDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "evidenceDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "receiptDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "checks": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "properties": {
                "checkId": {
                  "type": "string",
                  "minLength": 1
                },
                "outcome": {
                  "enum": [
                    "passed",
                    "failed",
                    "inconclusive"
                  ]
                }
              },
              "required": [
                "checkId",
                "outcome"
              ],
              "additionalProperties": false
            }
          },
          "outcome": {
            "enum": [
              "locally_reported_passing",
              "locally_reported_failing",
              "locally_reported_inconclusive"
            ]
          },
          "provenance": {
            "enum": [
              "customer_ci_signed",
              "customer_ci_reported"
            ]
          },
          "independentVerificationEstablished": {
            "const": false
          },
          "resultAssuranceEstablished": {
            "const": false
          },
          "releaseAuthorized": {
            "const": false
          },
          "recoveryAuthorized": {
            "const": false
          },
          "effectAuthority": {
            "const": "none"
          },
          "receivedAtEpochSeconds": {
            "type": "integer",
            "minimum": 0
          },
          "provider": {
            "enum": [
              "gitlab",
              "generic_signed_ci"
            ]
          },
          "trustBoundary": {
            "const": "customer_configured_signing_key"
          }
        },
        "additionalProperties": false
      },
      "CiConfigurationRead": {
        "type": "object",
        "properties": {
          "configurations": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "evidenceReceipts": {
            "type": "array",
            "maxItems": 50,
            "description": "Recent retained submissions, newest first.",
            "items": {
              "$ref": "#/components/schemas/RetainedCiReceipt"
            }
          }
        },
        "required": [
          "configurations",
          "evidenceReceipts"
        ],
        "additionalProperties": false
      }
    }
  }
}
