Skip to content

Commit 487eaf8

Browse files
committed
docs: Update README files with comprehensive MCP instructions
- Update main README.md with MCP server as primary option - Add detailed architecture and feature descriptions - Update MCP server README with current simplified state - Include automatic changelog information in documentation - Add Cursor AI integration instructions - Document local authentication and SSH setup - Provide clear examples and troubleshooting guides The documentation now accurately reflects the current MCP-first approach with automatic changelog inclusion and local authentication.
1 parent af30035 commit 487eaf8

2 files changed

Lines changed: 238 additions & 67 deletions

File tree

README.md

Lines changed: 159 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,178 @@
1-
auto-rebase — Automated Re-targeting of Feature Customizations
1+
# AutoRebase — Automated Re-targeting of Feature Customizations
22

3-
Overview
3+
## Overview
44

5-
auto-rebase helps re-target feature customizations when a Base SW updates. Given base-OLD, base-NEW, and feature-OLD, it produces feature-NEW with re-applied customizations, machine-readable patchsets, and a human report with traceability and validation.
5+
AutoRebase helps re-target feature customizations when a Base SW updates. Given base-OLD, base-NEW, and feature-OLD, it produces feature-NEW with re-applied customizations, machine-readable patchsets, and a human report with traceability and validation.
66

7-
Quickstart (Engine CLI)
7+
## 🚀 Quick Start Options
88

9-
- Optional: `bash scripts/install_tools.sh`
10-
- Run the demo on included sample data:
9+
### Option 1: MCP Server (Recommended for AI Integration)
1110

