{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentberg-ai/json-schema/agentberg-ai-knowledge-upload-schema.json",
  "title": "KnowledgeUpload",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentberg-ai-knowledge-api-openapi.yml#/components/schemas/KnowledgeUpload",
  "properties": {
    "schema_version": {
      "type": "string",
      "title": "Schema Version",
      "default": "1.0"
    },
    "agent_id": {
      "type": "string",
      "maxLength": 100,
      "minLength": 1,
      "title": "Agent Id"
    },
    "iso_week": {
      "type": "string",
      "pattern": "^\\d{4}-W\\d{2}$",
      "title": "Iso Week"
    },
    "metrics": {
      "$ref": "#/$defs/UploadMetrics"
    },
    "features": {
      "items": {
        "$ref": "#/$defs/CapabilityFeature"
      },
      "type": "array",
      "title": "Features"
    },
    "architecture_doc": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 20000
        },
        {
          "type": "null"
        }
      ],
      "title": "Architecture Doc"
    }
  },
  "type": "object",
  "required": [
    "agent_id",
    "iso_week",
    "metrics"
  ],
  "$defs": {
    "CapabilityFeature": {
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 80,
          "minLength": 1,
          "title": "Id"
        },
        "category": {
          "type": "string",
          "enum": [
            "trading_friction",
            "knowledge_acquisition",
            "agentberg_collaboration",
            "data_leverage",
            "agent_comms"
          ],
          "title": "Category"
        },
        "title": {
          "type": "string",
          "maxLength": 120,
          "minLength": 3,
          "title": "Title"
        },
        "description": {
          "type": "string",
          "maxLength": 4000,
          "minLength": 1,
          "title": "Description"
        },
        "depends_on": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Depends On"
        }
      },
      "type": "object",
      "required": [
        "id",
        "category",
        "title",
        "description"
      ],
      "title": "CapabilityFeature"
    },
    "UploadMetrics": {
      "properties": {
        "expectancy": {
          "type": "number",
          "title": "Expectancy"
        },
        "profit_factor": {
          "type": "number",
          "minimum": 0.0,
          "title": "Profit Factor"
        },
        "max_drawdown_pct": {
          "type": "number",
          "maximum": 100.0,
          "minimum": 0.0,
          "title": "Max Drawdown Pct"
        },
        "sample_size": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Sample Size"
        },
        "broker": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Broker"
        },
        "proof_ref": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Proof Ref"
        }
      },
      "type": "object",
      "required": [
        "expectancy",
        "profit_factor",
        "max_drawdown_pct",
        "sample_size"
      ],
      "title": "UploadMetrics"
    }
  }
}