{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.usefulmachinery.com/schemas/workflow-v1.schema.json",
  "title": "Useful Machinery workflow format version 1",
  "description": "Structural contract for a Useful Machinery workflow YAML document.",
  "$ref": "#/$defs/Workflow",
  "$defs": {
    "Identifier": {
      "type": "string",
      "maxLength": 64,
      "pattern": "^[a-z][A-Za-z0-9]*$"
    },
    "SourceRelativePath": {
      "type": "string",
      "minLength": 1,
      "not": {
        "anyOf": [
          { "pattern": "^/" },
          { "pattern": "^\\\\" },
          { "pattern": "^~[/\\\\]" },
          { "pattern": "^[A-Za-z]:[/\\\\]" },
          { "pattern": "[\\n\\r\\t]" }
        ]
      },
      "description": "A path resolved from the workflow YAML file. The resolver must reject normalized or symlink-resolved paths outside the explicitly supplied workflow source root."
    },
    "RuntimeRelativePath": {
      "type": "string",
      "minLength": 1,
      "not": {
        "anyOf": [
          { "pattern": "^/" },
          { "pattern": "^\\\\" },
          { "pattern": "^~[/\\\\]" },
          { "pattern": "^[A-Za-z]:[/\\\\]" },
          { "pattern": "(^|[/\\\\])\\.\\.([/\\\\]|$)" },
          { "pattern": "[\\n\\r\\t]" },
          { "pattern": "\u0000" }
        ]
      },
      "description": "A static path below the execution root."
    },
    "MediaType": {
      "type": "string",
      "maxLength": 128,
      "pattern": "^[!#$%&'*+.^_`|~0-9A-Za-z-]+/[!#$%&'*+.^_`|~0-9A-Za-z-]+([ \\t]*;[ \\t]*[!#$%&'*+.^_`|~0-9A-Za-z-]+=[^\\x00-\\x1f\\x7f;]+)*$"
    },
    "InputDeclaration": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": { "kind": { "const": "text" } },
          "required": ["kind"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "kind": { "const": "json" },
            "schema": { "$ref": "#/$defs/SourceRelativePath" }
          },
          "required": ["kind"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "kind": { "const": "file" },
            "mediaType": { "$ref": "#/$defs/MediaType" }
          },
          "required": ["kind"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": { "kind": { "const": "attachments" } },
          "required": ["kind"]
        }
      ]
    },
    "WorkflowInputs": {
      "type": "object",
      "maxProperties": 256,
      "propertyNames": { "$ref": "#/$defs/Identifier" },
      "additionalProperties": { "$ref": "#/$defs/InputDeclaration" }
    },
    "InputOrOutputReferenceString": {
      "type": "string",
      "pattern": "^inputs\\.[a-z][A-Za-z0-9]*$|^outputs\\.[a-z][A-Za-z0-9]*\\.[a-z][A-Za-z0-9]*$"
    },
    "FinalizerValueReferenceString": {
      "type": "string",
      "pattern": "^inputs\\.[a-z][A-Za-z0-9]*$|^outputs\\.[a-z][A-Za-z0-9]*\\.[a-z][A-Za-z0-9]*$|^finalization\\.context$"
    },
    "OutputReferenceString": {
      "type": "string",
      "pattern": "^outputs\\.[a-z][A-Za-z0-9]*\\.[a-z][A-Za-z0-9]*$"
    },
    "JsonPointer": {
      "type": "string",
      "pattern": "^(?:/(?:[^~/]|~[01])*)*$"
    },
    "TerminalDisposition": {
      "enum": ["succeeded", "failed", "skipped", "blocked", "not_run", "cancelled", "inherited"]
    },
    "OrdinaryConditionReferenceString": {
      "type": "string",
      "pattern": "^inputs\\.[a-z][A-Za-z0-9]*$|^outputs\\.[a-z][A-Za-z0-9]*\\.[a-z][A-Za-z0-9]*$"
    },
    "FinalizerConditionReferenceString": {
      "type": "string",
      "pattern": "^inputs\\.[a-z][A-Za-z0-9]*$|^outputs\\.[a-z][A-Za-z0-9]*\\.[a-z][A-Za-z0-9]*$|^finalization\\.context$"
    },
    "OrdinaryConditionOperand": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "ref": { "$ref": "#/$defs/OrdinaryConditionReferenceString" },
            "pointer": { "$ref": "#/$defs/JsonPointer" }
          },
          "required": ["ref"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": { "value": true },
          "required": ["value"]
        }
      ]
    },
    "FinalizerConditionOperand": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "ref": { "$ref": "#/$defs/FinalizerConditionReferenceString" },
            "pointer": { "$ref": "#/$defs/JsonPointer" }
          },
          "required": ["ref"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": { "value": true },
          "required": ["value"]
        }
      ]
    },
    "OrdinaryConditionSelector": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "ref": { "$ref": "#/$defs/OrdinaryConditionReferenceString" },
        "pointer": { "$ref": "#/$defs/JsonPointer" }
      },
      "required": ["ref", "pointer"]
    },
    "FinalizerConditionSelector": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "ref": { "$ref": "#/$defs/FinalizerConditionReferenceString" },
        "pointer": { "$ref": "#/$defs/JsonPointer" }
      },
      "required": ["ref", "pointer"]
    },
    "ConditionDisposition": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "node": { "$ref": "#/$defs/Identifier" },
        "is": { "$ref": "#/$defs/TerminalDisposition" }
      },
      "required": ["node", "is"]
    },
    "OrdinaryCondition": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "all": {
              "type": "array",
              "minItems": 1,
              "maxItems": 64,
              "items": { "$ref": "#/$defs/OrdinaryCondition" }
            }
          },
          "required": ["all"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "any": {
              "type": "array",
              "minItems": 1,
              "maxItems": 64,
              "items": { "$ref": "#/$defs/OrdinaryCondition" }
            }
          },
          "required": ["any"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": { "not": { "$ref": "#/$defs/OrdinaryCondition" } },
          "required": ["not"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "equals": {
              "type": "array",
              "minItems": 2,
              "maxItems": 2,
              "prefixItems": [
                { "$ref": "#/$defs/OrdinaryConditionOperand" },
                { "$ref": "#/$defs/OrdinaryConditionOperand" }
              ],
              "items": false
            }
          },
          "required": ["equals"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": { "exists": { "$ref": "#/$defs/OrdinaryConditionSelector" } },
          "required": ["exists"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": { "disposition": { "$ref": "#/$defs/ConditionDisposition" } },
          "required": ["disposition"]
        }
      ]
    },
    "FinalizerCondition": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "all": {
              "type": "array",
              "minItems": 1,
              "maxItems": 64,
              "items": { "$ref": "#/$defs/FinalizerCondition" }
            }
          },
          "required": ["all"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "any": {
              "type": "array",
              "minItems": 1,
              "maxItems": 64,
              "items": { "$ref": "#/$defs/FinalizerCondition" }
            }
          },
          "required": ["any"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": { "not": { "$ref": "#/$defs/FinalizerCondition" } },
          "required": ["not"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "equals": {
              "type": "array",
              "minItems": 2,
              "maxItems": 2,
              "prefixItems": [
                { "$ref": "#/$defs/FinalizerConditionOperand" },
                { "$ref": "#/$defs/FinalizerConditionOperand" }
              ],
              "items": false
            }
          },
          "required": ["equals"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": { "exists": { "$ref": "#/$defs/FinalizerConditionSelector" } },
          "required": ["exists"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": { "disposition": { "$ref": "#/$defs/ConditionDisposition" } },
          "required": ["disposition"]
        }
      ]
    },
    "InputOrOutputReference": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "ref": { "$ref": "#/$defs/InputOrOutputReferenceString" }
      },
      "required": ["ref"],
      "description": "A step-local value reference. An outputs reference creates a direct data prerequisite on its producer; an inputs reference creates no step prerequisite."
    },
    "FinalizerValueReference": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "ref": { "$ref": "#/$defs/FinalizerValueReferenceString" }
      },
      "required": ["ref"],
      "description": "A finalizer-local value reference. finalization.context is an engine value and creates no graph edge."
    },
    "PresentationField": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": { "value": { "type": "string" } },
          "required": ["value"]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": { "ref": { "$ref": "#/$defs/OutputReferenceString" } },
          "required": ["ref"]
        }
      ]
    },
    "ExportPresentation": {
      "type": "object",
      "additionalProperties": false,
      "minProperties": 1,
      "properties": {
        "title": { "$ref": "#/$defs/PresentationField" },
        "description": { "$ref": "#/$defs/PresentationField" }
      }
    },
    "OutputReference": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "ref": { "$ref": "#/$defs/OutputReferenceString" },
        "presentation": { "$ref": "#/$defs/ExportPresentation" }
      },
      "required": ["ref"],
      "description": "A workflow export reference. Exports and presentation select outputs but create no graph edge."
    },
    "FileSource": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "file": { "$ref": "#/$defs/SourceRelativePath" }
      },
      "required": ["file"]
    },
    "TextSource": {
      "oneOf": [
        { "$ref": "#/$defs/FileSource" },
        { "$ref": "#/$defs/InputOrOutputReference" }
      ]
    },
    "AttachmentSource": {
      "oneOf": [
        { "$ref": "#/$defs/FileSource" },
        { "$ref": "#/$defs/InputOrOutputReference" }
      ]
    },
    "FinalizerAttachmentSource": {
      "oneOf": [
        { "$ref": "#/$defs/FileSource" },
        { "$ref": "#/$defs/FinalizerValueReference" }
      ]
    },
    "InputBindings": {
      "type": "object",
      "propertyNames": { "$ref": "#/$defs/Identifier" },
      "additionalProperties": { "$ref": "#/$defs/InputOrOutputReference" }
    },
    "FinalizerInputBindings": {
      "type": "object",
      "propertyNames": { "$ref": "#/$defs/Identifier" },
      "additionalProperties": { "$ref": "#/$defs/FinalizerValueReference" }
    },
    "FailurePolicy": {
      "enum": ["required", "advisory"],
      "default": "required",
      "description": "Controls workflow impact when this node fails or is blocked. Omission resolves to required."
    },
    "Dependencies": {
      "type": "array",
      "uniqueItems": true,
      "items": { "$ref": "#/$defs/Identifier" },
      "description": "Explicit ordinary-step control prerequisites for ordering without declared data flow."
    },
    "FinalizerAfter": {
      "type": "array",
      "uniqueItems": true,
      "items": { "$ref": "#/$defs/Identifier" },
      "description": "Finalizer IDs that must be terminal before this finalizer is considered."
    },
    "FinalizerWhen": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": { "enum": ["succeeded", "failed", "cancelled"] },
      "default": ["succeeded", "failed", "cancelled"],
      "description": "Ordinary-phase triggers that select this finalizer. Omission selects all three."
    },
    "Command": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "argv": {
          "type": "array",
          "minItems": 1,
          "prefixItems": [
            { "type": "string", "minLength": 1, "not": { "pattern": "\u0000" } }
          ],
          "items": { "type": "string", "not": { "pattern": "\u0000" } }
        }
      },
      "required": ["argv"]
    },
    "PiConfig": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "model": { "type": "string", "minLength": 1 },
        "thinking": {
          "enum": ["off", "minimal", "low", "medium", "high", "xhigh", "max"]
        }
      },
      "required": ["model", "thinking"]
    },
    "PiHarness": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "pi" },
        "config": { "$ref": "#/$defs/PiConfig" }
      },
      "required": ["kind", "config"]
    },
    "ClaudeCodeConfig": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "model": { "type": "string", "minLength": 1 },
        "effort": { "enum": ["low", "medium", "high", "xhigh", "max"] }
      },
      "required": ["model", "effort"]
    },
    "ClaudeCodeHarness": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "claude_code" },
        "config": { "$ref": "#/$defs/ClaudeCodeConfig" }
      },
      "required": ["kind", "config"]
    },
    "CodexConfig": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "model": { "type": "string", "minLength": 1 },
        "effort": { "type": "string", "minLength": 1 }
      },
      "required": ["model", "effort"]
    },
    "CodexHarness": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "codex" },
        "config": { "$ref": "#/$defs/CodexConfig" }
      },
      "required": ["kind", "config"]
    },
    "AgentProfile": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "harness": {
          "oneOf": [
            { "$ref": "#/$defs/PiHarness" },
            { "$ref": "#/$defs/ClaudeCodeHarness" },
            { "$ref": "#/$defs/CodexHarness" }
          ]
        }
      },
      "required": ["harness"],
      "description": "Immutable workflow-local harness configuration. A profile grants no execution authority."
    },
    "AgentProfiles": {
      "type": "object",
      "propertyNames": { "$ref": "#/$defs/Identifier" },
      "additionalProperties": { "$ref": "#/$defs/AgentProfile" }
    },
    "AgentMessage": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "text": {
          "type": "array",
          "minItems": 1,
          "items": { "$ref": "#/$defs/TextSource" }
        },
        "attachments": {
          "type": "array",
          "items": { "$ref": "#/$defs/AttachmentSource" }
        }
      },
      "required": ["text"]
    },
    "Agent": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "profile": { "$ref": "#/$defs/Identifier" },
        "systemPrompt": { "$ref": "#/$defs/SourceRelativePath" },
        "message": { "$ref": "#/$defs/AgentMessage" }
      },
      "required": ["profile", "systemPrompt", "message"]
    },
    "FinalizerAgentMessage": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "text": {
          "type": "array",
          "minItems": 1,
          "items": { "$ref": "#/$defs/TextSource" }
        },
        "attachments": {
          "type": "array",
          "items": { "$ref": "#/$defs/FinalizerAttachmentSource" }
        }
      },
      "required": ["text"]
    },
    "FinalizerAgent": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "profile": { "$ref": "#/$defs/Identifier" },
        "systemPrompt": { "$ref": "#/$defs/SourceRelativePath" },
        "message": { "$ref": "#/$defs/FinalizerAgentMessage" }
      },
      "required": ["profile", "systemPrompt", "message"]
    },
    "TextPathOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "text" },
        "from": { "const": "path" },
        "path": { "$ref": "#/$defs/RuntimeRelativePath" }
      },
      "required": ["kind", "from", "path"]
    },
    "TextAgentResponseOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "text" },
        "from": { "const": "agent_response" }
      },
      "required": ["kind", "from"]
    },
    "JsonPathOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "json" },
        "from": { "const": "path" },
        "path": { "$ref": "#/$defs/RuntimeRelativePath" },
        "schema": { "$ref": "#/$defs/SourceRelativePath" }
      },
      "required": ["kind", "from", "path", "schema"]
    },
    "JsonAgentResultOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "json" },
        "from": { "const": "agent_result" },
        "schema": { "$ref": "#/$defs/SourceRelativePath" }
      },
      "required": ["kind", "from", "schema"]
    },
    "FilePathOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "file" },
        "from": { "const": "path" },
        "path": { "$ref": "#/$defs/RuntimeRelativePath" },
        "mediaType": { "$ref": "#/$defs/MediaType" }
      },
      "required": ["kind", "from", "path", "mediaType"]
    },
    "GitBranchWorkspaceOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "git_branch" },
        "from": { "const": "workspace" }
      },
      "required": ["kind", "from"]
    },
    "CommandOutputs": {
      "type": "object",
      "propertyNames": { "$ref": "#/$defs/Identifier" },
      "additionalProperties": {
        "oneOf": [
          { "$ref": "#/$defs/TextPathOutput" },
          { "$ref": "#/$defs/JsonPathOutput" },
          { "$ref": "#/$defs/FilePathOutput" },
          { "$ref": "#/$defs/GitBranchWorkspaceOutput" }
        ]
      }
    },
    "AgentOutputs": {
      "type": "object",
      "propertyNames": { "$ref": "#/$defs/Identifier" },
      "additionalProperties": {
        "oneOf": [
          { "$ref": "#/$defs/TextPathOutput" },
          { "$ref": "#/$defs/TextAgentResponseOutput" },
          { "$ref": "#/$defs/JsonPathOutput" },
          { "$ref": "#/$defs/JsonAgentResultOutput" },
          { "$ref": "#/$defs/FilePathOutput" },
          { "$ref": "#/$defs/GitBranchWorkspaceOutput" }
        ]
      }
    },
    "CommandRecoveryHandler": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "cmd" },
        "command": { "$ref": "#/$defs/Command" },
        "cwd": { "$ref": "#/$defs/RuntimeRelativePath" }
      },
      "required": ["kind", "command"]
    },
    "AgentRecoveryHandler": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "agent" },
        "profile": { "$ref": "#/$defs/Identifier" },
        "prompt": { "$ref": "#/$defs/SourceRelativePath" },
        "cwd": { "$ref": "#/$defs/RuntimeRelativePath" }
      },
      "required": ["kind", "profile", "prompt"]
    },
    "Recovery": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "retries": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10
        },
        "handler": {
          "oneOf": [
            { "$ref": "#/$defs/CommandRecoveryHandler" },
            { "$ref": "#/$defs/AgentRecoveryHandler" }
          ]
        }
      },
      "required": ["retries"]
    },
    "CommandStep": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "cmd" },
        "failurePolicy": { "$ref": "#/$defs/FailurePolicy" },
        "dependsOn": { "$ref": "#/$defs/Dependencies" },
        "cwd": { "$ref": "#/$defs/RuntimeRelativePath" },
        "recovery": { "$ref": "#/$defs/Recovery" },
        "condition": { "$ref": "#/$defs/OrdinaryCondition" },
        "inputs": { "$ref": "#/$defs/InputBindings" },
        "outputs": { "$ref": "#/$defs/CommandOutputs" },
        "command": { "$ref": "#/$defs/Command" }
      },
      "required": ["kind", "command"]
    },
    "AgentStep": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "agent" },
        "failurePolicy": { "$ref": "#/$defs/FailurePolicy" },
        "dependsOn": { "$ref": "#/$defs/Dependencies" },
        "cwd": { "$ref": "#/$defs/RuntimeRelativePath" },
        "recovery": { "$ref": "#/$defs/Recovery" },
        "condition": { "$ref": "#/$defs/OrdinaryCondition" },
        "outputs": { "$ref": "#/$defs/AgentOutputs" },
        "agent": { "$ref": "#/$defs/Agent" }
      },
      "required": ["kind", "agent"]
    },
    "Step": {
      "oneOf": [
        { "$ref": "#/$defs/CommandStep" },
        { "$ref": "#/$defs/AgentStep" }
      ]
    },
    "CommandFinalizer": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "cmd" },
        "failurePolicy": { "$ref": "#/$defs/FailurePolicy" },
        "after": { "$ref": "#/$defs/FinalizerAfter" },
        "when": { "$ref": "#/$defs/FinalizerWhen" },
        "condition": { "$ref": "#/$defs/FinalizerCondition" },
        "cwd": { "$ref": "#/$defs/RuntimeRelativePath" },
        "inputs": { "$ref": "#/$defs/FinalizerInputBindings" },
        "outputs": { "$ref": "#/$defs/CommandOutputs" },
        "command": { "$ref": "#/$defs/Command" }
      },
      "required": ["kind", "command"]
    },
    "AgentFinalizer": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "agent" },
        "failurePolicy": { "$ref": "#/$defs/FailurePolicy" },
        "after": { "$ref": "#/$defs/FinalizerAfter" },
        "when": { "$ref": "#/$defs/FinalizerWhen" },
        "condition": { "$ref": "#/$defs/FinalizerCondition" },
        "cwd": { "$ref": "#/$defs/RuntimeRelativePath" },
        "outputs": { "$ref": "#/$defs/AgentOutputs" },
        "agent": { "$ref": "#/$defs/FinalizerAgent" }
      },
      "required": ["kind", "agent"]
    },
    "Finalizer": {
      "oneOf": [
        { "$ref": "#/$defs/CommandFinalizer" },
        { "$ref": "#/$defs/AgentFinalizer" }
      ]
    },
    "Exports": {
      "type": "object",
      "maxProperties": 4096,
      "propertyNames": { "$ref": "#/$defs/Identifier" },
      "additionalProperties": { "$ref": "#/$defs/OutputReference" }
    },
    "Workflow": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schemaVersion": { "const": 1 },
        "description": { "type": "string" },
        "environmentPassthrough": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
            "not": { "pattern": "^(UM_|SCHERZO_|GIT_ASKPASS($|_REQUIRE$)|GIT_TERMINAL_PROMPT$|GIT_CURL_VERBOSE$|GIT_CONFIG($|_(COUNT|PARAMETERS|GLOBAL|NOSYSTEM|SYSTEM)$|_(KEY|VALUE)_)|GIT_SSH($|_COMMAND$)|GIT_TRACE|SSH_ASKPASS($|_REQUIRE$)|SSH_AUTH_SOCK$|SSH_AGENT_PID$|GH_TOKEN$|GITHUB_TOKEN$)" }
          }
        },
        "inputs": { "$ref": "#/$defs/WorkflowInputs" },
        "agentProfiles": { "$ref": "#/$defs/AgentProfiles" },
        "steps": {
          "type": "object",
          "minProperties": 1,
          "maxProperties": 256,
          "propertyNames": { "$ref": "#/$defs/Identifier" },
          "additionalProperties": { "$ref": "#/$defs/Step" }
        },
        "finalizers": {
          "type": "object",
          "maxProperties": 256,
          "propertyNames": { "$ref": "#/$defs/Identifier" },
          "additionalProperties": { "$ref": "#/$defs/Finalizer" }
        },
        "exports": { "$ref": "#/$defs/Exports" }
      },
      "required": ["schemaVersion", "steps"]
    }
  }
}
