{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aixbt-tech/json-schema/aixbt-tech-report-schema.json",
  "title": "Report",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aixbt-tech-v3-openapi.yaml#/components/schemas/Report",
  "allOf": [
    {
      "$ref": "#/$defs/ReportListItem"
    },
    {
      "type": "object",
      "required": [
        "summary",
        "body",
        "sources"
      ],
      "properties": {
        "summary": {
          "type": "string"
        },
        "body": {
          "type": "string",
          "description": "Markdown body of the published artifact without internal source-id markers."
        },
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "title",
              "url"
            ],
            "properties": {
              "title": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "publishedAt": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        },
        "evidence": {
          "type": "object",
          "description": "Publication-time evidence quoted by the artifact, with source\nattribution and observation timestamps. Immutable once\npublished.\n",
          "properties": {
            "snapshotAt": {
              "type": "string",
              "format": "date-time"
            },
            "entities": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "project",
                  "observations"
                ],
                "properties": {
                  "project": {
                    "$ref": "#/$defs/ProjectRef"
                  },
                  "observations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "key",
                        "value",
                        "unit",
                        "provider",
                        "observedAt",
                        "freshness"
                      ],
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "value": {
                          "type": "number"
                        },
                        "unit": {
                          "type": "string"
                        },
                        "provider": {
                          "type": "string"
                        },
                        "observedAt": {
                          "description": "Source-side observation timestamp. Null when\nthe provider publishes the figure without\none.\n",
                          "oneOf": [
                            {
                              "type": "string",
                              "format": "date-time"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "freshness": {
                          "type": "string"
                        },
                        "disagreement": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "ProjectRef": {
      "type": "object",
      "required": [
        "id",
        "slug",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "slug": {
          "type": "string",
          "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
          "maxLength": 64
        },
        "name": {
          "type": "string"
        }
      }
    },
    "ReportListItem": {
      "type": "object",
      "required": [
        "id",
        "title",
        "publishedAt",
        "primarySubject",
        "preview"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "publishedAt": {
          "type": "string",
          "format": "date-time"
        },
        "revisedAt": {
          "oneOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "primarySubject": {
          "$ref": "#/$defs/ReportSubject"
        },
        "relatedSubjects": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReportSubject"
          },
          "description": "Ordered, deduplicated Project bindings frozen from the Report's evidence membership and resolved to current Project identity; never inferred from prose, live Topic associations, or market evidence."
        },
        "preview": {
          "type": "string"
        }
      }
    },
    "ReportSubject": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "project",
            "topic"
          ]
        },
        "project": {
          "$ref": "#/$defs/ProjectRef"
        },
        "topic": {
          "$ref": "#/$defs/TopicRef"
        }
      }
    },
    "TopicRef": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    }
  }
}