Skip to main content

Turn AI-generated bug fixes into Stack Overflow contributions automatically

Project description

Resolution Capsule

AI coding assistants are trained on Stack Overflow. When they fix your bug, that fix should go back to Stack Overflow.

Resolution Capsule closes the loop: it captures an AI-generated fix, strips everything private (tokens, emails, internal paths, IPs, ticket IDs), and posts a clean, reviewable draft directly to Stack Overflow.


The Problem

Every day, AI assistants help developers fix bugs using knowledge that was scraped from public forums. Those fixes stay in a chat window and never benefit the next person who hits the same error. The knowledge loop is broken.

What It Does

  1. You fix a bug — with an AI assistant or manually
  2. Resolution Capsule captures the fix and its context
  3. It redacts secrets, identity markers, and internal details automatically
  4. It produces a Stack Overflow-ready draft and posts it via the API

The goal is zero friction between "fix applied" and "community helped."


Surfaces

Surface Best for
VS Code extension Capturing AI-generated fixes directly from your editor (git diff → post)
CLI CI pipelines, scripts, batch processing of resolved incidents
Web UI Quick one-off drafts and testing the sanitizer
AI skill Embedding the workflow inside Cursor, Copilot, Claude Code, or any agent

VS Code Extension

Install from the marketplace or from the .vsix in vscode-extension/.

Key command — Create from AI Fix:

  1. Use your AI assistant to apply a fix
  2. Cmd+Shift+PResolution Capsule: Create from AI Fix
  3. Describe the problem and root cause
  4. A sanitized draft opens — one click posts it to Stack Overflow

The command captures your current git diff as the fix automatically. No copy-pasting.

Other commands: Create From Selection, Create From Prompts, Connect Stack Overflow, Disconnect Stack Overflow.


CLI

python3 capsule_cli.py \
  --problem "Build fails after dependency upgrade" \
  --rootCause "Lockfile drift" \
  --fix "Regenerated package-lock.json" \
  --source "ai-assisted"

JSON input:

python3 capsule_cli.py --format json --json '{"problem":"...","rootCause":"...","fix":"...","source":"ai-assisted","mode":"balanced"}'

Write to file:

python3 capsule_cli.py --output capsule.md --problem "..." --rootCause "..." --fix "..."

Web UI

python3 app.py

Open http://127.0.0.1:8000.


Sanitization

Balanced mode (default): API keys, bearer tokens, JWTs, GitHub tokens, Slack tokens, AWS keys, emails, IPs, internal URLs, filesystem user paths, private key blocks.

Strict mode: everything above plus ticket IDs and long numeric identifiers.


What's Missing (and Where to Help)

This is a work in progress. The pieces that matter most and aren't built yet:

  • Cursor / Copilot / Claude Code hooks — trigger a capsule automatically when an AI fix is accepted, without the developer doing anything manually
  • Entropy-based secret detection — catch high-entropy strings that don't match known patterns
  • Duplicate detection — check if the question already exists on Stack Overflow before posting
  • Team policy packs — org-level redaction rules layered on top of the defaults
  • JetBrains plugin — same workflow as the VS Code extension

If any of these interest you, the codebase is small and the engine is pure Python with no dependencies.


Stack Overflow Setup

To enable auto-posting, register a free app at stackapps.com/apps/oauth/register with OAuth domain localhost, then add your credentials to VS Code settings:

resolutionCapsule.stackOverflow.clientId
resolutionCapsule.stackOverflow.clientSecret
resolutionCapsule.stackOverflow.apiKey

Run Resolution Capsule: Connect Stack Overflow once to authorise.


Contributing

The repo is at github.com/adivarshney/resolution-capsule. Issues, PRs, and ideas are all welcome. If you're unsure where to start, the AI tool integrations section above is the frontier.


Run the Tests

python3 -m unittest test_app -v

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

resolution_capsule-0.1.0.tar.gz (65.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

resolution_capsule-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file resolution_capsule-0.1.0.tar.gz.

File metadata

  • Download URL: resolution_capsule-0.1.0.tar.gz
  • Upload date:
  • Size: 65.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for resolution_capsule-0.1.0.tar.gz
Algorithm Hash digest
SHA256 007baafe3c3d8b92c675b9ec544b6fe724ca1d6cc2b44c378c667140cf7e8f8d
MD5 f7754b9a606903d85068df459ca2d6a8
BLAKE2b-256 2778f8e623b938a786c266d1a3493d12595497d1a843b413a91cd6023826c473

See more details on using hashes here.

File details

Details for the file resolution_capsule-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: resolution_capsule-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for resolution_capsule-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7208d74a7ca67eb5b24b4607460ba72f6432ff5b223197c8f83d4b17f935f515
MD5 a373b139082c18513516dd39e80f2e19
BLAKE2b-256 622e7d9a5c868f3ca81cf5d9fafc581250dba43063290953164158b02b3392dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page