{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://spec.super-arc.com/0.1.0/ruleset.json",
  "title": "Ruleset",
  "description": "A Ruleset in the Narrative Spec. Required core is deliberately tiny: a stub is valid, and depth is scored rather than demanded. Depth groups are the optional top-level objects below; a group is started when its key is present and its value is a non-null object, including {}.",
  "type": "object",
  "required": [
    "id",
    "specType",
    "specVersion",
    "name",
    "systems"
  ],
  "properties": {
    "id": {
      "$ref": "common.json#/$defs/id"
    },
    "specType": {
      "const": "ruleset"
    },
    "specVersion": {
      "$ref": "common.json#/$defs/specVersion"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "description": "Display name. May change; the slug in id may not."
    },
    "status": {
      "$ref": "common.json#/$defs/status"
    },
    "extensions": {
      "$ref": "common.json#/$defs/extensions"
    },
    "systems": {
      "type": "array",
      "minItems": 1,
      "description": "At least one system. A system marked complete must have cost, limit and tell started.",
      "items": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "complete": {
            "type": "boolean",
            "default": false,
            "description": "Writer asserts this system is fully specified. Triggers the cost/limit/tell invariant."
          }
        }
      }
    },
    "kind": {
      "type": [
        "object",
        "null"
      ],
      "description": "What sort of system this is: magic, technology, social, physical.",
      "properties": {
        "text": {
          "type": "string"
        }
      }
    },
    "cost": {
      "type": [
        "object",
        "null"
      ],
      "description": "What using it takes from the user.",
      "properties": {
        "text": {
          "type": "string"
        }
      }
    },
    "limit": {
      "type": [
        "object",
        "null"
      ],
      "description": "What it cannot do, and where it stops.",
      "properties": {
        "text": {
          "type": "string"
        }
      }
    },
    "tell": {
      "type": [
        "object",
        "null"
      ],
      "description": "How a reader knows it was used.",
      "properties": {
        "text": {
          "type": "string"
        }
      }
    },
    "notes": {
      "type": [
        "object",
        "null"
      ],
      "description": "Anything else the writer needs on the record.",
      "properties": {
        "text": {
          "type": "string"
        }
      }
    }
  },
  "x-depthOrder": [
    "kind",
    "cost",
    "limit",
    "tell",
    "notes"
  ]
}
