Skip to content

lhadjchikh/pullitzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ† Pullitzer

โš ๏ธ EXPERIMENTAL PROJECT - WORK IN PROGRESS โš ๏ธ

An experimental exploration of AI-assisted PR automation

Status: Pre-alpha research prototype | Not published to PyPI | Use at your own risk

This is a personal experiment in automated pull request workflows. It's a rapidly evolving prototype exploring how AI can help with PR feedback loops. Think of it as a research project into the future of development automation, not a production tool.

๐Ÿšง Current State

This is not ready for production use. Current status:

  • Prototype stage: Core concepts being explored, APIs changing daily
  • Limited testing: Only tested on my personal projects
  • Hardcoded assumptions: Many parts assume my specific development setup
  • Incomplete features: Most advertised features are partially implemented
  • No package distribution: Not published to PyPI, installation from source only

๐Ÿ”ฌ Research Goals

This project explores:

  • Automated PR iteration: Can AI meaningfully reduce the manual work in PR feedback loops?
  • Multi-tool orchestration: Unifying disparate development tools under one interface
  • AI cost awareness: Tracking the environmental impact of AI-assisted development
  • Human-AI collaboration patterns: Where automation helps vs. where it gets in the way

Experimental Vision

What if PR automation could handle the tedious parts while you focus on architecture and design?

# The dream (not yet reality):
$ pullitzer monitor
๐Ÿ”ง Auto-fixing formatting/linting...
๐Ÿค– Generating test fixes...
โœ… All checks passing

# Current reality:
$ pullitzer monitor
โš ๏ธ  Some features work
โš ๏ธ  Some features break
โš ๏ธ  Your mileage will vary

โœจ Planned Features (Mostly Aspirational)

Note: Most of these are partially implemented or experimental.

  • ๐Ÿš€ PR Automation - Basic PR creation works, monitoring is buggy
  • ๐Ÿ”ง Auto-Fix - Works for simple Python/JS formatting, everything else is manual
  • ๐Ÿค– AI Integration - Stub implementation, requires significant configuration
  • ๐Ÿ“Š Status Tracking - Basic terminal output, no fancy dashboards yet
  • ๐Ÿ”„ Iterative Fixing - Concept proven, implementation incomplete
  • ๐ŸŽฏ Multi-Language - Python works okay, JS partially, others untested
  • ๐ŸŒ Carbon Tracking - Experimental integration with ecologits

โš ๏ธ Known Limitations

This experimental prototype has significant limitations:

  • GitHub-only: Hardcoded for GitHub, no GitLab/Bitbucket support
  • Limited language support: Really only tested with Python
  • Flaky monitoring: The monitoring loop often gets stuck or misses updates
  • Incomplete AI integration: AI features are mostly stubbed out
  • No error handling: Expect crashes on unexpected inputs
  • Assumes specific tools: Expects black, ruff, prettier to be installed
  • macOS-focused: Developed on macOS, untested on Linux/Windows

๐ŸŽฌ Installation (From Source Only)

โš ๏ธ Not available on PyPI - this is experimental software

Install from source (at your own risk):

# Clone the repository (fork and update URL as needed)
git clone https://github.com/[YOUR-USERNAME]/pullitzer.git
cd pullitzer

# Install in development mode
pip install -e .

# Or with experimental carbon tracking
pip install -e ".[carbon]"

Note: Requires Python 3.8+ and various development tools that may not be documented.

Basic Usage (When It Works)

# These commands might work:
pullitzer pr create --title "feat: awesome feature"
pullitzer monitor  # Often gets stuck
pullitzer status   # Basic functionality

# These are experimental:
pullitzer fix      # Your mileage may vary
pullitzer monitor --pr 123  # Hardcoded assumptions

# Custom commands (use your own tools):
pullitzer fix --command "make lint"  # Recommended approach

Tip: You're probably better off using your existing linting scripts directly.

๐Ÿ“– How It Works

Pullitzer uses a two-tier approach to fixing PR issues:

1. Simple Fixes (Automated)

  • Formatting: Black, Prettier, terraform fmt
  • Linting: Ruff, ESLint with auto-fix
  • Imports: isort for Python

2. Complex Fixes (AI-Assisted)

  • Test Failures: Logic errors, assertion issues
  • Best Practices: Copilot suggestions, refactoring
  • Security: Vulnerability fixes, secure coding patterns
  • Coverage: Generate missing tests

