Yetkili 1D API sözleşmesi

JavaScript gerektirmeyen tam belge. Kaynak JSON. Bu görünüm API çağrısı veya dağıtım çalıştırmaz.

Kaynak SHA-256: 606b9a4723c8cdbfcfb5077d29c499523820532813f522747be3221d8b293e23

{
  "openapi": "3.1.0",
  "info": {
    "title": "GGMES 1D HTTP and RPC with bounded persisted resume",
    "version": "5.0.0",
    "description": "v3 şemaları korunur; importWorkspace nesne veya JSON string biçiminde eklenir. Kanonik istemci istekleri tanımlıdır; sunucu bazı ek alanları/argümanları yok sayabilir. Şema yetki veya anahtar sağlamaz. x-maxUtf8Bytes/x-maxUtf16CodeUnits/x-maxSerializedUtf8Bytes/x-encodedJsonSchema/x-normalization/x-uniqueBy standart doğrulamanın dışında açık çalışma zamanı kısıtlarıdır. Genel sunucu API envanteri değildir. v5 GET /v1/resume ekler; v4 path/schema sözleşmeleri korunur. HTTP keşfi capabilities.httpEndpoints alanındadır; RPC yöntem adı değildir."
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/capabilities": {
      "get": {
        "operationId": "readCapabilities",
        "description": "Tam yol eşleşir; query eklemek 404 üretir. Sunucunun methods listesi bu belgenin dışındaki yazma yeteneklerini de bildirir.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Origin"
          }
        ],
        "responses": {
          "200": {
            "description": "Kimlik ve gerçek sunucu limitleri.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CapabilitiesResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Origin"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/files": {
      "get": {
        "operationId": "listFiles",
        "description": "Yola göre sıralı metadata. Bilinmeyen/tekrarlı query 400 QUERY, text format 400 FORMAT. İçerik dönmez.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Origin"
          },
          {
            "$ref": "#/components/parameters/Validator"
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "json"
              ],
              "default": "json"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dosya metadata dizisi.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Origin"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "result"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "result": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Metadata"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "304": {
            "description": "Yetki doğrulaması sonrası temsil eşleşmesi; gövde yok.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Origin"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/file": {
      "get": {
        "operationId": "readFile",
        "description": "Aralık parametresi yoksa tam dosya. Biri varsa en çok 200 satır: end-start < 200; start varsayılan 1, end varsayılan min(totalLines,start+199), sonuç EOF'a kırpılır. Start dosya içinde olmalıdır. Satırlar kanonik pozitif güvenli tamsayıdır; baştaki sıfır kabul edilmez. Yinelenen/bilinmeyen query 400 QUERY. Hatalı aralık 400 RANGE. Kaynak bulunmazsa 404 NOT_FOUND.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Origin"
          },
          {
            "$ref": "#/components/parameters/Validator"
          },
          {
            "name": "path",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Path"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "text"
              ],
              "default": "json"
            }
          },
          {
            "name": "startLine",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Positive"
            }
          },
          {
            "name": "endLine",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Positive"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tam dosya veya aralık; JSON ya da ham UTF-8 text.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Content-SHA256": {
                "$ref": "#/components/headers/Digest"
              },
              "X-Revision": {
                "$ref": "#/components/headers/Revision"
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Origin"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "result"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "result": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/File"
                        },
                        {
                          "$ref": "#/components/schemas/Range"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "Temsil eşleşti; gövde yok. Kimlik doğrulaması ve güncel veri okuması önce yapılır.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "X-Content-SHA256": {
                "$ref": "#/components/headers/Digest"
              },
              "X-Revision": {
                "$ref": "#/components/headers/Revision"
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Origin"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/rpc": {
      "post": {
        "operationId": "rpcReadFileTaskAndImport",
        "description": "ReadRpc okuma, write/patch/restore dosya mutasyonları ve altı task mutasyonu. importWorkspace yalnız yeni yollara atomik ekleme yapar; nesne veya JSON string arşiv kabul eder. Boş files geçerlidir, expectedRevision kullanılmaz. Çakışma tüm işlemi reddeder. Tüm mutasyonlarda write rolü ve idempotencyKey zorunlu. TaskCreate dışındaki görev mutasyonları pozitif expectedRevision CAS ister. taskClaim dışındaki sahiplik işlemleri aktif ve aynı actor lease ister. CAS/lease kontrolü ve persist atomiktir; başarısız istekte değişiklik kaydedilmez. Süre bitişi sunucu saatine göre hesaplanır; kendiliğinden open durumuna geçiş veya zamanlayıcı yazması yoktur. Görevler dosya cursor akışını artırmaz, dosya yazma kilidi değildir. Görev yanıtı tam Task nesnesidir; dosya makbuzu yalnız write/patch/restore yanıtlarında bulunur. Gövde en fazla 1 MiB; search/changes kanonik argümanları tanımlıdır.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Origin"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RpcSubset"
              },
              "examples": {
                "create": {
                  "summary": "Sıralı yerel fixture örneği; proof.md r1 önceden mevcut olmalı.",
                  "value": {
                    "method": "taskCreate",
                    "args": [
                      {
                        "id": "example-task",
                        "title": "Örnek görev",
                        "goal": "Kanıt dosyasını doğrula"
                      }
                    ],
                    "idempotencyKey": "task-example-0001"
                  }
                },
                "claim": {
                  "summary": "Sıralı yerel fixture örneği; proof.md r1 önceden mevcut olmalı.",
                  "value": {
                    "method": "taskClaim",
                    "args": [
                      "example-task",
                      {
                        "expectedRevision": 1,
                        "leaseSeconds": 300
                      }
                    ],
                    "idempotencyKey": "task-example-0002"
                  }
                },
                "renew": {
                  "summary": "Sıralı yerel fixture örneği; proof.md r1 önceden mevcut olmalı.",
                  "value": {
                    "method": "taskRenew",
                    "args": [
                      "example-task",
                      {
                        "expectedRevision": 2,
                        "leaseSeconds": 600
                      }
                    ],
                    "idempotencyKey": "task-example-0003"
                  }
                },
                "update": {
                  "summary": "Sıralı yerel fixture örneği; proof.md r1 önceden mevcut olmalı.",
                  "value": {
                    "method": "taskUpdate",
                    "args": [
                      "example-task",
                      {
                        "expectedRevision": 3,
                        "note": "Kontrol edildi",
                        "nextStep": "Kanıtla tamamla",
                        "evidence": {
                          "path": "proof.md",
                          "revision": 1
                        }
                      }
                    ],
                    "idempotencyKey": "task-example-0004"
                  }
                },
                "release": {
                  "summary": "Sıralı yerel fixture örneği; proof.md r1 önceden mevcut olmalı.",
                  "value": {
                    "method": "taskRelease",
                    "args": [
                      "example-task",
                      {
                        "expectedRevision": 4
                      }
                    ],
                    "idempotencyKey": "task-example-0005"
                  }
                },
                "reclaim": {
                  "summary": "Sıralı yerel fixture örneği; proof.md r1 önceden mevcut olmalı.",
                  "value": {
                    "method": "taskClaim",
                    "args": [
                      "example-task",
                      {
                        "expectedRevision": 5,
                        "leaseSeconds": 300
                      }
                    ],
                    "idempotencyKey": "task-example-0006"
                  }
                },
                "complete": {
                  "summary": "Sıralı yerel fixture örneği; proof.md r1 önceden mevcut olmalı.",
                  "value": {
                    "method": "taskComplete",
                    "args": [
                      "example-task",
                      {
                        "expectedRevision": 6,
                        "evidence": {
                          "path": "proof.md",
                          "revision": 1
                        }
                      }
                    ],
                    "idempotencyKey": "task-example-0007"
                  }
                },
                "importObject": {
                  "summary": "Yerel fixture örneği; her yol çalışma alanında yeni olmalıdır.",
                  "value": {
                    "method": "importWorkspace",
                    "args": [
                      {
                        "format": "ggmes-1d",
                        "version": 1,
                        "files": [
                          {
                            "path": "import/example.md",
                            "content": "# Örnek 🌍"
                          }
                        ]
                      }
                    ],
                    "idempotencyKey": "import-example-object"
                  }
                },
                "importString": {
                  "summary": "Yerel fixture örneği; her yol çalışma alanında yeni olmalıdır.",
                  "value": {
                    "method": "importWorkspace",
                    "args": [
                      "{\"format\":\"ggmes-1d\",\"version\":1,\"files\":[{\"path\":\"import/string.md\",\"content\":\"Metin biçimi\"}]}"
                    ],
                    "idempotencyKey": "import-example-string"
                  }
                },
                "importEmpty": {
                  "summary": "Yerel fixture örneği; her yol çalışma alanında yeni olmalıdır.",
                  "value": {
                    "method": "importWorkspace",
                    "args": [
                      {
                        "format": "ggmes-1d",
                        "version": 1,
                        "files": []
                      }
                    ],
                    "idempotencyKey": "import-example-empty"
                  }
                }
              }
            }
          },
          "x-maxUtf8Bytes": 1048576
        },
        "responses": {
          "200": {
            "description": "Okuma metoduna göre önceki sonuçlar; write/patch/restore tam File ve varsa receipt; altı task mutasyonu tam Task. İdempotent tekrar özgün yanıtı döndürür; eski dosya replay yanıtları receipt içermeyebilir. importWorkspace: imported/paths/cursor; receipt yoktur.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "result"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "result": {
                      "oneOf": [
                        {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/TaskSummary"
                          }
                        },
                        {
                          "$ref": "#/components/schemas/Task"
                        },
                        {
                          "$ref": "#/components/schemas/Search"
                        },
                        {
                          "$ref": "#/components/schemas/Changes"
                        },
                        {
                          "$ref": "#/components/schemas/File"
                        },
                        {
                          "$ref": "#/components/schemas/ImportResult"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Origin"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "description": "CONFLICT: stale expectedRevision veya store CAS çakışması. MATCH: patch oldText sıfır/çok eşleşme. IDEMPOTENCY_CONFLICT: aynı actor/key farklı method/args. Otomatik yeni anahtarla tekrar yok; güncel kayıtla uzlaştırın. Görevlerde CONFLICT, REVISION_LIMIT, TASK_COMPLETED, TASK_OWNED, TASK_LEASE, TASK_EVIDENCE. Kanıt dosyası güncel sürümü eşleşmelidir. Importta yinelenen veya mevcut yol CONFLICT; tüm import atomik reddedilir.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/resume": {
      "get": {
        "operationId": "readServerResume",
        "description": "Yetkili workspace için kuyruk içinde tek store.load/persisted state üzerinden metadata. Query kabul edilmez; bilinmeyen/yinelenen her parametre400 QUERY. Read rolü izinli; kimlik doğrulama kuyruk ve depo okumasından önce. İstemci tarafı non-atomic capture ile farklıdır. Zaman damgası/pending iş sayısı icat edilmez; cursor dosya olayları içindir, görevlerin bağımsız revision değeri vardır. Cache-Control:no-store; ETag/304 sunulmaz. Capabilities.httpEndpoints içinde GET /v1/resume,maxResponseBytes:2048 duyurulur; RPC methods listesine eklenmez ve POST /v1/rpc resume yöntemi yoktur.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Origin"
          }
        ],
        "responses": {
          "200": {
            "description": "Tek kalıcı durumdan sınırlandırılmış özet; yetki/yedek değildir.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Origin"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerResumeResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Sunucuda yapılandırılmış çalışma alanı kimliği. Varsayılan kimlik yok. Anahtar URL'ye yazılmaz."
      }
    },
    "parameters": {
      "Origin": {
        "name": "Origin",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "description": "İsteğe bağlı; verilirse yapılandırılmış origin ile birebir eşleşmeli, aksi halde 403 ORIGIN. Eşleşirse Access-Control-Allow-Origin ve Access-Control-Expose-Headers: ETag, X-Content-SHA256, X-Revision döner."
      },
      "Validator": {
        "name": "If-None-Match",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "description": "ETag, W/ETag, virgülle ayrılmış liste veya *. Güncel temsil eşleşirse 304. Kimlik doğrulaması önce yapılır."
      }
    },
    "headers": {
      "ETag": {
        "schema": {
          "type": "string",
          "pattern": "^\"[a-f0-9]{64}\"$"
        },
        "description": "Çalışma alanı, format, aralık, sürüm ve temsile bağlı SHA-256 tabanlı değer."
      },
      "Digest": {
        "schema": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "description": "Aralıkta da TAM kaynak içeriğinin SHA-256 özeti."
      },
      "Revision": {
        "schema": {
          "type": "string",
          "pattern": "^[1-9][0-9]*$"
        }
      }
    },
    "responses": {
      "Error": {
        "description": "400: QUERY/FORMAT/PATH/RANGE/JSON/REQUEST/METHOD/TASK_ID/TASK_ARGS/LIMIT/CURSOR. 401: AUTH_MISSING/AUTH_INVALID (304 öncesi). 403: ORIGIN. 404: NOT_FOUND. 413: BODY_LIMIT. 415: CONTENT_TYPE. 429: QUEUE_LIMIT (workspace 32/global 128). 500: INTERNAL; özel hata ayrıntıları bastırılır. Yanıtlar Cache-Control:no-store, X-Content-Type-Options:nosniff, Vary:Origin içerir. Dosya mutasyonları: 400 REVISION/IDEMPOTENCY/PATCH/CONTENT/CAPACITY; 403 FORBIDDEN; 404 REVISION_GONE; 409 CONFLICT/MATCH/IDEMPOTENCY_CONFLICT. Görevlerde 400 TASK_ID/TASK_CONTENT/TASK_ARGS/TASK_LEASE_SECONDS/TASK_EVIDENCE/REVISION/CAPACITY; 404 NOT_FOUND; 409 REVISION_LIMIT/TASK_COMPLETED/TASK_OWNED/TASK_LEASE/TASK_EVIDENCE/CONFLICT. Importta iç JSON/arşiv formatı/dosya sayısı>32:400 IMPORT; yol:400 PATH; içerik:400 CONTENT; mevcutlarla toplam dosya/byte kotası:400 CAPACITY; çakışma:409 CONFLICT; dış gövde>1MiB:413 BODY_LIMIT; bozuk dış JSON:400 JSON.",
        "headers": {
          "Cache-Control": {
            "schema": {
              "const": "no-store"
            }
          },
          "X-Content-Type-Options": {
            "schema": {
              "const": "nosniff"
            }
          },
          "Vary": {
            "schema": {
              "const": "Origin"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Positive": {
        "type": "integer",
        "minimum": 1,
        "maximum": 9007199254740991
      },
      "Cursor": {
        "type": "integer",
        "minimum": 0,
        "maximum": 9007199254740991
      },
      "Path": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128,
        "description": "NFC, trim edilmiş; / ile ayrılan boş olmayan parçalar, . ve .. yok. Ters bölü, kontrol/DEL ve <>:\"|?* yasak. Sunucu filename() doğrular. Sunucu uzunluğu UTF-16 code unit ile ölçer; maxLength yalnız üst kod noktası sınırıdır.",
        "pattern": "^(?!\\s)(?!.*\\s$)(?!.*[\\\\<>:\"|?*\\u0000-\\u001f\\u007f])(?!(?:.*\\/)?\\.{1,2}(?:\\/|$))[^/]+(?:/[^/]+)*$",
        "x-maxUtf16CodeUnits": 128
      },
      "TaskId": {
        "type": "string",
        "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$",
        "not": {
          "enum": [
            "constructor",
            "prototype",
            "__proto__"
          ]
        }
      },
      "Metadata": {
        "type": "object",
        "required": [
          "path",
          "revision",
          "bytes",
          "actor",
          "updatedAt",
          "savedAt"
        ],
        "properties": {
          "path": {
            "$ref": "#/components/schemas/Path"
          },
          "revision": {
            "$ref": "#/components/schemas/Positive"
          },
          "bytes": {
            "$ref": "#/components/schemas/Cursor"
          },
          "actor": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "savedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "File": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Metadata"
          },
          {
            "type": "object",
            "required": [
              "content"
            ],
            "properties": {
              "content": {
                "type": "string"
              },
              "receipt": {
                "$ref": "#/components/schemas/Receipt"
              }
            },
            "not": {
              "required": [
                "startLine"
              ]
            }
          }
        ]
      },
      "Range": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Metadata"
          },
          {
            "type": "object",
            "required": [
              "content",
              "startLine",
              "endLine",
              "totalLines"
            ],
            "properties": {
              "content": {
                "type": "string"
              },
              "startLine": {
                "$ref": "#/components/schemas/Positive"
              },
              "endLine": {
                "$ref": "#/components/schemas/Positive"
              },
              "totalLines": {
                "$ref": "#/components/schemas/Positive"
              }
            }
          }
        ]
      },
      "Error": {
        "type": "object",
        "required": [
          "ok",
          "error"
        ],
        "properties": {
          "ok": {
            "const": false
          },
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "TaskSummary": {
        "type": "object",
        "required": [
          "id",
          "title",
          "status",
          "revision",
          "owner",
          "leaseExpiresAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/TaskId"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "enum": [
              "open",
              "claimed",
              "completed"
            ]
          },
          "revision": {
            "$ref": "#/components/schemas/Positive"
          },
          "owner": {
            "type": [
              "string",
              "null"
            ]
          },
          "leaseExpiresAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Task": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TaskSummary"
          },
          {
            "type": "object",
            "required": [
              "goal",
              "note",
              "nextStep",
              "evidence",
              "createdAt",
              "actor"
            ],
            "properties": {
              "goal": {
                "type": "string"
              },
              "note": {
                "type": "string"
              },
              "nextStep": {
                "type": "string"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "actor": {
                "type": "string"
              },
              "evidence": {
                "anyOf": [
                  {
                    "type": "null"
                  },
                  {
                    "type": "object",
                    "required": [
                      "path",
                      "revision",
                      "sha256",
                      "verifiedAt"
                    ],
                    "properties": {
                      "path": {
                        "$ref": "#/components/schemas/Path"
                      },
                      "revision": {
                        "$ref": "#/components/schemas/Positive"
                      },
                      "sha256": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "verifiedAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                ]
              }
            }
          }
        ]
      },
      "Search": {
        "type": "object",
        "required": [
          "query",
          "matches",
          "truncated"
        ],
        "properties": {
          "query": {
            "type": "string"
          },
          "truncated": {
            "type": "boolean"
          },
          "matches": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "object",
              "required": [
                "path",
                "revision",
                "line",
                "text"
              ],
              "properties": {
                "path": {
                  "$ref": "#/components/schemas/Path"
                },
                "revision": {
                  "$ref": "#/components/schemas/Positive"
                },
                "line": {
                  "$ref": "#/components/schemas/Positive"
                },
                "text": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Changes": {
        "type": "object",
        "required": [
          "cursor",
          "gap",
          "changes"
        ],
        "properties": {
          "cursor": {
            "$ref": "#/components/schemas/Cursor"
          },
          "gap": {
            "type": "boolean"
          },
          "changes": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Metadata"
                },
                {
                  "type": "object",
                  "required": [
                    "cursor",
                    "operation"
                  ],
                  "properties": {
                    "cursor": {
                      "$ref": "#/components/schemas/Positive"
                    },
                    "operation": {
                      "enum": [
                        "write",
                        "patch",
                        "restore"
                      ]
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "CapabilitiesResponse": {
        "type": "object",
        "required": [
          "ok",
          "result"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "result": {
            "type": "object",
            "required": [
              "version",
              "workspace",
              "actor",
              "role",
              "methods",
              "taskLimits",
              "limits",
              "shared",
              "execution",
              "idempotencyWindow"
            ],
            "properties": {
              "version": {
                "const": 1
              },
              "workspace": {
                "type": "string"
              },
              "actor": {
                "type": "string"
              },
              "role": {
                "enum": [
                  "read",
                  "write"
                ]
              },
              "methods": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "taskLimits": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/Positive"
                }
              },
              "limits": {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/Positive"
                }
              },
              "shared": {
                "const": true
              },
              "execution": {
                "const": false
              },
              "idempotencyWindow": {
                "type": "object",
                "required": [
                  "requests",
                  "bytes"
                ],
                "properties": {
                  "requests": {
                    "$ref": "#/components/schemas/Positive"
                  },
                  "bytes": {
                    "$ref": "#/components/schemas/Positive"
                  }
                }
              }
            }
          }
        }
      },
      "ReadRpc": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "method",
              "args"
            ],
            "properties": {
              "method": {
                "const": "taskList"
              },
              "args": {
                "type": "array",
                "maxItems": 0,
                "items": false
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "method",
              "args"
            ],
            "properties": {
              "method": {
                "const": "taskRead"
              },
              "args": {
                "type": "array",
                "minItems": 1,
                "maxItems": 1,
                "prefixItems": [
                  {
                    "$ref": "#/components/schemas/TaskId"
                  }
                ],
                "items": false
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "method",
              "args"
            ],
            "properties": {
              "method": {
                "const": "search"
              },
              "args": {
                "type": "array",
                "minItems": 1,
                "maxItems": 2,
                "prefixItems": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  {
                    "type": "object",
                    "properties": {
                      "limit": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 200
                      }
                    },
                    "additionalProperties": false
                  }
                ],
                "items": false
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "method",
              "args"
            ],
            "properties": {
              "method": {
                "const": "changes"
              },
              "args": {
                "type": "array",
                "maxItems": 1,
                "prefixItems": [
                  {
                    "$ref": "#/components/schemas/Cursor"
                  }
                ],
                "items": false
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Content": {
        "type": "string",
        "x-maxUtf8Bytes": 262144,
        "description": "En fazla 262144 UTF-8 bayt. Karakter/kod noktası sayısı değildir; boş içerik geçerlidir."
      },
      "IdempotencyKey": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_-]{8,128}$",
        "description": "Workspace içindeki actor + key kapsamı. Aynı method/args fingerprint tekrarında özgün sonuç döner; farklı gövdede 409 IDEMPOTENCY_CONFLICT. Tam aynı method/args JSON temsili korunmalı; nesne alan sırası fingerprinti etkiler. Sonuç belirsizse geri okuyun; tekrar gerekiyorsa aynı gövde/anahtar. Saklama penceresi en fazla 512 istek veya 8388608 bayt; sonsuz garanti değildir."
      },
      "WriteOptions": {
        "type": "object",
        "required": [
          "expectedRevision"
        ],
        "properties": {
          "expectedRevision": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Positive"
              }
            ],
            "description": "Yeni dosya null; mevcut dosya güncel pozitif sürüm. Eksik 400 REVISION; uyuşmazlık 409 CONFLICT. HTTP If-Match kullanılmaz."
          }
        },
        "additionalProperties": false
      },
      "ExistingOptions": {
        "type": "object",
        "required": [
          "expectedRevision"
        ],
        "properties": {
          "expectedRevision": {
            "$ref": "#/components/schemas/Positive"
          }
        },
        "additionalProperties": false
      },
      "PatchEdit": {
        "type": "object",
        "required": [
          "oldText",
          "newText"
        ],
        "properties": {
          "oldText": {
            "type": "string",
            "minLength": 1
          },
          "newText": {
            "$ref": "#/components/schemas/Content"
          }
        },
        "additionalProperties": false
      },
      "WriteRequest": {
        "type": "object",
        "required": [
          "method",
          "args",
          "idempotencyKey"
        ],
        "properties": {
          "method": {
            "const": "write"
          },
          "args": {
            "type": "array",
            "minItems": 3,
            "maxItems": 3,
            "prefixItems": [
              {
                "$ref": "#/components/schemas/Path"
              },
              {
                "$ref": "#/components/schemas/Content"
              },
              {
                "$ref": "#/components/schemas/WriteOptions"
              }
            ],
            "items": false
          },
          "idempotencyKey": {
            "$ref": "#/components/schemas/IdempotencyKey"
          }
        },
        "additionalProperties": false
      },
      "PatchRequest": {
        "type": "object",
        "required": [
          "method",
          "args",
          "idempotencyKey"
        ],
        "properties": {
          "method": {
            "const": "patch"
          },
          "args": {
            "type": "array",
            "minItems": 3,
            "maxItems": 3,
            "prefixItems": [
              {
                "$ref": "#/components/schemas/Path"
              },
              {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "items": {
                  "$ref": "#/components/schemas/PatchEdit"
                },
                "description": "Düzenlemeler sırayla uygulanır; oldText mevcut ara içerikte tam bir kez bulunmalı. Sıfır/çok eşleşme 409 MATCH. Her ara içerik UTF-8 sınırını karşılamalı. Bir adım başarısızsa tüm istek atomik olarak reddedilir."
              },
              {
                "$ref": "#/components/schemas/ExistingOptions"
              }
            ],
            "items": false
          },
          "idempotencyKey": {
            "$ref": "#/components/schemas/IdempotencyKey"
          }
        },
        "additionalProperties": false
      },
      "RestoreRequest": {
        "type": "object",
        "required": [
          "method",
          "args",
          "idempotencyKey"
        ],
        "properties": {
          "method": {
            "const": "restore"
          },
          "args": {
            "type": "array",
            "minItems": 3,
            "maxItems": 3,
            "prefixItems": [
              {
                "$ref": "#/components/schemas/Path"
              },
              {
                "$ref": "#/components/schemas/Positive"
              },
              {
                "$ref": "#/components/schemas/ExistingOptions"
              }
            ],
            "items": false
          },
          "idempotencyKey": {
            "$ref": "#/components/schemas/IdempotencyKey"
          }
        },
        "additionalProperties": false,
        "description": "İkinci argüman tutulmuş geçmiş sürümüdür. Bu içerikten yeni güncel sürüm oluşturulur; eski sürüme geri numaralandırma yapılmaz. Geçmişte yoksa 404 REVISION_GONE. expectedRevision güncel sürümü korur."
      },
      "RpcSubset": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ReadRpc"
          },
          {
            "$ref": "#/components/schemas/WriteRequest"
          },
          {
            "$ref": "#/components/schemas/PatchRequest"
          },
          {
            "$ref": "#/components/schemas/RestoreRequest"
          },
          {
            "$ref": "#/components/schemas/TaskCreateRequest"
          },
          {
            "$ref": "#/components/schemas/TaskClaimRequest"
          },
          {
            "$ref": "#/components/schemas/TaskRenewRequest"
          },
          {
            "$ref": "#/components/schemas/TaskUpdateRequest"
          },
          {
            "$ref": "#/components/schemas/TaskReleaseRequest"
          },
          {
            "$ref": "#/components/schemas/TaskCompleteRequest"
          },
          {
            "$ref": "#/components/schemas/ImportRequest"
          }
        ]
      },
      "Receipt": {
        "type": "object",
        "required": [
          "version",
          "operationId",
          "method",
          "workspace",
          "path",
          "revision",
          "sha256",
          "readPath"
        ],
        "properties": {
          "version": {
            "const": 1
          },
          "operationId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
          },
          "method": {
            "enum": [
              "write",
              "patch",
              "restore"
            ]
          },
          "workspace": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$"
          },
          "path": {
            "$ref": "#/components/schemas/Path"
          },
          "revision": {
            "$ref": "#/components/schemas/Positive"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "readPath": {
            "type": "string",
            "pattern": "^/v1/file[?]path=.+$",
            "description": "Tam değer /v1/file?path= + encodeURIComponent(path). Aynı ortak sunucu endpointinde, aynı workspace kimliğiyle authenticated GET gerekir; kamu belge originine göre çözmeyin."
          }
        },
        "additionalProperties": false,
        "description": "Yalnız write/patch/restore yanıt kopyasında isteğe bağlı makbuz. Başarılı persist sonrasında gönderilir; idempotent replay aynı makbuzu döndürür. Eski replay makbuz içermeyebilir. Dosya/history kaydına eklenmez. sha256 tüm UTF-8 içeriğe aittir. readPath güncel sürümü okur: revision ve hash birlikte karşılaştırılmalı; ileri sürüm makbuzu geçersiz kılmaz ama aynı içeriği kanıtlamaz. İmzalı kanıt, yetki veya bağımsız yedek değildir."
      },
      "TaskTitle": {
        "type": "string",
        "x-maxUtf8Bytes": 512,
        "pattern": "^[^\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]*$",
        "not": {
          "pattern": "^\\s*$"
        },
        "description": "UTF-8 bayt sınırı; TAB/LF/CR serbest, diğer C0 ve DEL yasak."
      },
      "TaskGoal": {
        "type": "string",
        "x-maxUtf8Bytes": 8192,
        "pattern": "^[^\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]*$",
        "not": {
          "pattern": "^\\s*$"
        },
        "description": "UTF-8 bayt sınırı; TAB/LF/CR serbest, diğer C0 ve DEL yasak."
      },
      "TaskNote": {
        "type": "string",
        "x-maxUtf8Bytes": 8192,
        "pattern": "^[^\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]*$",
        "description": "UTF-8 bayt sınırı; TAB/LF/CR serbest, diğer C0 ve DEL yasak."
      },
      "TaskNextStep": {
        "type": "string",
        "x-maxUtf8Bytes": 4096,
        "pattern": "^[^\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]*$",
        "description": "UTF-8 bayt sınırı; TAB/LF/CR serbest, diğer C0 ve DEL yasak."
      },
      "TaskDefinition": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/TaskId"
          },
          "title": {
            "$ref": "#/components/schemas/TaskTitle"
          },
          "goal": {
            "$ref": "#/components/schemas/TaskGoal"
          }
        },
        "required": [
          "id",
          "title",
          "goal"
        ],
        "additionalProperties": false
      },
      "TaskEvidenceInput": {
        "type": "object",
        "properties": {
          "path": {
            "$ref": "#/components/schemas/Path"
          },
          "revision": {
            "$ref": "#/components/schemas/Positive"
          }
        },
        "required": [
          "path",
          "revision"
        ],
        "additionalProperties": false,
        "description": "Sunucu mevcut dosyanın GÜNCEL sürümünü arar; geçmiş sürüm veya yanlış yol 409 TASK_EVIDENCE. İstemci SHA sağlamaz; sunucu UTF-8 içeriğinden SHA-256 ve verifiedAt üretir. Hash içerik kimliğidir; doğruluk değerlendirmesi/imza değildir."
      },
      "TaskLeaseOptions": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "$ref": "#/components/schemas/Positive"
          },
          "leaseSeconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 3600
          }
        },
        "required": [
          "expectedRevision",
          "leaseSeconds"
        ],
        "additionalProperties": false
      },
      "TaskUpdateOptions": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "$ref": "#/components/schemas/Positive"
          },
          "note": {
            "$ref": "#/components/schemas/TaskNote"
          },
          "nextStep": {
            "$ref": "#/components/schemas/TaskNextStep"
          },
          "evidence": {
            "$ref": "#/components/schemas/TaskEvidenceInput"
          }
        },
        "required": [
          "expectedRevision",
          "note",
          "nextStep"
        ],
        "additionalProperties": false
      },
      "TaskCompleteOptions": {
        "type": "object",
        "properties": {
          "expectedRevision": {
            "$ref": "#/components/schemas/Positive"
          },
          "evidence": {
            "$ref": "#/components/schemas/TaskEvidenceInput"
          }
        },
        "required": [
          "expectedRevision",
          "evidence"
        ],
        "additionalProperties": false
      },
      "TaskCreateRequest": {
        "type": "object",
        "properties": {
          "method": {
            "const": "taskCreate"
          },
          "args": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "prefixItems": [
              {
                "$ref": "#/components/schemas/TaskDefinition"
              }
            ],
            "items": false
          },
          "idempotencyKey": {
            "$ref": "#/components/schemas/IdempotencyKey"
          }
        },
        "required": [
          "method",
          "args",
          "idempotencyKey"
        ],
        "additionalProperties": false,
        "description": "En fazla 100 görev; ID benzersiz. open/r1, owner/leaseExpiresAt/evidence null, note/nextStep boş oluşur.",
        "examples": [
          {
            "method": "taskCreate",
            "args": [
              {
                "id": "example-task",
                "title": "Örnek görev",
                "goal": "Kanıt dosyasını doğrula"
              }
            ],
            "idempotencyKey": "task-example-0001"
          }
        ]
      },
      "TaskClaimRequest": {
        "type": "object",
        "properties": {
          "method": {
            "const": "taskClaim"
          },
          "args": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "prefixItems": [
              {
                "$ref": "#/components/schemas/TaskId"
              },
              {
                "$ref": "#/components/schemas/TaskLeaseOptions"
              }
            ],
            "items": false
          },
          "idempotencyKey": {
            "$ref": "#/components/schemas/IdempotencyKey"
          }
        },
        "required": [
          "method",
          "args",
          "idempotencyKey"
        ],
        "additionalProperties": false,
        "description": "open veya süresi dolmuş claimed görev üstlenilir. Süre bitişi <= sunucu now ise süresi dolmuştur; aktif sahip varsa aynı actor için de 409 TASK_OWNED. Status süresi dolunca kendiliğinden open olmaz.",
        "examples": [
          {
            "method": "taskClaim",
            "args": [
              "example-task",
              {
                "expectedRevision": 1,
                "leaseSeconds": 300
              }
            ],
            "idempotencyKey": "task-example-0002"
          },
          {
            "method": "taskClaim",
            "args": [
              "example-task",
              {
                "expectedRevision": 5,
                "leaseSeconds": 300
              }
            ],
            "idempotencyKey": "task-example-0006"
          }
        ]
      },
      "TaskRenewRequest": {
        "type": "object",
        "properties": {
          "method": {
            "const": "taskRenew"
          },
          "args": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "prefixItems": [
              {
                "$ref": "#/components/schemas/TaskId"
              },
              {
                "$ref": "#/components/schemas/TaskLeaseOptions"
              }
            ],
            "items": false
          },
          "idempotencyKey": {
            "$ref": "#/components/schemas/IdempotencyKey"
          }
        },
        "required": [
          "method",
          "args",
          "idempotencyKey"
        ],
        "additionalProperties": false,
        "description": "Yalnız aktif sahibi. Süre yeni sunucu now + leaseSeconds olarak hesaplanır; önceki sona eklenmez.",
        "examples": [
          {
            "method": "taskRenew",
            "args": [
              "example-task",
              {
                "expectedRevision": 2,
                "leaseSeconds": 600
              }
            ],
            "idempotencyKey": "task-example-0003"
          }
        ]
      },
      "TaskUpdateRequest": {
        "type": "object",
        "properties": {
          "method": {
            "const": "taskUpdate"
          },
          "args": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "prefixItems": [
              {
                "$ref": "#/components/schemas/TaskId"
              },
              {
                "$ref": "#/components/schemas/TaskUpdateOptions"
              }
            ],
            "items": false
          },
          "idempotencyKey": {
            "$ref": "#/components/schemas/IdempotencyKey"
          }
        },
        "required": [
          "method",
          "args",
          "idempotencyKey"
        ],
        "additionalProperties": false,
        "description": "Yalnız aktif sahibi. note ve nextStep ikisi de zorunlu; boş metin geçerli. evidence isteğe bağlıdır; verilirse güncel dosya sürümü ve hash doğrulanır.",
        "examples": [
          {
            "method": "taskUpdate",
            "args": [
              "example-task",
              {
                "expectedRevision": 3,
                "note": "Kontrol edildi",
                "nextStep": "Kanıtla tamamla",
                "evidence": {
                  "path": "proof.md",
                  "revision": 1
                }
              }
            ],
            "idempotencyKey": "task-example-0004"
          }
        ]
      },
      "TaskReleaseRequest": {
        "type": "object",
        "properties": {
          "method": {
            "const": "taskRelease"
          },
          "args": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "prefixItems": [
              {
                "$ref": "#/components/schemas/TaskId"
              },
              {
                "$ref": "#/components/schemas/ExistingOptions"
              }
            ],
            "items": false
          },
          "idempotencyKey": {
            "$ref": "#/components/schemas/IdempotencyKey"
          }
        },
        "required": [
          "method",
          "args",
          "idempotencyKey"
        ],
        "additionalProperties": false,
        "description": "Yalnız aktif sahibi. open durumuna geçer; owner ve leaseExpiresAt null olur. Notlar ve varsa evidence korunur.",
        "examples": [
          {
            "method": "taskRelease",
            "args": [
              "example-task",
              {
                "expectedRevision": 4
              }
            ],
            "idempotencyKey": "task-example-0005"
          }
        ]
      },
      "TaskCompleteRequest": {
        "type": "object",
        "properties": {
          "method": {
            "const": "taskComplete"
          },
          "args": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "prefixItems": [
              {
                "$ref": "#/components/schemas/TaskId"
              },
              {
                "$ref": "#/components/schemas/TaskCompleteOptions"
              }
            ],
            "items": false
          },
          "idempotencyKey": {
            "$ref": "#/components/schemas/IdempotencyKey"
          }
        },
        "required": [
          "method",
          "args",
          "idempotencyKey"
        ],
        "additionalProperties": false,
        "description": "Yalnız aktif sahibi ve güncel kanıtla completed olur; owner ve leaseExpiresAt null. Tamamlanmış görev tekrar mutasyona kapalı (409 TASK_COMPLETED).",
        "examples": [
          {
            "method": "taskComplete",
            "args": [
              "example-task",
              {
                "expectedRevision": 6,
                "evidence": {
                  "path": "proof.md",
                  "revision": 1
                }
              }
            ],
            "idempotencyKey": "task-example-0007"
          }
        ]
      },
      "ImportFile": {
        "type": "object",
        "required": [
          "path",
          "content"
        ],
        "properties": {
          "path": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Path"
              }
            ],
            "x-normalization": "NFC"
          },
          "content": {
            "$ref": "#/components/schemas/Content"
          }
        },
        "additionalProperties": false
      },
      "ImportArchive": {
        "type": "object",
        "required": [
          "format",
          "version",
          "files"
        ],
        "properties": {
          "format": {
            "const": "ggmes-1d"
          },
          "version": {
            "const": 1
          },
          "files": {
            "type": "array",
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/ImportFile"
            },
            "x-uniqueBy": "path",
            "description": "Boş dizi kabul edilir. Aynı yol iki kez bulunamaz; mevcut çalışma alanı yollarıyla çakışamaz. uniqueBy çalışma zamanı kısıtıdır; standart JSON Schema dış veri durumunu doğrulamaz."
          }
        },
        "additionalProperties": false,
        "description": "Kanonik GGMES 1D v1 güncel-dosya yedeği. Yalnız yeni yollar eklenir; var olan hiçbir dosya ezilmez. Geçmiş/görev aktarımı yapılmaz; ek alanlar sunucuda yok sayılabilir, bu kanonik şema reddeder. Dosya başına262144 UTF-8 bayt; mevcutlarla birlikte32 dosya ve2097152 bayt çalışma zamanı sınırı.",
        "examples": [
          {
            "format": "ggmes-1d",
            "version": 1,
            "files": [
              {
                "path": "import/example.md",
                "content": "# Örnek 🌍"
              }
            ]
          },
          {
            "format": "ggmes-1d",
            "version": 1,
            "files": []
          }
        ]
      },
      "ImportEncodedArchive": {
        "type": "string",
        "contentMediaType": "application/json",
        "contentSchema": {
          "$ref": "#/components/schemas/ImportArchive"
        },
        "x-encodedJsonSchema": {
          "$ref": "#/components/schemas/ImportArchive"
        },
        "description": "İlk args öğesi bu JSON metni veya doğrudan ImportArchive nesnesi olabilir. İç string JSON.parse ile çözülür; bozuk iç JSON 400 IMPORT. contentSchema/contentMediaType anotasyondur; standart doğrulayıcı içeriği otomatik parse/doğrulamayabilir. x-encodedJsonSchema bu projedeki açık runtime/test kuralıdır. UTF-8 dış RPC gövdesi1MiB; JSON string kaçışları da sayılır.",
        "examples": [
          "{\"format\":\"ggmes-1d\",\"version\":1,\"files\":[{\"path\":\"import/string.md\",\"content\":\"Metin biçimi\"}]}"
        ]
      },
      "ImportRequest": {
        "type": "object",
        "required": [
          "method",
          "args",
          "idempotencyKey"
        ],
        "properties": {
          "method": {
            "const": "importWorkspace"
          },
          "args": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "prefixItems": [
              {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/ImportArchive"
                  },
                  {
                    "$ref": "#/components/schemas/ImportEncodedArchive"
                  }
                ]
              }
            ],
            "items": false
          },
          "idempotencyKey": {
            "$ref": "#/components/schemas/IdempotencyKey"
          }
        },
        "additionalProperties": false,
        "x-maxSerializedUtf8Bytes": 1048576,
        "description": "Kanonik bir argüman; genel sunucu en çok3 argümana izin verse de diğerlerini kullanmaz. expectedRevision yoktur: her yeni dosya dahilen expectedRevision:null ile oluşturulur. write rolü/idempotencyKey zorunludur. Tüm dosyalar tek state clone üzerinde uygulanıp bir persist ile atomik kaydedilir. Bir çakışma/limit hatası tüm isteği geri çevirir; olay/history/replay kısmi kalmaz.",
        "examples": [
          {
            "method": "importWorkspace",
            "args": [
              {
                "format": "ggmes-1d",
                "version": 1,
                "files": [
                  {
                    "path": "import/example.md",
                    "content": "# Örnek 🌍"
                  }
                ]
              }
            ],
            "idempotencyKey": "import-example-object"
          },
          {
            "method": "importWorkspace",
            "args": [
              "{\"format\":\"ggmes-1d\",\"version\":1,\"files\":[{\"path\":\"import/string.md\",\"content\":\"Metin biçimi\"}]}"
            ],
            "idempotencyKey": "import-example-string"
          },
          {
            "method": "importWorkspace",
            "args": [
              {
                "format": "ggmes-1d",
                "version": 1,
                "files": []
              }
            ],
            "idempotencyKey": "import-example-empty"
          }
        ]
      },
      "ImportResult": {
        "type": "object",
        "required": [
          "imported",
          "paths",
          "cursor"
        ],
        "properties": {
          "imported": {
            "type": "integer",
            "minimum": 0,
            "maximum": 32
          },
          "paths": {
            "type": "array",
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/Path"
            }
          },
          "cursor": {
            "$ref": "#/components/schemas/Cursor"
          }
        },
        "additionalProperties": false,
        "description": "paths girdi sırasını korur, imported dosya sayısıdır. Her yeni dosya r1/history r1 ve bir write olayı üretir; cursor o kadar artar. Boş import0 dosya/aynı cursor döndürür ancak idempotency replay kaydı persist edilir. Dosya receipt yoktur. Aynı anahtar ve aynı method/args tekrarında özgün sonuç döner; string/nesne biçimini veya iç string boşluklarını değiştirmek farklı fingerprinttir."
      },
      "ServerResume": {
        "type": "object",
        "required": [
          "version",
          "mode",
          "workspace",
          "scope",
          "consistency",
          "authority",
          "backup",
          "cursor",
          "cursorKnown",
          "cursorScope",
          "cursorMeaning",
          "taskScope",
          "pendingServerCount",
          "pendingUiCount",
          "pendingScope",
          "files",
          "tasks",
          "omittedFiles",
          "omittedTasks",
          "truncated"
        ],
        "properties": {
          "version": {
            "const": 1
          },
          "mode": {
            "const": "shared"
          },
          "workspace": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,64}$"
          },
          "scope": {
            "const": "authenticated-workspace-metadata"
          },
          "consistency": {
            "const": "single-persisted-state"
          },
          "authority": {
            "const": false
          },
          "backup": {
            "const": false
          },
          "cursor": {
            "$ref": "#/components/schemas/Cursor"
          },
          "cursorKnown": {
            "const": true
          },
          "cursorScope": {
            "const": "file-events-only"
          },
          "cursorMeaning": {
            "const": "persisted-state-file-cursor"
          },
          "taskScope": {
            "const": "independent-task-revisions"
          },
          "pendingServerCount": {
            "type": "null"
          },
          "pendingUiCount": {
            "type": "null"
          },
          "pendingScope": {
            "const": "unknown-not-inferred-from-snapshot"
          },
          "files": {
            "type": "array",
            "maxItems": 32,
            "items": {
              "type": "object",
              "required": [
                "path",
                "revision"
              ],
              "properties": {
                "path": {
                  "$ref": "#/components/schemas/Path"
                },
                "revision": {
                  "$ref": "#/components/schemas/Positive"
                }
              },
              "additionalProperties": false
            }
          },
          "tasks": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "required": [
                "id",
                "revision",
                "status"
              ],
              "properties": {
                "id": {
                  "$ref": "#/components/schemas/TaskId"
                },
                "revision": {
                  "$ref": "#/components/schemas/Positive"
                },
                "status": {
                  "enum": [
                    "open",
                    "claimed",
                    "completed"
                  ]
                }
              },
              "additionalProperties": false
            }
          },
          "omittedFiles": {
            "type": "integer",
            "minimum": 0,
            "maximum": 32
          },
          "omittedTasks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ServerResumeResponse": {
        "type": "object",
        "required": [
          "ok",
          "result"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "result": {
            "$ref": "#/components/schemas/ServerResume"
          }
        },
        "additionalProperties": false,
        "x-maxSerializedUtf8Bytes": 2048,
        "description": "Tüm HTTP JSON gövdesi ok/result dahil en fazla2048 UTF-8 bayt. Truncated özette eski/değişmeyen atlanan kayıtlar changes(cursor) ile keşfedilemez; gerektiğinde tam metadata listesini okuyun. Bu yanıt dosya içeriği, görev başlığı/notu, anahtar veya endpoint taşımaz."
      }
    }
  },
  "servers": [
    {
      "url": "https://ggmes-1d-shared-121831709308.europe-west3.run.app"
    }
  ]
}