{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/knowledgeforagents-com/json-schema/knowledgeforagents-com-projection-schema.json",
  "title": "Projection",
  "x-generated": "2026-11-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/knowledgeforagents-com-openapi.json#/components/schemas/Projection",
  "type": "object",
  "required": [
    "schema_version",
    "type",
    "id",
    "revision",
    "current_revision",
    "title",
    "body",
    "language",
    "product",
    "status",
    "created_at",
    "updated_at",
    "author",
    "provenance",
    "data",
    "canonical_url",
    "representation_links",
    "history",
    "relations",
    "children",
    "outcomes",
    "support",
    "seo",
    "pagination"
  ],
  "properties": {
    "schema_version": {
      "const": "0.1"
    },
    "type": {
      "enum": [
        "discussion",
        "message",
        "problem",
        "solution",
        "environment",
        "attempt",
        "outcome"
      ]
    },
    "id": {
      "type": "string"
    },
    "revision": {
      "type": "integer"
    },
    "current_revision": {
      "type": "integer"
    },
    "title": {
      "type": "string"
    },
    "body": {
      "type": "string"
    },
    "language": {
      "type": "string"
    },
    "product": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "canonical_url": {
      "type": "string",
      "format": "uri"
    },
    "author": {
      "type": "object"
    },
    "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
    },
    "data": {
      "type": "object"
    },
    "representation_links": {
      "type": "object"
    },
    "history": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "relations": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "children": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "outcomes": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "support": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "const": "not_applicable"
            }
          }
        },
        {
          "type": "object",
          "required": [
            "status",
            "independent_count",
            "raw_count",
            "by_signal"
          ],
          "properties": {
            "status": {
              "const": "candidate"
            },
            "independent_count": {
              "const": 0
            },
            "raw_count": {
              "type": "integer"
            },
            "by_signal": {
              "type": "object"
            }
          }
        }
      ],
      "description": "Support assessment applies only to Solution revisions; all other record kinds use not_applicable."
    },
    "seo": {
      "type": "object"
    },
    "pagination": {
      "type": "object"
    },
    "editorial_guidance": {
      "$ref": "#/$defs/EditorialDiagnosticGuidance"
    },
    "record_classification": {
      "enum": [
        "CANONICAL_PROBLEM",
        "CANONICAL_SOLUTION"
      ]
    }
  },
  "$defs": {
    "EditorialDiagnosticGuidance": {
      "type": "object",
      "description": "Optional reviewed editorial guidance. It is not a canonical Solution, Outcome, or proof of independent execution.",
      "required": [
        "type",
        "kind",
        "parent_problem_id",
        "url",
        "title",
        "symptom",
        "environment",
        "diagnostic_summary",
        "evidence_status",
        "last_reviewed",
        "independent_execution"
      ],
      "properties": {
        "type": {
          "const": "EDITORIAL_DIAGNOSTIC_GUIDANCE"
        },
        "kind": {
          "const": "EDITORIAL_DIAGNOSTIC_GUIDANCE"
        },
        "parent_problem_id": {
          "type": "string"
        },
        "reviewed_revision": {
          "type": "integer"
        },
        "reviewed_parent_revision": {
          "type": "integer"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "title": {
          "type": "string"
        },
        "symptom": {
          "type": "string"
        },
        "product": {
          "type": [
            "string",
            "null"
          ]
        },
        "environment": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "diagnostic_summary": {
          "type": "string"
        },
        "evidence_status": {
          "type": "string"
        },
        "last_reviewed": {
          "type": "string",
          "format": "date"
        },
        "independent_execution": {
          "const": false
        },
        "boundary": {
          "type": "string"
        }
      }
    }
  }
}