[object Object]

← back to Ken

Ken: set-confidence.sh fails loud (exit 1 + stderr) on any non-success — no more silent no-op on a real-money knob

033147181736c3f56ffa082435c63137226059fa · 2026-07-15 11:55:33 -0700 · Steve Abrams

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 033147181736c3f56ffa082435c63137226059fa
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jul 15 11:55:33 2026 -0700

    Ken: set-confidence.sh fails loud (exit 1 + stderr) on any non-success — no more silent no-op on a real-money knob
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 kalshi-dash/set-confidence.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/kalshi-dash/set-confidence.sh b/kalshi-dash/set-confidence.sh
index 6018893..d0677d2 100755
--- a/kalshi-dash/set-confidence.sh
+++ b/kalshi-dash/set-confidence.sh
@@ -18,4 +18,11 @@ set -a; source .env; set +a
 curl -s -u "$ADMIN_USER:$ADMIN_PASSWORD" -X POST http://127.0.0.1:7810/api/trading/mode \
   -H 'Content-Type: application/json' \
   -d "{\"action\":\"update_trade_config\",\"min_confidence\":${VAL}}" \
-| python3 -c "import sys,json;d=json.load(sys.stdin);tc=d.get('trade_config',{});print('min_confidence ->',tc.get('min_confidence'),'| unchanged: sources',tc.get('min_sources'),'budget',tc.get('budget_cents'),'maxpos',tc.get('max_position_cents'),'stoploss',tc.get('daily_loss_limit_cents'),'enabled',tc.get('enabled'))"
+| python3 -c "
+import sys,json
+try: d=json.load(sys.stdin)
+except Exception as e: print('FAILED: non-JSON response:',e,file=sys.stderr); sys.exit(1)
+tc=d.get('trade_config')
+if d.get('error') or not tc or tc.get('min_confidence') is None:
+    print('FAILED: min_confidence NOT changed —',d.get('error') or d,file=sys.stderr); sys.exit(1)
+print('OK min_confidence ->',tc.get('min_confidence'),'| unchanged: sources',tc.get('min_sources'),'budget',tc.get('budget_cents'),'maxpos',tc.get('max_position_cents'),'stoploss',tc.get('daily_loss_limit_cents'),'enabled',tc.get('enabled'))"

← c49a8e1 Ken: scoped set-confidence.sh — fix endpoint to /api/trading  ·  back to Ken  ·  auto-save: 2026-07-15T12:06:24 (1 files) — kalshi-dash/risk- 4d35550 →