12-
```
13-
python -m engine.cli.auto_rebase init --old-base data/sample/base-1.0 --new-base data/sample/base-1.1 --feature data/sample/feature-5.0 --req-map data/sample/requirements_map.yaml --workdir artifacts/run1
14-
python -m engine.cli.auto_rebase extract-feature --out artifacts/run1/feature_patch
15-
python -m engine.cli.auto_rebase extract-base --out artifacts/run1/base_patch
16-
python -m engine.cli.auto_rebase retarget --feature-patch artifacts/run1/feature_patch --base-patch artifacts/run1/base_patch --new-base data/sample/base-1.1 --out artifacts/run1/feature-5.1
17-
python -m engine.cli.auto_rebase validate --path artifacts/run1/feature-5.1 --report artifacts/run1/report.html
18-
python -m engine.cli.auto_rebase finalize --path artifacts/run1/feature-5.1 --tag v5.1 --trace artifacts/run1/trace.json
11+
The MCP (Model Context Protocol) server provides AI-powered conflict resolution and is perfect for integration with AI models like Cursor.
12+
13+
**Setup:**
14+
```bash
15+
cd mcp-server
16+
npm install
17+
npm run build
1918
```
2019

21-
What You Get
20+
**Usage with Cursor:**
21+
1. Copy `mcp-server/cursor-mcp-config.json` to your Cursor MCP configuration
22+
2. Restart Cursor
23+
3. Use AI to call AutoRebase tools directly
2224

23-
- feature-NEW tree with applied changes
24-
- Machine-readable ΔF and ΔB patchsets
25-
- report.html and report.json (schema-validated)
26-
- trace.json listing requirement IDs per patch unit
27-
- Optional git tag and commit trailers
25+
**Available Tools:**
26+
- `autorebase`: Complete AutoRebase process with AI conflict resolution
27+
- `validate_repository`: Validate GitHub repositories and SHAs
2828

29-
Monorepo Layout
29+
See `mcp-server/README.md` for detailed MCP setup instructions.
3030

31-
See files under `engine/`, `server/`, `mcp-server/`, and `web/`. Adapters automatically detect external tools and fall back to robust text-based strategies if unavailable (e.g., difflib/comby heuristics).
31+
### Option 2: FastAPI Server
3232

33-
Environment
33+
REST API for programmatic access to AutoRebase functionality.
3434

35-
- Python 3.11+ recommended
36-
- Node 18+ for MCP server and Next.js app
37-
- Optional external tools: git, difftastic, gumtree, clang-tidy, coccinelle, dtc, yq, comby
35+
**Setup:**
36+
```bash
37+
pip install -r api/requirements.txt
38+
python api/main.py
39+
```
3840

39-
Development
41+
**Usage:**
42+
```bash
43+
curl -X POST "http://localhost:8000/autorebase" \
44+
-H "Content-Type: application/json" \
45+
-d '{
46+
"base_software_0": "main",
47+
"base_software_1": "main",
48+
"feature_software_0": "main",
49+
"base_repo_url": "https://github.com/user/base-repo.git",
50+
"feature_repo_url": "https://github.com/user/feature-repo.git"
51+
}'
52+
```
4053

41-
- Formatting/lint: ruff, black, isort configured in `pyproject.toml`
42-
- Tests: `pytest` (see `tests/`)
43-
- CI: GitHub Actions in `.github/workflows/ci.yml`
54+
See `README_FASTAPI.md` for detailed API documentation.
4455

45-
Limitations & Fallbacks
56+
### Option 3: Engine CLI (Legacy)
4657

47-
- External binaries are detected at runtime. If missing, adapters degrade gracefully with warnings and use text merges.
48-
- Sample adapters implement pragmatic heuristics sufficient for demo and unit tests.
58+
Command-line interface for direct AutoRebase operations.
4959

50-
Adding a New Adapter
60+
**Setup:**
61+
```bash
62+
bash scripts/install_tools.sh
63+
```
64+
65+
**Usage:**
66+
```bash
67+
python -m engine.cli.auto_rebase init --old-base data/sample/base-1.0 --new-base data/sample/base-1.1 --feature data/sample/feature-5.0 --req-map data/sample/requirements_map.yaml --workdir artifacts/run1
68+
python -m engine.cli.auto_rebase extract-feature --out artifacts/run1/feature_patch
69+
python -m engine.cli.auto_rebase extract-base --out artifacts/run1/base_patch
70+
python -m engine.cli.auto_rebase retarget --feature-patch artifacts/run1/feature_patch --base-patch artifacts/run1/base_patch --new-base data/sample/base-1.1 --out artifacts/run1/feature-5.1
71+
python -m engine.cli.auto_rebase validate --path artifacts/run1/feature-5.1 --report artifacts/run1/report.html
72+
python -m engine.cli.auto_rebase finalize --path artifacts/run1/feature-5.1 --tag v5.1 --trace artifacts/run1/trace.json
73+
```
5174

52-
- Implement the `Adapter` Protocol in `engine/adapters/*.py`.
53-
- Register detection, extraction, retargeting, apply, and validate. Prefer semantic ops; provide text fallback.
75+
## 🎯 What You Get
76+
77+
- **feature-NEW tree** with applied changes
78+
- **Machine-readable ΔF and ΔB patchsets**
79+
- **Complete changelog** with detailed processing information
80+
- **AI-powered conflict resolution** using OpenAI
81+
- **Requirements-based resolution** respecting REQUIREMENTS_MAP.yml
82+
- **report.html and report.json** (schema-validated)
83+
- **trace.json** listing requirement IDs per patch unit
84+
- **Optional git tag and commit trailers**
85+
86+
## 🏗️ Architecture
87+
88+
### MCP Server (`mcp-server/`)
89+
- Model Context Protocol server for AI integration
90+
- TypeScript/Node.js implementation
91+
- Provides tools for AI models to call AutoRebase functionality
92+
- Supports local SSH authentication and GitHub token authentication
93+
94+
### FastAPI Server (`api/`)
95+
- REST API for programmatic access
96+
- Python implementation with Pydantic models
97+
- Async/await support for concurrent operations
98+
- Comprehensive error handling and validation
99+
100+
### Engine (`engine/`)
101+
- Core AutoRebase logic and algorithms
102+
- Adapter pattern for different file types
103+
- Fallback strategies for missing external tools
104+
- Python implementation with extensive testing
105+
106+
### Web Interface (`web/`)
107+
- Next.js web application
108+
- User-friendly interface for AutoRebase operations
109+
- Real-time progress tracking and results visualization
110+
111+
## 🔧 Environment Requirements
112+
113+
- **Python**: 3.11+ recommended
114+
- **Node.js**: 18+ for MCP server and Next.js app
115+
- **OpenAI API Key**: Required for AI conflict resolution
116+
- **Git**: Required for repository operations
117+
- **Optional external tools**: difftastic, gumtree, clang-tidy, coccinelle, dtc, yq, comby
118+
119+
## 🚀 Key Features
120+
121+
### AI-Powered Conflict Resolution
122+
- Uses OpenAI GPT models to intelligently resolve merge conflicts
123+
- Respects REQUIREMENTS_MAP.yml for context-aware resolution
124+
- Validates resolutions with confidence scoring
125+
- Handles complex multi-file conflicts
126+
127+
### Automatic Changelog Generation
128+
- Complete processing history with timestamps
129+
- Detailed file-by-file change tracking
130+
- Patch application success/failure logging
131+
- AI resolution statistics and validation scores
132+
133+
### Flexible Authentication
134+
- **SSH**: Uses local SSH keys for GitHub operations
135+
- **GitHub Token**: Supports personal access tokens
136+
- **Public Repositories**: No authentication required for read operations
137+
- **Local Credentials**: Falls back to system Git configuration
138+
139+
### Robust Error Handling
140+
- Graceful degradation when external tools are missing
141+
- Comprehensive validation of inputs and outputs
142+
- Detailed error messages with troubleshooting guidance
143+
- Fallback strategies for edge cases
144+
145+
## 🧪 Development
146+
147+
- **Formatting/lint**: ruff, black, isort configured in `pyproject.toml`
148+
- **Tests**: `pytest` (see `tests/`)
149+
- **CI**: GitHub Actions in `.github/workflows/ci.yml`
150+
- **Type Safety**: TypeScript for MCP server, Pydantic for Python APIs
151+
152+
## 🔒 Security & Privacy
153+
154+
- **Local Processing**: All operations happen on your machine
155+
- **No Data Storage**: No sensitive data is stored or transmitted
156+
- **Secure Authentication**: Multiple authentication methods supported
157+
- **API Key Management**: Secure handling of OpenAI and GitHub tokens
158+
- **Public Repository Focus**: Designed for open-source workflows
159+
160+
## 📚 Documentation
161+
162+
- **MCP Server**: `mcp-server/README.md` - AI integration guide
163+
- **FastAPI**: `README_FASTAPI.md` - REST API documentation
164+
- **Cursor Setup**: `mcp-server/CURSOR_SETUP.md` - Cursor AI integration
165+
- **Engine**: `engine/README.md` - Core algorithm documentation
166+
167+
## 🤝 Contributing
168+
169+
1. Fork the repository
170+
2. Create a feature branch
171+
3. Make your changes
172+
4. Test thoroughly (unit tests + integration tests)
173+
5. Submit a pull request
174+
175+
## 📄 License
176+
177+
MIT License - see LICENSE file for details.
54178

0 commit comments

Comments
 (0)