{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/schemas/demo-build.schema.json",
  "title": "Canonical Demo Build",
  "type": "object",
  "required": [
    "description",
    "objective",
    "demo_builds"
  ],
  "properties": {
    "description": {
      "type": "string",
      "minLength": 1
    },
    "objective": {
      "type": "string",
      "minLength": 1
    },
    "demo_builds": {
      "type": "array",
      "minItems": 2,
      "items": {
        "type": "object",
        "required": [
          "objective",
          "why",
          "fictionalDisclosure",
          "playbookId",
          "simulationId",
          "basePath",
          "sourceChain",
          "pages",
          "schemaEndpoint",
          "blockedPhrases",
          "qaGates",
          "reportPath",
          "completionCriteria",
          "residualRisks",
          "objectiveAlignment"
        ],
        "properties": {
          "objective": {
            "type": "string",
            "minLength": 1
          },
          "why": {
            "type": "string",
            "minLength": 1
          },
          "fictionalDisclosure": {
            "type": "string",
            "minLength": 20
          },
          "playbookId": {
            "type": "string",
            "minLength": 1
          },
          "simulationId": {
            "type": "string",
            "minLength": 1
          },
          "basePath": {
            "type": "string",
            "pattern": "^/"
          },
          "sourceChain": {
            "type": "array",
            "minItems": 3,
            "items": {
              "type": "object",
              "required": [
                "stage",
                "path",
                "purpose"
              ],
              "properties": {
                "stage": {
                  "enum": [
                    "manifest",
                    "working",
                    "derived"
                  ]
                },
                "path": {
                  "type": "string",
                  "minLength": 1
                },
                "purpose": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "pages": {
            "type": "array",
            "minItems": 5,
            "items": {
              "type": "object",
              "required": [
                "route",
                "title",
                "pagePatternId",
                "schemaTypes",
                "visibleClaims"
              ],
              "properties": {
                "route": {
                  "type": "string",
                  "pattern": "^/demo/"
                },
                "title": {
                  "type": "string",
                  "minLength": 1
                },
                "pagePatternId": {
                  "type": "string",
                  "minLength": 1
                },
                "schemaTypes": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "visibleClaims": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          },
          "schemaEndpoint": {
            "type": "string",
            "pattern": "^/"
          },
          "blockedPhrases": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "qaGates": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "reportPath": {
            "type": "string",
            "minLength": 1
          },
          "completionCriteria": {
            "type": "array",
            "minItems": 3,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "residualRisks": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "objectiveAlignment": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    }
  }
}
