{
  "schemaVersion": "1.0",
  "schemas": {
    "researchObject": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "string",
          "const": "1.0"
        },
        "id": {
          "type": "string",
          "pattern": "^metis_[0-9A-Za-z]+$"
        },
        "slug": {
          "type": "string",
          "pattern": "^[a-z0-9-]+$"
        },
        "version": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "status": {
          "type": "string",
          "enum": [
            "observing",
            "researching",
            "analyzing",
            "synthesizing",
            "verifying",
            "published",
            "withheld"
          ]
        },
        "category": {
          "type": "string",
          "enum": [
            "flow",
            "market",
            "event",
            "synthesis"
          ]
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "dek": {
          "type": "string",
          "minLength": 1
        },
        "summary": {
          "type": "string",
          "minLength": 1
        },
        "thesis": {
          "type": "string",
          "minLength": 1
        },
        "whyItMatters": {
          "type": "string",
          "minLength": 1
        },
        "assets": {
          "minItems": 1,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "symbol": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "assetType": {
                "type": "string",
                "enum": [
                  "tokenized_equity",
                  "stablecoin",
                  "fund",
                  "commodity",
                  "bond",
                  "other"
                ]
              },
              "chain": {
                "type": "string"
              },
              "contractAddress": {
                "type": "string"
              },
              "referenceTicker": {
                "type": "string"
              },
              "issuerId": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "symbol",
              "name",
              "assetType"
            ],
            "additionalProperties": false
          }
        },
        "entities": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "type": {
                "type": "string",
                "enum": [
                  "issuer",
                  "protocol",
                  "venue",
                  "custodian",
                  "oracle",
                  "regulator",
                  "other"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "type"
            ],
            "additionalProperties": false
          }
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "timeWindow": {
          "type": "object",
          "properties": {
            "start": {
              "type": "string"
            },
            "end": {
              "type": "string"
            },
            "observedAt": {
              "type": "string"
            }
          },
          "required": [
            "start",
            "end",
            "observedAt"
          ],
          "additionalProperties": false
        },
        "observations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "kind": {
                "type": "string",
                "minLength": 1
              },
              "statement": {
                "type": "string",
                "minLength": 1
              },
              "metric": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "value": {
                    "type": "number"
                  },
                  "unit": {
                    "type": "string"
                  },
                  "baseline": {
                    "type": "number"
                  },
                  "delta": {
                    "type": "number"
                  }
                },
                "required": [
                  "name",
                  "value",
                  "unit"
                ],
                "additionalProperties": false
              },
              "occurredAt": {
                "type": "string"
              },
              "evidenceIds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "id",
              "kind",
              "statement",
              "occurredAt",
              "evidenceIds"
            ],
            "additionalProperties": false
          }
        },
        "evidence": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "sourceId": {
                "type": "string",
                "minLength": 1
              },
              "sourceType": {
                "type": "string",
                "enum": [
                  "onchain",
                  "market",
                  "issuer",
                  "regulatory",
                  "news",
                  "social",
                  "internal"
                ]
              },
              "title": {
                "type": "string",
                "minLength": 1
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "publisher": {
                "type": "string"
              },
              "retrievedAt": {
                "type": "string"
              },
              "publishedAt": {
                "type": "string"
              },
              "excerpt": {
                "type": "string",
                "maxLength": 600
              },
              "dataHash": {
                "type": "string"
              },
              "reliability": {
                "type": "string",
                "enum": [
                  "primary",
                  "high",
                  "medium",
                  "low"
                ]
              },
              "supportsClaimIds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "licenseNotes": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "sourceId",
              "sourceType",
              "title",
              "retrievedAt",
              "reliability",
              "supportsClaimIds"
            ],
            "additionalProperties": false
          }
        },
        "claims": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "statement": {
                "type": "string",
                "minLength": 1
              },
              "type": {
                "type": "string",
                "enum": [
                  "fact",
                  "calculation",
                  "inference",
                  "hypothesis"
                ]
              },
              "evidenceIds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "confidence": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "falsifiers": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "id",
              "statement",
              "type",
              "evidenceIds",
              "confidence"
            ],
            "additionalProperties": false
          }
        },
        "counterEvidence": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "sourceId": {
                "type": "string",
                "minLength": 1
              },
              "sourceType": {
                "type": "string",
                "enum": [
                  "onchain",
                  "market",
                  "issuer",
                  "regulatory",
                  "news",
                  "social",
                  "internal"
                ]
              },
              "title": {
                "type": "string",
                "minLength": 1
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "publisher": {
                "type": "string"
              },
              "retrievedAt": {
                "type": "string"
              },
              "publishedAt": {
                "type": "string"
              },
              "excerpt": {
                "type": "string",
                "maxLength": 600
              },
              "dataHash": {
                "type": "string"
              },
              "reliability": {
                "type": "string",
                "enum": [
                  "primary",
                  "high",
                  "medium",
                  "low"
                ]
              },
              "supportsClaimIds": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "licenseNotes": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "sourceId",
              "sourceType",
              "title",
              "retrievedAt",
              "reliability",
              "supportsClaimIds"
            ],
            "additionalProperties": false
          }
        },
        "methodology": {
          "type": "object",
          "properties": {
            "methods": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "transformations": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "comparisonWindow": {
              "type": "string"
            },
            "exclusions": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "codeVersion": {
              "type": "string"
            }
          },
          "required": [
            "methods",
            "transformations",
            "exclusions"
          ],
          "additionalProperties": false
        },
        "confidence": {
          "type": "object",
          "properties": {
            "score": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "band": {
              "type": "string",
              "enum": [
                "low",
                "moderate",
                "high"
              ]
            },
            "rationale": {
              "type": "string",
              "minLength": 1
            },
            "factors": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "contribution": {
                    "type": "number"
                  },
                  "explanation": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "contribution",
                  "explanation"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "score",
            "band",
            "rationale",
            "factors"
          ],
          "additionalProperties": false
        },
        "impact": {
          "type": "string",
          "enum": [
            "informational",
            "notable",
            "material",
            "critical"
          ]
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "disclosures": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "relatedResearchIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "provenance": {
          "type": "object",
          "properties": {
            "runId": {
              "type": "string",
              "minLength": 1
            },
            "agentVersion": {
              "type": "string",
              "minLength": 1
            },
            "modelRecords": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "minLength": 1
                  },
                  "model": {
                    "type": "string"
                  },
                  "purpose": {
                    "type": "string"
                  },
                  "promptVersion": {
                    "type": "string"
                  },
                  "completedAt": {
                    "type": "string"
                  }
                },
                "required": [
                  "provider",
                  "model",
                  "purpose",
                  "promptVersion",
                  "completedAt"
                ],
                "additionalProperties": false
              }
            },
            "sourceSnapshotHash": {
              "type": "string"
            },
            "contentHash": {
              "type": "string"
            }
          },
          "required": [
            "runId",
            "agentVersion",
            "modelRecords",
            "sourceSnapshotHash",
            "contentHash"
          ],
          "additionalProperties": false
        },
        "publication": {
          "type": "object",
          "properties": {
            "canonicalUrl": {
              "type": "string",
              "format": "uri"
            },
            "publishedAt": {
              "type": "string"
            },
            "updatedAt": {
              "type": "string"
            },
            "revisionNote": {
              "type": "string"
            }
          },
          "required": [
            "canonicalUrl",
            "publishedAt",
            "updatedAt"
          ],
          "additionalProperties": false
        },
        "distribution": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "channel": {
                "type": "string",
                "enum": [
                  "x",
                  "youtube",
                  "medium"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "published",
                  "failed",
                  "manual_review"
                ]
              },
              "externalUrl": {
                "type": "string",
                "format": "uri"
              },
              "externalId": {
                "type": "string"
              },
              "publishedAt": {
                "type": "string"
              },
              "attemptCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "lastErrorCode": {
                "type": "string"
              }
            },
            "required": [
              "channel",
              "status",
              "attemptCount"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "schemaVersion",
        "id",
        "slug",
        "version",
        "status",
        "category",
        "title",
        "dek",
        "summary",
        "thesis",
        "whyItMatters",
        "assets",
        "entities",
        "tags",
        "timeWindow",
        "observations",
        "evidence",
        "claims",
        "counterEvidence",
        "methodology",
        "confidence",
        "impact",
        "limitations",
        "disclosures",
        "relatedResearchIds",
        "provenance",
        "publication",
        "distribution"
      ],
      "additionalProperties": false
    },
    "publicResearchEvent": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "occurredAt": {
          "type": "string"
        },
        "stage": {
          "type": "string",
          "enum": [
            "observing",
            "researching",
            "analyzing",
            "synthesizing",
            "verifying",
            "published",
            "withheld"
          ]
        },
        "kind": {
          "type": "string",
          "enum": [
            "source_discovered",
            "observation_recorded",
            "anomaly_detected",
            "evidence_verified",
            "conflict_found",
            "draft_created",
            "review_completed",
            "publication_created"
          ]
        },
        "message": {
          "type": "string",
          "minLength": 1
        },
        "sourceClass": {
          "type": "string",
          "enum": [
            "onchain",
            "market",
            "issuer",
            "regulatory",
            "news",
            "social"
          ]
        },
        "publicMetadata": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ]
          }
        }
      },
      "required": [
        "id",
        "runId",
        "occurredAt",
        "stage",
        "kind",
        "message"
      ],
      "additionalProperties": false
    }
  }
}