Skip to main content

crash_pilot 1.0.9 copy "crash_pilot: ^1.0.9" to clipboard
crash_pilot: ^1.0.9 copied to clipboard

Autonomous self-healing & Shorebird hot-patch engine for Flutter apps with AST analysis and automated GitHub PR creation.

๐Ÿš€ CrashPilot #

The World's First Autonomous Self-Healing & Shorebird Hot-Patch Bot for Flutter Apps.
Zero-friction, instant surgical bug fixes and OTA deployment without waiting for App Store / Play Store reviews.


๐Ÿ“Œ What is CrashPilot? #

When a Flutter app crashes in production, it normally takes 24 to 72 hours for a developer to be alerted, reproduce the bug, write a patch, run tests, and wait for Google Play / Apple App Store approval. In the meantime, thousands of users experience crashes and leave 1-star ratings.

CrashPilot automates this entire lifecycle in under 10 minutes:

  1. Ingests Sentry & Firebase Crashlytics webhook alerts in real time.
  2. Parses Dart AST (package:analyzer) to locate the exact enclosing method, class, and null-safety context.
  3. Synthesizes Surgical Patches (only 5-15 lines, no speculative rewrites) using Gemini 1.5 Pro, Claude 3.5 Sonnet, or OpenAI GPT-4o.
  4. Verifies in a Sandbox: Enforces flutter analyze --fatal-infos (0 errors, 0 warnings) and runs auto-generated regression unit tests.
  5. Self-Heals: If tests fail, an automated reflection loop refines the fix.
  6. Dual Dispatch: Opens a complete diagnostic GitHub Pull Request and triggers Shorebird CodePush to hot-patch live user devices in minutes!

๐Ÿ—๏ธ Architecture #

[ Production Mobile App Crash ]
              โ”‚
              โ–ผ
   [ Sentry / Crashlytics ] โ”€โ”€(Webhook Alert with Stack Trace)
              โ”‚
              โ–ผ
    โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
    โ•‘                   CRASHPILOT ENGINE                          โ•‘
    โ•‘                                                              โ•‘
    โ•‘  1. Ingestion & Triage      (Deduplication & Severity Gate)  โ•‘
    โ•‘  2. Git & AST Locator       (Pulls commit, parses Dart AST)  โ•‘
    โ•‘  3. AI Patch Synthesizer    (Surgical Fix + Regression Test) โ•‘
    โ•‘  4. Sandbox Verifier        (flutter analyze & flutter test) โ•‘
    โ•‘  5. Self-Correction Loop    (Reflection on any test failure) โ•‘
    โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
              โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ–ผ                                 โ–ผ
[ GitHub Pull Request ]      [ Shorebird OTA Hot-Patch ]
(Detailed Diagnostic PR)     (Zero App Store Wait! 5-min fix)

โšก Quick Start (Developer Setup) #

1. Installation #

Clone or add CrashPilot to your workspace:

git clone https://github.com/vaibhavbadhe712/crash_pilot.git
cd crash_pilot
dart pub get

2. Initialize Configuration #

Generate crashpilot.yaml in your project root:

dart run bin/crash_pilot.dart init

3. Simulate Offline (Zero-Key Testing) #

Test the entire pipeline on your machine without requiring external API keys:

dart run bin/crash_pilot.dart simulate

4. Analyze Any Stack Trace #

dart run bin/crash_pilot.dart analyze-trace --raw "Null check operator used on a null value
#0  CartCubit.addItem (package:my_app/cart_cubit.dart:142:15)"

5. Autonomous Healing Run #

# Ingest from raw stack trace file:
dart run bin/crash_pilot.dart heal --trace crash.txt

# Or ingest from Sentry Webhook JSON:
dart run bin/crash_pilot.dart heal --json sentry_event.json --source sentry

โš™๏ธ Configuration (crashpilot.yaml) #

crashpilot:
  # AI Provider: 'gemini', 'claude', or 'openai'
  ai_provider: gemini
  gemini_model: gemini-1.5-pro

  # Shorebird OTA CodePush:
  # If true, runs `shorebird patch android/ios` upon test verification
  auto_shorebird_patch: false

  # Self-healing reflection retries
  max_retries: 2
  target_branch: main

๐Ÿค– GitHub Actions Workflow #

Add .github/workflows/crashpilot.yml to your Flutter repository:

name: CrashPilot Autonomous Self-Heal

on:
  repository_dispatch:
    types: [production-crash-alert]

jobs:
  auto-heal:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Setup Flutter
        uses: subosito/flutter-action@v2
        with:
          channel: 'stable'

      - name: Run CrashPilot
        env:
          GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
          SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }}
        run: |
          dart pub global activate --source path /path/to/crash_pilot
          crashpilot heal --json '${{ toJson(github.event.client_payload) }}' --source sentry

๐Ÿงช Testing #

Run static analysis and the automated test suite:

dart analyze
dart test

๐Ÿ“„ License #

MIT License. See LICENSE for details.

1
likes
160
points
284
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Autonomous self-healing & Shorebird hot-patch engine for Flutter apps with AST analysis and automated GitHub PR creation.

Repository (GitHub)
View/report issues

Topics

#crash-reporting #flutter #devops #automation #shorebird

License

MIT (license)

Dependencies

analyzer, args, http, meta, path, yaml

More

Packages that depend on crash_pilot