{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://causamarkets.com/data/schema.json",
  "title": "Causa edition",
  "description": "Causa open data, schema version 1.2. One edition per weekday; each Cause File explains one market move, cites its sources sentence by sentence, grades its confidence and states the condition that would prove it wrong. Calls are immutable after publication; rulings and corrections are added as dated records.",
  "x-version": "1.2",
  "x-changes": [
    {
      "version": "1.2",
      "date": "2026-10-31",
      "change": "Added the Proof Ledger (/data/ledger.json): every call sealed at publication with a SHA-256 fingerprint over canonical JSON, chained to the previous entry and anchored with OpenTimestamps; calls in /data/scorecard.json gain a fingerprint field."
    },
    {
      "version": "1.1",
      "date": "2026-10-30",
      "change": "Added alternatives (other explanations weighed) to Cause Files, session to pre-open editions, and schemaVersion, schemaUrl and thirdPartyData to every data file."
    },
    {
      "version": "1.0",
      "date": "2026-10-22",
      "change": "First published format."
    }
  ],
  "x-ledger": {
    "url": "https://causamarkets.com/data/ledger.json",
    "entry": "{ v, seq, id, edition, published, sealed, call: { text, mode, test, evidenceNeeded, deadline }, textHash, prev, hash }",
    "hash": "SHA-256 of the canonical JSON (keys sorted, no spaces, UTF-8) of the entry without its hash field. prev is the previous entry hash; the first entry links to 64 zeros.",
    "verify": "https://causamarkets.com/proof/"
  },
  "type": "object",
  "required": [
    "id",
    "number",
    "date",
    "asOf",
    "headline",
    "lede",
    "board",
    "files",
    "sources"
  ],
  "properties": {
    "schemaVersion": {
      "type": "string"
    },
    "id": {
      "type": "string",
      "format": "date",
      "description": "Stable edition id, the publication date."
    },
    "number": {
      "type": "integer"
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "session": {
      "type": "string",
      "format": "date",
      "description": "Trading session the moves describe, when it differs from the publication date."
    },
    "asOf": {
      "type": "string",
      "format": "date-time"
    },
    "intraday": {
      "type": "boolean",
      "description": "True when levels were taken while markets were open."
    },
    "headline": {
      "type": "string",
      "maxLength": 80
    },
    "lede": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "p",
          "src"
        ],
        "properties": {
          "p": {
            "type": "string"
          },
          "src": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "description": "Source ids, keys of the edition's sources object."
          }
        }
      }
    },
    "board": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "asset",
          "label",
          "value",
          "change",
          "changeType"
        ],
        "properties": {
          "asset": {
            "type": "string"
          },
          "value": {
            "type": "number"
          },
          "change": {
            "type": "number"
          },
          "changeType": {
            "enum": [
              "pct",
              "bp",
              "abs"
            ]
          },
          "file": {
            "type": "string"
          },
          "ref": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "src": {
            "type": "string"
          }
        }
      }
    },
    "files": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "slug",
          "asset",
          "title",
          "move",
          "summary",
          "chain",
          "body",
          "notThis",
          "grade",
          "falsifier"
        ],
        "properties": {
          "slug": {
            "type": "string",
            "description": "Permanent address: /cause/{slug}/. Moved slugs redirect."
          },
          "asset": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "move": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "dir": {
                "enum": [
                  "up",
                  "down",
                  "flat"
                ]
              },
              "note": {
                "type": "string"
              }
            }
          },
          "chain": {
            "type": "array",
            "minItems": 3,
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "enum": [
                    "trigger",
                    "channel",
                    "move"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "body": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "p",
                "src"
              ],
              "properties": {
                "k": {
                  "enum": [
                    "observed",
                    "reported",
                    "read",
                    "note"
                  ],
                  "description": "Evidence kind: observed data, reported by a source, our read, or a desk note."
                },
                "p": {
                  "type": "string"
                },
                "src": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "minItems": 1,
                  "description": "Source ids, keys of the edition's sources object."
                }
              }
            }
          },
          "alternatives": {
            "type": "array",
            "description": "Explanations weighed and not chosen.",
            "items": {
              "type": "object",
              "required": [
                "claim",
                "assessment",
                "weight",
                "src"
              ],
              "properties": {
                "claim": {
                  "type": "string"
                },
                "assessment": {
                  "type": "string"
                },
                "weight": {
                  "enum": [
                    "live",
                    "weaker",
                    "ruled-out"
                  ]
                },
                "src": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "minItems": 1,
                  "description": "Source ids, keys of the edition's sources object."
                }
              }
            }
          },
          "notThis": {
            "type": "string"
          },
          "grade": {
            "enum": [
              "A",
              "B",
              "C"
            ]
          },
          "falsifier": {
            "type": "object",
            "required": [
              "id",
              "text",
              "mode",
              "deadline"
            ],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^F-\\d{3,}$",
                "description": "Permanent call id."
              },
              "text": {
                "type": "string",
                "description": "Published wording. Never edited."
              },
              "mode": {
                "enum": [
                  "auto",
                  "editor"
                ]
              },
              "test": {
                "type": "object",
                "description": "auto mode: all clauses must hold on the same close.",
                "properties": {
                  "all": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "metric",
                        "op",
                        "value"
                      ],
                      "properties": {
                        "metric": {
                          "enum": [
                            "nasdaq",
                            "spx",
                            "us10y",
                            "brent",
                            "wti",
                            "gold",
                            "dxy",
                            "btc",
                            "eth"
                          ]
                        },
                        "op": {
                          "enum": [
                            "<",
                            ">",
                            "<=",
                            ">="
                          ]
                        },
                        "value": {
                          "type": "number"
                        },
                        "streak": {
                          "type": "integer",
                          "minimum": 1,
                          "description": "Consecutive closes required. Default 1."
                        }
                      }
                    }
                  }
                }
              },
              "evidenceNeeded": {
                "type": "string",
                "description": "editor mode: the official evidence that would settle the call."
              },
              "deadline": {
                "type": "string",
                "format": "date"
              }
            }
          }
        }
      }
    },
    "sources": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "required": [
          "title",
          "publisher",
          "date",
          "url"
        ]
      }
    }
  }
}