{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tsep-protocol.org/assets/schemas/directives.2.1.0-20261122.schema.json",
  "title": "TSEP SEO and GEO directive matrix — 2.1.0",
  "description": "Documentary statements, captured evidence and explicit unknowns. Validation checks structure, not factual truth or crawler compliance. No copied AI register.",
  "type": "object",
  "required": [
    "id",
    "schema_version",
    "schema_url",
    "date_published",
    "edition",
    "editorial_version",
    "checked_at",
    "content_sha256",
    "content_hash_material",
    "field_definitions",
    "human_review",
    "human_reviews",
    "statuses",
    "usages",
    "operators",
    "surfaces",
    "directives",
    "cells",
    "divergences",
    "deadlines",
    "evidence",
    "timestamp",
    "revisions",
    "related_datasets",
    "review_content_sha256",
    "review_hash_material"
  ],
  "properties": {
    "id": {
      "const": "tsep-directives"
    },
    "schema_version": {
      "const": "2.1.0"
    },
    "schema_url": {
      "const": "https://tsep-protocol.org/assets/schemas/directives.2.1.0-20261122.schema.json"
    },
    "date_published": {
      "const": "2026-11-05"
    },
    "edition": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "editorial_version": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}\\.[a-f0-9]{12}$"
    },
    "checked_at": {
      "type": "string"
    },
    "content_sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "content_hash_material": {
      "type": "object",
      "required": [
        "documentary_sha256",
        "documentary_fields",
        "representation_sha256",
        "related_dataset",
        "elapsed_deadlines"
      ],
      "properties": {
        "documentary_sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "documentary_fields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "representation_sha256": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "related_dataset": {
          "type": "object"
        },
        "elapsed_deadlines": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "field_definitions": {
      "type": "object"
    },
    "human_review": {
      "anyOf": [
        {
          "$ref": "#/$defs/review"
        },
        {
          "type": "null"
        }
      ]
    },
    "human_reviews": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/review"
      }
    },
    "statuses": {
      "type": "object",
      "required": [
        "documented",
        "dated_source",
        "announced",
        "in_force_until",
        "unused",
        "unsupported",
        "no_endpoint",
        "documented_silence",
        "to_research",
        "not_applicable",
        "outside_corpus"
      ],
      "additionalProperties": {
        "$ref": "#/$defs/localized"
      }
    },
    "usages": {
      "type": [
        "object",
        "array"
      ]
    },
    "operators": {
      "type": "array",
      "minItems": 7,
      "items": {
        "type": "object",
        "required": [
          "id",
          "name"
        ]
      }
    },
    "surfaces": {
      "type": "array",
      "minItems": 7,
      "items": {
        "type": "object",
        "required": [
          "id",
          "operator"
        ]
      }
    },
    "directives": {
      "type": "array",
      "minItems": 22,
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "views",
          "content_by_view",
          "scope_by_view"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "$ref": "#/$defs/localized"
          },
          "views": {
            "type": "array",
            "items": {
              "enum": [
                "search",
                "ai_answer"
              ]
            }
          },
          "content_by_view": {
            "type": "object",
            "minProperties": 1,
            "properties": {
              "search": {
                "type": "object",
                "required": [
                  "id",
                  "name",
                  "effect",
                  "limits"
                ],
                "properties": {
                  "name": {
                    "$ref": "#/$defs/localized"
                  },
                  "effect": {
                    "$ref": "#/$defs/localized"
                  },
                  "limits": {
                    "$ref": "#/$defs/localized"
                  }
                }
              },
              "ai_answer": {
                "type": "object",
                "required": [
                  "id",
                  "name",
                  "effect",
                  "limits"
                ],
                "properties": {
                  "name": {
                    "$ref": "#/$defs/localized"
                  },
                  "effect": {
                    "$ref": "#/$defs/localized"
                  },
                  "limits": {
                    "$ref": "#/$defs/localized"
                  }
                }
              }
            },
            "additionalProperties": false
          }
        }
      }
    },
    "cells": {
      "type": "array",
      "minItems": 154,
      "items": {
        "$ref": "#/$defs/cell"
      }
    },
    "divergences": {
      "type": "array"
    },
    "deadlines": {
      "type": "array"
    },
    "evidence": {
      "type": "object",
      "minProperties": 21,
      "additionalProperties": {
        "type": "object",
        "required": [
          "url",
          "capture",
          "sha256",
          "observed"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "capture": {
            "type": "string",
            "pattern": "^/assets/"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "observed": {
            "type": "string"
          }
        }
      }
    },
    "timestamp": {
      "type": [
        "object",
        "null"
      ]
    },
    "revisions": {
      "type": "array"
    },
    "related_datasets": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "id",
          "url",
          "relation",
          "edition",
          "content_sha256",
          "view_sha256"
        ],
        "properties": {
          "id": {
            "const": "tsep-ai-crawlers"
          },
          "relation": {
            "const": "complements"
          },
          "content_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "view_sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        }
      }
    },
    "review_content_sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "review_hash_material": {
      "type": "object",
      "required": [
        "review_contract",
        "documentary_sha256",
        "documentary_fields",
        "related_dataset"
      ],
      "properties": {
        "review_contract": {
          "const": "directives-documentary-v1"
        },
        "documentary_sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "documentary_fields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "related_dataset": {
          "type": "object",
          "required": [
            "id",
            "view_sha256"
          ],
          "properties": {
            "id": {
              "const": "tsep-ai-crawlers"
            },
            "view_sha256": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "not": {
    "anyOf": [
      {
        "required": [
          "ai_rows"
        ]
      },
      {
        "required": [
          "rows"
        ]
      }
    ]
  },
  "$defs": {
    "localized": {
      "type": "object",
      "required": [
        "fr",
        "en"
      ],
      "properties": {
        "fr": {
          "type": "string"
        },
        "en": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "source": {
      "type": "object",
      "required": [
        "key",
        "passage_sha256"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "passage_sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "passage": {
          "type": "string",
          "minLength": 1
        },
        "passage_basis": {
          "const": "text_capture"
        },
        "passage_start": {
          "type": "integer",
          "minimum": 0
        },
        "passage_end": {
          "type": "integer",
          "minimum": 1
        }
      },
      "anyOf": [
        {
          "required": [
            "passage"
          ]
        },
        {
          "required": [
            "passage_basis",
            "passage_start",
            "passage_end"
          ]
        }
      ]
    },
    "review": {
      "type": "object",
      "required": [
        "name",
        "date",
        "content_sha256",
        "matches_current"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "date": {
          "type": "string"
        },
        "content_sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "matches_current": {
          "type": "boolean"
        },
        "languages": {
          "type": "array",
          "items": {
            "enum": [
              "fr",
              "en"
            ]
          }
        },
        "review_content_sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "basis": {
          "enum": [
            "documentary",
            "legacy_documentary_equivalence"
          ]
        }
      }
    },
    "cell": {
      "type": "object",
      "required": [
        "directive",
        "surface",
        "usages",
        "status",
        "note",
        "sources",
        "observed",
        "checked_at",
        "docs_consulted",
        "source",
        "view"
      ],
      "properties": {
        "directive": {
          "type": "string"
        },
        "surface": {
          "type": "string"
        },
        "usages": {
          "type": "array",
          "minItems": 1,
          "items": {
            "enum": [
              "crawl",
              "index",
              "snippet",
              "ai_answer",
              "training",
              "user_fetch"
            ]
          }
        },
        "status": {
          "enum": [
            "documented",
            "dated_source",
            "announced",
            "in_force_until",
            "unused",
            "unsupported",
            "no_endpoint",
            "documented_silence",
            "to_research",
            "not_applicable",
            "outside_corpus"
          ]
        },
        "note": {
          "$ref": "#/$defs/localized"
        },
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/source"
          }
        },
        "observed": {
          "type": [
            "object",
            "null"
          ]
        },
        "checked_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "effective_from": {
          "type": [
            "string",
            "null"
          ]
        },
        "effective_until": {
          "type": [
            "string",
            "null"
          ]
        },
        "docs_consulted": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "effective_from_label": {
          "oneOf": [
            {
              "$ref": "#/$defs/localized"
            },
            {
              "type": "null"
            }
          ]
        },
        "source": {
          "type": [
            "string",
            "null"
          ]
        },
        "view": {
          "enum": [
            "search",
            "ai_answer"
          ]
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "status": {
                "not": {
                  "enum": [
                    "to_research",
                    "not_applicable",
                    "outside_corpus"
                  ]
                }
              }
            }
          },
          "then": {
            "properties": {
              "sources": {
                "minItems": 1
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "documented_silence"
              }
            }
          },
          "then": {
            "properties": {
              "docs_consulted": {
                "minItems": 1,
                "items": {
                  "type": "object",
                  "required": [
                    "source",
                    "checked_at",
                    "terms"
                  ],
                  "properties": {
                    "source": {
                      "type": "string",
                      "minLength": 1
                    },
                    "checked_at": {
                      "type": "string",
                      "minLength": 10
                    },
                    "terms": {
                      "type": "array",
                      "minItems": 1,
                      "items": {
                        "type": "string",
                        "minLength": 1
                      }
                    }
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "announced"
              }
            }
          },
          "then": {
            "anyOf": [
              {
                "required": [
                  "effective_from"
                ],
                "properties": {
                  "effective_from": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  }
                }
              },
              {
                "required": [
                  "effective_from_label"
                ],
                "properties": {
                  "effective_from": {
                    "type": "null"
                  },
                  "effective_from_label": {
                    "$ref": "#/$defs/localized"
                  }
                }
              }
            ]
          }
        },
        {
          "if": {
            "properties": {
              "status": {
                "const": "in_force_until"
              }
            }
          },
          "then": {
            "required": [
              "effective_until"
            ],
            "properties": {
              "effective_until": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              }
            }
          }
        }
      ]
    }
  }
}
