{
  "$defs": {
    "CampaignFault": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$",
          "title": "Name",
          "type": "string"
        },
        "signal_faults": {
          "default": [],
          "description": "Empty: the nominal case",
          "items": {
            "$ref": "#/$defs/SignalFault"
          },
          "title": "Signal Faults",
          "type": "array"
        }
      },
      "required": [
        "name"
      ],
      "title": "CampaignFault",
      "type": "object"
    },
    "CampaignVariant": {
      "additionalProperties": false,
      "properties": {
        "model": {
          "description": "A coupled model: the same system with this controller variant",
          "pattern": "^sha256:[0-9a-f]{64}$",
          "title": "Model",
          "type": "string"
        },
        "name": {
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$",
          "title": "Name",
          "type": "string"
        }
      },
      "required": [
        "name",
        "model"
      ],
      "title": "CampaignVariant",
      "type": "object"
    },
    "SignalFault": {
      "additionalProperties": false,
      "description": "A fault on a signal between two components: what the receiving\ncomponent reads instead of the true value.",
      "properties": {
        "at": {
          "description": "When it starts",
          "minimum": 0,
          "title": "At",
          "type": "number"
        },
        "kind": {
          "enum": [
            "stuck",
            "offset",
            "drift",
            "noise",
            "delay",
            "dropout"
          ],
          "title": "Kind",
          "type": "string"
        },
        "name": {
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$",
          "title": "Name",
          "type": "string"
        },
        "signal": {
          "description": "The input it corrupts: component.input",
          "pattern": "^[A-Za-z][A-Za-z0-9_-]*\\.\\S+$",
          "title": "Signal",
          "type": "string"
        },
        "steps": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "delay: communication steps",
          "title": "Steps"
        },
        "until": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "When it ends; never if absent",
          "title": "Until"
        },
        "value": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "stuck: the value read (absent: the last true value); offset: added; drift: added per time unit; noise: standard deviation; dropout: the value read (absent: 0)",
          "title": "Value"
        }
      },
      "required": [
        "name",
        "signal",
        "kind",
        "at"
      ],
      "title": "SignalFault",
      "type": "object"
    }
  },
  "$id": "mokili.campaign/1",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Requirements checked across controller variants and faults: every\nvariant meets every fault, from one base scenario.",
  "properties": {
    "base": {
      "description": "The scenario each cell starts from",
      "pattern": "^sha256:[0-9a-f]{64}$",
      "title": "Base",
      "type": "string"
    },
    "faults": {
      "items": {
        "$ref": "#/$defs/CampaignFault"
      },
      "minItems": 1,
      "title": "Faults",
      "type": "array"
    },
    "name": {
      "minLength": 1,
      "title": "Name",
      "type": "string"
    },
    "requirements": {
      "items": {
        "pattern": "^sha256:[0-9a-f]{64}$",
        "type": "string"
      },
      "minItems": 1,
      "title": "Requirements",
      "type": "array"
    },
    "schema": {
      "const": "mokili.campaign/1",
      "title": "Schema",
      "type": "string"
    },
    "variants": {
      "items": {
        "$ref": "#/$defs/CampaignVariant"
      },
      "minItems": 1,
      "title": "Variants",
      "type": "array"
    }
  },
  "required": [
    "schema",
    "name",
    "base",
    "variants",
    "faults",
    "requirements"
  ],
  "title": "Campaign",
  "type": "object"
}
