{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aisciencetracker.org/schema/discoveries.schema.json",
  "title": "AI Science Tracker discovery records",
  "description": "Array of curated discovery records. Field meanings: docs/discovery-schema.md. Licensed CC BY 4.0.",
  "type": "array",
  "items": {
    "type": "object",
    "additionalProperties": false,
    "required": [
      "id",
      "title",
      "summary",
      "field",
      "ai_technology",
      "organization",
      "source_url",
      "source_type",
      "publication_date",
      "added_date",
      "verification_status",
      "paper_url",
      "relevance"
    ],
    "properties": {
      "id": {
        "type": "string",
        "pattern": "^[a-z0-9][a-z0-9_-]*$"
      },
      "title": {
        "type": "string",
        "minLength": 1
      },
      "summary": {
        "type": "string",
        "minLength": 1
      },
      "field": {
        "type": "string",
        "enum": [
          "biology",
          "chemistry",
          "medicine",
          "materials",
          "climate",
          "mathematics",
          "physics",
          "computer science",
          "humanities",
          "multidisciplinary",
          "other"
        ]
      },
      "ai_technology": {
        "type": "string"
      },
      "organization": {
        "type": "string",
        "minLength": 1
      },
      "source_url": {
        "type": "string",
        "pattern": "^https://\\S+$"
      },
      "source_type": {
        "type": "string",
        "enum": [
          "press release",
          "blog",
          "paper",
          "other"
        ]
      },
      "publication_date": {
        "type": "string",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "added_date": {
        "type": "string",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "verification_status": {
        "type": "string",
        "enum": [
          "verified",
          "needs verification"
        ]
      },
      "paper_url": {
        "type": "string",
        "pattern": "^(https://\\S+)?$",
        "description": "Empty when no paper link is established."
      },
      "relevance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "impact",
          "validation",
          "novelty"
        ],
        "properties": {
          "impact": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5
          },
          "validation": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5
          },
          "novelty": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5
          }
        }
      },
      "evidence": {
        "type": "object",
        "additionalProperties": false,
        "description": "Source-attributed descriptions and an editorial test category; test_type sets validation under the Methodology precedence rules.",
        "required": [
          "publication_status",
          "tested",
          "unknown",
          "ai_role",
          "evidence_urls"
        ],
        "properties": {
          "publication_status": {
            "type": "string",
            "enum": [
              "Peer-reviewed paper",
              "Preprint",
              "Announcement only",
              "Not reported"
            ]
          },
          "tested": {
            "type": "string"
          },
          "unknown": {
            "type": "string"
          },
          "ai_role": {
            "type": "string"
          },
          "evidence_urls": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^https://\\S+$"
            }
          },
          "test_type": {
            "type": "string",
            "enum": [
              "not reported",
              "retrospective or benchmark",
              "direct test",
              "prospective or independent check",
              "replication or operational use"
            ],
            "description": "Sets relevance.validation (1-5 in this order)."
          }
        }
      },
      "source_review": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "date",
          "scope"
        ],
        "properties": {
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "format": "date"
          },
          "scope": {
            "type": "string",
            "minLength": 1
          }
        },
        "description": "Actual source review date and bounded material read; absent means unknown."
      },
      "follow_up_review": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "date",
          "scope"
        ],
        "properties": {
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "format": "date"
          },
          "scope": {
            "type": "string",
            "minLength": 1
          }
        },
        "description": "Actual follow-up search date and bounded scope; no guarantee of exhaustive coverage."
      },
      "follow_up": {
        "type": "array",
        "items": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "id",
            "kind",
            "date",
            "date_precision",
            "note",
            "source_urls",
            "recorded_date"
          ],
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]*$"
            },
            "kind": {
              "type": "string",
              "enum": [
                "publication",
                "same-team extension",
                "independent follow-up",
                "documented application",
                "contradiction",
                "correction",
                "retraction"
              ]
            },
            "date": {
              "type": [
                "string",
                "null"
              ]
            },
            "date_precision": {
              "type": "string",
              "enum": [
                "year",
                "month",
                "day",
                "unknown"
              ]
            },
            "note": {
              "type": "string",
              "minLength": 1
            },
            "source_urls": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "pattern": "^https://[^/\\s]+\\S*$",
                "format": "uri"
              }
            },
            "recorded_date": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "format": "date"
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "date_precision": {
                    "const": "year"
                  }
                }
              },
              "then": {
                "properties": {
                  "date": {
                    "type": "string",
                    "pattern": "^\\d{4}$"
                  }
                }
              }
            },
            {
              "if": {
                "properties": {
                  "date_precision": {
                    "const": "month"
                  }
                }
              },
              "then": {
                "properties": {
                  "date": {
                    "type": "string",
                    "pattern": "^\\d{4}-(0[1-9]|1[0-2])$"
                  }
                }
              }
            },
            {
              "if": {
                "properties": {
                  "date_precision": {
                    "const": "day"
                  }
                }
              },
              "then": {
                "properties": {
                  "date": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "format": "date"
                  }
                }
              }
            },
            {
              "if": {
                "properties": {
                  "date_precision": {
                    "const": "unknown"
                  }
                }
              },
              "then": {
                "properties": {
                  "date": {
                    "type": "null"
                  }
                }
              }
            }
          ]
        },
        "description": "Source-supported scientific events; stable IDs unique within the record. Partial dates retain their precision."
      },
      "relationships": {
        "type": "array",
        "items": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "type",
            "target_id",
            "reason",
            "source_urls"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "same result",
                "extends",
                "independent follow-up",
                "shared evidence"
              ]
            },
            "target_id": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]*$"
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "source_urls": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "pattern": "^https://[^/\\s]+\\S*$",
                "format": "uri"
              }
            }
          }
        },
        "description": "Directed source-supported links to existing active or archived IDs; no self-links or duplicate type/target pairs. Does not merge counts."
      }
    }
  }
}
