{
    "$id": "https://cdn.jsdelivr.net/gh/Force-Organization-Army-Builder/fo_data_validator@2/schema/faction.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"
                }
            ]
        },
        "units": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "role": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "type": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "tags": {
                        "description": "keywords and sub-types, matched by `tag:` references and profile filters; free text, though when the game defines `subTypes` a tag that matches none is a warning",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema4"
                            }
                        ]
                    },
                    "cost": {
                        "$ref": "#/definitions/__schema5"
                    },
                    "modelCount": {
                        "description": "models in the unit as bought for its `cost`; with `composition`, the sum over its blocks of `min` × models per copy",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema9"
                            }
                        ]
                    },
                    "additionalModels": {
                        "description": "up to `max` more models at `cost` each, of no particular profile; not used with `composition`",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema10"
                            }
                        ]
                    },
                    "composition": {
                        "description": "how many models of each profile the unit holds and how it grows, as blocks of models bought together; replaces `additionalModels`",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema11"
                            }
                        ]
                    },
                    "profiles": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "description": "needed for upgrades, default gear and sub-faction rules to point at the profile",
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema1"
                                        }
                                    ]
                                },
                                "name": {
                                    "type": "string"
                                },
                                "template": {
                                    "description": "a unit stat template id from the game",
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema1"
                                        }
                                    ]
                                },
                                "stats": {
                                    "type": "object",
                                    "propertyNames": {
                                        "$ref": "#/definitions/__schema1"
                                    },
                                    "additionalProperties": {
                                        "$ref": "#/definitions/__schema24"
                                    },
                                    "description": "stat id → value, checked against the template"
                                },
                                "specialRules": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/definitions/__schema25"
                                    }
                                },
                                "type": {
                                    "description": "replaces the unit's type for this profile",
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema1"
                                        }
                                    ]
                                },
                                "tags": {
                                    "description": "added to the unit's tags for this profile (e.g. Sergeant)",
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema26"
                                        }
                                    ]
                                },
                                "traits": {
                                    "description": "added to the unit's traits for this profile (validator 1.11.0), e.g. a Shield trait only the shield-bearers have: `profile.is(trait:…)` and profile-level matching see the unit's traits plus these, and the unit counts as holding them (selector `traits`, `unit.is(trait:…)`, container `count(trait:…)`) when any of its profiles does, as with profile `tags`",
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema27"
                                        }
                                    ]
                                }
                            },
                            "required": [
                                "id",
                                "name",
                                "template",
                                "stats"
                            ],
                            "additionalProperties": false
                        }
                    },
                    "upgrades": {
                        "type": "object",
                        "propertyNames": {
                            "$ref": "#/definitions/__schema1"
                        },
                        "additionalProperties": {
                            "type": "object",
                            "properties": {
                                "name": {
                                    "$ref": "#/definitions/__schema2"
                                },
                                "description": {
                                    "$ref": "#/definitions/__schema3"
                                },
                                "id": {
                                    "$ref": "#/definitions/__schema1"
                                },
                                "profileId": {
                                    "$ref": "#/definitions/__schema28"
                                },
                                "multiSelect": {
                                    "$ref": "#/definitions/__schema29"
                                },
                                "default": {
                                    "$ref": "#/definitions/__schema30"
                                },
                                "perModel": {
                                    "$ref": "#/definitions/__schema31"
                                },
                                "min": {
                                    "$ref": "#/definitions/__schema35"
                                },
                                "max": {
                                    "$ref": "#/definitions/__schema36"
                                },
                                "restrictions": {
                                    "$ref": "#/definitions/__schema37"
                                },
                                "replaces": {
                                    "$ref": "#/definitions/__schema42"
                                },
                                "limitBy": {
                                    "$ref": "#/definitions/__schema44"
                                },
                                "when": {
                                    "$ref": "#/definitions/__schema47"
                                },
                                "grantedBy": {
                                    "$ref": "#/definitions/__schema50"
                                },
                                "gearNote": {
                                    "$ref": "#/definitions/__schema51"
                                },
                                "swapFrom": {
                                    "description": "each pick of any option takes `count` (default 1) of this gear off the upgrade's profile (or the unit at large), up to what is held, besides giving the option's own gear; covers options reached through a reference too, except options with their own `swaps`; not applied to the `default` option",
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema53"
                                        }
                                    ]
                                },
                                "mirrorOf": {
                                    "description": "id of a sibling unit upgrade on another profile whose pick this upgrade always copies: the same option, never chosen by the player, with the amount set by this upgrade's own `perModel` and profile. Both must offer the same option ids (references expanded) and the same `default`; `perModel.type` must be `every` or `single`; the source can't itself have `mirrorOf`",
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema1"
                                        }
                                    ]
                                },
                                "options": {
                                    "type": "object",
                                    "propertyNames": {
                                        "$ref": "#/definitions/__schema1"
                                    },
                                    "additionalProperties": {
                                        "$ref": "#/definitions/__schema54"
                                    },
                                    "description": "own options and references to shared faction upgrades; when ids clash, the upgrade's own option wins, then the shared upgrade referenced first"
                                }
                            },
                            "required": [
                                "name",
                                "id",
                                "perModel",
                                "options"
                            ],
                            "additionalProperties": false
                        }
                    },
                    "defaultGear": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "kind": {
                                    "$ref": "#/definitions/__schema40"
                                },
                                "id": {
                                    "$ref": "#/definitions/__schema1"
                                },
                                "perModel": {
                                    "$ref": "#/definitions/__schema101"
                                },
                                "excludeProfiles": {
                                    "$ref": "#/definitions/__schema103"
                                },
                                "profileId": {
                                    "$ref": "#/definitions/__schema104"
                                },
                                "note": {
                                    "$ref": "#/definitions/__schema105"
                                }
                            },
                            "required": [
                                "kind",
                                "id"
                            ],
                            "additionalProperties": false,
                            "description": "Gear a unit carries without taking any upgrade"
                        }
                    },
                    "traits": {
                        "description": "the unit's traits (e.g. a faction trait), matched by `trait:` references and selector `traits` as case-insensitive text; effects may add or remove some",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema107"
                            }
                        ]
                    },
                    "when": {
                        "description": "when the unit may be taken",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema48"
                            }
                        ]
                    },
                    "limit": {
                        "description": "how many of this unit a scope may hold, e.g. unique characters",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema108"
                            }
                        ]
                    }
                },
                "required": [
                    "name",
                    "id",
                    "role",
                    "type",
                    "cost",
                    "modelCount",
                    "profiles"
                ],
                "additionalProperties": false
            }
        },
        "weapons": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "template": {
                        "$ref": "#/definitions/__schema109"
                    },
                    "profiles": {
                        "$ref": "#/definitions/__schema110"
                    }
                },
                "required": [
                    "name",
                    "id",
                    "template",
                    "profiles"
                ],
                "additionalProperties": false
            }
        },
        "equipment": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "text": {
                        "type": "string"
                    },
                    "weapon": {
                        "type": "object",
                        "properties": {
                            "template": {
                                "$ref": "#/definitions/__schema109"
                            },
                            "profiles": {
                                "$ref": "#/definitions/__schema110"
                            }
                        },
                        "required": [
                            "template",
                            "profiles"
                        ],
                        "additionalProperties": false,
                        "description": "weapon profiles the equipment lets its holder use, e.g. a grenade's thrown attack (validator 2.3.0). Shown as part of the equipment, checked like a weapon's profiles; not a weapon the unit holds, so `weapon:` references, restrictions, `limitBy` and swaps never see it (they see the equipment)"
                    }
                },
                "required": [
                    "name",
                    "id",
                    "text"
                ],
                "additionalProperties": false
            }
        },
        "upgrades": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "profileId": {
                        "$ref": "#/definitions/__schema28"
                    },
                    "multiSelect": {
                        "$ref": "#/definitions/__schema29"
                    },
                    "default": {
                        "$ref": "#/definitions/__schema30"
                    },
                    "perModel": {
                        "$ref": "#/definitions/__schema31"
                    },
                    "min": {
                        "$ref": "#/definitions/__schema35"
                    },
                    "max": {
                        "$ref": "#/definitions/__schema36"
                    },
                    "restrictions": {
                        "$ref": "#/definitions/__schema37"
                    },
                    "replaces": {
                        "$ref": "#/definitions/__schema42"
                    },
                    "limitBy": {
                        "$ref": "#/definitions/__schema44"
                    },
                    "when": {
                        "$ref": "#/definitions/__schema47"
                    },
                    "grantedBy": {
                        "$ref": "#/definitions/__schema50"
                    },
                    "gearNote": {
                        "$ref": "#/definitions/__schema51"
                    },
                    "options": {
                        "$ref": "#/definitions/__schema112"
                    }
                },
                "required": [
                    "name",
                    "id",
                    "perModel",
                    "options"
                ],
                "additionalProperties": false,
                "description": "A faction-level upgrade units point at instead of repeating it"
            }
        },
        "specialRules": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "text": {
                        "type": "string"
                    },
                    "configurable": {
                        "description": "the rule takes a value, e.g. Ambush (X)",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema113"
                            }
                        ]
                    },
                    "defaultValue": {
                        "description": "the value a configurable rule has when a selection gives none",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema114"
                            }
                        ]
                    },
                    "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/__schema5"
                            }
                        ]
                    },
                    "slots": {
                        "description": "slots each unit with the rule adds to its group, e.g. one filled from another faction",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema115"
                            }
                        ]
                    }
                },
                "required": [
                    "name",
                    "id",
                    "text"
                ],
                "additionalProperties": false
            }
        },
        "groups": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "type": {
                        "description": "a group type id from the game",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema1"
                            }
                        ]
                    },
                    "slots": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "roles": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/definitions/__schema1"
                                    },
                                    "description": "units of any of these roles may fill the slot"
                                },
                                "tags": {
                                    "description": "game-declared slot tags, e.g. `prime`",
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema148"
                                        }
                                    ]
                                },
                                "required": {
                                    "description": "must be filled for the list to be valid (compulsory slots)",
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema149"
                                        }
                                    ]
                                },
                                "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/__schema150"
                                        }
                                    ]
                                },
                                "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/__schema118"
                                        }
                                    ]
                                },
                                "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/__schema151"
                                        }
                                    ]
                                },
                                "source": {
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema130"
                                        }
                                    ]
                                },
                                "effects": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/definitions/__schema138"
                                    }
                                },
                                "when": {
                                    "allOf": [
                                        {
                                            "$ref": "#/definitions/__schema48"
                                        }
                                    ]
                                },
                                "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/__schema48"
                                        }
                                    ]
                                }
                            },
                            "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/__schema118"
                            }
                        ]
                    },
                    "requires": {
                        "description": "all must be met",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema153"
                            }
                        ]
                    },
                    "requirementText": {
                        "description": "shown when a requirement isn't met",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema157"
                            }
                        ]
                    },
                    "when": {
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema48"
                            }
                        ]
                    },
                    "min": {
                        "description": "how many of this group a list must hold, e.g. a mandatory veteran formation",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema20"
                            }
                        ]
                    },
                    "max": {
                        "description": "how many of this group a list may hold",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema20"
                            }
                        ]
                    },
                    "cost": {
                        "description": "replaces its group type's `cost`",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema5"
                            }
                        ]
                    },
                    "effects": {
                        "description": "applied to every unit in the group, e.g. \"Every unit in this group gains the Gun Line trait\"",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema158"
                            }
                        ]
                    },
                    "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/__schema159"
                            }
                        ]
                    },
                    "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/__schema160"
                            }
                        ]
                    }
                },
                "required": [
                    "name",
                    "id",
                    "type",
                    "slots"
                ],
                "additionalProperties": false
            }
        },
        "selectors": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "match": {
                        "$ref": "#/definitions/__schema119"
                    }
                },
                "required": [
                    "name",
                    "id",
                    "match"
                ],
                "additionalProperties": false,
                "description": "A selector with a name, referenced as `@id` from expressions and selector fields"
            }
        },
        "slotOptions": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "text": {
                        "$ref": "#/definitions/__schema166"
                    },
                    "slotTag": {
                        "$ref": "#/definitions/__schema167"
                    },
                    "category": {
                        "$ref": "#/definitions/__schema168"
                    },
                    "slotRoles": {
                        "$ref": "#/definitions/__schema169"
                    },
                    "units": {
                        "$ref": "#/definitions/__schema171"
                    },
                    "cost": {
                        "$ref": "#/definitions/__schema172"
                    },
                    "effects": {
                        "$ref": "#/definitions/__schema173"
                    },
                    "when": {
                        "$ref": "#/definitions/__schema178"
                    }
                },
                "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."
            }
        },
        "subChoices": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "values": {
                        "$ref": "#/definitions/__schema179"
                    },
                    "default": {
                        "$ref": "#/definitions/__schema1"
                    }
                },
                "required": [
                    "name",
                    "id",
                    "values",
                    "default"
                ],
                "additionalProperties": false,
                "description": "A choice made alongside an option, defined once and shared by every option that offers it"
            }
        },
        "listRules": {
            "description": "list rules that apply to contingents using this faction (or sub-faction), e.g. a rule about this faction's own traits",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema181"
                }
            ]
        },
        "name": {
            "$ref": "#/definitions/__schema2"
        },
        "description": {
            "$ref": "#/definitions/__schema3"
        },
        "id": {
            "$ref": "#/definitions/__schema1"
        },
        "version": {
            "type": "string"
        },
        "game": {
            "type": "object",
            "properties": {
                "id": {
                    "$ref": "#/definitions/__schema1"
                },
                "versions": {
                    "type": "string",
                    "description": "A semver range a version must satisfy, e.g. `>=1.2.0 <2.0.0`"
                }
            },
            "required": [
                "id",
                "versions"
            ],
            "additionalProperties": false
        },
        "defaultGroup": {
            "description": "the group a new list's main root group starts as when the faction is picked (its usual core formation); the faction's or the game's, of a root group type taken from the main faction",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema1"
                }
            ]
        },
        "subFactionGroups": {
            "description": "the independent sub-faction picks a contingent of this faction makes; sub-factions name theirs in `group`. Sub-factions without a `group` are in the `default` group (max 1), which may be declared here to name it or change its limits",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema200"
                }
            ]
        }
    },
    "required": [
        "units",
        "weapons",
        "equipment",
        "upgrades",
        "specialRules",
        "groups",
        "name",
        "id",
        "version",
        "game"
    ],
    "additionalProperties": false,
    "definitions": {
        "__schema0": {
            "type": "string"
        },
        "__schema1": {
            "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)"
        },
        "__schema2": {
            "type": "string"
        },
        "__schema3": {
            "type": "string"
        },
        "__schema4": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "__schema5": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "$ref": "#/definitions/__schema6"
            },
            "description": "resource id → amount, e.g. `{ \"points\": 100 }` or `{ \"credits\": 4, \"slots\": 1 }`"
        },
        "__schema6": {
            "anyOf": [
                {
                    "$ref": "#/definitions/__schema7"
                },
                {
                    "$ref": "#/definitions/__schema8"
                }
            ],
            "description": "A plain number, or an expression that evaluates to one"
        },
        "__schema7": {
            "type": "number"
        },
        "__schema8": {
            "type": "string",
            "description": "An expression in the Force Org expression language (docs/specs/expression_language_spec_2026-10-17.md)"
        },
        "__schema9": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
        },
        "__schema10": {
            "type": "object",
            "properties": {
                "max": {
                    "$ref": "#/definitions/__schema9"
                },
                "cost": {
                    "$ref": "#/definitions/__schema5"
                }
            },
            "required": [
                "max",
                "cost"
            ],
            "additionalProperties": false
        },
        "__schema11": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema12"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema14"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema15"
                    },
                    "profiles": {
                        "$ref": "#/definitions/__schema16"
                    },
                    "min": {
                        "$ref": "#/definitions/__schema17"
                    },
                    "max": {
                        "$ref": "#/definitions/__schema19"
                    },
                    "cost": {
                        "$ref": "#/definitions/__schema21"
                    },
                    "replaces": {
                        "$ref": "#/definitions/__schema22"
                    }
                },
                "required": [
                    "id",
                    "profiles"
                ],
                "additionalProperties": false,
                "description": "A set of models bought together: the unit holds between `min` and `max` copies of it, e.g. a Gun Crew of one Gunner and one Loader"
            }
        },
        "__schema12": {
            "description": "shown to players, e.g. \"Gun Crew\"; left out, built from the profile names",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema13"
                }
            ]
        },
        "__schema13": {
            "type": "string"
        },
        "__schema14": {
            "type": "string"
        },
        "__schema15": {
            "description": "unique within the unit; the key a saved list stores the number of copies under",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema1"
                }
            ]
        },
        "__schema16": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "$ref": "#/definitions/__schema9"
            },
            "description": "profile id → how many models of it one copy of the block holds, e.g. `{ \"gunner\": 1, \"loader\": 1 }`"
        },
        "__schema17": {
            "description": "copies in the unit as bought for its `cost`; left out = 1",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema18"
                }
            ]
        },
        "__schema18": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
        },
        "__schema19": {
            "description": "most copies the unit may hold; left out = `min`. An expression (validator 1.10.0) is evaluated live for the unit as it stands, in the unit's scopes, e.g. `floor(unit.models() / 5)` on a block that `replaces` models; only a block with `replaces` may read `unit.models()`",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema20"
                }
            ]
        },
        "__schema20": {
            "anyOf": [
                {
                    "$ref": "#/definitions/__schema18"
                },
                {
                    "$ref": "#/definitions/__schema8"
                }
            ],
            "description": "A whole number (0 or more), or an expression that evaluates to a number"
        },
        "__schema21": {
            "description": "what each copy above `min` costs; needed when `max` is more than `min` or an expression",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema5"
                }
            ]
        },
        "__schema22": {
            "description": "each copy takes the place of models of `profile` in `block` instead of adding models, e.g. one Sapper upgraded to a Foreman: the unit's size stays the same and the profile's count moves to this block's profiles",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema23"
                }
            ]
        },
        "__schema23": {
            "type": "object",
            "properties": {
                "block": {
                    "description": "the block whose models it replaces",
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema1"
                        }
                    ]
                },
                "profile": {
                    "description": "the profile in that block each copy takes the place of; one model of it per model in the copy",
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema1"
                        }
                    ]
                }
            },
            "required": [
                "block",
                "profile"
            ],
            "additionalProperties": false
        },
        "__schema24": {
            "type": "string"
        },
        "__schema25": {
            "type": "object",
            "properties": {
                "id": {
                    "$ref": "#/definitions/__schema1"
                },
                "value": {
                    "type": "string"
                }
            },
            "required": [
                "id"
            ],
            "additionalProperties": false
        },
        "__schema26": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "__schema27": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "__schema28": {
            "description": "the profile that takes this upgrade's gear; left out, the unit at large does",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema1"
                }
            ]
        },
        "__schema29": {
            "type": "boolean"
        },
        "__schema30": {
            "description": "id of the option picked by default",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema1"
                }
            ]
        },
        "__schema31": {
            "type": "object",
            "properties": {
                "type": {
                    "type": "string",
                    "enum": [
                        "single",
                        "multiple",
                        "every",
                        "some",
                        "one-in-x"
                    ],
                    "description": "single: once for the unit or one model; multiple: any number of times; every: every model gets it; some: any number of models; one-in-x: `count` (default 1) per `everyX` models"
                },
                "everyX": {
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema9"
                        }
                    ]
                },
                "count": {
                    "description": "one-in-x only: picks allowed per `everyX` models (default 1), a positive whole number; the cap is count × floor(models / everyX), e.g. `{ \"type\": \"one-in-x\", \"everyX\": 5, \"count\": 2 }` for 'for every five Models, up to two Models may each…'",
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema9"
                        }
                    ]
                },
                "max": {
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema18"
                        }
                    ]
                },
                "excludeProfiles": {
                    "description": "profiles not counted as models for this upgrade",
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema32"
                        }
                    ]
                }
            },
            "required": [
                "type"
            ],
            "additionalProperties": false
        },
        "__schema32": {
            "type": "object",
            "properties": {
                "anyOf": {
                    "$ref": "#/definitions/__schema33"
                },
                "noneOf": {
                    "$ref": "#/definitions/__schema34"
                }
            },
            "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."
        },
        "__schema33": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "__schema34": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "__schema35": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema20"
                }
            ]
        },
        "__schema36": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema20"
                }
            ]
        },
        "__schema37": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema38"
                }
            ]
        },
        "__schema38": {
            "type": "object",
            "properties": {
                "exclusions": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/__schema39"
                    }
                },
                "required": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "kind": {
                                "$ref": "#/definitions/__schema40"
                            },
                            "id": {
                                "$ref": "#/definitions/__schema1"
                            },
                            "profiles": {
                                "$ref": "#/definitions/__schema41"
                            }
                        },
                        "required": [
                            "kind",
                            "id"
                        ],
                        "additionalProperties": false,
                        "description": "Gear the unit must hold, optionally only counting profiles that match the filter"
                    }
                },
                "requiredAnd": {
                    "type": "boolean"
                }
            },
            "required": [
                "exclusions",
                "required",
                "requiredAnd"
            ],
            "additionalProperties": false
        },
        "__schema39": {
            "type": "object",
            "properties": {
                "kind": {
                    "$ref": "#/definitions/__schema40"
                },
                "id": {
                    "$ref": "#/definitions/__schema1"
                }
            },
            "required": [
                "kind",
                "id"
            ],
            "additionalProperties": false,
            "description": "Points at a faction weapon or piece of equipment"
        },
        "__schema40": {
            "type": "string",
            "enum": [
                "weapon",
                "equipment"
            ]
        },
        "__schema41": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema32"
                }
            ]
        },
        "__schema42": {
            "description": "sibling unit upgrades this upgrade takes the place of when picked",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema43"
                }
            ]
        },
        "__schema43": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema44": {
            "description": "caps total non-default picks at Σ count × amount of that gear held",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema45"
                }
            ]
        },
        "__schema45": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "kind": {
                        "$ref": "#/definitions/__schema40"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "profiles": {
                        "$ref": "#/definitions/__schema41"
                    },
                    "count": {
                        "$ref": "#/definitions/__schema46"
                    }
                },
                "required": [
                    "kind",
                    "id",
                    "count"
                ],
                "additionalProperties": false,
                "description": "An upgrade may be picked `count` times for each of this gear the unit has"
            }
        },
        "__schema46": {
            "type": "number",
            "exclusiveMinimum": 0
        },
        "__schema47": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema48"
                }
            ]
        },
        "__schema48": {
            "type": "object",
            "properties": {
                "if": {
                    "$ref": "#/definitions/__schema8"
                },
                "message": {
                    "$ref": "#/definitions/__schema49"
                }
            },
            "required": [
                "if",
                "message"
            ],
            "additionalProperties": false,
            "description": "A rule's condition plus the player-facing reason shown when it isn't met"
        },
        "__schema49": {
            "type": "string"
        },
        "__schema50": {
            "description": "id of the sub-faction unit modifier that added this upgrade",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema1"
                }
            ]
        },
        "__schema51": {
            "description": "a short note shown next to every gear this upgrade's picks give (validator 1.11.0), e.g. a mount: `Hull mounted`. It covers the options' `weaponRefs` / `equipmentRefs` and swap `to`s, the `default` option's and those of options reached through a reference included (the referencing upgrade's note wins over the shared upgrade's). Display only: gear is still matched, counted and swapped by kind and id",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema52"
                }
            ]
        },
        "__schema52": {
            "type": "string"
        },
        "__schema53": {
            "type": "object",
            "properties": {
                "kind": {
                    "$ref": "#/definitions/__schema40"
                },
                "id": {
                    "$ref": "#/definitions/__schema1"
                },
                "count": {
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema9"
                        }
                    ]
                }
            },
            "required": [
                "kind",
                "id"
            ],
            "additionalProperties": false
        },
        "__schema54": {
            "anyOf": [
                {
                    "$ref": "#/definitions/__schema55"
                },
                {
                    "type": "object",
                    "properties": {
                        "id": {
                            "description": "id of the option entry in the unit upgrade",
                            "allOf": [
                                {
                                    "$ref": "#/definitions/__schema1"
                                }
                            ]
                        },
                        "target": {
                            "description": "id of the faction upgrade it pulls in",
                            "allOf": [
                                {
                                    "$ref": "#/definitions/__schema1"
                                }
                            ]
                        },
                        "restrictions": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/__schema38"
                                }
                            ]
                        }
                    },
                    "required": [
                        "id",
                        "target"
                    ],
                    "additionalProperties": false
                }
            ]
        },
        "__schema55": {
            "type": "object",
            "properties": {
                "name": {
                    "$ref": "#/definitions/__schema2"
                },
                "description": {
                    "$ref": "#/definitions/__schema3"
                },
                "id": {
                    "$ref": "#/definitions/__schema1"
                },
                "cost": {
                    "$ref": "#/definitions/__schema5"
                },
                "weaponRefs": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/__schema1"
                    }
                },
                "equipmentRefs": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/__schema1"
                    }
                },
                "swaps": {
                    "description": "gear this option replaces, wherever the profile got it from",
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema56"
                        }
                    ]
                },
                "subChoices": {
                    "description": "ids of shared sub-choices made with the option, e.g. a weapon's `mount`",
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema59"
                        }
                    ]
                },
                "effects": {
                    "description": "applied to the unit while the option is picked, e.g. armour plating raising armour",
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema60"
                        }
                    ]
                },
                "when": {
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema48"
                        }
                    ]
                },
                "max": {
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema20"
                        }
                    ]
                }
            },
            "required": [
                "name",
                "id",
                "cost"
            ],
            "additionalProperties": false
        },
        "__schema56": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "from": {
                        "$ref": "#/definitions/__schema57"
                    },
                    "to": {
                        "$ref": "#/definitions/__schema39"
                    }
                },
                "required": [
                    "from",
                    "to"
                ],
                "additionalProperties": false,
                "description": "Takes one `from` (one of each, for a list) off the upgrade's profile and gives it `to` in its place, per pick"
            }
        },
        "__schema57": {
            "anyOf": [
                {
                    "$ref": "#/definitions/__schema39"
                },
                {
                    "$ref": "#/definitions/__schema58"
                }
            ],
            "description": "the gear taken off; a list takes one of each, and a pick needs all of them held"
        },
        "__schema58": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema39"
            }
        },
        "__schema59": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema60": {
            "type": "array",
            "items": {
                "oneOf": [
                    {
                        "$ref": "#/definitions/__schema61"
                    },
                    {
                        "$ref": "#/definitions/__schema68"
                    },
                    {
                        "$ref": "#/definitions/__schema77"
                    },
                    {
                        "$ref": "#/definitions/__schema87"
                    },
                    {
                        "$ref": "#/definitions/__schema95"
                    }
                ]
            }
        },
        "__schema61": {
            "type": "object",
            "properties": {
                "kind": {
                    "$ref": "#/definitions/__schema62"
                },
                "profiles": {
                    "$ref": "#/definitions/__schema63"
                },
                "changes": {
                    "$ref": "#/definitions/__schema64"
                },
                "when": {
                    "$ref": "#/definitions/__schema67"
                }
            },
            "required": [
                "kind",
                "changes"
            ],
            "additionalProperties": false,
            "description": "several stat changes sharing one profile filter"
        },
        "__schema62": {
            "type": "string",
            "const": "stat"
        },
        "__schema63": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema32"
                }
            ]
        },
        "__schema64": {
            "type": "array",
            "items": {
                "oneOf": [
                    {
                        "$ref": "#/definitions/__schema65"
                    },
                    {
                        "$ref": "#/definitions/__schema66"
                    }
                ],
                "description": "`add` shifts the number and keeps its suffix: '3+' -1 → '2+', '6\"' +1 → '7\"'"
            }
        },
        "__schema65": {
            "type": "object",
            "properties": {
                "stat": {
                    "$ref": "#/definitions/__schema1"
                },
                "op": {
                    "type": "string",
                    "const": "add"
                },
                "value": {
                    "type": "number"
                },
                "min": {
                    "type": "number"
                },
                "max": {
                    "type": "number"
                }
            },
            "required": [
                "stat",
                "op",
                "value"
            ],
            "additionalProperties": false
        },
        "__schema66": {
            "type": "object",
            "properties": {
                "stat": {
                    "$ref": "#/definitions/__schema1"
                },
                "op": {
                    "type": "string",
                    "const": "set"
                },
                "value": {
                    "type": "string"
                }
            },
            "required": [
                "stat",
                "op",
                "value"
            ],
            "additionalProperties": false
        },
        "__schema67": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema48"
                }
            ]
        },
        "__schema68": {
            "type": "object",
            "properties": {
                "kind": {
                    "$ref": "#/definitions/__schema69"
                },
                "profiles": {
                    "$ref": "#/definitions/__schema70"
                },
                "rule": {
                    "$ref": "#/definitions/__schema71"
                },
                "remove": {
                    "$ref": "#/definitions/__schema72"
                },
                "replace": {
                    "$ref": "#/definitions/__schema74"
                },
                "when": {
                    "$ref": "#/definitions/__schema76"
                }
            },
            "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"
        },
        "__schema69": {
            "type": "string",
            "const": "specialRule"
        },
        "__schema70": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema32"
                }
            ]
        },
        "__schema71": {
            "description": "the rule each picked profile gains",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema25"
                }
            ]
        },
        "__schema72": {
            "description": "(validator 2.5.0) rule ids each picked profile loses, whatever their value",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema73"
                }
            ]
        },
        "__schema73": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema74": {
            "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/__schema75"
                }
            ]
        },
        "__schema75": {
            "type": "object",
            "properties": {
                "from": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/__schema1"
                    }
                },
                "to": {
                    "$ref": "#/definitions/__schema25"
                }
            },
            "required": [
                "from",
                "to"
            ],
            "additionalProperties": false
        },
        "__schema76": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema48"
                }
            ]
        },
        "__schema77": {
            "type": "object",
            "properties": {
                "kind": {
                    "$ref": "#/definitions/__schema78"
                },
                "profiles": {
                    "$ref": "#/definitions/__schema79"
                },
                "add": {
                    "$ref": "#/definitions/__schema80"
                },
                "remove": {
                    "$ref": "#/definitions/__schema82"
                },
                "replace": {
                    "$ref": "#/definitions/__schema84"
                },
                "when": {
                    "$ref": "#/definitions/__schema86"
                }
            },
            "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"
        },
        "__schema78": {
            "type": "string",
            "const": "trait"
        },
        "__schema79": {
            "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/__schema32"
                }
            ]
        },
        "__schema80": {
            "description": "traits the unit gains (with `profiles`, each picked profile)",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema81"
                }
            ]
        },
        "__schema81": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "__schema82": {
            "description": "traits the unit loses, if it has them (with `profiles`, each picked profile)",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema83"
                }
            ]
        },
        "__schema83": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "__schema84": {
            "description": "the unit (with `profiles`, each picked profile) loses any of `from` and, only if it had one, gains `to`",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema85"
                }
            ]
        },
        "__schema85": {
            "type": "object",
            "properties": {
                "from": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "to": {
                    "type": "string"
                }
            },
            "required": [
                "from",
                "to"
            ],
            "additionalProperties": false
        },
        "__schema86": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema48"
                }
            ]
        },
        "__schema87": {
            "type": "object",
            "properties": {
                "kind": {
                    "$ref": "#/definitions/__schema88"
                },
                "profiles": {
                    "$ref": "#/definitions/__schema89"
                },
                "add": {
                    "$ref": "#/definitions/__schema90"
                },
                "remove": {
                    "$ref": "#/definitions/__schema92"
                },
                "when": {
                    "$ref": "#/definitions/__schema94"
                }
            },
            "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"
        },
        "__schema88": {
            "type": "string",
            "const": "subType"
        },
        "__schema89": {
            "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/__schema32"
                }
            ]
        },
        "__schema90": {
            "description": "ids of game `subTypes` the unit (with `profiles`, each picked profile) gains, e.g. `[\"sergeant\"]`",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema91"
                }
            ]
        },
        "__schema91": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema92": {
            "description": "ids of game `subTypes` the unit (with `profiles`, each picked profile) loses, if it has them",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema93"
                }
            ]
        },
        "__schema93": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema94": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema48"
                }
            ]
        },
        "__schema95": {
            "type": "object",
            "properties": {
                "kind": {
                    "$ref": "#/definitions/__schema96"
                },
                "add": {
                    "$ref": "#/definitions/__schema97"
                },
                "categories": {
                    "$ref": "#/definitions/__schema98"
                },
                "when": {
                    "$ref": "#/definitions/__schema100"
                }
            },
            "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`"
        },
        "__schema96": {
            "type": "string",
            "const": "slotTag"
        },
        "__schema97": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            },
            "description": "game-declared slot tags the slot holding the unit counts as having, e.g. `[\"prime\"]`"
        },
        "__schema98": {
            "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/__schema99"
                }
            ]
        },
        "__schema99": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema100": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema48"
                }
            ]
        },
        "__schema101": {
            "description": "carried by every model, so the amount follows the unit's model count",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema102"
                }
            ]
        },
        "__schema102": {
            "type": "boolean"
        },
        "__schema103": {
            "description": "with `perModel`: profiles that don't carry it",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema32"
                }
            ]
        },
        "__schema104": {
            "description": "the profile that carries it; left out, the unit at large does. With `perModel`: one for each model of that profile",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema1"
                }
            ]
        },
        "__schema105": {
            "description": "a short note shown next to this gear wherever the unit's gear is listed (validator 1.11.0), e.g. a mount: `Turret mounted`. Display only: gear is still matched, counted and swapped by kind and id",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema106"
                }
            ]
        },
        "__schema106": {
            "type": "string"
        },
        "__schema107": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "__schema108": {
            "type": "object",
            "properties": {
                "max": {
                    "$ref": "#/definitions/__schema20"
                },
                "scope": {
                    "type": "string",
                    "enum": [
                        "group",
                        "contingent",
                        "list"
                    ]
                },
                "message": {
                    "type": "string"
                }
            },
            "required": [
                "max",
                "scope"
            ],
            "additionalProperties": false
        },
        "__schema109": {
            "description": "a weapon stat template id from the game, e.g. `ranged` / `melee`: the template of every profile without its own `template`",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema1"
                }
            ]
        },
        "__schema110": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "template": {
                        "description": "a weapon stat template id from the game for this profile, in place of the weapon's `template` (validator 1.11.0), e.g. `melee` on the close-combat profile of a spear whose weapon `template` is `ranged`",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema1"
                            }
                        ]
                    },
                    "stats": {
                        "type": "object",
                        "propertyNames": {
                            "$ref": "#/definitions/__schema1"
                        },
                        "additionalProperties": {
                            "$ref": "#/definitions/__schema111"
                        },
                        "description": "stat id → value, checked against the profile's template"
                    },
                    "traits": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "specialRules": {
                        "type": "array",
                        "items": {
                            "$ref": "#/definitions/__schema25"
                        }
                    }
                },
                "required": [
                    "name",
                    "stats"
                ],
                "additionalProperties": false
            }
        },
        "__schema111": {
            "type": "string"
        },
        "__schema112": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "$ref": "#/definitions/__schema55"
            }
        },
        "__schema113": {
            "type": "boolean"
        },
        "__schema114": {
            "type": "string"
        },
        "__schema115": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "roleChoices": {
                        "$ref": "#/definitions/__schema116"
                    },
                    "units": {
                        "$ref": "#/definitions/__schema117"
                    },
                    "source": {
                        "$ref": "#/definitions/__schema129"
                    },
                    "effects": {
                        "$ref": "#/definitions/__schema137"
                    }
                },
                "required": [
                    "roleChoices"
                ],
                "additionalProperties": false,
                "description": "A slot a mechanic adds to a group"
            }
        },
        "__schema116": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            },
            "description": "the slot's role; with several the player picks one"
        },
        "__schema117": {
            "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/__schema118"
                }
            ]
        },
        "__schema118": {
            "anyOf": [
                {
                    "$ref": "#/definitions/__schema119"
                },
                {
                    "type": "string",
                    "pattern": "^@[a-z0-9]+(?:-[a-z0-9]+)*$",
                    "description": "A named selector by id, accepted wherever a `UnitSelector` is, e.g. `\"@line-infantry\"`"
                }
            ]
        },
        "__schema119": {
            "type": "object",
            "properties": {
                "unitIds": {
                    "$ref": "#/definitions/__schema120"
                },
                "roles": {
                    "$ref": "#/definitions/__schema121"
                },
                "traits": {
                    "$ref": "#/definitions/__schema122"
                },
                "profiles": {
                    "$ref": "#/definitions/__schema124"
                },
                "specialRules": {
                    "$ref": "#/definitions/__schema125"
                },
                "exclude": {
                    "$ref": "#/definitions/__schema127"
                }
            },
            "additionalProperties": false,
            "description": "Picks units by id, role, trait and profile type/tags; left out, a field matches every unit"
        },
        "__schema120": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema121": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema122": {
            "description": "a unit matches when it has any of these traits, matched as case-insensitive text",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema123"
                }
            ]
        },
        "__schema123": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "__schema124": {
            "description": "a unit matches when one of its profiles does (or the unit itself, if it has no profiles)",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema32"
                }
            ]
        },
        "__schema125": {
            "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/__schema126"
                }
            ]
        },
        "__schema126": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema127": {
            "description": "a unit that matches any of these does not match the selector",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema128"
                }
            ]
        },
        "__schema128": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "unitIds": {
                        "$ref": "#/definitions/__schema120"
                    },
                    "roles": {
                        "$ref": "#/definitions/__schema121"
                    },
                    "traits": {
                        "$ref": "#/definitions/__schema122"
                    },
                    "profiles": {
                        "$ref": "#/definitions/__schema124"
                    },
                    "specialRules": {
                        "$ref": "#/definitions/__schema125"
                    }
                },
                "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"
            }
        },
        "__schema129": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema130"
                }
            ]
        },
        "__schema130": {
            "anyOf": [
                {
                    "$ref": "#/definitions/__schema131"
                },
                {
                    "$ref": "#/definitions/__schema136"
                }
            ],
            "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"
        },
        "__schema131": {
            "type": "object",
            "properties": {
                "faction": {
                    "$ref": "#/definitions/__schema132"
                },
                "subFactions": {
                    "$ref": "#/definitions/__schema133"
                },
                "units": {
                    "$ref": "#/definitions/__schema135"
                }
            },
            "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"
        },
        "__schema132": {
            "description": "a faction of the same game, possibly from another source; may be the contingent's own",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema1"
                }
            ]
        },
        "__schema133": {
            "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/__schema134"
                }
            ]
        },
        "__schema134": {
            "anyOf": [
                {
                    "type": "string",
                    "const": "any"
                },
                {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/__schema1"
                    }
                }
            ]
        },
        "__schema135": {
            "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/__schema118"
                }
            ]
        },
        "__schema136": {
            "minItems": 1,
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema131"
            }
        },
        "__schema137": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema138"
            }
        },
        "__schema138": {
            "oneOf": [
                {
                    "$ref": "#/definitions/__schema61"
                },
                {
                    "$ref": "#/definitions/__schema68"
                },
                {
                    "$ref": "#/definitions/__schema77"
                },
                {
                    "$ref": "#/definitions/__schema87"
                },
                {
                    "$ref": "#/definitions/__schema95"
                },
                {
                    "$ref": "#/definitions/__schema139"
                }
            ],
            "description": "applied to the unit filling the slot, after the group's effects, e.g. replacing a borrowed unit's faction trait"
        },
        "__schema139": {
            "type": "object",
            "properties": {
                "kind": {
                    "$ref": "#/definitions/__schema140"
                },
                "profiles": {
                    "$ref": "#/definitions/__schema141"
                },
                "count": {
                    "$ref": "#/definitions/__schema142"
                },
                "name": {
                    "$ref": "#/definitions/__schema143"
                },
                "effects": {
                    "$ref": "#/definitions/__schema145"
                },
                "when": {
                    "$ref": "#/definitions/__schema147"
                }
            },
            "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"
        },
        "__schema140": {
            "type": "string",
            "const": "model"
        },
        "__schema141": {
            "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/__schema32"
                }
            ]
        },
        "__schema142": {
            "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/__schema9"
                }
            ]
        },
        "__schema143": {
            "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/__schema144"
                }
            ]
        },
        "__schema144": {
            "type": "string"
        },
        "__schema145": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema146"
            },
            "description": "applied in order to the split-off models only"
        },
        "__schema146": {
            "oneOf": [
                {
                    "type": "object",
                    "properties": {
                        "kind": {
                            "$ref": "#/definitions/__schema62"
                        },
                        "changes": {
                            "$ref": "#/definitions/__schema64"
                        },
                        "when": {
                            "$ref": "#/definitions/__schema67"
                        }
                    },
                    "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/__schema69"
                        },
                        "rule": {
                            "$ref": "#/definitions/__schema71"
                        },
                        "remove": {
                            "$ref": "#/definitions/__schema72"
                        },
                        "replace": {
                            "$ref": "#/definitions/__schema74"
                        },
                        "when": {
                            "$ref": "#/definitions/__schema76"
                        }
                    },
                    "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/__schema78"
                        },
                        "add": {
                            "$ref": "#/definitions/__schema80"
                        },
                        "remove": {
                            "$ref": "#/definitions/__schema82"
                        },
                        "replace": {
                            "$ref": "#/definitions/__schema84"
                        },
                        "when": {
                            "$ref": "#/definitions/__schema86"
                        }
                    },
                    "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/__schema88"
                        },
                        "add": {
                            "$ref": "#/definitions/__schema90"
                        },
                        "remove": {
                            "$ref": "#/definitions/__schema92"
                        },
                        "when": {
                            "$ref": "#/definitions/__schema94"
                        }
                    },
                    "required": [
                        "kind"
                    ],
                    "additionalProperties": false,
                    "description": "sub-types the split-off model gains or loses, as its own `tags`"
                }
            ]
        },
        "__schema147": {
            "description": "whether the split happens at all; it sees the unit, not a profile",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema48"
                }
            ]
        },
        "__schema148": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema149": {
            "type": "boolean"
        },
        "__schema150": {
            "type": "object",
            "properties": {
                "min": {
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema18"
                        }
                    ]
                },
                "max": {
                    "allOf": [
                        {
                            "$ref": "#/definitions/__schema20"
                        }
                    ]
                }
            },
            "additionalProperties": false
        },
        "__schema151": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "categories": {
                        "$ref": "#/definitions/__schema152"
                    }
                },
                "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"
            }
        },
        "__schema152": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            },
            "description": "only slot options with one of these `category`s are offered for the tag"
        },
        "__schema153": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "units": {
                        "$ref": "#/definitions/__schema118"
                    },
                    "count": {
                        "$ref": "#/definitions/__schema154"
                    },
                    "scope": {
                        "$ref": "#/definitions/__schema155"
                    }
                },
                "required": [
                    "units"
                ],
                "additionalProperties": false,
                "description": "units the list must already hold before the group can be taken"
            }
        },
        "__schema154": {
            "description": "matching units needed; left out = 1",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema9"
                }
            ]
        },
        "__schema155": {
            "description": "where they're counted: the group's contingent outside it (default) or its root group",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema156"
                }
            ]
        },
        "__schema156": {
            "type": "string",
            "enum": [
                "contingent",
                "root"
            ]
        },
        "__schema157": {
            "type": "string"
        },
        "__schema158": {
            "type": "array",
            "items": {
                "oneOf": [
                    {
                        "$ref": "#/definitions/__schema61"
                    },
                    {
                        "$ref": "#/definitions/__schema68"
                    },
                    {
                        "$ref": "#/definitions/__schema77"
                    },
                    {
                        "$ref": "#/definitions/__schema87"
                    },
                    {
                        "$ref": "#/definitions/__schema95"
                    },
                    {
                        "$ref": "#/definitions/__schema139"
                    }
                ],
                "description": "applied to every unit in the group, including units in slots added later"
            }
        },
        "__schema159": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema160": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "units": {
                        "$ref": "#/definitions/__schema161"
                    },
                    "scope": {
                        "$ref": "#/definitions/__schema162"
                    },
                    "effects": {
                        "$ref": "#/definitions/__schema164"
                    }
                },
                "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\""
            }
        },
        "__schema161": {
            "description": "the units `effects` apply to, seen with their own traits and sub-faction modifiers; left out = every unit in reach",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema118"
                }
            ]
        },
        "__schema162": {
            "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/__schema163"
                }
            ]
        },
        "__schema163": {
            "type": "string",
            "enum": [
                "list",
                "contingent"
            ]
        },
        "__schema164": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema165"
            },
            "description": "stat, special-rule, trait and slot-tag effects"
        },
        "__schema165": {
            "oneOf": [
                {
                    "$ref": "#/definitions/__schema61"
                },
                {
                    "$ref": "#/definitions/__schema68"
                },
                {
                    "$ref": "#/definitions/__schema77"
                },
                {
                    "$ref": "#/definitions/__schema87"
                },
                {
                    "$ref": "#/definitions/__schema95"
                }
            ],
            "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"
        },
        "__schema166": {
            "type": "string"
        },
        "__schema167": {
            "description": "offered on slots with this tag",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema1"
                }
            ]
        },
        "__schema168": {
            "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/__schema1"
                }
            ]
        },
        "__schema169": {
            "description": "only offered on slots of these roles; left out = any role",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema170"
                }
            ]
        },
        "__schema170": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema171": {
            "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/__schema118"
                }
            ]
        },
        "__schema172": {
            "description": "added to the cost of the unit in the slot",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema5"
                }
            ]
        },
        "__schema173": {
            "type": "array",
            "items": {
                "oneOf": [
                    {
                        "$ref": "#/definitions/__schema61"
                    },
                    {
                        "$ref": "#/definitions/__schema68"
                    },
                    {
                        "$ref": "#/definitions/__schema77"
                    },
                    {
                        "$ref": "#/definitions/__schema87"
                    },
                    {
                        "$ref": "#/definitions/__schema139"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "kind": {
                                "$ref": "#/definitions/__schema174"
                            },
                            "roleChoices": {
                                "$ref": "#/definitions/__schema116"
                            },
                            "units": {
                                "$ref": "#/definitions/__schema117"
                            },
                            "source": {
                                "$ref": "#/definitions/__schema129"
                            },
                            "effects": {
                                "$ref": "#/definitions/__schema137"
                            },
                            "count": {
                                "$ref": "#/definitions/__schema175"
                            }
                        },
                        "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/__schema176"
                            },
                            "roles": {
                                "$ref": "#/definitions/__schema177"
                            }
                        },
                        "required": [
                            "kind",
                            "roles"
                        ],
                        "additionalProperties": false,
                        "description": "units of these roles may also fill the slot"
                    }
                ]
            }
        },
        "__schema174": {
            "type": "string",
            "const": "slot"
        },
        "__schema175": {
            "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/__schema9"
                }
            ]
        },
        "__schema176": {
            "type": "string",
            "const": "allowedRoles"
        },
        "__schema177": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema178": {
            "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/__schema48"
                }
            ]
        },
        "__schema179": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "costMultiplier": {
                        "description": "resource id → multiplier for the option's cost, e.g. a turret mount `{ \"points\": 3 }`",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema180"
                            }
                        ]
                    },
                    "cost": {
                        "description": "added to the option's cost",
                        "allOf": [
                            {
                                "$ref": "#/definitions/__schema5"
                            }
                        ]
                    }
                },
                "required": [
                    "name",
                    "id"
                ],
                "additionalProperties": false
            }
        },
        "__schema180": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "type": "number"
            }
        },
        "__schema181": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "oneOf": [
                    {
                        "type": "object",
                        "properties": {
                            "kind": {
                                "$ref": "#/definitions/__schema182"
                            },
                            "id": {
                                "$ref": "#/definitions/__schema1"
                            },
                            "resource": {
                                "$ref": "#/definitions/__schema1"
                            },
                            "units": {
                                "$ref": "#/definitions/__schema183"
                            },
                            "contingentTypes": {
                                "$ref": "#/definitions/__schema184"
                            },
                            "max": {
                                "$ref": "#/definitions/__schema186"
                            },
                            "message": {
                                "$ref": "#/definitions/__schema187"
                            }
                        },
                        "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/__schema188"
                            },
                            "id": {
                                "$ref": "#/definitions/__schema1"
                            },
                            "units": {
                                "$ref": "#/definitions/__schema189"
                            },
                            "groupTypes": {
                                "$ref": "#/definitions/__schema190"
                            },
                            "scope": {
                                "$ref": "#/definitions/__schema191"
                            },
                            "min": {
                                "$ref": "#/definitions/__schema192"
                            },
                            "max": {
                                "$ref": "#/definitions/__schema193"
                            },
                            "message": {
                                "$ref": "#/definitions/__schema194"
                            }
                        },
                        "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/__schema195"
                            },
                            "id": {
                                "$ref": "#/definitions/__schema1"
                            },
                            "scope": {
                                "$ref": "#/definitions/__schema196"
                            },
                            "groupTypes": {
                                "$ref": "#/definitions/__schema198"
                            },
                            "when": {
                                "$ref": "#/definitions/__schema48"
                            }
                        },
                        "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"
                    }
                ]
            }
        },
        "__schema182": {
            "type": "string",
            "const": "resourceCap"
        },
        "__schema183": {
            "description": "count only these units; left out = every unit",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema118"
                }
            ]
        },
        "__schema184": {
            "description": "count only units in contingents whose root group is one of these types",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema185"
                }
            ]
        },
        "__schema185": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema186": {
            "anyOf": [
                {
                    "type": "object",
                    "properties": {
                        "percentOfLimit": {
                            "type": "number"
                        },
                        "round": {
                            "type": "string",
                            "enum": [
                                "up",
                                "down"
                            ]
                        }
                    },
                    "required": [
                        "percentOfLimit"
                    ],
                    "additionalProperties": false
                },
                {
                    "type": "object",
                    "properties": {
                        "value": {
                            "$ref": "#/definitions/__schema6"
                        }
                    },
                    "required": [
                        "value"
                    ],
                    "additionalProperties": false
                }
            ]
        },
        "__schema187": {
            "type": "string"
        },
        "__schema188": {
            "type": "string",
            "const": "count"
        },
        "__schema189": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema118"
                }
            ]
        },
        "__schema190": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema191": {
            "type": "string",
            "enum": [
                "group",
                "contingent",
                "list"
            ]
        },
        "__schema192": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema20"
                }
            ]
        },
        "__schema193": {
            "allOf": [
                {
                    "$ref": "#/definitions/__schema20"
                }
            ]
        },
        "__schema194": {
            "type": "string"
        },
        "__schema195": {
            "type": "string",
            "const": "expression"
        },
        "__schema196": {
            "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/__schema197"
                }
            ]
        },
        "__schema197": {
            "type": "string",
            "enum": [
                "list",
                "group"
            ]
        },
        "__schema198": {
            "description": "with `scope: \"group\"`: only groups of these types",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema199"
                }
            ]
        },
        "__schema199": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/__schema1"
            }
        },
        "__schema200": {
            "type": "object",
            "propertyNames": {
                "$ref": "#/definitions/__schema1"
            },
            "additionalProperties": {
                "type": "object",
                "properties": {
                    "name": {
                        "$ref": "#/definitions/__schema2"
                    },
                    "description": {
                        "$ref": "#/definitions/__schema3"
                    },
                    "id": {
                        "$ref": "#/definitions/__schema1"
                    },
                    "min": {
                        "$ref": "#/definitions/__schema201"
                    },
                    "max": {
                        "$ref": "#/definitions/__schema202"
                    }
                },
                "required": [
                    "name",
                    "id"
                ],
                "additionalProperties": false,
                "description": "An independent sub-faction pick, e.g. a doctrine and a heritage: a contingent takes between `min` and `max` of the sub-factions in each group"
            }
        },
        "__schema201": {
            "description": "how many sub-factions of this group a contingent must take; left out = 0. Expressions may use `contingent`, `root`, `main` and `list`",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema20"
                }
            ]
        },
        "__schema202": {
            "description": "how many sub-factions of this group a contingent may take; left out = 1. Expressions may use `contingent`, `root`, `main` and `list`, e.g. `1 + (list.has(unit:x) ? 1 : 0)`",
            "allOf": [
                {
                    "$ref": "#/definitions/__schema20"
                }
            ]
        }
    },
    "title": "Faction"
}
