{
  "$id": "https://schema.workspec.io/v1alpha1/c4/external-system.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "An external-system element: a system outside the project boundary.",
  "properties": {
    "description": {
      "description": "What this external system provides and how it is used.",
      "minLength": 1,
      "type": "string"
    },
    "links": {
      "description": "Cross-references to other artifacts or docs: exactly one {<linkType>: <pathRef>} pair per entry, plus an optional cardinality key ({from, to, label?}). Path refs must start with \"~/\" or \"@workspace/\".",
      "items": {
        "additionalProperties": {},
        "propertyNames": {
          "description": "The link type, e.g. \"adr\", \"runbook\" — or \"cardinality\" for the optional cardinality key.",
          "type": "string"
        },
        "type": "object"
      },
      "type": "array"
    },
    "source": {
      "description": "Freeform provenance note: how or where this artifact was sourced from.",
      "type": "string"
    },
    "tags": {
      "description": "Free-text labels for filtering and grouping.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "title": {
      "description": "Human-readable name of the external system.",
      "type": "string"
    },
    "type": {
      "const": "external-system",
      "description": "Redundant kind literal; inferred from directory when absent.",
      "type": "string"
    }
  },
  "required": [
    "title",
    "description"
  ],
  "title": "WorkSpec C4 External System (v1alpha1)",
  "type": "object"
}
