{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://bitsum.com/json-schemas/2025-02-12-00/schema",
    "$title": "Process Lasso Rules",
    "$description": "JSON Schema for Process Lasso Rulesets",
    "type": "object",
    "properties": {
        "$description": {
            "type": "string",
            "description": "Description of the ruleset file"
        },
        "$schema": {
            "type": "string",
            "format": "uri",
            "description": "Reference to the JSON schema"
        },
        "$title": {
            "type": "string",
            "description": "Title of the ruleset"
        },
        "cpuModel": {
            "type": "string",
            "description": "CPU model identifier"
        },
        "appPowerProfileRuleOrder": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "description": "Order of app power profile rules"
        },
        "cpuAffinityRuleOrder": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "description": "Order of CPU affinity rules"
        },
        "cpuLimitRuleOrder": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "description": "Order of CPU limit rules"
        },
        "hardThrottlesRuleOrder": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "description": "Order of hard throttle rules"
        },
        "instanceCountLimitRuleOrder": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "description": "Order of instance count limit rules"
        },
        "ioPriorityClassRuleOrder": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "description": "Order of I/O priority class rules"
        },
        "memoryPriorityRuleOrder": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "description": "Order of memory priority rules"
        },
        "priorityBoostRuleOrder": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "description": "Order of priority boost rules"
        },
        "priorityClassRuleOrder": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "description": "Order of priority class rules"
        },
        "watchdogRuleOrder": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "description": "Order of watchdog rules"
        },
        "ruleSets": {
            "type": "array",
            "description": "Collection of process-specific rule sets",
            "items": {
                "$ref": "#/$defs/ruleSet"
            }
        }
    },
    "additionalProperties": true,
    "$defs": {
        "ruleSet": {
            "type": "object",
            "description": "Rule set for a specific process",
            "required": [
                "processName"
            ],
            "properties": {
                "processName": {
                    "type": "string",
                    "description": "Name of the process"
                },
                "appPowerProfile": {
                    "type": "string",
                    "description": "Power profile to apply"
                },
                "cpuAffinity": {
                    "type": "string",
                    "description": "CPU affinity mask in range format",
                    "pattern": "^[0-9]+(-[0-9]+)?(,[0-9]+(-[0-9]+)?)*$"
                },
                "cpuAffinityDelay": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Delay in milliseconds before applying CPU affinity"
                },
                "cpuLimiter": {
                    "type": "string",
                    "description": "CPU limiter settings (percent;period;mode;threshold)"
                },
                "disallowed": {
                    "type": "boolean",
                    "description": "Whether the process is disallowed from running"
                },
                "disallowedExclusion": {
                    "type": "boolean",
                    "description": "Exclude process from disallowed list"
                },
                "groupExtender": {
                    "type": "boolean",
                    "description": "Enable group extender for multi-processor groups"
                },
                "hardThrottle": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Hard throttle value"
                },
                "instanceBalancer": {
                    "type": "string",
                    "description": "Instance balancer settings"
                },
                "instanceCountLimit": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Maximum number of process instances allowed"
                },
                "ioPriority": {
                    "type": "string",
                    "enum": [
                        "VeryLow",
                        "Low",
                        "Normal",
                        "High"
                    ],
                    "description": "I/O priority class"
                },
                "ioPriorityEnforcedByRegistry": {
                    "type": "boolean",
                    "description": "Whether I/O priority is enforced via registry"
                },
                "memoryPriority": {
                    "type": "string",
                    "enum": [
                        "VeryLow",
                        "Low",
                        "Normal",
                        "Medium",
                        "BelowNormal",
                        "High"
                    ],
                    "description": "Memory priority class"
                },
                "memoryPriorityEnforcedByRegistry": {
                    "type": "boolean",
                    "description": "Whether memory priority is enforced via registry"
                },
                "performanceMode": {
                    "type": "boolean",
                    "description": "Enable performance mode for this process"
                },
                "preventDisplaySleep": {
                    "type": "boolean",
                    "description": "Prevent display from sleeping while process runs"
                },
                "preventPCSleep": {
                    "type": "boolean",
                    "description": "Prevent PC from sleeping while process runs"
                },
                "priorityClass": {
                    "type": "string",
                    "enum": [
                        "Idle",
                        "BelowNormal",
                        "Normal",
                        "AboveNormal",
                        "High",
                        "Realtime"
                    ],
                    "description": "Process priority class"
                },
                "priorityClassEnforcedByRegistry": {
                    "type": "boolean",
                    "description": "Whether priority class is enforced via registry"
                },
                "smarttrimExclusion": {
                    "type": "boolean",
                    "description": "Exclude process from SmartTrim"
                },
                "threadPriorityBoosts": {
                    "type": "string",
                    "enum": [
                        "on",
                        "off"
                    ],
                    "description": "Thread priority boost setting"
                },
                "watchdogEntries": {
                    "type": "array",
                    "description": "Watchdog monitoring entries for this process",
                    "items": {
                        "$ref": "#/$defs/watchdogEntry"
                    }
                }
            },
            "additionalProperties": false
        },
        "watchdogEntry": {
            "type": "object",
            "required": [
                "watchdogEntry"
            ],
            "properties": {
                "watchdogEntry": {
                    "type": "string",
                    "description": "Watchdog entry configuration string"
                }
            },
            "additionalProperties": false
        }
    }
}