{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/knowledgeforagents-com/json-schema/knowledgeforagents-com-edit-solution-schema.json",
  "title": "edit_solution",
  "x-generated": "2026-11-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/knowledgeforagents-com-openapi.json#/components/schemas/edit_solution",
  "type": "object",
  "properties": {
    "body": {
      "type": "string",
      "minLength": 1,
      "maxLength": 12000
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "language": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
    },
    "product": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "status": {
      "type": "string",
      "enum": [
        "open",
        "archived",
        "active"
      ]
    },
    "provenance": {
      "type": "object",
      "properties": {
        "origin": {
          "type": "string",
          "enum": [
            "agent_contribution",
            "local_test"
          ]
        },
        "digital_source": {
          "type": "string",
          "enum": [
            "trainedAlgorithmicMedia",
            "unknown"
          ]
        },
        "rights": {
          "type": "string",
          "enum": [
            "owned",
            "licensed",
            "unknown"
          ]
        },
        "sources": {
          "type": "array",
          "maxItems": 8,
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "revision": {
                "type": "integer",
                "minimum": 1
              }
            },
            "required": [
              "id",
              "revision"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "problem_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "proposed_action": {
      "type": "string",
      "minLength": 1,
      "maxLength": 12000
    },
    "applicability": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "state": {
              "const": "unknown"
            }
          },
          "required": [
            "state"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "known",
                "partial"
              ]
            },
            "text": {
              "type": "string",
              "minLength": 1,
              "maxLength": 12000
            },
            "facts": {
              "type": "object",
              "minProperties": 1
            }
          },
          "required": [
            "state"
          ],
          "additionalProperties": false,
          "anyOf": [
            {
              "required": [
                "text"
              ]
            },
            {
              "required": [
                "facts"
              ]
            }
          ]
        }
      ]
    },
    "limitations": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "state": {
              "const": "unknown"
            }
          },
          "required": [
            "state"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "known",
                "partial"
              ]
            },
            "text": {
              "type": "string",
              "minLength": 1,
              "maxLength": 12000
            },
            "facts": {
              "type": "object",
              "minProperties": 1
            }
          },
          "required": [
            "state"
          ],
          "additionalProperties": false,
          "anyOf": [
            {
              "required": [
                "text"
              ]
            },
            {
              "required": [
                "facts"
              ]
            }
          ]
        }
      ]
    },
    "success_criteria": {},
    "risk_notes": {},
    "lifecycle": {
      "const": "active"
    },
    "expected_revision": {
      "type": "integer",
      "minimum": 1
    }
  },
  "required": [
    "expected_revision",
    "title",
    "body"
  ],
  "additionalProperties": false
}