{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.connectsoft.ai/reference/schemas/blueprint-ux.schema.json",
  "title": "User Experience Blueprint (blueprint-ux-v1)",
  "description": "Descriptor document of the User Experience Blueprint kind (BC-02). Validated by BlueprintService; metadata per blueprint-common.schema.json; generation outputs and validation rules per model/blueprints.yaml.",
  "type": "object",
  "required": [
    "metadata",
    "personas",
    "journeys",
    "screens",
    "stateFamilies",
    "designSystem",
    "accessibility",
    "locales"
  ],
  "additionalProperties": false,
  "properties": {
    "metadata": {
      "$ref": "blueprint-common.schema.json#/$defs/Metadata"
    },
    "personas": {
      "type": "array",
      "items": {
        "$ref": "blueprint-common.schema.json#/$defs/Persona"
      }
    },
    "journeys": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "personaId",
          "steps"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "personaId": {
            "type": "string"
          },
          "steps": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "screenId"
              ],
              "properties": {
                "screenId": {
                  "type": "string"
                },
                "decision": {
                  "type": "string"
                },
                "adverse": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      }
    },
    "screens": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "title",
          "readModels",
          "states",
          "roles"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "workArea": {
            "type": "string"
          },
          "readModels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "commands": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      }
    },
    "stateFamilies": {
      "type": "array",
      "items": {
        "enum": [
          "asset-readiness",
          "deployment-availability",
          "run",
          "approval",
          "usage",
          "freshness"
        ]
      }
    },
    "designSystem": {
      "type": "object",
      "required": [
        "tokens"
      ],
      "properties": {
        "tokens": {
          "type": "string"
        },
        "statusPalette": {
          "type": "string"
        },
        "components": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "accessibility": {
      "type": "object",
      "required": [
        "wcag"
      ],
      "properties": {
        "wcag": {
          "enum": [
            "2.2-AA"
          ]
        },
        "keyboard": {
          "type": "boolean"
        },
        "reducedMotion": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "locales": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "rtlLocales": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "handoff": {
      "type": "object",
      "required": [],
      "properties": {
        "masterBriefRef": {
          "type": "string"
        },
        "packs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "fixturesRef": {
          "type": "string"
        },
        "acceptanceRef": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  }
}
