Skip to content

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

73 Commits

Folders and files

Repository files navigation

๐Ÿ” ConflictLens

Predict merge conflicts and security risks before they reach the merge stage.

VS Code TypeScript Node.js React Gemini MIT License

GitHub Stars GitHub Issues GitHub Forks


๐Ÿšจ The Problem

Traditional Git conflict detection mainly focuses on textual conflicts.

But code can be logically incompatible even when Git reports:

No merge conflict

Two branches may modify related functions, dependencies, security-sensitive code, or application behavior without touching the exact same lines.

That's where ConflictLens comes in.


๐Ÿ’ก What is ConflictLens?

ConflictLens is an AI-powered VS Code extension and backend system designed to identify semantic merge risks and security issues before merging branches.

Instead of waiting for a merge to fail, ConflictLens analyzes changes across Git branches and provides developers with:

  • ๐Ÿ”€ Semantic conflict detection
  • ๐Ÿ”‘ Secret detection
  • ๐Ÿ›ก๏ธ Injection-risk analysis
  • ๐Ÿ“Š Risk scoring
  • ๐Ÿค– AI-powered explanations
  • ๐Ÿ–ฅ๏ธ Inline VS Code diagnostics
  • ๐Ÿ“ˆ Visual risk dashboard

"Don't wait for the merge to reveal the problem. ConflictLens predicts it before it happens."


โœจ Core Features

๐Ÿ”€ Semantic Conflict Detection

Analyze changes beyond simple line-by-line differences.

  • AST-level analysis
  • Function signature tracking
  • Cross-file dependency analysis
  • Potential semantic breakage detection

๐Ÿ” Security Scanning

Detect potentially dangerous code patterns before they become part of a merged codebase.

  • API keys
  • Tokens
  • Credentials
  • Connection strings
  • Security-sensitive patterns

๐Ÿ›ก๏ธ Injection Analysis

Identify potentially dangerous patterns such as:

  • SQL injection
  • Command injection
  • Unsafe eval
  • Unsafe input handling

๐Ÿ“Š Risk Scoring

Convert detected issues into an easy-to-understand risk level:

LOW โ†’ MEDIUM โ†’ HIGH โ†’ CRITICAL

๐Ÿค– AI Explanations

Use the Gemini API to generate:

  • Plain-English explanations
  • Risk summaries
  • Recommended fixes
  • Developer-friendly context

๐Ÿ–ฅ๏ธ VS Code Integration

Get warnings directly inside your development environment using:

  • Diagnostics API
  • Inline warnings
  • Squiggly underlines
  • Hover information

๐Ÿ—๏ธ Architecture

                         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ”‚       Developer       โ”‚
                         โ”‚       VS Code         โ”‚
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                     โ”‚
                                     โ–ผ
                         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ”‚   ConflictLens        โ”‚
                         โ”‚   VS Code Extension   โ”‚
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                     โ”‚
                                     โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚          Backend API             โ”‚
                    โ”‚       Node.js + Express          โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    โ”‚
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ–ผ                     โ–ผ                     โ–ผ
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ”‚ Git & Semantic  โ”‚   โ”‚ Security Engine โ”‚   โ”‚  AI Explanation โ”‚
     โ”‚ Analysis Engine โ”‚   โ”‚                 โ”‚   โ”‚     Gemini      โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
              โ”‚                     โ”‚                     โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                    โ–ผ
                         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ”‚   Risk Analysis       โ”‚
                         โ”‚   & Recommendations   โ”‚
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                     โ”‚
                                     โ–ผ
                         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ”‚   React Dashboard     โ”‚
                         โ”‚   Risk Visualization  โ”‚
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿง  How It Works

1๏ธโƒฃ Analyze Git Changes

ConflictLens examines changes between branches using Git integration.

2๏ธโƒฃ Understand Code Structure

The semantic analysis layer tracks functions, signatures, and dependencies rather than relying only on textual differences.

3๏ธโƒฃ Scan for Security Risks

The security engine searches for sensitive credentials and potentially dangerous code patterns.

4๏ธโƒฃ Calculate Risk

Detected issues are classified according to their severity.

5๏ธโƒฃ Explain the Problem

The AI layer converts technical findings into understandable explanations and recommendations.

6๏ธโƒฃ Show Results

Developers receive feedback directly inside VS Code and through the dashboard.


๐Ÿ› ๏ธ Tech Stack

