{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://surfingdog.ai/spec/schemas/capabilities.json",
  "title": "The capability vocabulary (vocab/capabilities.json)",
  "type": "object",
  "properties": {
    "version": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991
    },
    "name": {
      "type": "string"
    },
    "title": {
      "description": "Version 2: the vocabulary's title for people.",
      "type": "string"
    },
    "published": {
      "description": "Version 2: the day this version was published.",
      "type": "string",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
    },
    "licence": {
      "description": "Version 2: \"MIT\".",
      "type": "string"
    },
    "url": {
      "description": "Version 2: where the latest version is served.",
      "type": "string",
      "format": "uri"
    },
    "summary": {
      "type": "string"
    },
    "states": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": ["yes", "partial", "no", "na"]
      }
    },
    "state_meanings": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "enum": ["yes", "partial", "no", "na"]
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": ["declared", "tested", "proven"]
      }
    },
    "evidence_meanings": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "enum": ["declared", "tested", "proven"]
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "produced": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": ["declared", "tested", "proven"]
      },
      "description": "The evidence steps the publishing network produces today. Not part of what the capabilities mean: another network may produce other steps of the same ladder."
    },
    "lead": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9_]{0,31}$",
        "description": "A name the vocabulary gives: lower case, never renamed. The list of this version is in the document."
      },
      "description": "Which capabilities the publishing network's result pages show first. A presentation choice, not part of what the capabilities mean."
    },
    "journeys": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9_]{0,31}$",
        "description": "A name the vocabulary gives: lower case, never renamed. The list of this version is in the document."
      }
    },
    "doors": {
      "description": "Version 2: the kinds of door, and how each is read.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,31}$",
            "description": "A name the vocabulary gives: lower case, never renamed. The list of this version is in the document."
          },
          "label": {
            "type": "string"
          },
          "via": {
            "type": "string",
            "description": "What of the door is read: an item type, a tool, a skill, an operation…"
          },
          "spec": {
            "description": "The door's own specification.",
            "type": "string",
            "format": "uri"
          },
          "experimental": {
            "type": "boolean"
          },
          "how": {
            "type": "string"
          }
        },
        "required": ["id", "label", "via", "how"]
      }
    },
    "never_doors": {
      "description": "Version 2: what never meets a capability.",
      "type": "string"
    },
    "names": {
      "description": "Version 2: how a tool, skill or operation name is read.",
      "type": "string"
    },
    "capabilities": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,31}$",
            "description": "A name the vocabulary gives: lower case, never renamed. The list of this version is in the document."
          },
          "journey": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,31}$",
            "description": "A name the vocabulary gives: lower case, never renamed. The list of this version is in the document."
          },
          "label": {
            "type": "string"
          },
          "question": {
            "type": "string"
          },
          "definition": {
            "description": "Version 2: what doing it means, in one or two sentences.",
            "type": "string"
          },
          "aliases": {
            "description": "Version 2: other words people and agents use for it.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "kind": {
            "description": "Version 2: the request kind a directory filters by for it (`accepts=`), where there is one.",
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,31}$"
          },
          "partial": {
            "description": "Version 2: what the state partial means for it.",
            "type": "string"
          },
          "evidence": {
            "description": "Version 2: what has to be seen at each step of the ladder.",
            "type": "object",
            "properties": {
              "declared": {
                "type": "string"
              },
              "tested": {
                "type": "string"
              },
              "proven": {
                "type": "string"
              }
            },
            "required": ["declared", "tested", "proven"]
          },
          "not_enough": {
            "description": "Version 2: things that look like it and never meet it.",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "doors": {
            "description": "Version 2: how each kind of door meets it, by example names (an item type, a tool, a skill, an operation, a protocol's capability). A kind of door left out does not carry it.",
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,31}$",
              "description": "A name the vocabulary gives: lower case, never renamed. The list of this version is in the document."
            },
            "additionalProperties": {
              "minItems": 1,
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "required": ["id", "journey", "label", "question"]
      }
    },
    "changelog": {
      "description": "Version 2: every version and amendment, oldest first.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "date": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "The day of the change."
          },
          "change": {
            "type": "string",
            "enum": ["published", "amended"],
            "description": "published: the version came out; amended: it was changed in place, compatibly."
          },
          "summary": {
            "type": "string"
          }
        },
        "required": ["version", "date", "change", "summary"]
      }
    }
  },
  "required": ["version", "name", "states", "evidence", "produced", "lead", "journeys", "capabilities"]
}
