resilience

Enforce persistence and crash recovery for Kalshi trading engine cycles.

Updated Jan 16, 2026
One-click install
npx skills add https://github.com/JuelHossain/kalshi-trading-team --skill resilience-juelhossain
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: resilience
Source: https://github.com/JuelHossain/kalshi-trading-team/tree/main/ai-env/skills/resilience
Command: npx skills add https://github.com/JuelHossain/kalshi-trading-team --skill resilience-juelhossain

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enforces the Resilience pillar, ensuring robust operation and seamless recovery via persistence.

Core Features & Use Cases

  • Persistence: High-value signals are stored in Synapse (SQLite) to survive process crashes.
  • State Restoration: Engine restores active cycles from Synapse on startup.
  • Reliability: No single point of failure in data handoff.
  • Defensive API Usage: Backoff with exponential backoff for 429/500 errors and jitter; hibernation after repeated failures; jitter to avoid thundering herd.
  • Process & Monitoring: PM2 orchestration; brain_tap.py health diagnostics.

Quick Start

Enable resilience checks by triggering a simulated crash and verifying that Synapse recovers the engine state on reboot.

Frequently Asked Questions about resilience

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I restore engine state from SQLite after a process crash?

To restore engine state after a process crash, high-value signals are persisted in Synapse SQLite storage, allowing the engine to automatically recover active cycles on startup and prevent data loss.

What is the best way to handle API rate limits and 429 errors with exponential backoff?

Handling API rate limits and 429 errors requires defensive API usage with exponential backoff and jitter, which spaces out retries to avoid thundering herd effects and triggers hibernation after repeated failures.

How does PM2 process orchestration work with health checks for crash recovery?

PM2 process orchestration works with crash recovery by managing long-running engine cycles and running brain_tap.py health diagnostics to monitor system reliability and ensure no single point of failure in data handoffs.

Can I use persistence and crash recovery for long-running cycles in a trading system?

Yes, persistence and crash recovery support long-running engine cycles in trading systems by enforcing Synapse SQLite state storage and PM2 orchestration to guarantee reliability during restart scenarios and inter-service handoffs.

Why does my system experience a thundering herd when restarting multiple services?

A thundering herd occurs during restarts when multiple services retry simultaneously; adding jitter to exponential backoff delays retries randomly, preventing synchronized API requests and reducing system overload.

What are the limitations of using SQLite for engine state persistence?

Using SQLite for engine state persistence requires Synapse integration to survive process crashes, but its scope is limited to local state restoration and inter-service handoffs rather than distributed database clustering.