# Gate Check Usage ## Files - `gate_config.json`: threshold configuration - `gate_check.sh`: gate decision script ## Thresholds Current defaults in `gate_config.json`: - `maxTokens = 30000` - `maxRetries = 2` - `maxMinutes = 40` ## Command ```bash ./gate_check.sh ``` Parameters: - `tokens` (non-negative integer) - `retries` (non-negative integer) - `minutes` (non-negative integer) - `escalationFlag` (`true/false`, `1/0`, `yes/no`, `y/n`) ## Decision Rules 1. If `escalationFlag` is true-like (`true/1/yes/y`), output `PAUSE_AND_ESCALATE`. 2. Else if any threshold is exceeded (`tokens > maxTokens` OR `retries > maxRetries` OR `minutes > maxMinutes`), output `BLOCK`. 3. Otherwise output `PASS`. ## Return Codes - `0` = `PASS` - `2` = `BLOCK` - `3` = `PAUSE_AND_ESCALATE` - `1` = input/config error ## Examples ```bash ./gate_check.sh 12000 1 20 false # PASS ./gate_check.sh 45000 1 20 false # BLOCK ./gate_check.sh 12000 1 20 true # PAUSE_AND_ESCALATE ```