{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Kenton Labs formal-CS record",
  "description": "Record structure. Domain-specific payload semantics require a named checker; schema validity is not formal verification.",
  "type": "object",
  "required": [
    "id",
    "version",
    "domain",
    "kind",
    "title",
    "problem",
    "specification",
    "claim",
    "witness",
    "verification_scope",
    "explanation",
    "limitations",
    "verification_status",
    "review_status",
    "provenance",
    "references",
    "license_status",
    "dataset",
    "lesson",
    "related_ids"
  ],
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^KL-FCS-[0-9]{3,}$"
    },
    "version": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
    },
    "domain": {
      "enum": [
        "Algorithms",
        "Automata",
        "Programming-language semantics",
        "Type systems",
        "SAT / SMT",
        "Model checking",
        "Circuit minimization",
        "Scheduling",
        "Compiler optimization",
        "Graph algorithms",
        "Formal languages",
        "Term rewriting",
        "Abstract interpretation",
        "Program verification",
        "Combinatorial optimization",
        "Constraint satisfaction",
        "Game theory",
        "Distributed protocols",
        "Information theory",
        "Finite probability",
        "Relational algebra",
        "Linear algebra over GF(2)"
      ]
    },
    "kind": {
      "enum": [
        "abstract",
        "algorithm",
        "automata",
        "circuits",
        "coding",
        "compiler",
        "constraints",
        "games",
        "graph",
        "hoare",
        "knapsack",
        "languages",
        "linear",
        "markov",
        "model-checking",
        "protocols",
        "relational",
        "rewriting",
        "sat",
        "scheduling",
        "semantics",
        "smt",
        "types"
      ]
    },
    "title": {
      "type": "string"
    },
    "problem": {
      "type": "string"
    },
    "specification": {
      "type": "object",
      "minProperties": 1
    },
    "claim": {
      "type": "object",
      "minProperties": 1
    },
    "witness": {
      "type": "object",
      "minProperties": 1
    },
    "verification_scope": {
      "type": "string"
    },
    "explanation": {
      "type": "string"
    },
    "limitations": {
      "type": "string"
    },
    "verification_status": {
      "enum": [
        "draft",
        "mechanically-checked",
        "failed",
        "unknown",
        "withdrawn"
      ]
    },
    "review_status": {
      "enum": [
        "awaiting-independent-review",
        "independently-reviewed",
        "withdrawn"
      ]
    },
    "provenance": {
      "type": "object",
      "required": [
        "origin",
        "external_dataset",
        "model_run"
      ],
      "additionalProperties": false,
      "properties": {
        "origin": {
          "type": "string"
        },
        "external_dataset": {
          "type": [
            "string",
            "null"
          ]
        },
        "model_run": {
          "type": [
            "object",
            "null"
          ]
        }
      }
    },
    "references": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "license_status": {
      "type": "string"
    },
    "dataset": {
      "type": "object",
      "minProperties": 1
    },
    "lesson": {
      "type": "object",
      "minProperties": 1
    },
    "related_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^KL-FCS-[0-9]{3,}$"
      }
    }
  }
}
