{
  "version": "1.0.0-rc.1",
  "publisher": "MineSpace Inc.",
  "canonical": "https://minespace.us/Clara/",
  "format": "CLARA-CONNECT-1",
  "service": "platform.cgi?service=connect&action={action}",
  "method": "POST",
  "authorization": "Bearer member credential or scoped ct_ credential; admin only for release deployment and revocation",
  "actions": {
    "search": {
      "fields": [
        "org",
        "q"
      ],
      "scope": "search"
    },
    "get": {
      "fields": [
        "org",
        "id"
      ],
      "scope": "get"
    },
    "save": {
      "fields": [
        "org",
        "id",
        "revision",
        "content",
        "sha256"
      ],
      "scope": "save",
      "revision": "0 for new; compare-and-swap"
    },
    "key-issue": {
      "fields": [
        "org",
        "label",
        "scopes",
        "hours"
      ],
      "requires": "redeemed member credential; 1\u2013720 hours"
    },
    "key-list": {
      "fields": [
        "org"
      ]
    },
    "key-revoke": {
      "fields": [
        "org",
        "id"
      ]
    },
    "box-list": {
      "fields": [
        "org"
      ],
      "scope": "exchange-read"
    },
    "box-get": {
      "fields": [
        "org",
        "id"
      ],
      "scope": "exchange-read"
    },
    "box-save": {
      "fields": [
        "org",
        "id",
        "revision",
        "content",
        "sha256"
      ],
      "scope": "exchange-write"
    },
    "release-deploy": {
      "fields": [
        "org",
        "visibility",
        "content",
        "sha256"
      ],
      "requires": "hosting admin; immutable release; private/public; test-bearing package"
    },
    "release-list": {
      "fields": [
        "org"
      ]
    },
    "release-revoke": {
      "fields": [
        "org",
        "id"
      ],
      "requires": "hosting admin"
    }
  },
  "libraryBundle": {
    "format": "CLARA-LIBRARIES-1",
    "fields": {
      "format": "CLARA-LIBRARIES-1",
      "roots": [
        "clara://namespace/library@1.0.0"
      ],
      "entries": [
        {
          "record": "signed CLARA-NEXUS-1 object",
          "package": "verified CLARA-PROJECT-1 object"
        }
      ]
    },
    "pins": "JSON mapping namespace to trusted Ed25519 public key; verify out-of-band",
    "constraints": "32 libraries, exact versions, pure standalone function packages, no routes or host capabilities, deterministic source linking into a new project; duplicate symbols rejected by compiler",
    "registryInstallation": {
      "resolver": "public NEXUS registry on current host",
      "endpoint": "exactly one signed HTTPS .json package endpoint per library, CORS enabled if remote",
      "integrity": "verify publisher pin and signature before fetching; recompile and verify package digest",
      "limits": "32 packages; client-only downloads; no private credential forwarding"
    }
  },
  "sealedEnvelope": {
    "format": "CLARA-SEALED-1",
    "kdf": "PBKDF2-SHA256",
    "iterations": 600000,
    "salt": "16 random bytes hex",
    "iv": "12 random bytes hex",
    "ciphertext": "AES-256-GCM ciphertext plus 16-byte tag, hex",
    "aad": "CLARA-SEALED-1|PBKDF2-SHA256|600000",
    "plaintext": "UTF-8 JSON CLARA-PROJECT-1; 190 KB max"
  },
  "privateFederation": {
    "mode": "client fan-out, no central indexing",
    "maxPeers": 8,
    "serverEnv": "CLARA_PRIVATE_DISCOVERY_ORIGINS",
    "credential": "explicit per-peer scoped credential",
    "searchOnly": true,
    "https": true
  },
  "deployment": {
    "route": "apps/{release-id}/api/{route}",
    "directFallback": "runtime.cgi?_route=/apps/{release-id}/api/{route}",
    "storage": "separate SQLite file per release",
    "auth": "private reads require membership; protected routes and writes require administrator",
    "validation": "browser compiler and tests; server structural checks and admin approval, not independent server source compilation",
    "rollback": "retain previous immutable release URL; revoke unwanted release"
  },
  "privacy": "No passphrase or plaintext submitted to encrypted object store. Ordinary sync is server readable. Metadata, host logs and frontend trust are not hidden.",
  "synchronization": {
    "mode": "explicit push/pull; local project stores remote organization, ID and base revision",
    "conflict": "409 on newer revision; pull a new copy and manually merge before pushing",
    "excludes": "runtime data, IndexedDB data, secrets, and private signing keys"
  }
}