๐Ÿ› ๏ธ Configuration

Using Custom Commands

Pullitzer respects your project's existing lint and format tooling. You can specify your own lint/fix commands:

# Use your project's lint script
pullitzer fix --command "python scripts/lint.py"

# Monitor PR with custom fix command
pullitzer monitor --fix-command "npm run lint:fix" --max-iterations 5

# Works with any command
pullitzer fix --command "make format"
pullitzer fix --command "./scripts/fix-all.sh"
pullitzer fix --command "poetry run poe format"

This is especially useful when:

  • Your project has specific formatting rules
  • You use custom linting configurations
  • You have a unified lint/format script
  • You want full control over the fix process

Configuration File

Create a .pullitzer.yml in your project root:

# .pullitzer.yml
version: 1

monitor:
  max_iterations: 5
  check_interval: 30
  auto_fix: true

fixes:
  python:
    - black
    - ruff
    - isort
  javascript:
    - eslint
    - prettier
  terraform:
    - fmt

ai:
  enabled: true
  provider: claude  # or openai, local
  
notifications:
  slack: https://hooks.slack.com/services/YOUR/WEBHOOK/URL

๐ŸŽฏ Use Cases

Continuous PR Monitoring

# Create PR first
pullitzer pr create --title "feat: new feature"

# Start monitoring with auto-fixes
pullitzer monitor --watch

# This will:
# 1. Monitor CI status
# 2. Apply fixes automatically  
# 3. Re-run until all checks pass

Pre-Push Cleanup

# Fix all issues before pushing
pullitzer fix --all
git add -A
git commit -m "feat: new feature"
git push

Complex Fix Workflow

# Analyze PR for complex issues
pullitzer analyze --pr 123

# This generates fix tasks in .pullitzer/tasks/
# Each task includes specific instructions for resolution

๐Ÿค Integration

GitHub Actions

name: Pullitzer

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  pullitzer:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.11'
      - run: pip install pullitzer
      - run: pullitzer monitor --ci

Pre-commit Hook

# .pre-commit-config.yaml
repos:
  - repo: local
    hooks:
      - id: pullitzer
        name: Pullitzer
        entry: pullitzer fix --staged
        language: system
        pass_filenames: false

๐Ÿ“Š Monitoring Dashboard

Pullitzer provides a rich terminal UI for monitoring:

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Pullitzer PR Monitor โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ PR #123: feat: add new authentication system                โ”‚
โ”‚ Branch: feature/auth                                        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Status: ๐ŸŸก In Progress                                      โ”‚
โ”‚                                                              โ”‚
โ”‚ Checks:                                                      โ”‚
โ”‚ โœ… Linting (Python)              2m 15s                     โ”‚
โ”‚ โœ… Linting (JavaScript)          1m 32s                     โ”‚
โ”‚ โŒ Tests (Backend)               3m 45s                     โ”‚
โ”‚ โณ Tests (Frontend)              Running...                 โ”‚
โ”‚ โœ… Security Scan                 1m 10s                     โ”‚
โ”‚                                                              โ”‚
โ”‚ Issues Found:                                               โ”‚
โ”‚ ๐Ÿ”ง 2 formatting issues (auto-fixing...)                     โ”‚
โ”‚ ๐Ÿงช 1 test failure (generating fix task...)                  โ”‚
โ”‚ ๐Ÿ’ก 3 Copilot suggestions                                    โ”‚
โ”‚                                                              โ”‚
โ”‚ Coverage: 87.3% (-0.5%)                                     โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

๐Ÿงช Development

This is actively being experimented on. Expect frequent breaking changes.

Development Setup

git clone https://github.com/[YOUR-USERNAME]/pullitzer.git
cd pullitzer
pip install -e ".[dev]"  # May have undocumented dependencies

Tests

Limited test coverage. Most functionality is manually tested (when tested at all).

pytest  # Some tests might fail

๐ŸŒ Carbon Footprint Tracking

Pullitzer integrates with Ecologits to track the carbon footprint of AI-assisted PR fixes.

Why Track Carbon?

