{
  "components": {
    "schemas": {
      "BindGithubInstallationRequest": {
        "additionalProperties": false,
        "properties": {
          "coreInstallationId": {
            "type": "string"
          },
          "providerInstallationId": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "coreInstallationId",
          "providerInstallationId"
        ],
        "type": "object"
      },
      "BranchRuleProviderChangeResponse": {
        "enum": [
          "rewrite",
          "delete"
        ],
        "type": "string"
      },
      "ConnectionListResponse": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ConnectionResponse"
            },
            "type": "array"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "type": "object"
      },
      "ConnectionModeResponse": {
        "enum": [
          "backup",
          "twoWay"
        ],
        "type": "string"
      },
      "ConnectionNextAction": {
        "description": "Conservative guidance only. This route exposes no mutation link or implied\nauthorization to execute the next action.",
        "enum": [
          "none",
          "wait",
          "inspectRefs",
          "reviewOutage",
          "resolveQuarantine"
        ],
        "type": "string"
      },
      "ConnectionProviderResponse": {
        "enum": [
          "github"
        ],
        "type": "string"
      },
      "ConnectionResponse": {
        "additionalProperties": false,
        "properties": {
          "connectionId": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "githubPreflightHref": {
            "type": "string"
          },
          "incidentsHref": {
            "type": "string"
          },
          "mode": {
            "$ref": "#/components/schemas/ConnectionModeResponse"
          },
          "onboardingComplete": {
            "type": "boolean"
          },
          "outage": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OutageStatusResponse"
              }
            ]
          },
          "provider": {
            "$ref": "#/components/schemas/ConnectionProviderResponse"
          },
          "providerRepositoryId": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "refsHref": {
            "type": "string"
          },
          "repositoryId": {
            "type": "string"
          },
          "requiresTargetPreflight": {
            "type": "boolean"
          },
          "resourceHref": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/ConnectionStateResponse"
          },
          "statusHref": {
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "repositoryId",
          "connectionId",
          "provider",
          "providerRepositoryId",
          "mode",
          "state",
          "outage",
          "version",
          "createdAt",
          "updatedAt",
          "onboardingComplete",
          "requiresTargetPreflight",
          "resourceHref",
          "statusHref",
          "githubPreflightHref",
          "refsHref",
          "incidentsHref"
        ],
        "type": "object"
      },
      "ConnectionStateResponse": {
        "enum": [
          "pending",
          "active",
          "pausedPartial",
          "outage",
          "quarantined",
          "disconnecting",
          "disconnected"
        ],
        "type": "string"
      },
      "ConnectionStatusResponse": {
        "additionalProperties": false,
        "properties": {
          "connectionId": {
            "type": "string"
          },
          "mode": {
            "$ref": "#/components/schemas/ConnectionModeResponse"
          },
          "nextAction": {
            "$ref": "#/components/schemas/ConnectionNextAction"
          },
          "outage": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OutageStatusResponse"
              }
            ]
          },
          "repositoryId": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/ConnectionStateResponse"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "repositoryId",
          "connectionId",
          "mode",
          "state",
          "version",
          "updatedAt",
          "outage",
          "nextAction"
        ],
        "type": "object"
      },
      "CreateConnectionRequest": {
        "additionalProperties": false,
        "properties": {
          "botId": {
            "type": "string"
          },
          "ownerSlug": {
            "type": "string"
          },
          "providerInstallationId": {
            "type": "string"
          },
          "providerRepositoryId": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "repositorySlug": {
            "type": "string"
          }
        },
        "required": [
          "providerInstallationId",
          "providerRepositoryId",
          "ownerSlug",
          "repositorySlug",
          "botId"
        ],
        "type": "object"
      },
      "ErrorBody": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          }
        },
        "required": [
          "code",
          "message",
          "requestId",
          "retryable"
        ],
        "type": "object"
      },
      "ErrorEnvelope": {
        "additionalProperties": false,
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorBody"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "GithubInstallationPreflightResponse": {
        "additionalProperties": false,
        "properties": {
          "defaultRef": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "installationId": {
            "type": "string"
          },
          "installationVersion": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "objectFormat": {
            "type": "string"
          },
          "observedAt": {
            "format": "date-time",
            "type": "string"
          },
          "portableRefCount": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "provider": {
            "$ref": "#/components/schemas/ConnectionProviderResponse"
          },
          "providerOwnerId": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "providerRepositoryId": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "repositorySizeKib": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "installationId",
          "installationVersion",
          "provider",
          "providerRepositoryId",
          "providerOwnerId",
          "fullName",
          "defaultRef",
          "repositorySizeKib",
          "portableRefCount",
          "objectFormat",
          "observedAt"
        ],
        "type": "object"
      },
      "GithubPreflightResponse": {
        "additionalProperties": false,
        "properties": {
          "connectionId": {
            "type": "string"
          },
          "connectionVersion": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "defaultRef": {
            "type": "string"
          },
          "fullName": {
            "type": "string"
          },
          "objectFormat": {
            "type": "string"
          },
          "observedAt": {
            "format": "date-time",
            "type": "string"
          },
          "portableRefCount": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "providerOwnerId": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "providerRepositoryId": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "repositoryId": {
            "type": "string"
          },
          "repositorySizeKib": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "resourceHref": {
            "type": "string"
          },
          "runtimeRefComparisonRequired": {
            "type": "boolean"
          },
          "targetDefaultRef": {
            "type": "string"
          },
          "targetLinkVerified": {
            "type": "boolean"
          },
          "targetRevisionSha256": {
            "type": "string"
          }
        },
        "required": [
          "repositoryId",
          "connectionId",
          "connectionVersion",
          "providerRepositoryId",
          "providerOwnerId",
          "fullName",
          "defaultRef",
          "repositorySizeKib",
          "portableRefCount",
          "objectFormat",
          "targetLinkVerified",
          "runtimeRefComparisonRequired",
          "targetDefaultRef",
          "targetRevisionSha256",
          "observedAt",
          "resourceHref"
        ],
        "type": "object"
      },
      "ImportConflictBody": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string"
          },
          "currentState": {
            "$ref": "#/components/schemas/ImportStateResponse"
          },
          "currentVersion": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          },
          "resourceHref": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          }
        },
        "required": [
          "code",
          "message",
          "requestId",
          "retryable",
          "currentVersion",
          "currentState",
          "resourceHref"
        ],
        "type": "object"
      },
      "ImportConflictEnvelope": {
        "additionalProperties": false,
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ImportConflictBody"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "ImportPhaseResponse": {
        "enum": [
          "sourceProbe",
          "initialImport",
          "largeTransfer"
        ],
        "type": "string"
      },
      "ImportProgressResponse": {
        "additionalProperties": false,
        "properties": {
          "gitComplete": {
            "type": "boolean"
          },
          "importSliceCount": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "lfsBytes": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "lfsComplete": {
            "type": "boolean"
          },
          "lfsObjectCount": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "packedGitBytes": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "portableRefCount": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "published": {
            "type": "boolean"
          },
          "stagedPortableRefCount": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "packedGitBytes",
          "importSliceCount",
          "portableRefCount",
          "stagedPortableRefCount",
          "gitComplete",
          "lfsComplete",
          "lfsObjectCount",
          "lfsBytes",
          "published"
        ],
        "type": "object"
      },
      "ImportStateResponse": {
        "enum": [
          "created",
          "queued",
          "running",
          "paused",
          "outage",
          "quarantined",
          "succeeded",
          "failed",
          "cancelled"
        ],
        "type": "string"
      },
      "ImportStatusResponse": {
        "additionalProperties": false,
        "properties": {
          "cancellable": {
            "type": "boolean"
          },
          "connectionId": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "importId": {
            "type": "string"
          },
          "outage": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OutageStatusResponse"
              }
            ]
          },
          "phase": {
            "$ref": "#/components/schemas/ImportPhaseResponse"
          },
          "progress": {
            "$ref": "#/components/schemas/ImportProgressResponse"
          },
          "quarantineReasonCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "recoverable": {
            "type": "boolean"
          },
          "recoveryHref": {
            "type": [
              "string",
              "null"
            ]
          },
          "repositoryId": {
            "type": "string"
          },
          "resourceHref": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/ImportStateResponse"
          },
          "successorImportHref": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "repositoryId",
          "connectionId",
          "importId",
          "phase",
          "state",
          "version",
          "cancellable",
          "createdAt",
          "updatedAt",
          "outage",
          "quarantineReasonCode",
          "recoverable",
          "recoveryHref",
          "successorImportHref",
          "progress",
          "resourceHref"
        ],
        "type": "object"
      },
      "IncidentAcknowledgmentResponse": {
        "additionalProperties": false,
        "properties": {
          "acknowledged": {
            "type": "boolean"
          },
          "incidentId": {
            "type": "string"
          },
          "incidentVersion": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "recordedAt": {
            "format": "date-time",
            "type": "string"
          },
          "resourceHref": {
            "type": "string"
          }
        },
        "required": [
          "incidentId",
          "incidentVersion",
          "acknowledged",
          "recordedAt",
          "resourceHref"
        ],
        "type": "object"
      },
      "IncidentAcknowledgmentStatusResponse": {
        "additionalProperties": false,
        "properties": {
          "acknowledged": {
            "type": "boolean"
          },
          "acknowledgedIncidentVersion": {
            "format": "int64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "incidentId": {
            "type": "string"
          },
          "recordedAt": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "resourceHref": {
            "type": "string"
          }
        },
        "required": [
          "incidentId",
          "acknowledged",
          "acknowledgedIncidentVersion",
          "recordedAt",
          "resourceHref"
        ],
        "type": "object"
      },
      "IncidentAttemptListResponse": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/IncidentAttemptResponse"
            },
            "type": "array"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "IncidentAttemptResponse": {
        "additionalProperties": false,
        "properties": {
          "attemptId": {
            "type": "string"
          },
          "connectionId": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "incidentId": {
            "type": "string"
          },
          "incidentVersion": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "kind": {
            "$ref": "#/components/schemas/TwoWayAttemptKindResponse"
          },
          "principalId": {
            "type": "string"
          },
          "principalKind": {
            "$ref": "#/components/schemas/TwoWayPrincipalKindResponse"
          },
          "repositoryId": {
            "type": "string"
          },
          "resourceHref": {
            "type": "string"
          },
          "resultCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "sequence": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "state": {
            "$ref": "#/components/schemas/TwoWayAttemptStateResponse"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "repositoryId",
          "connectionId",
          "incidentId",
          "incidentVersion",
          "attemptId",
          "sequence",
          "kind",
          "state",
          "principalKind",
          "principalId",
          "resultCode",
          "createdAt",
          "updatedAt",
          "resourceHref"
        ],
        "type": "object"
      },
      "IncidentConflictBody": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string"
          },
          "currentState": {
            "$ref": "#/components/schemas/IncidentStateResponse"
          },
          "currentVersion": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          },
          "resourceHref": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          }
        },
        "required": [
          "code",
          "message",
          "requestId",
          "retryable",
          "currentVersion",
          "currentState",
          "resourceHref"
        ],
        "type": "object"
      },
      "IncidentConflictEnvelope": {
        "additionalProperties": false,
        "properties": {
          "error": {
            "$ref": "#/components/schemas/IncidentConflictBody"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "IncidentEvidenceResponse": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "import_id": {
                "type": "string"
              },
              "kind": {
                "enum": [
                  "importRecovery"
                ],
                "type": "string"
              },
              "quarantine_reason_code": {
                "type": "string"
              },
              "recovery_href": {
                "type": "string"
              },
              "successor_import_href": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "import_id",
              "quarantine_reason_code",
              "recovery_href",
              "successor_import_href",
              "kind"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "append_only": {
                "type": "boolean"
              },
              "gitdown_observation": {
                "$ref": "#/components/schemas/RefObservationResponse"
              },
              "kind": {
                "enum": [
                  "branchRule"
                ],
                "type": "string"
              },
              "policy_version": {
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "provider_change": {
                "$ref": "#/components/schemas/BranchRuleProviderChangeResponse"
              },
              "provider_observation": {
                "$ref": "#/components/schemas/RefObservationResponse"
              }
            },
            "required": [
              "provider_change",
              "provider_observation",
              "gitdown_observation",
              "append_only",
              "policy_version",
              "kind"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "desired": {
                "$ref": "#/components/schemas/RefObservationResponse"
              },
              "expected": {
                "$ref": "#/components/schemas/RefObservationResponse"
              },
              "kind": {
                "enum": [
                  "targetDrift"
                ],
                "type": "string"
              },
              "observed_at": {
                "format": "date-time",
                "type": "string"
              },
              "observed_oid": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "reason": {
                "$ref": "#/components/schemas/TargetDriftReasonResponse"
              }
            },
            "required": [
              "expected",
              "desired",
              "observed_oid",
              "reason",
              "observed_at",
              "kind"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "active_anchor_count": {
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "append_only": {
                "type": "boolean"
              },
              "checkpoint_gitdown": {
                "$ref": "#/components/schemas/RefObservationResponse"
              },
              "checkpoint_github": {
                "$ref": "#/components/schemas/RefObservationResponse"
              },
              "incident_generation": {
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "kind": {
                "enum": [
                  "twoWay"
                ],
                "type": "string"
              },
              "observed_gitdown": {
                "$ref": "#/components/schemas/RefObservationResponse"
              },
              "observed_github": {
                "$ref": "#/components/schemas/RefObservationResponse"
              },
              "preserved_tip_count": {
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "preserved_tips_href": {
                "type": "string"
              },
              "ref_name": {
                "type": "string"
              },
              "removed_anchor_count": {
                "description": "Deprecated compatibility field. Successful lifetime-retained\nresolution always returns zero.",
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "resolution": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/TwoWayResolutionResponse"
                  }
                ]
              }
            },
            "required": [
              "ref_name",
              "incident_generation",
              "checkpoint_github",
              "checkpoint_gitdown",
              "observed_github",
              "observed_gitdown",
              "append_only",
              "preserved_tip_count",
              "active_anchor_count",
              "removed_anchor_count",
              "preserved_tips_href",
              "resolution",
              "kind"
            ],
            "type": "object"
          }
        ]
      },
      "IncidentKindResponse": {
        "enum": [
          "divergence",
          "branchRuleRejected",
          "transferFailure",
          "historyGap",
          "identityMismatch",
          "checkpointCorrupt",
          "dependencyOutage"
        ],
        "type": "string"
      },
      "IncidentListResponse": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/IncidentResponse"
            },
            "type": "array"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "type": "object"
      },
      "IncidentResponse": {
        "additionalProperties": false,
        "properties": {
          "acknowledgmentHref": {
            "type": "string"
          },
          "checkpointId": {
            "type": [
              "string",
              "null"
            ]
          },
          "connectionId": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "evidence": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/IncidentEvidenceResponse"
              }
            ]
          },
          "incidentId": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/IncidentKindResponse"
          },
          "outage": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OutageStatusResponse"
              }
            ]
          },
          "reasonCode": {
            "type": "string"
          },
          "repositoryId": {
            "type": "string"
          },
          "resourceHref": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/IncidentStateResponse"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "repositoryId",
          "connectionId",
          "incidentId",
          "checkpointId",
          "kind",
          "state",
          "reasonCode",
          "outage",
          "evidence",
          "version",
          "createdAt",
          "updatedAt",
          "resourceHref",
          "acknowledgmentHref"
        ],
        "type": "object"
      },
      "IncidentStateResponse": {
        "enum": [
          "open",
          "resolving",
          "outage",
          "resolved"
        ],
        "type": "string"
      },
      "OutageKindResponse": {
        "enum": [
          "storage",
          "provider",
          "core",
          "authorization",
          "queue",
          "runtime"
        ],
        "type": "string"
      },
      "OutageStatusResponse": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/OutageKindResponse"
          },
          "lastObservedAt": {
            "format": "date-time",
            "type": "string"
          },
          "reasonCode": {
            "type": "string"
          },
          "retryAt": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "startedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "reasonCode",
          "startedAt",
          "lastObservedAt",
          "retryAt"
        ],
        "type": "object"
      },
      "ProviderInstallationResponse": {
        "additionalProperties": false,
        "properties": {
          "coreInstallationId": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "installationId": {
            "type": "string"
          },
          "provider": {
            "$ref": "#/components/schemas/ConnectionProviderResponse"
          },
          "providerAccountId": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "providerInstallationId": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "installationId",
          "coreInstallationId",
          "provider",
          "providerInstallationId",
          "providerAccountId",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "ReauthorizeGithubInstallationRequest": {
        "additionalProperties": false,
        "properties": {
          "providerInstallationId": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "providerInstallationId"
        ],
        "type": "object"
      },
      "RefListResponse": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/RefResponse"
            },
            "type": "array"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "type": "object"
      },
      "RefObservationResponse": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "presence": {
                "enum": [
                  "unknown"
                ],
                "type": "string"
              }
            },
            "required": [
              "presence"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "generation": {
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "presence": {
                "enum": [
                  "absent"
                ],
                "type": "string"
              }
            },
            "required": [
              "generation",
              "presence"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "generation": {
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "oid": {
                "type": "string"
              },
              "presence": {
                "enum": [
                  "present"
                ],
                "type": "string"
              }
            },
            "required": [
              "oid",
              "generation",
              "presence"
            ],
            "type": "object"
          }
        ]
      },
      "RefResponse": {
        "additionalProperties": false,
        "properties": {
          "checkpointId": {
            "type": "string"
          },
          "connectionId": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "gitdownObservation": {
            "$ref": "#/components/schemas/RefObservationResponse"
          },
          "incidentHref": {
            "type": [
              "string",
              "null"
            ]
          },
          "outage": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OutageStatusResponse"
              }
            ]
          },
          "providerObservation": {
            "$ref": "#/components/schemas/RefObservationResponse"
          },
          "refName": {
            "type": "string"
          },
          "repositoryId": {
            "type": "string"
          },
          "resourceHref": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/RefStateResponse"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "repositoryId",
          "connectionId",
          "checkpointId",
          "refName",
          "state",
          "providerObservation",
          "gitdownObservation",
          "incidentHref",
          "outage",
          "version",
          "createdAt",
          "updatedAt",
          "resourceHref"
        ],
        "type": "object"
      },
      "RefStateResponse": {
        "enum": [
          "pending",
          "inSync",
          "paused",
          "outage",
          "retired"
        ],
        "type": "string"
      },
      "ResolveTwoWayIncidentRequest": {
        "additionalProperties": false,
        "properties": {
          "chosen": {
            "$ref": "#/components/schemas/TwoWayResolutionChoiceRequest"
          },
          "dispositions": {
            "items": {
              "$ref": "#/components/schemas/TwoWayDispositionRequest"
            },
            "type": "array"
          }
        },
        "required": [
          "chosen",
          "dispositions"
        ],
        "type": "object"
      },
      "SidecarAttestationResponse": {
        "additionalProperties": false,
        "properties": {
          "appId": {
            "type": "string"
          },
          "attestationId": {
            "type": "string"
          },
          "attestationVersion": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "commitOid": {
            "type": "string"
          },
          "connectionId": {
            "type": "string"
          },
          "coreObservationSha256": {
            "type": "string"
          },
          "direction": {
            "$ref": "#/components/schemas/SidecarFlowDirection"
          },
          "evidenceSha256": {
            "type": "string"
          },
          "expiresAt": {
            "format": "date-time",
            "type": "string"
          },
          "installationGeneration": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "installationId": {
            "type": "string"
          },
          "meaning": {
            "type": "string"
          },
          "observedAt": {
            "format": "date-time",
            "type": "string"
          },
          "providerObservationSha256": {
            "type": "string"
          },
          "repositoryId": {
            "type": "string"
          },
          "resourceHref": {
            "type": "string"
          },
          "schemaVersion": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "source": {
            "$ref": "#/components/schemas/SidecarEvidenceSource"
          },
          "sourceEvidenceId": {
            "type": "string"
          },
          "syncInstallationId": {
            "type": "string"
          },
          "trustState": {
            "$ref": "#/components/schemas/SidecarTrustState"
          }
        },
        "required": [
          "schemaVersion",
          "attestationId",
          "repositoryId",
          "commitOid",
          "appId",
          "installationId",
          "installationGeneration",
          "syncInstallationId",
          "connectionId",
          "attestationVersion",
          "trustState",
          "direction",
          "source",
          "sourceEvidenceId",
          "providerObservationSha256",
          "coreObservationSha256",
          "evidenceSha256",
          "observedAt",
          "expiresAt",
          "meaning",
          "resourceHref"
        ],
        "type": "object"
      },
      "SidecarEvidenceSource": {
        "enum": [
          "initial_import_slice",
          "reconcile_unchanged",
          "reconcile_mirror",
          "two_way_settlement"
        ],
        "type": "string"
      },
      "SidecarFlowDirection": {
        "enum": [
          "provider_to_gitdown",
          "gitdown_to_provider",
          "matched"
        ],
        "type": "string"
      },
      "SidecarTrustState": {
        "enum": [
          "observed",
          "app_attested",
          "unavailable_retired"
        ],
        "type": "string"
      },
      "TargetDriftReasonResponse": {
        "enum": [
          "desiredWithoutAttribution",
          "unexpectedTarget"
        ],
        "type": "string"
      },
      "TwoWayAttemptKindResponse": {
        "enum": [
          "resolution",
          "retry",
          "safeResume"
        ],
        "type": "string"
      },
      "TwoWayAttemptStateResponse": {
        "enum": [
          "pending",
          "running",
          "succeeded",
          "retryableFailure",
          "outage"
        ],
        "type": "string"
      },
      "TwoWayAttemptSummaryResponse": {
        "additionalProperties": false,
        "properties": {
          "attemptId": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/TwoWayAttemptKindResponse"
          },
          "principalId": {
            "type": "string"
          },
          "principalKind": {
            "$ref": "#/components/schemas/TwoWayPrincipalKindResponse"
          },
          "resultCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "sequence": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "state": {
            "$ref": "#/components/schemas/TwoWayAttemptStateResponse"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "attemptId",
          "sequence",
          "kind",
          "state",
          "principalKind",
          "principalId",
          "resultCode",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "TwoWayDispositionKindRequest": {
        "enum": [
          "superseded",
          "intentionallyDropped",
          "externalArchive"
        ],
        "type": "string"
      },
      "TwoWayDispositionKindResponse": {
        "enum": [
          "superseded",
          "intentionallyDropped",
          "externalArchive"
        ],
        "type": "string"
      },
      "TwoWayDispositionRequest": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/TwoWayDispositionKindRequest"
          },
          "oid": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "oid",
          "kind",
          "reason"
        ],
        "type": "object"
      },
      "TwoWayDispositionResponse": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/TwoWayDispositionKindResponse"
          },
          "oid": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "oid",
          "kind",
          "reason"
        ],
        "type": "object"
      },
      "TwoWayPreservedTipListResponse": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/TwoWayPreservedTipResponse"
            },
            "type": "array"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "type": "object"
      },
      "TwoWayPreservedTipResponse": {
        "additionalProperties": false,
        "properties": {
          "anchorId": {
            "type": "string"
          },
          "anchorState": {
            "$ref": "#/components/schemas/TwoWayRepairAnchorStateResponse"
          },
          "oid": {
            "type": "string"
          },
          "origins": {
            "items": {
              "$ref": "#/components/schemas/TwoWayTipOriginResponse"
            },
            "type": "array"
          }
        },
        "required": [
          "anchorId",
          "oid",
          "origins",
          "anchorState"
        ],
        "type": "object"
      },
      "TwoWayPrincipalKindResponse": {
        "enum": [
          "human",
          "bot"
        ],
        "type": "string"
      },
      "TwoWayRepairAnchorStateResponse": {
        "enum": [
          "planned",
          "active",
          "removed"
        ],
        "type": "string"
      },
      "TwoWayResolutionChoiceRequest": {
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "presence": {
                "enum": [
                  "absent"
                ],
                "type": "string"
              }
            },
            "required": [
              "presence"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "oid": {
                "type": "string"
              },
              "presence": {
                "enum": [
                  "present"
                ],
                "type": "string"
              }
            },
            "required": [
              "oid",
              "presence"
            ],
            "type": "object"
          }
        ]
      },
      "TwoWayResolutionResponse": {
        "additionalProperties": false,
        "properties": {
          "attempt": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "attempts": {
            "items": {
              "$ref": "#/components/schemas/TwoWayAttemptSummaryResponse"
            },
            "type": "array"
          },
          "chosen": {
            "$ref": "#/components/schemas/RefObservationResponse"
          },
          "dispositions": {
            "items": {
              "$ref": "#/components/schemas/TwoWayDispositionResponse"
            },
            "type": "array"
          },
          "principalId": {
            "type": "string"
          },
          "principalKind": {
            "$ref": "#/components/schemas/TwoWayPrincipalKindResponse"
          },
          "resolutionId": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/TwoWayResolutionStateResponse"
          }
        },
        "required": [
          "resolutionId",
          "principalKind",
          "principalId",
          "chosen",
          "state",
          "attempt",
          "attempts",
          "dispositions"
        ],
        "type": "object"
      },
      "TwoWayResolutionStateResponse": {
        "enum": [
          "proposed",
          "graphVerified",
          "settled",
          "cleanupComplete"
        ],
        "type": "string"
      },
      "TwoWayTipOriginResponse": {
        "enum": [
          "checkpointGithub",
          "checkpointGitdown",
          "currentGithub",
          "currentGitdown"
        ],
        "type": "string"
      }
    },
    "securitySchemes": {
      "botBearer": {
        "bearerFormat": "Gitdown bot access token",
        "description": "Grant-bound Gitdown bot identity. Gitdown must return an exact, live repository-bound Sync capability decision.",
        "scheme": "bearer",
        "type": "http"
      },
      "syncOAuthBearer": {
        "bearerFormat": "Gitdown Sync OAuth access token",
        "description": "Sync-audience human OAuth identity. Gitdown must return an exact, live repository-bound Sync capability decision.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "External contract for Gitdown Sync. Twenty-seven product operations cover human-authorized GitHub installation lifecycle, backup connection creation, explicit two-way elevation and disconnect, repository-rooted observation, immutable commit-attestation detail, imports, ref checkpoints, incidents and normalized preserved-tip pages, proof-bound checkpoint recovery, resolution, retry, and safe resume. Connection creation remains backup-only and pending; bidirectional access requires its dedicated fresh-preflight human ceremony. /live and /ready operational probes remain outside this contract.",
    "title": "Gitdown Sync External API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/connections": {
      "post": {
        "operationId": "createConnection",
        "parameters": [
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "description": "Canonical ULID globally binding the human, source, target request, and resulting connection",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Strong ETag containing the observed positive provider-installation version",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConnectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionResponse"
                }
              }
            },
            "description": "Exact connection creation replay",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionResponse"
                }
              }
            },
            "description": "Backup-only pending connection and non-public Gitdown repository created with initial source validation durably queued",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid headers, body, source selection, or target slugs",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human lacks live installation/owner authority",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Installation version, idempotency, source binding, or target allocation conflict",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request body exceeds the bounded contract",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "A required Gitdown, GitHub, or Sync dependency is unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          }
        ],
        "tags": [
          "connections"
        ]
      }
    },
    "/v1/installations": {
      "post": {
        "operationId": "bindGithubInstallation",
        "parameters": [
          {
            "description": "Canonical authorization request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "description": "Canonical ULID retained as the Sync provider-installation identity on first binding",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BindGithubInstallationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderInstallationResponse"
                }
              }
            },
            "description": "Exact replay or reuse of the retained provider-installation binding",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderInstallationResponse"
                }
              }
            },
            "description": "GitHub App installation verified and bound with current Gitdown user authority",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid headers or body",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human lacks live installation authority",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Provider or installation binding conflicts with retained identity",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "A required Gitdown, GitHub, or Sync dependency is unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          }
        ],
        "tags": [
          "installations"
        ]
      }
    },
    "/v1/installations/{installationId}/github/reauthorize": {
      "post": {
        "operationId": "reauthorizeGithubInstallation",
        "parameters": [
          {
            "description": "Canonical Sync provider-installation ULID",
            "in": "path",
            "name": "installationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical authorization request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "description": "Strong ETag containing the observed positive provider-installation version",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical ULID binding this exact reauthorization request",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReauthorizeGithubInstallationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderInstallationResponse"
                }
              }
            },
            "description": "Exact GitHub installation identity live-verified and app-owned authorization state advanced",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid headers or numeric GitHub installation ID",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human lacks live credential-change authority",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Provider installation is absent",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Installation version, retained identity, authority, or idempotency prerequisite changed",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Request body exceeds the bounded contract",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "A required Gitdown, GitHub, or Sync dependency is unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          }
        ],
        "tags": [
          "installations"
        ]
      }
    },
    "/v1/installations/{installationId}/github/repositories/{providerRepositoryId}/preflight": {
      "post": {
        "operationId": "preflightGithubRepository",
        "parameters": [
          {
            "description": "Canonical Sync provider-installation ULID",
            "in": "path",
            "name": "installationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Positive GitHub numeric repository ID",
            "in": "path",
            "name": "providerRepositoryId",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Canonical authorization request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "description": "Strong ETag containing the observed positive provider-installation version",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GithubInstallationPreflightResponse"
                }
              }
            },
            "description": "Fresh human-authorized GitHub source eligibility observation; connection creation always revalidates it",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target or headers",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human lacks live installation authority",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Provider installation is absent",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Installation version or GitHub source prerequisite changed",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "A required Gitdown, GitHub, or Sync dependency is unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          }
        ],
        "tags": [
          "installations"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections": {
      "get": {
        "operationId": "listConnections",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size from 1 through 50; defaults to 20",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Opaque canonical connection ULID returned by the preceding page",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionListResponse"
                }
              }
            },
            "description": "Bounded page of repository-bound connections",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid repository, request ID, or page request",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:read authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "connections"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}": {
      "get": {
        "operationId": "getConnection",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionResponse"
                }
              }
            },
            "description": "Repository-bound connection detail",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target or request ID",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:read authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Connection absent or not bound to this repository",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "connections"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/commits/{commitOid}/attestations/{attestationId}": {
      "get": {
        "operationId": "getCommitSidecarAttestation",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Exact lowercase SHA-1 or SHA-256 commit object ID",
            "in": "path",
            "name": "commitOid",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Content-bound lowercase SHA-256 evidence identity",
            "in": "path",
            "name": "attestationId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SidecarAttestationResponse"
                }
              }
            },
            "description": "Authorized immutable Sync observation detail",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid exact binding or request ID",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:read authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Evidence absent, expired, or not bound to every route coordinate",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "attestations"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/disconnect": {
      "post": {
        "operationId": "disconnectConnection",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical authorization request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "description": "Strong ETag containing the observed positive connection version",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical ULID binding this exact disconnect request",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionResponse"
                }
              }
            },
            "description": "Exact disconnect replay",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionResponse"
                }
              }
            },
            "description": "Disconnect accepted or replayed; new synchronization activity is blocked",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target or headers",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human lacks live disconnect authority",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Connection or installation is absent",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Version, authority, state, or idempotency prerequisite changed",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "A required Gitdown or Sync dependency is unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          }
        ],
        "tags": [
          "connections"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/github/preflight": {
      "post": {
        "operationId": "preflightGithubConnection",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "description": "Strong ETag containing the observed positive connection version",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GithubPreflightResponse"
                }
              }
            },
            "description": "Current source limits and Gitdown target binding verified; no connection state changed",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target, request ID, or expected version",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:read authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Connection absent or not bound to this repository",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Connection, installation, source, or target prerequisite changed",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "A required Gitdown, GitHub, or Sync dependency is unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "connections"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/imports/{importId}": {
      "get": {
        "operationId": "getImport",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync import ULID",
            "in": "path",
            "name": "importId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportStatusResponse"
                }
              }
            },
            "description": "Bounded repository import status",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target or request ID",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "description": "Bearer authentication challenge",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:read authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Import absent or not bound to this repository and connection",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "imports"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/imports/{importId}/cancel": {
      "post": {
        "operationId": "cancelImport",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync import ULID",
            "in": "path",
            "name": "importId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "description": "Canonical ULID for this logical cancellation",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Strong ETag containing the observed positive import version",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportStatusResponse"
                }
              }
            },
            "description": "Import cancelled or exact cancellation replayed",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target, request ID, idempotency key, or expected version",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "description": "Bearer authentication challenge",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:resolve authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Import absent or not bound to this repository and connection",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportConflictEnvelope"
                }
              }
            },
            "description": "Idempotency conflict, stale version, or terminal import",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "imports"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/imports/{importId}/retry": {
      "post": {
        "operationId": "retryQuarantinedImport",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical quarantined Sync import ULID",
            "in": "path",
            "name": "importId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "description": "Canonical ULID binding this logical recovery authorization",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Strong ETag containing the observed quarantined import version",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportStatusResponse"
                }
              }
            },
            "description": "Exact successor authorization replayed",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportStatusResponse"
                }
              }
            },
            "description": "Successor InitialImport accepted",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target, request ID, idempotency key, or expected version",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human lacks exact repository recovery authority",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Import absent or not bound to this repository and connection",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportConflictEnvelope"
                }
              }
            },
            "description": "Idempotency conflict, stale version, or ineligible quarantine",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          }
        ],
        "tags": [
          "imports"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/incidents": {
      "get": {
        "operationId": "listIncidents",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size from 1 through 50; defaults to 20",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Opaque canonical incident ULID returned by the preceding page",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentListResponse"
                }
              }
            },
            "description": "Bounded page of repository-bound incidents",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target, request ID, or page request",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:read authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Connection absent or not bound to this repository",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "incidents"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/incidents/{incidentId}": {
      "get": {
        "operationId": "getIncident",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical incident ULID",
            "in": "path",
            "name": "incidentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentResponse"
                }
              }
            },
            "description": "Repository-bound incident",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target or request ID",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:read authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Incident absent or not bound to this repository and connection",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "incidents"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/incidents/{incidentId}/acknowledge": {
      "get": {
        "operationId": "getIncidentAcknowledgment",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical incident ULID",
            "in": "path",
            "name": "incidentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentAcknowledgmentStatusResponse"
                }
              }
            },
            "description": "Caller-specific personal acknowledgment state",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target or request ID",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:read authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Incident absent or not bound to this repository and connection",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "incidents"
        ]
      },
      "post": {
        "operationId": "acknowledgeIncident",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical incident ULID",
            "in": "path",
            "name": "incidentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "description": "Canonical ULID for this logical personal acknowledgment",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Strong ETag containing the observed positive incident version",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentAcknowledgmentResponse"
                }
              }
            },
            "description": "Personal acknowledgment recorded, replayed, or already present",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target, request ID, idempotency key, or expected version",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:acknowledge authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Incident absent or not bound to this repository and connection",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Idempotency conflict or stale incident version",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "incidents"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/incidents/{incidentId}/attempts": {
      "get": {
        "operationId": "listIncidentAttempts",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical incident ULID",
            "in": "path",
            "name": "incidentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentAttemptListResponse"
                }
              }
            },
            "description": "Lifetime two-way attempt history in sequence order",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target or request ID",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:read authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Incident absent, not bound to this repository, or has no two-way attempt history",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "incidents"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/incidents/{incidentId}/attempts/{attemptId}": {
      "get": {
        "operationId": "getIncidentAttempt",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical incident ULID",
            "in": "path",
            "name": "incidentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical attempt ULID",
            "in": "path",
            "name": "attemptId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentAttemptResponse"
                }
              }
            },
            "description": "One lifetime two-way attempt",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target or request ID",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:read authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Attempt absent or not bound to this repository, connection, and incident",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "incidents"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/incidents/{incidentId}/recover-checkpoint": {
      "post": {
        "operationId": "recoverCheckpointQuarantine",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical checkpoint-corruption incident ULID",
            "in": "path",
            "name": "incidentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "description": "Canonical ULID for this logical recovery authorization",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Strong ETag containing the observed positive incident version",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentResponse"
                }
              }
            },
            "description": "Corrupt checkpoint retired behind lifetime evidence and a fresh observation generation scheduled",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target, request ID, idempotency key, or expected version",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human lacks exact sync:resolve authority",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Incident absent or not bound to this repository and connection",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentConflictEnvelope"
                }
              }
            },
            "description": "Idempotency conflict, stale graph, or ineligible quarantine",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          }
        ],
        "tags": [
          "incidents"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/incidents/{incidentId}/resolution": {
      "post": {
        "operationId": "resolveTwoWayIncident",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical two-way incident ULID",
            "in": "path",
            "name": "incidentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "description": "Canonical ULID for this logical resolution intent",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Strong ETag containing the observed positive incident version",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveTwoWayIncidentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentResponse"
                }
              }
            },
            "description": "Resolution intent accepted or replayed; completion remains pending graph validation",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target, request, idempotency key, expected version, or OID",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:resolve authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Incident absent or not bound to this repository and connection",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentConflictEnvelope"
                }
              }
            },
            "description": "Idempotency conflict, stale version, or ineligible resolution",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "incidents"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/incidents/{incidentId}/resume": {
      "post": {
        "operationId": "resumeTwoWayIncident",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical two-way incident ULID",
            "in": "path",
            "name": "incidentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "description": "Canonical ULID for this logical safe resume",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Strong ETag containing the observed positive incident version",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentResponse"
                }
              }
            },
            "description": "Graph-proven incident safely resumed or replayed",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target, request ID, idempotency key, or expected version",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:resolve authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Incident or checkpoint absent or not bound to this repository and connection",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentConflictEnvelope"
                }
              }
            },
            "description": "Idempotency conflict, stale version, or graph settlement not complete",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "incidents"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/incidents/{incidentId}/retry": {
      "post": {
        "operationId": "retryTwoWayIncident",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical two-way incident ULID",
            "in": "path",
            "name": "incidentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "description": "Canonical ULID for this logical retry",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Strong ETag containing the observed positive incident version",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentResponse"
                }
              }
            },
            "description": "Retry attempt durably enqueued or replayed",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target, request ID, idempotency key, or expected version",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:retry authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Incident absent or not bound to this repository and connection",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentConflictEnvelope"
                }
              }
            },
            "description": "Idempotency conflict, stale version, or no retryable attempt",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "incidents"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/incidents/{incidentId}/tips": {
      "get": {
        "operationId": "listIncidentPreservedTips",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical incident ULID",
            "in": "path",
            "name": "incidentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size from 1 through 50; defaults to 20",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Opaque canonical repair-anchor ULID returned by the preceding page",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TwoWayPreservedTipListResponse"
                }
              }
            },
            "description": "Bounded page of normalized preserved tips",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target, request ID, or page request",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:read authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Incident absent or not bound to this repository and connection",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "incidents"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/refs": {
      "get": {
        "operationId": "listRefs",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size from 1 through 50; defaults to 20",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Opaque canonical checkpoint ULID returned by the preceding page",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefListResponse"
                }
              }
            },
            "description": "Bounded page of repository-bound ref checkpoints",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target, request ID, or page request",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:read authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Connection absent or not bound to this repository",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "refs"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/refs/{checkpointId}": {
      "get": {
        "operationId": "getRef",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical ref checkpoint ULID",
            "in": "path",
            "name": "checkpointId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefResponse"
                }
              }
            },
            "description": "Repository-bound ref checkpoint",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target or request ID",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:read authorization denied",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Ref absent or not bound to this repository and connection",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "refs"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/status": {
      "get": {
        "operationId": "getConnectionStatus",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionStatusResponse"
                }
              }
            },
            "description": "Narrow repository-bound connection status",
            "headers": {
              "X-Request-Id": {
                "description": "Effective canonical request ULID",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target or request ID",
            "headers": {
              "X-Request-Id": {
                "description": "Effective canonical request ULID",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "description": "Bearer authentication challenge",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "Effective canonical request ULID",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Exact sync:read authorization denied",
            "headers": {
              "X-Request-Id": {
                "description": "Effective canonical request ULID",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Connection absent or not bound to this repository",
            "headers": {
              "X-Request-Id": {
                "description": "Effective canonical request ULID",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Authorization or Sync service unavailable",
            "headers": {
              "X-Request-Id": {
                "description": "Effective canonical request ULID",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          },
          {
            "botBearer": []
          }
        ],
        "tags": [
          "connection status"
        ]
      }
    },
    "/v1/repositories/{repositoryId}/connections/{connectionId}/two-way/enable": {
      "post": {
        "operationId": "enableTwoWayConnection",
        "parameters": [
          {
            "description": "Canonical Gitdown repository ULID",
            "in": "path",
            "name": "repositoryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical Sync connection ULID",
            "in": "path",
            "name": "connectionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical authorization request ULID; generated when absent",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "description": "Strong ETag containing the observed positive Backup connection version",
            "in": "header",
            "name": "If-Match",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Canonical ULID binding this exact elevation request",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionResponse"
                }
              }
            },
            "description": "Backup connection changed to two-way after current GitHub, Gitdown target, and user permission checks",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Invalid target or headers",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human bearer token rejected",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Human lacks live elevated-access authority",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Connection or installation is absent",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "Version, mode, installation, source, target, or idempotency prerequisite changed",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            },
            "description": "A required Gitdown, GitHub, or Sync dependency is unavailable",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "syncOAuthBearer": []
          }
        ],
        "tags": [
          "connections"
        ]
      }
    }
  },
  "x-gitdown-error-codes": [
    "AUTHENTICATION_REQUIRED",
    "AUTHORIZATION_DENIED",
    "AUTHORIZATION_REQUEST_INVALID",
    "AUTHORIZATION_UNAVAILABLE",
    "CONTENT_TYPE_INVALID",
    "CORE_GRANT_CONFLICT",
    "CORE_RESPONSE_INVALID",
    "CORE_UNAVAILABLE",
    "DISCONNECT_CONFLICT",
    "ENCODING_UNAVAILABLE",
    "EXPECTED_VERSION_INVALID",
    "GITHUB_PREFLIGHT_FAILED",
    "GITHUB_RESPONSE_INVALID",
    "GITHUB_UNAVAILABLE",
    "IDEMPOTENCY_KEY_INVALID",
    "IDEMPOTENCY_KEY_REUSED",
    "IMPORT_NOT_CANCELLABLE",
    "INSTALLATION_AUTHORITY_CHANGED",
    "INSTALLATION_BINDING_CONFLICT",
    "INSTALLATION_INACTIVE",
    "INSTALLATION_VERSION_CONFLICT",
    "PAGE_INVALID",
    "PROVIDER_IDENTITY_CHANGED",
    "REQUEST_ID_INVALID",
    "REQUEST_INVALID",
    "REQUEST_TOO_LARGE",
    "RECOVERY_INELIGIBLE",
    "RESOURCE_NOT_FOUND",
    "RESPONSE_INVALID",
    "STORE_INCOHERENT",
    "STORE_UNAVAILABLE",
    "SOURCE_ALREADY_CONNECTED",
    "SOURCE_CONNECTION_ALREADY_BOUND",
    "TARGET_INVALID",
    "TARGET_REPOSITORY_CAP_REACHED",
    "TARGET_SLUG_TAKEN",
    "TWO_WAY_ENABLE_CONFLICT",
    "TOKEN_REJECTED",
    "VERSION_CONFLICT"
  ]
}
