{
  "$defs": {
    "Direction": {
      "description": "Trade direction.",
      "enum": [
        "long",
        "short"
      ],
      "title": "Direction",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "properties": {
    "definition_id": {
      "description": "ConditionDefinition ID to attach",
      "title": "Definition Id",
      "type": "string"
    },
    "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."
    },
    "remainder_unprotected": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Explicit permission to leave a partial stop remainder unprotected (exit only)",
      "title": "Remainder Unprotected"
    },
    "role": {
      "description": "ConditionDefinition role: entry, exit, or gate (block entries)",
      "enum": [
        "entry",
        "exit",
        "gate"
      ],
      "title": "Role",
      "type": "string"
    },
    "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",
    "definition_id",
    "role"
  ],
  "title": "builder_attach_ruleArguments",
  "type": "object"
}