Layer Technology
๐Ÿงฉ VS Code Extension TypeScript + VS Code Extension API
๐Ÿ”€ Git Integration simple-git
๐ŸŒณ AST Analysis @babel/parser + @babel/traverse
๐Ÿ” Security Scanner Custom pattern/rule engine
โš™๏ธ Backend Node.js + Express
๐Ÿค– AI Google Gemini API
๐Ÿ“Š Dashboard React Webview
๐Ÿ“ฆ Shared Types TypeScript
๐Ÿ“š Documentation Markdown

๐Ÿ“ Project Structure

ConflictLens/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ docs/
โ”‚   โ”œโ”€โ”€ PRD
โ”‚   โ”œโ”€โ”€ Architecture
โ”‚   โ””โ”€โ”€ Technology Stack
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ extension/
โ”‚   โ””โ”€โ”€ VS Code Extension
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ backend/
โ”‚   โ””โ”€โ”€ src/
โ”‚       โ”œโ”€โ”€ semantic/
โ”‚       โ”‚   โ””โ”€โ”€ Git & Semantic Analysis
โ”‚       โ”‚
โ”‚       โ”œโ”€โ”€ security/
โ”‚       โ”‚   โ””โ”€โ”€ Security Scanning & Risk Scoring
โ”‚       โ”‚
โ”‚       โ”œโ”€โ”€ ai/
โ”‚       โ”‚   โ””โ”€โ”€ Gemini AI Explanation Layer
โ”‚       โ”‚
โ”‚       โ””โ”€โ”€ schema/
โ”‚           โ””โ”€โ”€ Shared Types & Validators
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ dashboard/
โ”‚   โ””โ”€โ”€ React Webview Dashboard
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ packages/
โ”‚   โ””โ”€โ”€ git-engine/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ shared/
โ”‚   โ””โ”€โ”€ Cross-module Types
โ”‚
โ”œโ”€โ”€ ๐Ÿ“„ package.json
โ”œโ”€โ”€ ๐Ÿ“„ package-lock.json
โ””โ”€โ”€ ๐Ÿ“„ README.md

โšก Quick Start

1. Clone the Repository

git clone https://github.com/soumen-tech/ConflictLens.git
cd ConflictLens

2. Install Backend Dependencies

cd backend
npm install

3. Run the Security Scanner

npm run scan:security -- <path-to-diff-file>

4. Start the Backend

npm run dev

5. Build the VS Code Extension

cd ../extension
npm install
npm run compile

Then press:

F5

inside VS Code to launch the Extension Development Host.


๐Ÿ”ฌ Example Risk Flow

Developer changes code
        โ”‚
        โ–ผ
Git branch analysis
        โ”‚
        โ–ผ
Semantic dependency analysis
        โ”‚
        โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ–ผ               โ–ผ
Potential conflict   Security risk
        โ”‚               โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                โ–ผ
          Risk Scoring
                โ”‚
                โ–ผ
        AI Explanation
                โ”‚
                โ–ผ
       Developer Warning
                โ”‚
                โ–ผ
       Fix Before Merge

๐Ÿ‘ฅ Development Tracks

Track Area Focus
01 Git & Semantic Analysis AST + dependency analysis
02 Security Engine Security scanning + risk scoring
03 VS Code Extension Diagnostics + developer experience
04 Backend + AI API + Gemini integration
05 Dashboard React UI + integration + QA

๐Ÿ“š Documentation

The project includes documentation covering:

  • ๐Ÿ“‹ Product Requirements
  • ๐Ÿ—๏ธ System Architecture
  • ๐Ÿงฐ Technology Stack

Explore the docs/ directory for the detailed project documentation.


๐Ÿ”ฎ Vision

ConflictLens aims to move Git conflict detection from:

"Will Git be able to merge these files?"

to:

"Will these changes still work correctly after they are merged?"

The goal is to give developers early visibility into semantic conflicts, security risks, and potentially dangerous changes before they become expensive problems.


๐Ÿค Contributing

Contributions, ideas, bug reports, and improvements are welcome.

# Fork the repository

# Create a feature branch
git checkout -b feature/your-feature

# Make your changes

# Commit
git commit -m "feat: add your feature"

# Push
git push origin feature/your-feature

# Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License.


๐Ÿ” Detect Early. Understand Better. Merge Safer.


ConflictLens

GitHub Repository โ€ข Issues โ€ข Pull Requests

โญ If you find the project interesting, consider giving it a star.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages