chore(org): rename Architect codename from Aurelius to Helix

This commit is contained in:
Chen Gu
2026-08-13 17:00:21 +08:00
parent 19ad03d390
commit 9f8d8672d7
54 changed files with 2723 additions and 11 deletions
+47
View File
@@ -0,0 +1,47 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CONFIG_FILE="$SCRIPT_DIR/gate_config.json"
if [[ $# -ne 4 ]]; then
echo "Usage: $0 <tokens> <retries> <minutes> <escalationFlag>" >&2
exit 1
fi
tokens="$1"
retries="$2"
minutes="$3"
escalationFlag="$4"
for v in "$tokens" "$retries" "$minutes"; do
if ! [[ "$v" =~ ^[0-9]+$ ]]; then
echo "Invalid numeric input. tokens/retries/minutes must be non-negative integers." >&2
exit 1
fi
done
read_config() {
python3 - "$CONFIG_FILE" <<'PY'
import json, sys
with open(sys.argv[1], 'r', encoding='utf-8') as f:
c = json.load(f)
print(c['maxTokens'], c['maxRetries'], c['maxMinutes'])
PY
}
read -r maxTokens maxRetries maxMinutes < <(read_config)
flag_lc="$(echo "$escalationFlag" | tr '[:upper:]' '[:lower:]')"
if [[ "$flag_lc" == "1" || "$flag_lc" == "true" || "$flag_lc" == "yes" || "$flag_lc" == "y" ]]; then
echo "PAUSE_AND_ESCALATE"
exit 3
fi
if (( tokens > maxTokens || retries > maxRetries || minutes > maxMinutes )); then
echo "BLOCK"
exit 2
fi
echo "PASS"
exit 0