{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://machinereadyknowledge.com/mrk-1.0.schema.json",
  "title": "MRK-1.0 - Machine-Ready Knowledge article front matter",
  "description": "An article is machine-ready when its front matter validates against this schema AND the editorial clauses hold: sections truly stand alone (the self_contained flag is a human attestation set at the curation gate, not inferred) and identifiers remain stable across the article's history (a process property, audited from revision history). Full standard: https://machinereadyknowledge.com",
  "type": "object",
  "required": ["id", "title", "applies_to", "owner", "lifecycle", "verified", "sections"],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]*-[0-9]+$",
      "description": "Immutable once assigned. Never reused, never renamed."
    },
    "title": {"type": "string", "minLength": 1},
    "type": {"type": "string"},
    "applies_to": {"$ref": "#/$defs/applicability"},
    "owner": {"type": "string"},
    "lifecycle": {"enum": ["current", "superseded", "retired"]},
    "verified": {"type": "string", "format": "date"},
    "supersedes": {"type": "string", "pattern": "^[a-z][a-z0-9-]*-[0-9]+$"},
    "sections": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/section"}}
  },
  "$defs": {
    "applicability": {
      "type": "object",
      "required": ["plan", "region"],
      "properties": {
        "plan": {"type": "array", "minItems": 1, "items": {"type": "string"}},
        "region": {"type": ["string", "array"]},
        "version": {"type": "string"}
      }
    },
    "section": {
      "type": "object",
      "required": ["id", "self_contained"],
      "properties": {
        "id": {"type": "string", "pattern": "^[a-z][a-z0-9-]*-[0-9]+#[a-z][a-z0-9-]*$"},
        "self_contained": {"const": true, "description": "Attested by a human curator, not inferred."}
      }
    }
  }
}
