{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://governedai.ai/schemas/nda_status.schema.json",
  "title": "NDA Status Record",
  "description": "A single NDA status record. The schema is published; specific NDA records are TIER_2_NDA and are never public.",
  "type": "object",
  "required": [
    "nda_id",
    "schema_version",
    "counterparty_id",
    "nda_type",
    "status",
    "scope",
    "executed_at",
    "term"
  ],
  "additionalProperties": false,
  "properties": {
    "nda_id": {
      "type": "string",
      "pattern": "^NDA-[0-9]{4}-[A-Z0-9]{8}$",
      "description": "Internal opaque NDA identifier"
    },
    "schema_version": {
      "type": "string",
      "const": "0.1.0"
    },
    "counterparty_id": {
      "type": "string",
      "pattern": "^CP-[A-Z0-9]{8}$",
      "description": "Reference to counterparty_registry entry"
    },
    "nda_type": {
      "type": "string",
      "enum": ["mutual", "unilateral_inbound", "unilateral_outbound", "scoped_evaluation", "partner_tier"]
    },
    "status": {
      "type": "string",
      "enum": ["draft", "executed", "active", "expired", "terminated"]
    },
    "scope": {
      "type": "object",
      "required": ["description", "tier_ceiling"],
      "properties": {
        "description": {
          "type": "string",
          "description": "Free-form scope description; what the NDA covers"
        },
        "tier_ceiling": {
          "type": "string",
          "enum": ["TIER_1_PARTNER", "TIER_2_NDA", "TIER_3_INTERNAL_ONLY"],
          "description": "Highest tier the NDA permits disclosure of"
        },
        "platforms": {
          "type": "array",
          "items": { "type": "string" }
        },
        "exclusions": {
          "type": "array",
          "items": { "type": "string" },
          "description": "Explicit exclusions from the NDA scope (e.g. patent-sensitive material)"
        }
      },
      "additionalProperties": false
    },
    "executed_at": {
      "type": "string",
      "format": "date-time"
    },
    "term": {
      "type": "object",
      "required": ["duration_months"],
      "properties": {
        "duration_months": {
          "type": "integer",
          "minimum": 1,
          "maximum": 120
        },
        "expires_at": {
          "type": "string",
          "format": "date-time"
        },
        "survives_termination_clauses": {
          "type": "array",
          "items": { "type": "string" }
        }
      },
      "additionalProperties": false
    },
    "named_signatories": {
      "type": "array",
      "minItems": 2,
      "items": {
        "type": "object",
        "required": ["organization", "named_signer"],
        "properties": {
          "organization": { "type": "string" },
          "named_signer": { "type": "string" },
          "title": { "type": "string" }
        },
        "additionalProperties": false
      }
    },
    "counsel_of_record": {
      "type": "object",
      "properties": {
        "optimax_counsel": { "type": "string" },
        "counterparty_counsel": { "type": "string" }
      },
      "additionalProperties": false
    },
    "audit_log": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["timestamp", "action"],
        "properties": {
          "timestamp": { "type": "string", "format": "date-time" },
          "action": { "type": "string" },
          "actor": { "type": "string" }
        }
      }
    }
  }
}