Every AI API call consumes energy and produces CO2 emissions. Pullitzer helps you:

  • Measure the environmental impact of AI assistance
  • Compare AI vs manual fixing carbon costs
  • Optimize to reduce unnecessary API calls
  • Report on your development's carbon footprint

Usage

# View carbon report
pullitzer carbon

# Export as JSON for CI/CD
pullitzer carbon --format json

# Generate markdown report
pullitzer carbon --format markdown

Example Report

๐ŸŒ Environmental Impact
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Sessions tracked: 12
Total CO2: 0.0234 kg
Total energy: 156.3 Wh
API calls: 47

Equivalent to:
๐Ÿš— 0.1 km driven
๐ŸŒณ 0.001 trees needed/year
๐Ÿ“ฑ 13 phone charges

Configuration

Enable/disable tracking via environment variable:

# Disable carbon tracking
export PULLITZER_TRACK_CARBON=false

Carbon Badge

Add to your README:

![Carbon Footprint](https://img.shields.io/badge/carbon%20footprint-0.023kg%20CO2-brightgreen)

๐Ÿค– AI Integration

Pullitzer can integrate with AI services for complex fixes:

Claude (Anthropic)

from pullitzer import AIFixer

fixer = AIFixer(provider="claude", api_key="sk-...")
fixer.analyze_and_fix(pr_number=123)

OpenAI GPT

fixer = AIFixer(provider="openai", api_key="sk-...")
fixer.analyze_and_fix(pr_number=123)

๐Ÿ“š CLI Reference

pullitzer pr

Manage pull requests.

pullitzer pr create        # Create new PR for current branch
pullitzer pr update        # Update existing PR
pullitzer pr find          # Find PR for current branch
pullitzer pr list          # List all PRs
pullitzer pr show          # Show PR details

# Create options:
  --title TEXT           PR title
  --body TEXT            PR body/description
  --base TEXT            Base branch (default: main)
  --draft                Create as draft PR
  --no-push              Do not push branch to remote

pullitzer monitor

Monitor a PR and apply automatic fixes.

pullitzer monitor [OPTIONS]

Options:
  --pr INT               PR number to monitor (defaults to current branch PR)
  --max-iterations INT   Maximum fix iterations (default: 5)
  --no-fix               Monitor only, no auto-fixing
  --watch                Continue monitoring after completion
  --fix-command TEXT     Custom lint/fix command (e.g., "python scripts/lint.py")

pullitzer fix

Apply automated fixes for code issues.

pullitzer fix [OPTIONS]

Options:
  --all                  Run all available fixes
  --python               Fix Python code only
  --javascript           Fix JavaScript/TypeScript only
  --terraform            Fix Terraform only
  --staged               Fix staged files only
  --commit               Commit fixes automatically
  --command TEXT         Use custom lint/fix command

pullitzer status

Check PR status without making changes.

pullitzer status [OPTIONS]

Options:
  --pr INT               PR number (defaults to current branch PR)
  --json                 Output as JSON for scripting

pullitzer analyze

Analyze PR for complex issues and generate fix tasks.

pullitzer analyze [OPTIONS]

Options:
  --pr INT               PR number to analyze
  --provider TEXT        AI provider (claude, openai, local)

pullitzer carbon

Show carbon footprint report for AI-assisted fixes.

pullitzer carbon [OPTIONS]

Options:
  --format TEXT          Output format (text, json, markdown)

๐Ÿ“ License

Apache License 2.0 - Provided as-is with no warranties.

๐Ÿค Contributing

This is a personal experiment. Feel free to fork and adapt for your own use, but I'm not actively maintaining this for others.

โš ๏ธ Disclaimer

This is experimental software created for personal learning and exploration of AI-assisted development workflows. It is:

  • Not production-ready
  • Not tested beyond my personal projects
  • Likely to have bugs and incomplete features
  • Subject to breaking changes without notice

Use at your own risk. If you're looking for production PR automation tools, consider established solutions like Renovate, Dependabot, or pre-commit.

๐ŸŽช About the Name

"Pullitzer" is a playful nod to the idea that good PRs deserve recognition. This tool won't win any prizes for code quality (it's experimental!), but it represents an exploration into making PR workflows less painful.


This is an experimental project exploring AI-assisted PR automation. Expect rough edges, incomplete features, and frequent changes.

About

AI-assisted pull request iteration - exploring automated PR feedback loops

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages