{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://spec.super-arc.com/0.1.0/relationship.json",
  "title": "Relationship",
  "description": "A Relationship 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",
    "endpoints",
    "kind"
  ],
  "properties": {
    "id": {
      "$ref": "common.json#/$defs/id"
    },
    "specType": {
      "const": "relationship"
    },
    "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"
    },
    "endpoints": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "items": {
        "$ref": "common.json#/$defs/ref"
      },
      "description": "Exactly two typed refs. Both must resolve."
    },
    "kind": {
      "type": "string",
      "description": "kin, rival, mentor, debt, …"
    },
    "valence": {
      "type": [
        "object",
        "null"
      ],
      "description": "Warm, cold, or load-bearing in both directions.",
      "properties": {
        "text": {
          "type": "string"
        }
      }
    },
    "history": {
      "type": [
        "object",
        "null"
      ],
      "description": "How it got this way.",
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "$ref": "common.json#/$defs/ref"
          }
        },
        "notes": {
          "type": "string"
        }
      }
    },
    "visibility": {
      "type": [
        "object",
        "null"
      ],
      "description": "What it looks like in public versus in private.",
      "properties": {
        "public": {
          "type": "string"
        },
        "private": {
          "type": "string"
        }
      }
    },
    "currentState": {
      "type": [
        "object",
        "null"
      ],
      "description": "Where it stands as of the pinned present.",
      "properties": {
        "text": {
          "type": "string"
        }
      }
    }
  },
  "x-depthOrder": [
    "valence",
    "history",
    "visibility",
    "currentState"
  ]
}
