Ken
Search the build
-
a2449ac2026-09-26 Ken reconcile-canary: retry transient PG restart errors (57P03/ENOENT/ECONNREFUSED) before exit 2; log error code (TK-11999) -
cc325552026-09-11 Bump kalshi-dash to 1.0.5 after verified socket migration -
d840eb62026-09-11 Use Unix socket for Ken hourly signal database -
8f36d512026-08-31 document TK-10166 live-arm verification -
a030a582026-08-13 auto-data-snapshot: 2026-08-13T13:58:08 (1 data files) — package-lock.json -
75b875f2026-08-13 chore(ken): v1.1.0 (session close — weather-news pulse feature, default-off/shadow) -
67b0c902026-08-13 feat(ken): WEATHER_PULSE_SHADOW mode — log the nudge, do not apply to p_yes -
a6239c32026-08-13 chore(ken): enable WEATHER_PULSE=1 in bertha-cron env (advisory pulse on next deploy) -
c87cbf82026-08-13 feat(ken): weather-pulse resolves NWS office from event.location -
7dc1cce2026-08-13 feat(ken): optional weather-news pulse (agent-reach free NWS AFD reader) -
f1bde082026-08-04 chore: v1.0.4 (session close) — auth hardening for public ken.agentabrams.com exposure -
531d5a72026-08-04 Ken auth: close IP-bypass hole before public reverse-proxy exposure -
0d924a32026-08-04 chore: lint + refactor (mkMarket readability), v1.0.3 (session close) -
5d8b90b2026-08-04 auto-save: 2026-08-04T10:32:27 (2 files) — kalshi-dash/ken-paper.png kalshi-dash/ken-real.png -
aa47a3b2026-08-04 Ken: make real-money dashboard mode deep-linkable via ?real=1/0 query param -
8ba89722026-08-04 Ken: add real-money-only dashboard toggle (Paper Arena ⟷ Real Money) -
2bec9fc2026-08-04 auto-save: 2026-08-04T09:32:01 (1 files) — kalshi-dash/place-manual-trade.mjs -
99698272026-08-04 fix: migrate Kalshi exit orders + manual create_order to v2 /portfolio/events/orders API -
982c1f42026-08-03 auto-save: 2026-08-03T13:24:27 (1 files) — kalshi-dash/ken-refresh-site.sh -
07bb4112026-08-03 auto-save: 2026-08-03T12:23:59 (1 files) — kalshi-dash/ken-trade-flash.sh -
d6811ed2026-08-03 Ken: incorporate the brass AB Trading Switch onto the dashboard front page -
ea9bacb2026-08-03 Ken: style the /trading toggle as a large brass AB bat-switch -
2191a432026-08-03 Ken: add /trading real-money on-off switch (UI toggle = source of truth) -
416f69e2026-08-03 auto-save: 2026-08-03T11:53:46 (1 files) — kalshi-dash/package-lock.json -
fa8b5c22026-08-03 chore: v1.0.2 (session close — 8 Ken bug fixes + reconciliation canary + near-term/liquidity filters) -
14b42752026-08-03 auto-save: 2026-08-03T11:23:33 (2 files) — kalshi-dash/arm-live-run.mjs kalshi-dash/ken-safemode-guard.sh -
b49c1722026-08-03 Ken: widen near-term window 120->365 days — 120d left only ~11 tradeable markets; the actual junk was 2028-2045 multi-year longshots, which a 1-year window excludes while keeping liquid mid-term markets. -
afc629c2026-08-03 Ken: carry close_time into allMarkets — the near-term filter nuked the pool to 0 active because the market mapping dropped close_time. Now mapped so the 120-day filter works. -
b2c914b2026-08-03 Ken: near-term + real-book filter (Steve) — scan now only trades markets closing within 120 days with a two-sided book; real-trade path also requires yes_ask/yes_bid (not stale last_price) + near-term. Stops winners building track records on far-future longshots (2028-2045) that have no live order book to bet real money against. -
29760752026-08-03 Ken: MIN_RESOLVED 100->50 (Steve, 2026-08-03) — let real trading start sooner on the fresh sim; keeps 2-winner consensus + independence denylist as the real safety. High-conviction winners (90% win) are well above noise at N=50. -
b2420a92026-08-03 Ken: migrate live buy order to Kalshi v2 create-order (POST /portfolio/events/orders) -
259b8962026-08-03 Ken: reconcile-canary self-alerts to CNCP parking-lot on divergence (best-effort, never masks exit code). Installed as launchd com.steve.ken-reconcile-canary (30min + RunAtLoad) per Steve approval. -
a33bc892026-08-03 Ken (Cody gate c): add read-only reconciliation canary — verifies ken_portfolios rollup (returned/invested/balance) still equals the per-trade ledger within $2. Catches the bigint-string over-credit bug class forever. Exit 1 + ALERT on divergence. Coerces bigint-as-string (the very bug). -
2f7617c2026-08-03 Ken (Cody gate b): independence gate on winner-consensus — exclude control/indiscriminate strategies (random/spray_pray/full_send = noise/take-all; penny_pincher/nickel_slots/degen_lite = low-edge no quality gate) from driving REAL trades. Two correlated low-bar strategies agreeing was noise, not consensus. They still paper-trade as controls. -
eb2e4852026-08-03 Ken: ROOT-CAUSE the paper over-credit — node-postgres returns bigint cost_cents as a STRING, so 'returned = cost_cents + pnl' CONCATENATED ('71'+21='7121') instead of adding, over-crediting every WIN ~100-1000x (this, not double-counting, was the balloon; survived the idempotency fix). Coerce cost to Number. Removed temp debug probe. -
2e710212026-08-03 Ken: TEMP debug probe — log any settle crediting >$50 (returned/cost/pnl/price/qty) to isolate the residual ~100x over-credit that survives the idempotency fix -
811d3822026-08-03 chore: gitignore runtime data, v1.0.1 (session close) -
d2605df2026-08-03 Ken (Cody gate): raise winner-gate MIN_RESOLVED 20->100 (N=20@60% clearable by ~25% variance → real money followed lucky noise); fix cumulative_pnl_cents to accumulate in ON CONFLICT (was frozen at day's first trade); fix resolver log to count SETTLED not SELECTED trades -
d1ce3012026-08-03 Ken: saveTradeConfig read-merges DB enabled gate (root-cause re-arm fix) + loud catch [yoloforever c1, Cody-gated, TK-10166] -
bf37e332026-08-03 Ken: fix restartIntervals crash — it referenced boot-scoped runScanSafe/runSweepSafe (ReferenceError crashed the process whenever POST /api/scan-config ran). Call module-level autonomousScan/redditIntelligenceLoop directly with catch guards. Boot path unchanged. -
9507bcf2026-08-03 Ken: config-cache coherence — autoTrader refreshes enabled gate from DB each cycle (no more silent re-arm) [yoloforever c1, TK-10166] -
9de5a642026-08-03 Ken UI: unmistakable PAPER/LIVE-MONEY badge + 'Paper Balance' label — stop conflating live DATA with live TRADING (TK-10166) -
fc471b82026-08-03 auto-save: 2026-08-03T09:22:36 (1 files) — kalshi-dash/src/Layout.jsx -
e7e3c8c2026-08-03 Ken: fix resolver 270x portfolio over-credit — settle idempotently (UPDATE ... WHERE status='open' RETURNING, credit only on winning the flip) + re-entrancy guard so duplicate intervals (5121/9388) + slow passes can't double-count. Real bets follow paper winners, so clean rollups matter. -
b9768ef2026-08-03 Ken v2 GO-LIVE wiring: live orders follow profitable-winner consensus w/ live-price fetch; NOT the weather engine (TK-10166) -
ae4735c2026-08-03 auto-save: 2026-08-03T08:52:19 (1 files) — kalshi-dash/.gitignore -
d137b3b2026-08-03 Ken v2: profit-based ranking — sum(daily_pnl_cents), gate on net>0, rank by real $ (TK-10166) -
74d4a2d2026-08-03 Ken v2 follow-the-winners: hourly auto-check, alerts on QUIET->SIGNAL emergence (TK-10166) -
f60f68f2026-08-03 auto-save: 2026-08-03T08:22:05 (1 files) — kalshi-dash/.gitignore -
57358372026-08-03 Ken v2 follow-the-winners signal: durable win-record source (ken_daily_pnl) + graceful rebuild state (TK-10166) -
5e77ebc2026-08-03 auto-save: 2026-08-03T07:51:47 (1 files) — kalshi-dash/server.js -
05c75722026-08-03 Ken: FIX resolver never settling — trades inserted with empty status but resolver queried status='open', so 30k paper trades froze open forever (returns never credited → phantom -$30k balance). INSERT now writes status='open' + column default set. True paper P&L is -$907, not -$30,092. -
a3aff5e2026-07-15 Ken: surface real Kalshi API error body (was '[object Object]') + method/path in kalshiFetch errors — reveals the 410 order-failure reason -
2066e752026-07-15 Ken: FIX no-trades root cause — Kalshi API renamed price fields (yes_bid→yes_bid_dollars string, volume_24h→volume_24h_fp). Ken read the dead fields → every market mapped to 0 → 0 active → 0 signals → 0 trades. Now reads new _dollars/_fp fields (dollars-string→cents), backward-compatible. Live test: 0→851 active markets. -
5a71f562026-07-15 Ken: live Risk Level knob in Settings — drag to preview, Apply commits min_confidence to /api/trading/mode (real-money knob, explicit apply). Plus standalone risk-knob.html visualizer. -
4d355502026-07-15 auto-save: 2026-07-15T12:06:24 (1 files) — kalshi-dash/risk-knob.html -
03314712026-07-15 Ken: set-confidence.sh fails loud (exit 1 + stderr) on any non-success — no more silent no-op on a real-money knob -
c49a8e12026-07-15 Ken: scoped set-confidence.sh — fix endpoint to /api/trading/mode (was /api/risk → silent no-op); adjusts ONLY min_confidence 50-99 -
d83c6ee2026-07-14 Ken: retry/backoff in geminiAnalyze for shared-Ollama 'server busy' contention (stays all-local, best-effort) -
16c240e2026-07-14 Ken: fix Weather page 400 — server now handles 'get_data' action (on-mount load), aliased to fetch_all -
a3273932026-07-14 Ken: live-run status chip in dashboard header (motion graphics) -
1bdf5792026-07-14 Ken: bounded live-run controls — $/day spend cap + auto-off after N days -
af4870c2026-07-14 Ken: gate manual create_order endpoint on safe_mode too (close the non-autoTrader real-order path) -
6fc1f522026-07-10 Ken: enforce safe/paper — autoTrader honors safe_mode + master enabled defaults OFF (no real orders without deliberate toggle) -
a060e292026-07-10 Ken: add captured_at to ken_market_snapshots (momentum query) — pipelines error-free -
2fa80322026-07-10 Ken: seed 99 paper-trading portfolios + add portfolio stat columns (local boot) -
a3dd1712026-07-10 Ken: switch AI analyst from paid Gemini to local Ollama (hermes3:8b) + local boot on Mac3 -
c303efd2026-06-03 Untrack .DS_Store + gitignore it -
cb1104e2026-05-30 gitignore: add backup/source-leak file globs (*.bak, *.orig, *.old, etc.) -
cf5d8b82026-05-13 snapshot: 1 file(s) changed, +1 new -
a27e0fd2026-05-07 tighten .gitignore: add missing standing-rule patterns (.env* tmp/ *.log .DS_Store dist/ build/ .next/) -
93ce9eb2026-05-04 [overnight] pre-debate baseline
Authors
- Steve71
- auto-commit-fleet1
Agents used
Skills used
- /trading7
- /portfolio5
- /orders5
- /events3
- /mode3
- /dashboard2
- /day2
- /claude1
- /code1
- /shadow1
- /points1
- /capped1
- /fail-safe1
- /ken-paper1
- /ken-real1
- /real1
- /subtitle1
- /place-manual-trade1
- /ask1
- /ken-refresh-site1
- /ken-trade-flash1
- /trading-switch-widget1
- /safe1
- /package-lock1
- /liquidity1
- /arm-live-run1
- /ken-safemode-guard1
- /invested1
- /balance1
- /indiscriminate1
Creative ideas + design notes
a2449ac · 2026-09-26 · Ken reconcile-canary: retry transient PG restart errors (57P03/ENOENT/ECONNREFUSED) before exit 2; log error code (TK-11999)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GEE4jWy9RBmz5QnR2xcvno
67b0c90 · 2026-08-13 · feat(ken): WEATHER_PULSE_SHADOW mode — log the nudge, do not apply to p_yes
Money-safe: with WEATHER_PULSE_SHADOW=1 the pulse is computed + logged into components.weather_pulse but p_yes is unchanged (verified pYesFinal===pYes), so real trades cannot move. ecosystem bertha-cron env set to WEATHER_PULSE=1 + SHADOW=1 for live-market validation before the nudge is ever allowed to influence a real order.
c87cbf8 · 2026-08-13 · feat(ken): weather-pulse resolves NWS office from event.location
The pulse now FIRES from the location the models pipeline already carries — city name -> getCityCoords -> NWS /points -> gridId (office) -> AFD read. Still gated/capped/fail-safe and DEFAULT-OFF. Verified live: New York->OKX (nudge -0.002), Los Angeles->LOX (nudge 0).
7dc1cce · 2026-08-13 · feat(ken): optional weather-news pulse (agent-reach free NWS AFD reader)
Advisory-only, capped (±0.03), contested-markets-only, gated by WEATHER_PULSE=1. Fail-safe: flag off or any error => no-op (byte-identical). Read-only; never touches risk.js / order sizing / live-money gates. Verified: flag-off no-op + live $0 OKX AFD fetch.
531d5a7 · 2026-08-04 · Ken auth: close IP-bypass hole before public reverse-proxy exposure
- Drop 45.61.58.125 (Kamatera) from the auth-bypass whitelist so proxied public traffic must pass login (basic-auth / Google OAuth), not auto-trust. - isWhitelistedIP() now keys off req.socket.remoteAddress (real TCP peer) instead of the client-controllable X-Forwarded-For header — a public visitor can no longer forge `X-Forwarded-For: 127.0.0.1` to bypass auth. - Loopback (127.0.0.1/::1) bypass retained so the safe-mode guard keeps working. Prep for serving ken.agentabrams.com via Kamatera reverse-proxy to Mac2.
8ba8972 · 2026-08-04 · Ken: add real-money-only dashboard toggle (Paper Arena ⟷ Real Money)
- New GET /api/dashboard/real endpoint: same shape as /api/dashboard but computed from ken_trades (actual Kalshi orders) + live account balance, not the 99-bot paper arena. Paper path untouched. - Dashboard.jsx: persistent realMode toggle button in header, dynamic labels/subtitle, refetches on toggle. Rebuilt bundle.
9969827 · 2026-08-04 · fix: migrate Kalshi exit orders + manual create_order to v2 /portfolio/events/orders API
Take-profit and stop-loss sell paths were still calling retired POST /portfolio/orders (v1, 410). Manual create_order was also on v1. All three now use POST /portfolio/events/orders with bid/ask semantics, IOC time_in_force for market-like behavior, and yes-price dollar values. Refs: TK-10174
d6811ed · 2026-08-03 · Ken: incorporate the brass AB Trading Switch onto the dashboard front page
Serve /trading-switch-widget.js and inject it into the SPA index.html at serve-time (no React rebuild). Renders a compact brass bat-switch pinned bottom-right of the dashboard, wired to the same set_trading endpoint + guard source-of-truth; right-click opens the full /trading panel.
ea9bacb · 2026-08-03 · Ken: style the /trading toggle as a large brass AB bat-switch
Brass faceplate + corner screws, engraved AB monogram + ON/OFF labels, throw lever with a knob that glows green when armed. Same data-on wiring; purely presentational.
2191a43 · 2026-08-03 · Ken: add /trading real-money on-off switch (UI toggle = source of truth)
New auth-gated /trading page + POST /api/trading/mode action=set_trading that atomically sets risk_state.config.trading_on + safe_mode (+auto-trader). Rewired ken-safemode-guard.sh from 'always hold safe_mode=true' to SOURCE-OF-TRUTH: it holds safe_mode == !trading_on, auto-heals + alerts on unauthorized drift in EITHER direction, and never-silent alerts when armed / when a real trade lands. Bootstrapped the guard via launchd (it had died). Default OFF/safe; arming stays a human toggle. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b2420a9 · 2026-08-03 · Ken: migrate live buy order to Kalshi v2 create-order (POST /portfolio/events/orders)
v1 POST /portfolio/orders now 410s (deprecated_v1_order_endpoint) — no real order could place. v2 single YES-book: bid=buy YES, ask=sell YES(=buy NO), price=YES price in dollars, +required self_trade_prevention_type + client_order_id idempotency key. Fixes zero-fills on the live $50 run. Exit sells (TP/SL) left on v1 as a flagged follow-up; positions still resolve at settlement. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
a327393 · 2026-07-14 · Ken: live-run status chip in dashboard header (motion graphics)
- GET /api/live-run — day X/N, $ spent today vs daily cap, auto-off date, days left - Layout.jsx status bar: animated LiveRunChip (pulsing glow, shimmer sweep, blinking live dot, flowing progress bar, rAF count-up on $ spent). Idle 'PAPER' pill when no run armed; full green LIVE chip when active. - index.css: lrchip motion keyframes (lrGlow/lrShimmer/lrBlink/lrBarFlow) - also added the chip + endpoint-consumer to the legacy inline dashboard Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1bdf579 · 2026-07-14 · Ken: bounded live-run controls — $/day spend cap + auto-off after N days
- getLiveRun/saveLiveRun (ken_config 'live_run') - autoTrader: auto-disarm (enabled=false + safe_mode=on) after end_date; per-day spend cap via liveDailyRemaining (resets each calendar day) - arm-live-run.mjs: arms a bounded run ($10/day x5, total $50 cap). Arming the gates stays a human action (classifier-gated), not autonomous. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
a3dd171 · 2026-07-10 · Ken: switch AI analyst from paid Gemini to local Ollama (hermes3:8b) + local boot on Mac3
- geminiAnalyze() now calls local Ollama /api/generate (format:json), env-overridable via KEN_LOCAL_MODEL/OLLAMA_URL; removes GEMINI_API_KEY dependency - raise per-day AI cap 200 -> 100000 (local = $0, no throttle) - persona/label strings reflect local model - add start.sh (sources .env) + reconstructed schema.sql (18 ken_* tables) so Ken boots + persists on Mac3 against local Postgres 'ken' + existing bertha_betting
File tree
- .env.example
- .gitignore
- CHANGES.md
- CHANGES2.md
- ecosystem.config.js
- kalshi-dash/.gitignore
- kalshi-dash/arm-live-run.mjs
- kalshi-dash/data/yoloforever-ledger.md
- kalshi-dash/docs/plans/2026-03-01-ken-neon-redesign.md
- kalshi-dash/follow-the-winners-check.sh
- kalshi-dash/follow-the-winners.mjs
- kalshi-dash/index.html
- kalshi-dash/ken-paper.png
- kalshi-dash/ken-real.png
- kalshi-dash/ken-refresh-site.sh
- kalshi-dash/ken-safemode-guard.sh
- kalshi-dash/ken-trade-flash.sh
- kalshi-dash/package-lock.json
- kalshi-dash/package.json
- kalshi-dash/place-manual-trade.mjs
- kalshi-dash/postcss.config.js
- kalshi-dash/risk-knob.html
- kalshi-dash/schema.sql
- kalshi-dash/scripts/reconcile-canary.mjs
- kalshi-dash/seed-portfolios.mjs
- kalshi-dash/server.js
- kalshi-dash/set-confidence.sh
- kalshi-dash/src/Layout.jsx
- kalshi-dash/src/Login.jsx
- kalshi-dash/src/api.js
- kalshi-dash/src/components/MiniCandlestick.jsx
- kalshi-dash/src/components/RingGauge.jsx
- kalshi-dash/src/components/RiskKnob.jsx
- kalshi-dash/src/components/Sparkline.jsx
- kalshi-dash/src/components/TickerTape.jsx
- kalshi-dash/src/hooks/useAnimatedValue.js
- kalshi-dash/src/index.css
- kalshi-dash/src/main.jsx
- kalshi-dash/src/pages/Dashboard.jsx
- kalshi-dash/src/pages/Heatmap.jsx
- kalshi-dash/src/pages/Intelligence.jsx
- kalshi-dash/src/pages/Markets.jsx
- kalshi-dash/src/pages/Orbit.jsx
- kalshi-dash/src/pages/Orders.jsx
- kalshi-dash/src/pages/Positions.jsx
- kalshi-dash/src/pages/Pulse.jsx
- kalshi-dash/src/pages/Risk.jsx
- kalshi-dash/src/pages/Settings.jsx
- kalshi-dash/src/pages/Signals.jsx
- kalshi-dash/src/pages/Trading.jsx
- kalshi-dash/src/pages/Weather.jsx
- kalshi-dash/src/setup/SetupWizard.jsx
- kalshi-dash/src/setup/steps/BrowseMarkets.jsx
- kalshi-dash/src/setup/steps/ConnectKalshi.jsx
- kalshi-dash/src/setup/steps/FetchWeather.jsx
- kalshi-dash/src/setup/steps/GoLive.jsx
- kalshi-dash/src/setup/steps/RiskProfile.jsx
- kalshi-dash/src/setup/steps/RunPredictions.jsx
- kalshi-dash/src/setup/steps/TestConnection.jsx
- kalshi-dash/src/setup/steps/Welcome.jsx
- kalshi-dash/src/utils/chartTheme.js
- kalshi-dash/start.sh
- kalshi-dash/tailwind.config.js
- kalshi-dash/trading-switch-widget.js
- kalshi-dash/trading-switch.html
- kalshi-dash/vite.config.js
- next.config.js
- package-lock.json
- package.json
- postcss.config.js
- public/favicon.svg
- react-dash/index.html
- react-dash/package-lock.json
- react-dash/package.json
- react-dash/postcss.config.js
- react-dash/server.js
- react-dash/src/Layout.jsx
- react-dash/src/Login.jsx
- react-dash/src/api.js
- react-dash/src/index.css
- react-dash/src/main.jsx
- react-dash/src/pages/Bankroll.jsx
- react-dash/src/pages/Dashboard.jsx
- react-dash/src/pages/Markets.jsx
- react-dash/src/pages/Models.jsx
- react-dash/src/pages/Polymarket.jsx
- react-dash/src/pages/Risk.jsx
- react-dash/src/pages/Settings.jsx
- react-dash/src/pages/Trades.jsx
- react-dash/src/pages/Weather.jsx
- react-dash/src/setup/SetupWizard.jsx
- react-dash/src/setup/steps/ConnectPoly.jsx
- react-dash/src/setup/steps/FetchWeather.jsx
- react-dash/src/setup/steps/GoLive.jsx
- react-dash/src/setup/steps/IngestMarkets.jsx
- react-dash/src/setup/steps/RiskProfile.jsx
- react-dash/src/setup/steps/RunPredictions.jsx
- react-dash/src/setup/steps/TestConnection.jsx
- react-dash/src/setup/steps/Welcome.jsx
- react-dash/tailwind.config.js
- react-dash/vite.config.js
- src/app/api/alerts/route.js
- src/app/api/bankroll/route.js
- src/app/api/dashboard/route.js
- src/app/api/health/route.js
- src/app/api/markets/route.js
- src/app/api/models/route.js
- src/app/api/risk/route.js
- src/app/api/trades/route.js
- src/app/api/weather/route.js
- src/app/api/workers/route.js
- src/app/dashboard/bankroll/page.js
- src/app/dashboard/layout.js
- src/app/dashboard/markets/page.js
- src/app/dashboard/models/page.js
- src/app/dashboard/page.js
- src/app/dashboard/risk/page.js
- src/app/dashboard/settings/page.js
- src/app/dashboard/trades/page.js
- src/app/dashboard/weather/page.js
- src/app/globals.css
- src/app/layout.js
- src/app/page.js
- src/lib/auth.js
- src/lib/db.js
- src/lib/model.js
- src/lib/polymarket.js
- src/lib/risk.js
- src/lib/slack.js
- src/lib/weather-pulse.js
- src/lib/weather.js
- src/workers/cron-runner.js
- tailwind.config.js
- verification/e2e-proof.json