{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://spec.super-arc.com/0.1.0/faction.json",
  "title": "Faction",
  "description": "A Faction 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",
    "goal"
  ],
  "properties": {
    "id": {
      "$ref": "common.json#/$defs/id"
    },
    "specType": {
      "const": "faction"
    },
    "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"
    },
    "goal": {
      "type": "string",
      "description": "What it is trying to achieve."
    },
    "power": {
      "type": [
        "object",
        "null"
      ],
      "description": "What it can actually make happen.",
      "properties": {
        "resources": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "reach": {
          "type": "string"
        }
      }
    },
    "membership": {
      "type": [
        "object",
        "null"
      ],
      "description": "Who belongs, and how one joins.",
      "properties": {
        "members": {
          "type": "array",
          "items": {
            "$ref": "common.json#/$defs/ref"
          }
        },
        "criteria": {
          "type": "string"
        }
      }
    },
    "relations": {
      "type": [
        "object",
        "null"
      ],
      "description": "Standing with other factions.",
      "properties": {
        "relationships": {
          "type": "array",
          "items": {
            "$ref": "common.json#/$defs/ref"
          }
        },
        "notes": {
          "type": "string"
        }
      }
    },
    "tells": {
      "type": [
        "object",
        "null"
      ],
      "description": "How a reader recognises its hand in a scene.",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  },
  "x-depthOrder": [
    "power",
    "membership",
    "relations",
    "tells"
  ]
}
