Implement Phase 1.1: Delete Python skeleton and create C++/TypeScript architecture

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-25 08:37:29 +00:00
parent 155a8b896c
commit 15e40ffd4c
36 changed files with 792 additions and 1112 deletions

View File

@@ -1,60 +1,61 @@
# WizardMerge
**Intelligent Merge Conflict Resolution**
SEE ALSO: https://github.com/JohnDoe6345789/mergebot
WizardMerge is a powerful tool for resolving merge conflicts using intelligent algorithms based on research from The University of Hong Kong. It combines dependency analysis at both text and LLVM-IR levels to provide smart merge suggestions.
## Architecture
PyQt6 + QML demo application that showcases a themed UI shell alongside simple
merge algorithm helpers. The project ships with a theming plugin system so you
can extend the UI palette without touching the core code.
WizardMerge uses a multi-frontend architecture with a high-performance C++ backend and multiple frontend options:
## Features
- PyQt6 application bootstrapped from `wizardmerge.app`
- QML front-end that reads theme colors from the Python context
- Built-in light and dark themes plus an example warm plugin theme
- Simple merge algorithm utilities in `wizardmerge.algo`
- Helper scripts for environment setup and running the app
### Backend (C++)
- **Location**: `backend/`
- **Build System**: CMake + Ninja
- **Package Manager**: Conan
- **Features**: Three-way merge algorithm, conflict detection, auto-resolution
### Frontend (TypeScript/Next.js)
- **Location**: `frontend/`
- **Runtime**: bun
- **Framework**: Next.js 14
- **Features**: Web-based UI for conflict resolution
## Roadmap
See [ROADMAP.md](ROADMAP.md) for our vision and development plan to make resolving merge conflicts easier. The roadmap covers:
- Enhanced merge algorithms (three-way merge, conflict detection)
See [ROADMAP.md](ROADMAP.md) for our vision and development plan. The roadmap covers:
- Enhanced merge algorithms (three-way merge, conflict detection)
- Smart semantic merging for different file types
- Advanced visualization and UI improvements
- Git workflow integration
- AI-assisted conflict resolution
## Getting Started
1. Create a virtual environment and install dependencies:
```sh
./setup.sh
```
2. Launch the GUI (activates `.venv` automatically when present):
```sh
./run_app.sh
```
### C++ Backend
3. To install requirements into an existing environment instead of creating a
new one:
```sh
./install_all_python.sh
```
```sh
cd backend
./build.sh
```
## Theming
Themes live under `wizardmerge/themes`. Built-ins follow the `<name>_theme.py`
pattern. Plugin themes can be placed in `wizardmerge/themes/plugins` or in any
folder passed to `ThemeManager(extra_plugin_paths=[Path("/path/to/themes")])`.
Each theme module must expose a `Theme` instance named `theme` (or the
`warm_theme` example) with a palette mapping of color keys used by the QML UI.
See [backend/README.md](backend/README.md) for details.
## QML
The UI entry point is `wizardmerge/qml/main.qml`. It binds to a `theme` context
property injected from Python so you can use colors consistently across QML
components. Maintain two-space indentation when updating QML files.
### TypeScript Frontend
## Algorithms
`wizardmerge/algo/merge.py` offers a deterministic `merge_pairs` function for
interleaving two sequences of lines and reporting their origins. The GUI can be
extended to call these helpers when you add inputs to the placeholder area in
the QML layout.
```sh
cd frontend
bun install
bun run dev
```
See [frontend/README.md](frontend/README.md) for details.
## Research Foundation
WizardMerge is based on research from The University of Hong Kong achieving:
- 28.85% reduction in conflict resolution time
- Merge suggestions for over 70% of code blocks affected by conflicts
- Dependency analysis at text and LLVM-IR levels
See [docs/PAPER.md](docs/PAPER.md) for the complete research paper.