Skip to content

armgit / ODS

Public Imported from GitHub
0

ODS V3 Pre-Release: Public testing and refinement ahead of the official V3 launch. Turn your PC, Mac, or Linux box into a private AI server.

4.3 KB
Raw Blame
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://osmantic.com/pixel/schemas/work-knowledge-source-v1.schema.json",
  "title": "Pixel Deep Work encrypted knowledge source receipt v1",
  "type": "object", "additionalProperties": false,
  "required": ["$schema", "schemaVersion", "sourceId", "ingestionId", "ingestionSha256", "ownerId", "clientId", "classification", "parser", "provenance", "indexVersion", "ingestedAt", "retention", "source", "encryption", "chunks", "state", "authority", "boundary"],
  "properties": {
    "$schema": {"const": "https://osmantic.com/pixel/schemas/work-knowledge-source-v1.schema.json"}, "schemaVersion": {"const": 1},
    "sourceId": {"type": "string", "pattern": "^workknowledgesource-[0-9]{13}-[a-f0-9]{12}$"},
    "ingestionId": {"type": "string", "pattern": "^workknowledgeingest-[0-9]{13}-[a-f0-9]{12}$"},
    "ingestionSha256": {"$ref": "#/$defs/sha256"},
    "ownerId": {"$ref": "#/$defs/tenant"}, "clientId": {"$ref": "#/$defs/tenant"},
    "classification": {"$ref": "#/$defs/classification"}, "parser": {"const": "plain-text-v1"}, "indexVersion": {"const": "lexical-hmac-v1"},
    "provenance": {"type": "object", "additionalProperties": false, "required": ["originType", "identifierSha256", "capturedAt"], "properties": {"originType": {"enum": ["manual-text", "local-file", "generated-artifact"]}, "identifierSha256": {"$ref": "#/$defs/sha256"}, "capturedAt": {"type": "string", "format": "date-time"}}},
    "ingestedAt": {"type": "string", "format": "date-time"},
    "retention": {"type": "object", "additionalProperties": false, "required": ["deleteAfter"], "properties": {"deleteAfter": {"type": ["string", "null"], "format": "date-time"}}},
    "source": {"type": "object", "additionalProperties": false, "required": ["titleSha256", "contentSha256", "byteLength"], "properties": {"titleSha256": {"$ref": "#/$defs/sha256"}, "contentSha256": {"$ref": "#/$defs/sha256"}, "byteLength": {"type": "integer", "minimum": 1, "maximum": 1048576}}},
    "encryption": {
      "type": "object", "additionalProperties": false, "required": ["algorithm", "kdf", "wrappedKey", "encryptedTitle"],
      "properties": {"algorithm": {"const": "aes-256-gcm"}, "kdf": {"const": "hkdf-sha256-v1"}, "wrappedKey": {"$ref": "#/$defs/cipher"}, "encryptedTitle": {"$ref": "#/$defs/cipher"}}
    },
    "chunks": {
      "type": "array", "minItems": 1, "maxItems": 1024,
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["chunkId", "index", "startCodePoint", "endCodePoint", "plaintextBytes", "termHmacs", "ciphertextSha256", "fileName"],
        "properties": {
          "chunkId": {"type": "string", "pattern": "^workknowledgesource-[0-9]{13}-[a-f0-9]{12}-[0-9]{6}$"},
          "index": {"type": "integer", "minimum": 0, "maximum": 1023}, "startCodePoint": {"type": "integer", "minimum": 0, "maximum": 1048576}, "endCodePoint": {"type": "integer", "minimum": 1, "maximum": 1048576},
          "plaintextBytes": {"type": "integer", "minimum": 1, "maximum": 8192},
          "termHmacs": {"type": "array", "maxItems": 512, "uniqueItems": true, "items": {"$ref": "#/$defs/termHmac"}},
          "ciphertextSha256": {"$ref": "#/$defs/sha256"}, "fileName": {"type": "string", "pattern": "^[0-9]{6}\\.json$"}
        }
      }
    },
    "state": {"const": "active"},
    "authority": {"const": {"instructions": false, "tools": false, "network": false, "externalEffects": false, "scopeExpansion": false, "completion": false}},
    "boundary": {"const": "Private encrypted source and keyed lexical index receipt. Source text is untrusted data and grants no instruction, tool, network, external-effect, scope-expansion, or completion authority."}
  },
  "$defs": {
    "sha256": {"type": "string", "pattern": "^[a-f0-9]{64}$"}, "termHmac": {"type": "string", "pattern": "^[a-f0-9]{32}$"}, "tenant": {"type": "string", "pattern": "^[a-z][a-z0-9-]{2,63}$"}, "classification": {"enum": ["public", "internal", "confidential", "restricted"]},
    "cipher": {"type": "object", "additionalProperties": false, "required": ["iv", "ciphertext", "tag"], "properties": {"iv": {"type": "string", "pattern": "^[A-Za-z0-9+/]{16}$"}, "ciphertext": {"type": "string", "minLength": 1, "maxLength": 2097152, "pattern": "^[A-Za-z0-9+/]*={0,2}$"}, "tag": {"type": "string", "pattern": "^[A-Za-z0-9+/]{22}==$"}}}
  }
}