{
  "$defs": {
    "Direction": {
      "description": "Trade direction.",
      "enum": [
        "long",
        "short"
      ],
      "title": "Direction",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "properties": {
    "condition": {
      "additionalProperties": true,
      "description": "Typed condition source with a \"kind\" discriminator. Read builder_discover(action='overview') once for the complete language; use action='get' for exact detail. Combinators may hold inline conditions or condition_ref children.",
      "title": "Condition",
      "type": "object"
    },
    "direction": {
      "anyOf": [
        {
          "$ref": "#/$defs/Direction"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Entry role: required ('long' or 'short'). Exit role: optionally scope the exit to that position direction; None means BOTH long and short. Not used for gates."
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional strategy-scoped definition name (snake_case, at most 48 chars, leading letter, unique within the strategy). Auto-generated if omitted.",
      "title": "Name"
    },
    "remainder_unprotected": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Exit role: explicit consent to leave a partial stop's remainder unprotected. Otherwise another exit must cover the remainder.",
      "title": "Remainder Unprotected"
    },
    "role": {
      "description": "Rule role: entry, exit, or gate (block entries)",
      "enum": [
        "entry",
        "exit",
        "gate"
      ],
      "title": "Role",
      "type": "string"
    },
    "scan_run_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional ID of the signal scan run that validated this condition.",
      "title": "Scan Run Id"
    },
    "size_frac": {
      "anyOf": [
        {
          "exclusiveMinimum": 0.0,
          "maximum": 1.0,
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Exit role: fraction to close, greater than 0 through 1. None = full close.",
      "title": "Size Frac"
    },
    "strategy_id": {
      "description": "Strategy ID",
      "title": "Strategy Id",
      "type": "string"
    }
  },
  "required": [
    "strategy_id",
    "role",
    "condition"
  ],
  "title": "add_ruleArguments",
  "type": "object"
}
