{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "RTT/1 Analyzer Schema",
  "description": "Canonical RTT/1 analyzer output schema.",
  "type": "object",

  "properties": {
    "module": { "type": "string" },
    "rtt": { "type": "number" },

    "coherence": { "type": ["number", "null"] },
    "drift": { "type": ["string", "null"] },

    "substrate": {
      "type": ["object", "null"],
      "properties": {
        "summary": { "type": ["string", "null"] },
        "signals": {
          "type": "array",
          "items": { "type": "string" }
        },
        "operators": {
          "type": "array",
          "items": { "type": "string" }
        }
      }
    },

    "diagnostics": {
      "type": "object",
      "properties": {
        "issues": {
          "type": "array",
          "items": { "type": "string" }
        },
        "warnings": {
          "type": "array",
          "items": { "type": "string" }
        },
        "stats": {
          "type": "object",
          "properties": {
            "timestamp": { "type": "number" },
            "length": { "type": "number" }
          }
        }
      }
    }
  },

  "required": ["module", "rtt", "substrate", "diagnostics"]
}
