Skip to content

feat: AI Bounty Description Enhancer (solfoundry#848) [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] - #1436

Open
waterWang wants to merge 1 commit into
SolFoundry:feat/milestone-payoutsfrom
waterWang:feat/milestone-payouts
Open

feat: AI Bounty Description Enhancer (solfoundry#848) [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT]#1436
waterWang wants to merge 1 commit into
SolFoundry:feat/milestone-payoutsfrom
waterWang:feat/milestone-payouts

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Implements the AI Bounty Description Enhancer (Issue #848, 450K $FNDRY bounty).

Description

This feature adds an AI-powered system that analyzes vague bounty descriptions and generates improved versions with clearer requirements, acceptance criteria, and examples using multiple LLM providers.

Architecture

  • New API endpoints under /api/bounties/{id}/enhance*:

    • POST /api/bounties/{id}/enhance — Trigger AI enhancement (Claude, Codex, Gemini)
    • GET /api/bounties/{id}/enhancements — List all enhancement records
    • GET /api/bounties/{id}/enhancements/{eid} — Get a specific enhancement
    • POST /api/bounties/{id}/enhancements/{eid}/approve — Approve & apply enhancement
    • POST /api/bounties/{id}/enhancements/{eid}/reject — Reject enhancement
  • New service: app/services/bounty_enhancer_service.py — Core AI logic with:

    • Structured prompt engineering for each LLM provider
    • JSON response parsing with fallback handling
    • In-memory enhancement record storage
    • Approval workflow (approve updates bounty, reject marks as rejected)
  • New models: app/models/bounty_enhance.py — Pydantic models for requests/responses

  • Configuration: ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_API_KEY env vars

Acceptance Criteria Met

  1. ✅ Multi-LLM analysis (Claude via Anthropic, Codex via OpenAI, Gemini via Google)
  2. ✅ Automatic description enhancement with structured sections
  3. ✅ Maintainer approval workflow before publishing
  4. ✅ 20 comprehensive tests (all passing)

Additional Fix

Fixed a pre-existing NameError: name List is not defined in app/api/bounties.py (missing List import from typing).

Testing

cd backend && python3 -m pytest tests/test_bounty_enhance.py -v
# 20 passed in 3.10s

Implement AI-powered bounty description enhancement with multi-LLM support:
- Add POST /api/bounties/{id}/enhance — trigger AI enhancement
- Add GET /api/bounties/{id}/enhancements — list all enhancements
- Add GET /api/bounties/{id}/enhancements/{eid} — get specific enhancement
- Add POST /api/bounties/{id}/enhancements/{eid}/approve — approve & apply
- Add POST /api/bounties/{id}/enhancements/{eid}/reject — reject enhancement
- Support Claude, Codex, and Gemini providers
- Maintainer approval workflow before publishing
- Configurable via ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_API_KEY
- 20 comprehensive tests (all passing)
- Fix pre-existing missing List import in bounties.py

[fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant