Project Story: GitFlow AI

https://gitflow-ai-600965458720.us-west1.run.app/

https://github.com/Shengliang/gitflow-ai

The Inspiration: Escaping "Merge Hell"

In large-scale engineering organizations, the bottleneck isn't writing code—it's the coordination cost of bringing that code together. We’ve all been there: it’s "Merge Thursday," and the team is paralyzed. Eight different project branches are trying to land on master simultaneously. Standard Git tools see line-by-line conflicts, but they don't understand the intent.

We were inspired by the sheer magnitude of the "Productivity Gap." If a team of $E$ engineers works on $B$ branches, the potential for conflict doesn't grow linearly; it scales quadratically with the complexity of the code intersections. We realized that while AI is great at writing snippets, the real "Final Boss" of the SDLC is Orchestration. We wanted to build a "Mission Control" for Git that doesn't just report conflicts but semantically resolves them.

How We Built It

GitFlow AI is built on a high-fidelity stack designed for real-time feedback:

  1. The Brain (Gemini 3.1 Pro): We used Gemini not just for text, but as a semantic engine. When a conflict occurs, we feed the "Before," "After," and "Target" states into the model to determine the developer's intent.
  2. The Voice (Gemini Multimodal Live API): To make the demo truly immersive, we integrated the Live API to provide a real-time, low-latency audio presentation of the system architecture.
  3. The State (Firebase): We used Firestore to manage the "Merge Queue" in real-time. As AI resolves conflicts or CI tests pass/fail, the dashboard updates instantly for all stakeholders.
  4. The UI (React & Tailwind): We adopted a "Brutalist Tech" aesthetic to reflect the precision and power of the underlying engine.

The Math of Merging

We modeled our merge strategies using graph theory. For a set of $N$ pull requests, we implemented two primary modes:

  • Mode A (Divide & Conquer): A binary tree merge strategy. Instead of merging $N \to 1$, we merge in pairs. The depth of the merge tree is reduced to $O(\log N)$, significantly isolating conflicts.
  • Mode B (FIFO Batching): We group PRs into atomic units. If we have a batch size $K$, the probability of a clean merge $P(C)$ can be modeled as: $$P(C) = \prod_{i=1}^{K} (1 - p_i)$$ where $p_i$ is the probability of a semantic conflict in PR $i$. Our AI's goal is to minimize $p_i$ through pre-merge "Semantic Probing."

Challenges We Faced

The biggest hurdle was Real-Time Synchronization. Orchestrating a Git rebase is a destructive operation if not handled carefully. We had to build a "Safety First" layer that stages every AI resolution in a temporary "Shadow Branch" before it ever touches the main project.

Another challenge was the Multimodal Live API integration. Ensuring the audio stream and the text transcript stayed perfectly synced during a 4-minute continuous monologue required precise handling of PCM audio buffers and state management in React to prevent "Transcript Drift."

What We Learned

This project taught us that Context is King. A standard git merge is a syntax-level operation. By moving to a Semantic Merge, we can resolve $90\%$ of common conflicts (like imports, CSS ordering, or non-overlapping function additions) without human intervention. We also learned that providing a "Mission Control" view significantly reduces the anxiety of release cycles, turning a high-stress manual process into a background automated task.

Built With

  • googleaistudio
Share this project:

Updates