{
    "$id": "https://cdn.jsdelivr.net/gh/Force-Organization-Army-Builder/fo_data_validator@2/schema/game.schema.json",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "$schema": {
            "description": "JSON Schema URL for editor support; ignored by Force Org",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema0"
                }
            ]
        },
        "name": {
            "$ref": "#/definitions/__schema1"
        },
        "description": {
            "$ref": "#/definitions/__schema2"
        },
        "id": {
            "$ref": "#/definitions/__schema3"
        },
        "version": {
            "type": "string"
        },
        "terms": {
            "description": "the game's own words for built-in concepts, in expressions and the UI",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema4"
                }
            ]
        },
        "roles": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "grants": {
                        "description": "contingent resources a filled slot of this role grants its contingent, e.g. `{ \"reserve\": 1, \"elite\": 1 }`; a slot with several roles grants as the first that grants anything",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema6"
                            }
                        ]
                    }
                },
                "required": [
                    "name",
                    "id"
                ],
                "additionalProperties": false
            }
        },
        "unitTypes": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema3"
                    }
                },
                "required": [
                    "name",
                    "id"
                ],
                "additionalProperties": false,
                "description": "A unit type; `description` holds the rules every unit of the type follows"
            }
        },
        "subTypes": {
            "description": "unit sub-types (validator 1.12.0); when set, unit and profile `tags`, `tag:` references and profile filter values that match no sub-type (or unit type) are warnings",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema10"
                }
            ]
        },
        "traits": {
            "description": "unit traits (validator 2.0.0); when set, unit and profile `traits`, the traits effects give or take, selector `traits` and `trait:` references that match no trait here are warnings",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema11"
                }
            ]
        },
        "groupTypes": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "$ref": "#/definitions/__schema12"
            },
            "description": "group / formation / retinue / team types"
        },
        "slotTags": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "optionLabel": {
                        "description": "what the slot options offered on slots with this tag are called, e.g. \"Special Option\"; left out, \"Option\"",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema18"
                            }
                        ]
                    },
                    "color": {
                        "description": "the tag's colour in the app's palette (`amber`, `red`, `orange`, `green`, `teal`, `blue`, `violet`, `pink`, `slate`); left out or unknown, the app picks one from the tag's id",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema3"
                            }
                        ]
                    },
                    "icon": {
                        "description": "the tag's mark in the app's icon set (`star`, `spark`, `diamond`, `hex`, `cross`, `flag`, `swords`, `crown`, `fleur`, `circle`, `triangle`, `square`, `target`, `bolt`); left out or unknown, the app picks one from the tag's id",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema3"
                            }
                        ]
                    }
                },
                "required": [
                    "name",
                    "id"
                ],
                "additionalProperties": false
            }
        },
        "resources": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "scope": {
                        "type": "string",
                        "enum": [
                            "list",
                            "unit",
                            "contingent"
                        ],
                        "description": "`list`: spent across the list against a limit the player sets (points, credits). `unit`: spent within one unit against a capacity from its profile (equipment slots). `contingent`: granted and spent within each contingent, never set by the player (reserve points); going below zero is a list issue"
                    },
                    "message": {
                        "description": "contingent resources: the issue shown when a contingent has spent too much",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema19"
                            }
                        ]
                    },
                    "usedFor": {
                        "description": "what amounts in this resource may be given for; left out, by scope: `list` → unit, additional model, option, slot option and group costs; `unit` → option and slot option costs; `contingent` → group costs and grants",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema20"
                            }
                        ]
                    },
                    "defaultLimit": {
                        "description": "list resources: the limit offered for new lists",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema21"
                            }
                        ]
                    },
                    "capacityStat": {
                        "description": "unit resources: the profile stat holding the unit's capacity",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema3"
                            }
                        ]
                    },
                    "suffix": {
                        "description": "e.g. \"pts\"",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema22"
                            }
                        ]
                    }
                },
                "required": [
                    "name",
                    "id",
                    "scope"
                ],
                "additionalProperties": false
            }
        },
        "stats": {
            "type": "object",
            "properties": {
                "unit": {
                    "type": "object",
                    "propertyNames": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "additionalProperties": {
                        "$ref": "#/definitions/__schema23"
                    }
                },
                "weapon": {
                    "type": "object",
                    "propertyNames": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "additionalProperties": {
                        "$ref": "#/definitions/__schema23"
                    }
                }
            },
            "required": [
                "unit",
                "weapon"
            ],
            "additionalProperties": false
        },
        "choices": {
            "description": "list-level choices, e.g. stance or battle size",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema25"
                }
            ]
        },
        "listRules": {
            "description": "typed list-wide rules, e.g. percentage caps",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema88"
                }
            ]
        },
        "groups": {
            "description": "groups every faction may take (core formations shared by every faction)",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema107"
                }
            ]
        },
        "specialRules": {
            "description": "special rules that belong to no single faction",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema144"
                }
            ]
        },
        "selectors": {
            "description": "selectors every faction may use",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema152"
                }
            ]
        },
        "slotOptions": {
            "description": "choices slots with a tag offer (e.g. benefits for tagged slots)",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema153"
                }
            ]
        },
        "subChoices": {
            "description": "sub-choices options in every faction may offer",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema167"
                }
            ]
        }
    },
    "required": [
        "name",
        "id",
        "version",
        "roles",
        "unitTypes",
        "groupTypes",
        "resources",
        "stats"
    ],
    "additionalProperties": false,
    "definitions": {
        "__schema0": {
            "type": "string"
        },
        "__schema1": {
            "type": "string"
        },
        "__schema2": {
            "type": "string"
        },
        "__schema3": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
            "description": "A record id: lowercase kebab-case, e.g. `infantry-squad` (letters a-z and digits, with single hyphens between words)"
        },
        "__schema4": {
            "type": "object",
            "propertyNames": {
                "type": "string",
                "enum": [
                    "option",
                    "profile",
                    "unit",
                    "slot",
                    "group",
                    "contingent",
                    "root",
                    "main",
                    "list",
                    "faction",
                    "subFaction",
                    "upgrade",
                    "gear",
                    "weapon",
                    "equipment",
                    "specialRule",
                    "selector"
                ]
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "word": {
                        "description": "For built-in scopes (and `group` as a reference kind): the word data authors may write in expressions instead of the built-in name, e.g. `formation` for `group`",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema5"
                            }
                        ]
                    },
                    "singular": {
                        "type": "string"
                    },
                    "plural": {
                        "type": "string"
                    }
                },
                "required": [
                    "singular",
                    "plural"
                ],
                "additionalProperties": false
            }
        },
        "__schema5": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
        },
        "__schema6": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "$ref": "#/definitions/__schema7"
            },
            "description": "resource id → amount, e.g. `{ \"points\": 100 }` or `{ \"credits\": 4, \"slots\": 1 }`"
        },
        "__schema7": {
            "anyOf": [
                {
                    "$ref": "#/definitions/__schema8"
                },
                {
                    "$ref": "#/definitions/__schema9"
                }
            ],
            "description": "A plain number, or an expression that evaluates to one"
        },
        "__schema8": {
            "type": "number"
        },
        "__schema9": {
            "type": "string",
            "description": "An expression in the Force Org expression language (docs/specs/expression_language_spec_2026-10-17.md)"
        },
        "__schema10": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema3"
                    }
                },
                "required": [
                    "name",
                    "id"
                ],
                "additionalProperties": false,
                "description": "A unit sub-type, given to units and profiles as a `tags` entry matching its name (case-insensitively) or id; `description` holds the rules every model with the sub-type follows"
            }
        },
        "__schema11": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema3"
                    }
                },
                "required": [
                    "name",
                    "id"
                ],
                "additionalProperties": false,
                "description": "A unit trait, given to units and profiles as a `traits` entry matching its name (case-insensitively) or id; `description` holds what the trait means"
            }
        },
        "__schema12": {
            "type": "object",
            "properties": {
                "name": {
                    "$ref": "#/definitions/__schema1"
                },
                "description": {
                    "$ref": "#/definitions/__schema2"
                },
                "id": {
                    "$ref": "#/definitions/__schema3"
                },
                "contingent": {
                    "anyOf": [
                        {
                            "$ref": "#/definitions/__schema13"
                        },
                        {
                            "$ref": "#/definitions/__schema14"
                        }
                    ],
                    "description": "`root` groups start a contingent; linked groups attach to a root group of one of the listed types and share its faction source"
                },
                "source": {
                    "description": "root groups only: `main` uses the list's main faction and sub-faction, `ally` a different one the player picks, `any` (validator 2.1.0) any faction of the game the player picks, the main one included. Only a `main` root starts the main contingent. Left out = `main`",
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema15"
                        }
                    ]
                },
                "min": {
                    "description": "how many of this type a list may hold (at least)",
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema16"
                        }
                    ]
                },
                "max": {
                    "description": "how many of this type a list may hold (at most)",
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema16"
                        }
                    ]
                },
                "cost": {
                    "description": "what a group of this type costs, counted in its contingent for contingent resources and in the list for list resources, e.g. `{ \"reserve\": 1, \"elite\": 1 }`; a group's own `cost` replaces it",
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema6"
                        }
                    ]
                }
            },
            "required": [
                "name",
                "id",
                "contingent"
            ],
            "additionalProperties": false
        },
        "__schema13": {
            "type": "string",
            "const": "root"
        },
        "__schema14": {
            "type": "object",
            "properties": {
                "linksTo": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/__schema3"
                    }
                }
            },
            "required": [
                "linksTo"
            ],
            "additionalProperties": false
        },
        "__schema15": {
            "type": "string",
            "enum": [
                "main",
                "ally",
                "any"
            ]
        },
        "__schema16": {
            "anyOf": [
                {
                    "$ref": "#/definitions/__schema17"
                },
                {
                    "$ref": "#/definitions/__schema9"
                }
            ],
            "description": "A whole number (0 or more), or an expression that evaluates to a number"
        },
        "__schema17": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
        },
        "__schema18": {
            "type": "string"
        },
        "__schema19": {
            "type": "string"
        },
        "__schema20": {
            "type": "array",
            "items": {
                "type": "string",
                "enum": [
                    "unit",
                    "additionalModels",
                    "option",
                    "slotOption",
                    "group",
                    "grant"
                ],
                "description": "Where an amount in a resource can be given: a unit's cost, the cost of each additional model, an option's cost (with its sub-choice values), a slot option's cost, a group's cost, or what a role or special rule grants"
            }
        },
        "__schema21": {
            "type": "number"
        },
        "__schema22": {
            "type": "string"
        },
        "__schema23": {
            "type": "object",
            "properties": {
                "name": {
                    "$ref": "#/definitions/__schema1"
                },
                "description": {
                    "$ref": "#/definitions/__schema2"
                },
                "id": {
                    "$ref": "#/definitions/__schema3"
                },
                "stats": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "$ref": "#/definitions/__schema3"
                            },
                            "label": {
                                "type": "string",
                                "description": "column header, e.g. \"WS\""
                            },
                            "numeric": {
                                "description": "numeric stats can be shifted by stat effects ('3+' -1 → '2+')",
                                "allOf": [
                                    {
                                        "$ref": "#/definitions/__schema24"
                                    }
                                ]
                            }
                        },
                        "required": [
                            "id",
                            "label"
                        ],
                        "additionalProperties": false
                    }
                }
            },
            "required": [
                "name",
                "id",
                "stats"
            ],
            "additionalProperties": false
        },
        "__schema24": {
            "type": "boolean"
        },
        "__schema25": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "values": {
                        "$ref": "#/definitions/__schema26"
                    },
                    "default": {
                        "$ref": "#/definitions/__schema87"
                    }
                },
                "required": [
                    "name",
                    "id",
                    "values"
                ],
                "additionalProperties": false,
                "description": "A list-level choice, e.g. stance or battle size"
            }
        },
        "__schema26": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "units": {
                        "$ref": "#/definitions/__schema27"
                    },
                    "effects": {
                        "$ref": "#/definitions/__schema42"
                    }
                },
                "required": [
                    "name",
                    "id"
                ],
                "additionalProperties": false,
                "description": "One of a list choice's values"
            }
        },
        "__schema27": {
            "description": "the units `effects` apply to, seen with their own traits and sub-faction modifiers (validator 1.13.0); left out = every unit in the list, allies included",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema28"
                }
            ]
        },
        "__schema28": {
            "anyOf": [
                {
                    "$ref": "#/definitions/__schema29"
                },
                {
                    "type": "string",
                    "pattern": "^@[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "description": "A named selector by id, accepted wherever a `UnitSelector` is, e.g. `\"@line-infantry\"`"
                }
            ]
        },
        "__schema29": {
            "type": "object",
            "properties": {
                "unitIds": {
                    "$ref": "#/definitions/__schema30"
                },
                "roles": {
                    "$ref": "#/definitions/__schema31"
                },
                "traits": {
                    "$ref": "#/definitions/__schema32"
                },
                "profiles": {
                    "$ref": "#/definitions/__schema34"
                },
                "specialRules": {
                    "$ref": "#/definitions/__schema38"
                },
                "exclude": {
                    "$ref": "#/definitions/__schema40"
                }
            },
            "additionalProperties": false,
            "description": "Picks units by id, role, trait and profile type/tags; left out, a field matches every unit"
        },
        "__schema30": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            }
        },
        "__schema31": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            }
        },
        "__schema32": {
            "description": "a unit matches when it has any of these traits, matched as case-insensitive text",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema33"
                }
            ]
        },
        "__schema33": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "__schema34": {
            "description": "a unit matches when one of its profiles does (or the unit itself, if it has no profiles)",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema35"
                }
            ]
        },
        "__schema35": {
            "type": "object",
            "properties": {
                "anyOf": {
                    "$ref": "#/definitions/__schema36"
                },
                "noneOf": {
                    "$ref": "#/definitions/__schema37"
                }
            },
            "additionalProperties": false,
            "description": "Picks profiles by their type and tags (the unit's included), matched as case-insensitive text. Left out, every profile is picked."
        },
        "__schema36": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "__schema37": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "__schema38": {
            "description": "(validator 2.5.0) special rule ids: a unit matches when it or one of its profiles holds any of them, with any value",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema39"
                }
            ]
        },
        "__schema39": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            }
        },
        "__schema40": {
            "description": "a unit that matches any of these does not match the selector",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema41"
                }
            ]
        },
        "__schema41": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "unitIds": {
                        "$ref": "#/definitions/__schema30"
                    },
                    "roles": {
                        "$ref": "#/definitions/__schema31"
                    },
                    "traits": {
                        "$ref": "#/definitions/__schema32"
                    },
                    "profiles": {
                        "$ref": "#/definitions/__schema34"
                    },
                    "specialRules": {
                        "$ref": "#/definitions/__schema38"
                    }
                },
                "additionalProperties": false,
                "description": "Units to leave out, matched like a selector (its fields all apply); e.g. `{ \"profiles\": { \"anyOf\": [\"Unique\"] } }` leaves out every unit with a Unique profile"
            }
        },
        "__schema42": {
            "description": "stat, special-rule, trait and slot-tag effects on every matching unit in the list while this value is picked (validator 1.13.0), e.g. a stance value giving every unit a trait",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema43"
                }
            ]
        },
        "__schema43": {
            "type": "array",
            "items": {
                "oneOf": [
                    {
                        "$ref": "#/definitions/__schema44"
                    },
                    {
                        "$ref": "#/definitions/__schema53"
                    },
                    {
                        "$ref": "#/definitions/__schema63"
                    },
                    {
                        "$ref": "#/definitions/__schema73"
                    },
                    {
                        "$ref": "#/definitions/__schema81"
                    }
                ],
                "description": "applied to every matching unit in the list while the value is picked, right after the unit's own traits and sub-faction modifiers; the pick is already the condition, so a `when` needs no `choice()`"
            }
        },
        "__schema44": {
            "type": "object",
            "properties": {
                "kind": {
                    "$ref": "#/definitions/__schema45"
                },
                "profiles": {
                    "$ref": "#/definitions/__schema46"
                },
                "changes": {
                    "$ref": "#/definitions/__schema47"
                },
                "when": {
                    "$ref": "#/definitions/__schema50"
                }
            },
            "required": [
                "kind",
                "changes"
            ],
            "additionalProperties": false,
            "description": "several stat changes sharing one profile filter"
        },
        "__schema45": {
            "type": "string",
            "const": "stat"
        },
        "__schema46": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema35"
                }
            ]
        },
        "__schema47": {
            "type": "array",
            "items": {
                "oneOf": [
                    {
                        "$ref": "#/definitions/__schema48"
                    },
                    {
                        "$ref": "#/definitions/__schema49"
                    }
                ],
                "description": "`add` shifts the number and keeps its suffix: '3+' -1 → '2+', '6\"' +1 → '7\"'"
            }
        },
        "__schema48": {
            "type": "object",
            "properties": {
                "stat": {
                    "$ref": "#/definitions/__schema3"
                },
                "op": {
                    "type": "string",
                    "const": "add"
                },
                "value": {
                    "type": "number"
                },
                "min": {
                    "type": "number"
                },
                "max": {
                    "type": "number"
                }
            },
            "required": [
                "stat",
                "op",
                "value"
            ],
            "additionalProperties": false
        },
        "__schema49": {
            "type": "object",
            "properties": {
                "stat": {
                    "$ref": "#/definitions/__schema3"
                },
                "op": {
                    "type": "string",
                    "const": "set"
                },
                "value": {
                    "type": "string"
                }
            },
            "required": [
                "stat",
                "op",
                "value"
            ],
            "additionalProperties": false
        },
        "__schema50": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema51"
                }
            ]
        },
        "__schema51": {
            "type": "object",
            "properties": {
                "if": {
                    "$ref": "#/definitions/__schema9"
                },
                "message": {
                    "$ref": "#/definitions/__schema52"
                }
            },
            "required": [
                "if",
                "message"
            ],
            "additionalProperties": false,
            "description": "A rule's condition plus the player-facing reason shown when it isn't met"
        },
        "__schema52": {
            "type": "string"
        },
        "__schema53": {
            "type": "object",
            "properties": {
                "kind": {
                    "$ref": "#/definitions/__schema54"
                },
                "profiles": {
                    "$ref": "#/definitions/__schema55"
                },
                "rule": {
                    "$ref": "#/definitions/__schema56"
                },
                "remove": {
                    "$ref": "#/definitions/__schema58"
                },
                "replace": {
                    "$ref": "#/definitions/__schema60"
                },
                "when": {
                    "$ref": "#/definitions/__schema62"
                }
            },
            "required": [
                "kind"
            ],
            "additionalProperties": false,
            "description": "changes the special rules of the profiles `profiles` picks (all of them when left out) and the unit's own: `remove`, then `replace`, then `rule` (added). Needs at least one of the three"
        },
        "__schema54": {
            "type": "string",
            "const": "specialRule"
        },
        "__schema55": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema35"
                }
            ]
        },
        "__schema56": {
            "description": "the rule each picked profile gains",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema57"
                }
            ]
        },
        "__schema57": {
            "type": "object",
            "properties": {
                "id": {
                    "$ref": "#/definitions/__schema3"
                },
                "value": {
                    "type": "string"
                }
            },
            "required": [
                "id"
            ],
            "additionalProperties": false
        },
        "__schema58": {
            "description": "(validator 2.5.0) rule ids each picked profile loses, whatever their value",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema59"
                }
            ]
        },
        "__schema59": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            }
        },
        "__schema60": {
            "description": "(validator 2.5.0) each picked profile loses any of `from` (whatever their value) and, only if it held one, gains `to`, e.g. `{ \"from\": [\"skirmisher\"], \"to\": { \"id\": \"armoured\", \"value\": \"1\" } }`",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema61"
                }
            ]
        },
        "__schema61": {
            "type": "object",
            "properties": {
                "from": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/__schema3"
                    }
                },
                "to": {
                    "$ref": "#/definitions/__schema57"
                }
            },
            "required": [
                "from",
                "to"
            ],
            "additionalProperties": false
        },
        "__schema62": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema51"
                }
            ]
        },
        "__schema63": {
            "type": "object",
            "properties": {
                "kind": {
                    "$ref": "#/definitions/__schema64"
                },
                "profiles": {
                    "$ref": "#/definitions/__schema65"
                },
                "add": {
                    "$ref": "#/definitions/__schema66"
                },
                "remove": {
                    "$ref": "#/definitions/__schema68"
                },
                "replace": {
                    "$ref": "#/definitions/__schema70"
                },
                "when": {
                    "$ref": "#/definitions/__schema72"
                }
            },
            "required": [
                "kind"
            ],
            "additionalProperties": false,
            "description": "changes the unit's traits, or with `profiles` (validator 2.9.0) only some profiles' traits; a unit holds a trait when it or any of its profiles does. Traits match as case-insensitive text"
        },
        "__schema64": {
            "type": "string",
            "const": "trait"
        },
        "__schema65": {
            "description": "(validator 2.9.0) the profiles whose models the effect changes: `add` gives the traits to each picked profile, and `remove` / `replace` take them from it (a trait of the whole unit stays on the profiles not picked). Its `when` may then use `profile`, checked per profile. Left out, the effect changes the whole unit",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema35"
                }
            ]
        },
        "__schema66": {
            "description": "traits the unit gains (with `profiles`, each picked profile)",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema67"
                }
            ]
        },
        "__schema67": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "__schema68": {
            "description": "traits the unit loses, if it has them (with `profiles`, each picked profile)",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema69"
                }
            ]
        },
        "__schema69": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "__schema70": {
            "description": "the unit (with `profiles`, each picked profile) loses any of `from` and, only if it had one, gains `to`",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema71"
                }
            ]
        },
        "__schema71": {
            "type": "object",
            "properties": {
                "from": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "to": {
                    "type": "string"
                }
            },
            "required": [
                "from",
                "to"
            ],
            "additionalProperties": false
        },
        "__schema72": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema51"
                }
            ]
        },
        "__schema73": {
            "type": "object",
            "properties": {
                "kind": {
                    "$ref": "#/definitions/__schema74"
                },
                "profiles": {
                    "$ref": "#/definitions/__schema75"
                },
                "add": {
                    "$ref": "#/definitions/__schema76"
                },
                "remove": {
                    "$ref": "#/definitions/__schema78"
                },
                "when": {
                    "$ref": "#/definitions/__schema80"
                }
            },
            "required": [
                "kind"
            ],
            "additionalProperties": false,
            "description": "(validator 2.10.0) gives or takes away sub-types: `remove`, then `add`. Later effects' profile filters, selectors and `tag:` references see the result; the gear engine (default gear, per-model upgrades, `excludeProfiles`) doesn't, and keeps reading the tags the unit record and sub-faction unit modifiers give. Needs the game's `subTypes`. In a slot option's `effects` (validator 2.11.0), the last step, it reaches that option's later effects, list rules, other expressions' `tag:` references and the unit's display, not earlier steps"
        },
        "__schema74": {
            "type": "string",
            "const": "subType"
        },
        "__schema75": {
            "description": "the profiles whose models gain or lose the sub-types (their `tags`); its `when` may then use `profile`, checked per profile. Left out, the unit's own `tags` change",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema35"
                }
            ]
        },
        "__schema76": {
            "description": "ids of game `subTypes` the unit (with `profiles`, each picked profile) gains, e.g. `[\"sergeant\"]`",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema77"
                }
            ]
        },
        "__schema77": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            }
        },
        "__schema78": {
            "description": "ids of game `subTypes` the unit (with `profiles`, each picked profile) loses, if it has them",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema79"
                }
            ]
        },
        "__schema79": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            }
        },
        "__schema80": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema51"
                }
            ]
        },
        "__schema81": {
            "type": "object",
            "properties": {
                "kind": {
                    "$ref": "#/definitions/__schema82"
                },
                "add": {
                    "$ref": "#/definitions/__schema83"
                },
                "categories": {
                    "$ref": "#/definitions/__schema84"
                },
                "when": {
                    "$ref": "#/definitions/__schema86"
                }
            },
            "required": [
                "kind",
                "add"
            ],
            "additionalProperties": false,
            "description": "(validator 2.2.0) the slot that holds the unit counts as having these slot tags, so it offers their slot options and `slot.is(tag:…)` reads true. It tags the slot, not the unit, so there is no profile filter; in place before slot options are offered. Not allowed in a slot option's `effects`"
        },
        "__schema82": {
            "type": "string",
            "const": "slotTag"
        },
        "__schema83": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            },
            "description": "game-declared slot tags the slot holding the unit counts as having, e.g. `[\"prime\"]`"
        },
        "__schema84": {
            "description": "for the tags it adds, only slot options of these `category`s are offered, e.g. `[\"honour\"]`; left out, every option of the tag. Combined with the slot's own `tagOptions` and other slotTag effects on the same tag, only options every restriction allows are offered",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema85"
                }
            ]
        },
        "__schema85": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            }
        },
        "__schema86": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema51"
                }
            ]
        },
        "__schema87": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema3"
                }
            ]
        },
        "__schema88": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "oneOf": [
                    {
                        "type": "object",
                        "properties": {
                            "kind": {
                                "$ref": "#/definitions/__schema89"
                            },
                            "id": {
                                "$ref": "#/definitions/__schema3"
                            },
                            "resource": {
                                "$ref": "#/definitions/__schema3"
                            },
                            "units": {
                                "$ref": "#/definitions/__schema90"
                            },
                            "contingentTypes": {
                                "$ref": "#/definitions/__schema91"
                            },
                            "max": {
                                "$ref": "#/definitions/__schema93"
                            },
                            "message": {
                                "$ref": "#/definitions/__schema94"
                            }
                        },
                        "required": [
                            "kind",
                            "id",
                            "resource",
                            "max",
                            "message"
                        ],
                        "additionalProperties": false,
                        "description": "Caps what may be spent on matching units, e.g. heavy units 25%, allies 50%"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "kind": {
                                "$ref": "#/definitions/__schema95"
                            },
                            "id": {
                                "$ref": "#/definitions/__schema3"
                            },
                            "units": {
                                "$ref": "#/definitions/__schema96"
                            },
                            "groupTypes": {
                                "$ref": "#/definitions/__schema97"
                            },
                            "scope": {
                                "$ref": "#/definitions/__schema98"
                            },
                            "min": {
                                "$ref": "#/definitions/__schema99"
                            },
                            "max": {
                                "$ref": "#/definitions/__schema100"
                            },
                            "message": {
                                "$ref": "#/definitions/__schema101"
                            }
                        },
                        "required": [
                            "kind",
                            "id",
                            "scope",
                            "message"
                        ],
                        "additionalProperties": false,
                        "description": "Limits how many matching units (or groups) a scope may hold"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "kind": {
                                "$ref": "#/definitions/__schema102"
                            },
                            "id": {
                                "$ref": "#/definitions/__schema3"
                            },
                            "scope": {
                                "$ref": "#/definitions/__schema103"
                            },
                            "groupTypes": {
                                "$ref": "#/definitions/__schema105"
                            },
                            "when": {
                                "$ref": "#/definitions/__schema51"
                            }
                        },
                        "required": [
                            "kind",
                            "id",
                            "when"
                        ],
                        "additionalProperties": false,
                        "description": "Escape hatch for list rules no typed form covers. A rule only flags the list; it never prevents anything"
                    }
                ]
            }
        },
        "__schema89": {
            "type": "string",
            "const": "resourceCap"
        },
        "__schema90": {
            "description": "count only these units; left out = every unit",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema28"
                }
            ]
        },
        "__schema91": {
            "description": "count only units in contingents whose root group is one of these types",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema92"
                }
            ]
        },
        "__schema92": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            }
        },
        "__schema93": {
            "anyOf": [
                {
                    "type": "object",
                    "properties": {
                        "percentOfLimit": {
                            "type": "number"
                        },
                        "round": {
                            "type": "string",
                            "enum": [
                                "up",
                                "down"
                            ]
                        }
                    },
                    "required": [
                        "percentOfLimit"
                    ],
                    "additionalProperties": false
                },
                {
                    "type": "object",
                    "properties": {
                        "value": {
                            "$ref": "#/definitions/__schema7"
                        }
                    },
                    "required": [
                        "value"
                    ],
                    "additionalProperties": false
                }
            ]
        },
        "__schema94": {
            "type": "string"
        },
        "__schema95": {
            "type": "string",
            "const": "count"
        },
        "__schema96": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema28"
                }
            ]
        },
        "__schema97": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            }
        },
        "__schema98": {
            "type": "string",
            "enum": [
                "group",
                "contingent",
                "list"
            ]
        },
        "__schema99": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema16"
                }
            ]
        },
        "__schema100": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema16"
                }
            ]
        },
        "__schema101": {
            "type": "string"
        },
        "__schema102": {
            "type": "string",
            "const": "expression"
        },
        "__schema103": {
            "description": "`list` (default): the condition is checked once for the whole list. `group`: checked once for each group (of the listed `groupTypes`, or any) with `group`, `contingent`, `root`, `main` and `list` available; the message is reported for each group that fails",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema104"
                }
            ]
        },
        "__schema104": {
            "type": "string",
            "enum": [
                "list",
                "group"
            ]
        },
        "__schema105": {
            "description": "with `scope: \"group\"`: only groups of these types",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema106"
                }
            ]
        },
        "__schema106": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            }
        },
        "__schema107": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "type": {
                        "description": "a group type id from the game",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema3"
                            }
                        ]
                    },
                    "slots": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "roles": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/definitions/__schema3"
                                    },
                                    "description": "units of any of these roles may fill the slot"
                                },
                                "tags": {
                                    "description": "game-declared slot tags, e.g. `prime`",
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema108"
                                        }
                                    ]
                                },
                                "required": {
                                    "description": "must be filled for the list to be valid (compulsory slots)",
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema109"
                                        }
                                    ]
                                },
                                "repeat": {
                                    "description": "the slot may be added more than once, each copy holding one unit (a team's vehicles, optional slots); `max` left out = no limit",
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema110"
                                        }
                                    ]
                                },
                                "units": {
                                    "description": "only matching units may fill this slot; with a `source`, `unitIds` are its units (any entry's, for a list of sources)",
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema28"
                                        }
                                    ]
                                },
                                "tagOptions": {
                                    "description": "(validator 2.2.0) tag id → which of that tag's slot options this slot offers, e.g. `{ \"prime\": { \"categories\": [\"honour\"] } }`; each key must be one of the slot's `tags`. A tag left out offers every option",
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema111"
                                        }
                                    ]
                                },
                                "source": {
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema113"
                                        }
                                    ]
                                },
                                "effects": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/definitions/__schema120"
                                    }
                                },
                                "when": {
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema51"
                                        }
                                    ]
                                },
                                "unitWhen": {
                                    "description": "(validator 2.6.0) a condition on the unit filling the slot, checked against it as configured (its options' gear and traits included, before the group's effects) and shown as an issue while false; units are still offered by role and `units`, though an app may hide units that none of their options could make meet it. E.g. a slot of two roles that units of the second may fill only with some gear: `{ \"if\": \"unit.is(role:officer) or unit.has(equipment:signal-array)\", \"message\": \"…\" }`",
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema51"
                                        }
                                    ]
                                }
                            },
                            "required": [
                                "roles"
                            ],
                            "additionalProperties": false
                        }
                    },
                    "units": {
                        "description": "only matching units may fill any slot, including slots a mechanic adds, except slots with a `source`",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema28"
                            }
                        ]
                    },
                    "requires": {
                        "description": "all must be met",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema131"
                            }
                        ]
                    },
                    "requirementText": {
                        "description": "shown when a requirement isn't met",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema135"
                            }
                        ]
                    },
                    "when": {
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema51"
                            }
                        ]
                    },
                    "min": {
                        "description": "how many of this group a list must hold, e.g. a mandatory veteran formation",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema16"
                            }
                        ]
                    },
                    "max": {
                        "description": "how many of this group a list may hold",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema16"
                            }
                        ]
                    },
                    "cost": {
                        "description": "replaces its group type's `cost`",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema6"
                            }
                        ]
                    },
                    "effects": {
                        "description": "applied to every unit in the group, e.g. \"Every unit in this group gains the Gun Line trait\"",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema136"
                            }
                        ]
                    },
                    "addedSlotRoles": {
                        "description": "(validator 2.6.0) the only roles the `slot` effects of slot options picked in this group's slots may add: each effect's `roleChoices` is narrowed to them, and an option left with none isn't offered. `[]` = no option that adds a slot; left out, no limit",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema137"
                            }
                        ]
                    },
                    "listEffects": {
                        "description": "(validator 2.7.0) while the group is in the list, each entry's `effects` apply to the matching units in reach, wherever they are, e.g. `[{ \"units\": \"@vehicles\", \"effects\": [{ \"kind\": \"specialRule\", \"rule\": { \"id\": \"fearless\" } }] }]`",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema138"
                            }
                        ]
                    }
                },
                "required": [
                    "name",
                    "id",
                    "type",
                    "slots"
                ],
                "additionalProperties": false
            }
        },
        "__schema108": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            }
        },
        "__schema109": {
            "type": "boolean"
        },
        "__schema110": {
            "type": "object",
            "properties": {
                "min": {
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema17"
                        }
                    ]
                },
                "max": {
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema16"
                        }
                    ]
                }
            },
            "additionalProperties": false
        },
        "__schema111": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "categories": {
                        "$ref": "#/definitions/__schema112"
                    }
                },
                "required": [
                    "categories"
                ],
                "additionalProperties": false,
                "description": "Limits the slot options a slot offers for one of its tags (validator 2.2.0). Where several restrictions apply to one tag on one slot (this and slotTag effects' `categories`), only options every one of them allows are offered"
            }
        },
        "__schema112": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            },
            "description": "only slot options with one of these `category`s are offered for the tag"
        },
        "__schema113": {
            "anyOf": [
                {
                    "$ref": "#/definitions/__schema114"
                },
                {
                    "$ref": "#/definitions/__schema119"
                }
            ],
            "description": "One faction the slot's units come from, or (validator 2.8.0) a list of them: the slot offers every entry's units, and each unit filling it may come from any entry, e.g. `[{ \"faction\": \"field-army\" }, { \"faction\": \"clockwork-guild\" }]` for \"from A or B, in any combination\". List each faction once. The slot's `units` applies to every entry; its `unitIds` may name any entry's units"
        },
        "__schema114": {
            "type": "object",
            "properties": {
                "faction": {
                    "$ref": "#/definitions/__schema115"
                },
                "subFactions": {
                    "$ref": "#/definitions/__schema116"
                },
                "units": {
                    "$ref": "#/definitions/__schema118"
                }
            },
            "required": [
                "faction"
            ],
            "additionalProperties": false,
            "description": "Where a slot's units come from instead of the contingent. Units keep their own records (gear, rules, upgrades) but not their home sub-faction's unit modifiers. The slot's `units` selector picks among them, seeing only each unit's own traits; the group's `units` doesn't apply"
        },
        "__schema115": {
            "description": "a faction of the same game, possibly from another source; may be the contingent's own",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema3"
                }
            ]
        },
        "__schema116": {
            "description": "units of these sub-factions of `faction` may fill the slot too (`any` = every one loaded), whether or not the contingent took them; left out, only the faction's own units",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema117"
                }
            ]
        },
        "__schema117": {
            "anyOf": [
                {
                    "type": "string",
                    "const": "any"
                },
                {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/__schema3"
                    }
                }
            ]
        },
        "__schema118": {
            "description": "(validator 2.8.0) only matching units of this faction (and its listed sub-factions) may fill the slot, as well as matching the slot's own `units`; its `unitIds` are this entry's units. E.g. `{ \"unitIds\": [\"battle-construct\"] }` for \"or only these units of B\"",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema28"
                }
            ]
        },
        "__schema119": {
            "minItems": 1,
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema114"
            }
        },
        "__schema120": {
            "oneOf": [
                {
                    "$ref": "#/definitions/__schema44"
                },
                {
                    "$ref": "#/definitions/__schema53"
                },
                {
                    "$ref": "#/definitions/__schema63"
                },
                {
                    "$ref": "#/definitions/__schema73"
                },
                {
                    "$ref": "#/definitions/__schema81"
                },
                {
                    "$ref": "#/definitions/__schema121"
                }
            ],
            "description": "applied to the unit filling the slot, after the group's effects, e.g. replacing a borrowed unit's faction trait"
        },
        "__schema121": {
            "type": "object",
            "properties": {
                "kind": {
                    "$ref": "#/definitions/__schema122"
                },
                "profiles": {
                    "$ref": "#/definitions/__schema123"
                },
                "count": {
                    "$ref": "#/definitions/__schema124"
                },
                "name": {
                    "$ref": "#/definitions/__schema126"
                },
                "effects": {
                    "$ref": "#/definitions/__schema128"
                },
                "when": {
                    "$ref": "#/definitions/__schema130"
                }
            },
            "required": [
                "kind",
                "effects"
            ],
            "additionalProperties": false,
            "description": "(validator 2.10.0) one model of the unit (or `count`), chosen by the player, gets its own benefits: it is split off its profile into a copy of that profile as it stands, and `effects` change only the copy. The unit's model count and cost don't change. The gear engine still counts the model under its source profile, so it keeps its gear and gear choices. Allowed in slot options' `effects`, groups' `effects` and slots' `effects`, e.g. a prime option where one model gains +1 Armour and the Sergeant sub-type"
        },
        "__schema122": {
            "type": "string",
            "const": "model"
        },
        "__schema123": {
            "description": "the profiles the models may come from: the first in record order that has a model gives them. Left out, every profile",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema35"
                }
            ]
        },
        "__schema124": {
            "description": "models split off (default 1), e.g. 2 for \"two models in the unit gain…\"; fewer when the profile has fewer",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema125"
                }
            ]
        },
        "__schema125": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
        },
        "__schema126": {
            "description": "shown for the split-off models, e.g. `Lead Construct`; left out, the source profile's name followed by the name of what gives the effect in brackets: `Battle Construct (Lead Construct)`",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema127"
                }
            ]
        },
        "__schema127": {
            "type": "string"
        },
        "__schema128": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema129"
            },
            "description": "applied in order to the split-off models only"
        },
        "__schema129": {
            "oneOf": [
                {
                    "type": "object",
                    "properties": {
                        "kind": {
                            "$ref": "#/definitions/__schema45"
                        },
                        "changes": {
                            "$ref": "#/definitions/__schema47"
                        },
                        "when": {
                            "$ref": "#/definitions/__schema50"
                        }
                    },
                    "required": [
                        "kind",
                        "changes"
                    ],
                    "additionalProperties": false,
                    "description": "stat changes to the split-off model; its `when` may use `profile`, meaning that model"
                },
                {
                    "type": "object",
                    "properties": {
                        "kind": {
                            "$ref": "#/definitions/__schema54"
                        },
                        "rule": {
                            "$ref": "#/definitions/__schema56"
                        },
                        "remove": {
                            "$ref": "#/definitions/__schema58"
                        },
                        "replace": {
                            "$ref": "#/definitions/__schema60"
                        },
                        "when": {
                            "$ref": "#/definitions/__schema62"
                        }
                    },
                    "required": [
                        "kind"
                    ],
                    "additionalProperties": false,
                    "description": "changes the split-off model's special rules: `remove`, then `replace`, then `rule` (added)"
                },
                {
                    "type": "object",
                    "properties": {
                        "kind": {
                            "$ref": "#/definitions/__schema64"
                        },
                        "add": {
                            "$ref": "#/definitions/__schema66"
                        },
                        "remove": {
                            "$ref": "#/definitions/__schema68"
                        },
                        "replace": {
                            "$ref": "#/definitions/__schema70"
                        },
                        "when": {
                            "$ref": "#/definitions/__schema72"
                        }
                    },
                    "required": [
                        "kind"
                    ],
                    "additionalProperties": false,
                    "description": "traits the split-off model gains or loses, as its own; its `when` may use `profile`, meaning that model"
                },
                {
                    "type": "object",
                    "properties": {
                        "kind": {
                            "$ref": "#/definitions/__schema74"
                        },
                        "add": {
                            "$ref": "#/definitions/__schema76"
                        },
                        "remove": {
                            "$ref": "#/definitions/__schema78"
                        },
                        "when": {
                            "$ref": "#/definitions/__schema80"
                        }
                    },
                    "required": [
                        "kind"
                    ],
                    "additionalProperties": false,
                    "description": "sub-types the split-off model gains or loses, as its own `tags`"
                }
            ]
        },
        "__schema130": {
            "description": "whether the split happens at all; it sees the unit, not a profile",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema51"
                }
            ]
        },
        "__schema131": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "units": {
                        "$ref": "#/definitions/__schema28"
                    },
                    "count": {
                        "$ref": "#/definitions/__schema132"
                    },
                    "scope": {
                        "$ref": "#/definitions/__schema133"
                    }
                },
                "required": [
                    "units"
                ],
                "additionalProperties": false,
                "description": "units the list must already hold before the group can be taken"
            }
        },
        "__schema132": {
            "description": "matching units needed; left out = 1",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema125"
                }
            ]
        },
        "__schema133": {
            "description": "where they're counted: the group's contingent outside it (default) or its root group",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema134"
                }
            ]
        },
        "__schema134": {
            "type": "string",
            "enum": [
                "contingent",
                "root"
            ]
        },
        "__schema135": {
            "type": "string"
        },
        "__schema136": {
            "type": "array",
            "items": {
                "oneOf": [
                    {
                        "$ref": "#/definitions/__schema44"
                    },
                    {
                        "$ref": "#/definitions/__schema53"
                    },
                    {
                        "$ref": "#/definitions/__schema63"
                    },
                    {
                        "$ref": "#/definitions/__schema73"
                    },
                    {
                        "$ref": "#/definitions/__schema81"
                    },
                    {
                        "$ref": "#/definitions/__schema121"
                    }
                ],
                "description": "applied to every unit in the group, including units in slots added later"
            }
        },
        "__schema137": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            }
        },
        "__schema138": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "units": {
                        "$ref": "#/definitions/__schema139"
                    },
                    "scope": {
                        "$ref": "#/definitions/__schema140"
                    },
                    "effects": {
                        "$ref": "#/definitions/__schema142"
                    }
                },
                "required": [
                    "effects"
                ],
                "additionalProperties": false,
                "description": "(validator 2.7.0) Effects a group gives units outside it, e.g. \"every Walker in a list with this group gains Fearless\""
            }
        },
        "__schema139": {
            "description": "the units `effects` apply to, seen with their own traits and sub-faction modifiers; left out = every unit in reach",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema28"
                }
            ]
        },
        "__schema140": {
            "description": "which units are in reach: `list` (the default) = every unit in the list, in every contingent, allies included; `contingent` = the units in the group's contingent",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema141"
                }
            ]
        },
        "__schema141": {
            "type": "string",
            "enum": [
                "list",
                "contingent"
            ]
        },
        "__schema142": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema143"
            },
            "description": "stat, special-rule, trait and slot-tag effects"
        },
        "__schema143": {
            "oneOf": [
                {
                    "$ref": "#/definitions/__schema44"
                },
                {
                    "$ref": "#/definitions/__schema53"
                },
                {
                    "$ref": "#/definitions/__schema63"
                },
                {
                    "$ref": "#/definitions/__schema73"
                },
                {
                    "$ref": "#/definitions/__schema81"
                }
            ],
            "description": "applied to every matching unit in reach while the group is in the list, right after list choice values; an effect's `when` sees the unit's own slot and group, not this group's"
        },
        "__schema144": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "text": {
                        "type": "string"
                    },
                    "configurable": {
                        "description": "the rule takes a value, e.g. Ambush (X)",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema145"
                            }
                        ]
                    },
                    "defaultValue": {
                        "description": "the value a configurable rule has when a selection gives none",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema146"
                            }
                        ]
                    },
                    "grants": {
                        "description": "contingent resources a unit with the rule grants its contingent (negative takes some away). Expressions may use the `rule` scope, e.g. Quartermaster (X) `{ \"reserve\": \"rule.value() - 1\" }`",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema6"
                            }
                        ]
                    },
                    "slots": {
                        "description": "slots each unit with the rule adds to its group, e.g. one filled from another faction",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema147"
                            }
                        ]
                    }
                },
                "required": [
                    "name",
                    "id",
                    "text"
                ],
                "additionalProperties": false
            }
        },
        "__schema145": {
            "type": "boolean"
        },
        "__schema146": {
            "type": "string"
        },
        "__schema147": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "roleChoices": {
                        "$ref": "#/definitions/__schema148"
                    },
                    "units": {
                        "$ref": "#/definitions/__schema149"
                    },
                    "source": {
                        "$ref": "#/definitions/__schema150"
                    },
                    "effects": {
                        "$ref": "#/definitions/__schema151"
                    }
                },
                "required": [
                    "roleChoices"
                ],
                "additionalProperties": false,
                "description": "A slot a mechanic adds to a group"
            }
        },
        "__schema148": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            },
            "description": "the slot's role; with several the player picks one"
        },
        "__schema149": {
            "description": "only matching units may fill the slot; with a `source`, `unitIds` are its units (any entry's, for a list of sources)",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema28"
                }
            ]
        },
        "__schema150": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema113"
                }
            ]
        },
        "__schema151": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema120"
            }
        },
        "__schema152": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "match": {
                        "$ref": "#/definitions/__schema29"
                    }
                },
                "required": [
                    "name",
                    "id",
                    "match"
                ],
                "additionalProperties": false,
                "description": "A selector with a name, referenced as `@id` from expressions and selector fields"
            }
        },
        "__schema153": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "text": {
                        "$ref": "#/definitions/__schema154"
                    },
                    "slotTag": {
                        "$ref": "#/definitions/__schema155"
                    },
                    "category": {
                        "$ref": "#/definitions/__schema156"
                    },
                    "slotRoles": {
                        "$ref": "#/definitions/__schema157"
                    },
                    "units": {
                        "$ref": "#/definitions/__schema159"
                    },
                    "cost": {
                        "$ref": "#/definitions/__schema160"
                    },
                    "effects": {
                        "$ref": "#/definitions/__schema161"
                    },
                    "when": {
                        "$ref": "#/definitions/__schema166"
                    }
                },
                "required": [
                    "name",
                    "id",
                    "text",
                    "slotTag"
                ],
                "additionalProperties": false,
                "description": "A choice made for a slot with the option's tag, applying its effects to the unit in the slot (and the group), e.g. special benefits or enhancements. One option per tag per slot."
            }
        },
        "__schema154": {
            "type": "string"
        },
        "__schema155": {
            "description": "offered on slots with this tag",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema3"
                }
            ]
        },
        "__schema156": {
            "description": "(validator 2.2.0) what kind of option this is among its tag's, e.g. `honour`; a slot's `tagOptions` and a slotTag effect's `categories` offer only options of the categories they name",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema3"
                }
            ]
        },
        "__schema157": {
            "description": "only offered on slots of these roles; left out = any role",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema158"
                }
            ]
        },
        "__schema158": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            }
        },
        "__schema159": {
            "description": "only offered on slots whose unit matches, seen as it stands before slot-option effects (its traits from option and group effects included), e.g. `{ \"traits\": [\"Field Army\"] }` for an option only Field Army units may take; left out = any unit",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema28"
                }
            ]
        },
        "__schema160": {
            "description": "added to the cost of the unit in the slot",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema6"
                }
            ]
        },
        "__schema161": {
            "type": "array",
            "items": {
                "oneOf": [
                    {
                        "$ref": "#/definitions/__schema44"
                    },
                    {
                        "$ref": "#/definitions/__schema53"
                    },
                    {
                        "$ref": "#/definitions/__schema63"
                    },
                    {
                        "$ref": "#/definitions/__schema73"
                    },
                    {
                        "$ref": "#/definitions/__schema121"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "kind": {
                                "$ref": "#/definitions/__schema162"
                            },
                            "roleChoices": {
                                "$ref": "#/definitions/__schema148"
                            },
                            "units": {
                                "$ref": "#/definitions/__schema149"
                            },
                            "source": {
                                "$ref": "#/definitions/__schema150"
                            },
                            "effects": {
                                "$ref": "#/definitions/__schema151"
                            },
                            "count": {
                                "$ref": "#/definitions/__schema163"
                            }
                        },
                        "required": [
                            "kind",
                            "roleChoices"
                        ],
                        "additionalProperties": false,
                        "description": "adds a slot (or `count` slots) to the group; with several roles the player picks one"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "kind": {
                                "$ref": "#/definitions/__schema164"
                            },
                            "roles": {
                                "$ref": "#/definitions/__schema165"
                            }
                        },
                        "required": [
                            "kind",
                            "roles"
                        ],
                        "additionalProperties": false,
                        "description": "units of these roles may also fill the slot"
                    }
                ]
            }
        },
        "__schema162": {
            "type": "string",
            "const": "slot"
        },
        "__schema163": {
            "description": "how many such slots the option adds to the group (default 1), each holding its own unit (validator 2.4.0); with several `roleChoices` the player picks one role, which all of them take, e.g. `{ \"kind\": \"slot\", \"roleChoices\": [\"support\"], \"count\": 3 }`",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema125"
                }
            ]
        },
        "__schema164": {
            "type": "string",
            "const": "allowedRoles"
        },
        "__schema165": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema3"
            }
        },
        "__schema166": {
            "description": "(validator 2.6.0) only offered while true, seeing the unit as its `units` does; a pick whose `when` turns false is an issue. E.g. `{ \"if\": \"group.is(group:gun-line)\", \"message\": \"Only in a Gun Line\" }`",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema51"
                }
            ]
        },
        "__schema167": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "values": {
                        "$ref": "#/definitions/__schema168"
                    },
                    "default": {
                        "$ref": "#/definitions/__schema3"
                    }
                },
                "required": [
                    "name",
                    "id",
                    "values",
                    "default"
                ],
                "additionalProperties": false,
                "description": "A choice made alongside an option, defined once and shared by every option that offers it"
            }
        },
        "__schema168": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "costMultiplier": {
                        "description": "resource id → multiplier for the option's cost, e.g. a turret mount `{ \"points\": 3 }`",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema169"
                            }
                        ]
                    },
                    "cost": {
                        "description": "added to the option's cost",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema6"
                            }
                        ]
                    }
                },
                "required": [
                    "name",
                    "id"
                ],
                "additionalProperties": false
            }
        },
        "__schema169": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema3"
            },
            "additionalProperties": {
                "type": "number"
            }
        }
    },
    "title": "GameSystem"
}
