Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6ccdd1f
Update README.md
FatinShadab May 28, 2026
afec3b8
cleanup
FatinShadab May 28, 2026
f75ce85
Update README.md
FatinShadab May 28, 2026
04230fe
remove unused dependecy
FatinShadab May 28, 2026
1710e6f
readme bug fix
FatinShadab May 28, 2026
d822499
fix + update
FatinShadab May 29, 2026
f86a5ec
Update README.md
FatinShadab May 29, 2026
660dc90
Update README.md
FatinShadab May 29, 2026
2ea9f80
updated the documets
FatinShadab May 29, 2026
f908d53
Update README.md
FatinShadab May 29, 2026
d0502fd
Update README.md
FatinShadab May 29, 2026
b178565
Update .gitignore
FatinShadab May 29, 2026
92f4aa3
Create CITATION.cff
FatinShadab May 29, 2026
323639b
Create FUNDING.yml
FatinShadab May 30, 2026
6e6e5e9
Delete FUNDING.yml
FatinShadab May 30, 2026
0923691
feature added
FatinShadab May 30, 2026
516c76e
new feature added
FatinShadab May 31, 2026
1a6b981
Document and publish release v0.1.4.
FatinShadab May 31, 2026
95a944c
Revert "Document and publish release v0.1.4."
FatinShadab May 31, 2026
9a90443
doc added
FatinShadab May 31, 2026
92071f0
mcp bug fixed
FatinShadab May 31, 2026
2a022b7
ai added + mcp improved
FatinShadab May 31, 2026
32e5b69
ai feature updated
FatinShadab May 31, 2026
26aab05
fix
FatinShadab May 31, 2026
cafa311
Update graph.html.j2
FatinShadab May 31, 2026
9924509
doc added
FatinShadab Jun 1, 2026
6981919
feature added
FatinShadab Jun 1, 2026
55b1669
Merge pull request #2 from Ogro-Projukti/v.0.1.4
FatinShadab Jun 1, 2026
32a877a
fix(deps): support Python 3.12+ Tree-sitter installs without breaking…
FatinShadab Jun 1, 2026
6ca1b87
feature enhance
FatinShadab Jun 1, 2026
a6d6870
copy button added
YeamimHossainSajid Jun 1, 2026
e0811bb
Update parser.py
FatinShadab Jun 1, 2026
99b79a5
Update CHANGELOG.md
FatinShadab Jun 1, 2026
054ea60
Merge pull request #3 from Ogro-Projukti/issue_1_fix
FatinShadab Jun 1, 2026
4c2ecfd
added assets
FatinShadab Jun 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .cursor/rules/watcher-knowledge-graph.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
description: CodeGenome knowledge graph and MCP Context
alwaysApply: true
---

# CodeGenome MCP Integration

You are operating within a repository analyzed by CodeGenome, an architectural knowledge graph tool. This project contains a `.genome/` directory.

## Core Directives

1. **Mandatory MCP Usage**: When `.genome/watcher.db` exists, you MUST use CodeGenome MCP access for all codebase, architecture, dependency, or symbol queries whenever it is available.
2. **Access Order**: First use native CodeGenome MCP tools exposed in your context. If those tools are missing, you MAY try a local MCP HTTP endpoint such as `http://127.0.0.1:7331/mcp` when the user has started it or configured it. Treat this as MCP transport access, not as an arbitrary application HTTP API.
3. **Prefer Graph over Grep**: Use graph-backed MCP tools instead of raw file searching (`grep`) or reading entire files blindly. The graph provides semantic understanding.
4. **Fallback Gracefully**: If native MCP tools are missing and HTTP MCP access is unavailable, incompatible, or returns empty data, tell the user exactly what failed and what to configure. Then, if needed, read `.genome/graph.json` or `.genome/exports/*.md` before resorting to standard text searches.
5. **Keep Context Fresh**: After modifying code files, remind the user to run `codegenome analyze` or start the live evolution server `codegenome evolve --live` to keep the graph updated.

## Available MCP Capabilities

- **Discovery**: `search_nodes` (find symbols)
- **Relationships**: `get_neighbors` (imports, callers, callees)
- **Architecture**: `get_entry_points`, `get_dead_code`, `get_circular_deps`, `get_god_nodes`
- **Metrics**: `get_complexity`, `get_churn`, `get_graph` (summary statistics)
- **Evolution**: `get_timeline`, `get_changes` (architectural diffs)

## Constraints & Behaviors

- Only read `.genome/graph.json` or `.genome/exports/*.md` directly if native MCP tools and local HTTP MCP transport are unavailable or fail to surface enough context.
- Verify your MCP usage by monitoring tool call success. If native tools are missing, try the configured local HTTP MCP endpoint when possible. If both native and HTTP MCP access fail, politely ask the user to configure their editor's MCP settings to run `codegenome mcp-start` (stdio) or start the server with `codegenome mcp-start --transport http`.
24 changes: 24 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# CodeGenome Knowledge Graph (MCP)

You are operating within a repository analyzed by CodeGenome, an architectural knowledge graph tool. This project contains a `.genome/` directory.

## Core Directives

1. **Mandatory MCP Usage**: When `.genome/watcher.db` exists, you MUST use CodeGenome MCP access for all codebase, architecture, dependency, or symbol queries whenever it is available.
2. **Access Order**: First use native CodeGenome MCP tools exposed in your context. If those tools are missing, you MAY try a local MCP HTTP endpoint such as `http://127.0.0.1:7331/mcp` when the user has started it or configured it. Treat this as MCP transport access, not as an arbitrary application HTTP API.
3. **Prefer Graph over Grep**: Use graph-backed MCP tools instead of raw file searching (`grep`) or reading entire files blindly. The graph provides semantic understanding.
4. **Fallback Gracefully**: If native MCP tools are missing and HTTP MCP access is unavailable, incompatible, or returns empty data, tell the user exactly what failed and what to configure. Then, if needed, read `.genome/graph.json` or `.genome/exports/*.md` before resorting to standard text searches.
5. **Keep Context Fresh**: After modifying code files, remind the user to run `codegenome analyze` or start the live evolution server `codegenome evolve --live` to keep the graph updated.

## Available MCP Capabilities

- **Discovery**: `search_nodes` (find symbols)
- **Relationships**: `get_neighbors` (imports, callers, callees)
- **Architecture**: `get_entry_points`, `get_dead_code`, `get_circular_deps`, `get_god_nodes`
- **Metrics**: `get_complexity`, `get_churn`, `get_graph` (summary statistics)
- **Evolution**: `get_timeline`, `get_changes` (architectural diffs)

## Constraints & Behaviors

- Only read `.genome/graph.json` or `.genome/exports/*.md` directly if native MCP tools and local HTTP MCP transport are unavailable or fail to surface enough context.
- Verify your MCP usage by monitoring tool call success. If native tools are missing, try the configured local HTTP MCP endpoint when possible. If both native and HTTP MCP access fail, politely ask the user to configure their editor's MCP settings to run `codegenome mcp-start` (stdio) or start the server with `codegenome mcp-start --transport http`.
41 changes: 41 additions & 0 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Compatibility

on:
push:
branches: ["main"]
pull_request:

jobs:
install-and-parser-smoke:
name: "${{ matrix.os }} / py${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
python-version: ["3.11", "3.12", "3.13"]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Upgrade build tooling
run: python -m pip install --upgrade pip setuptools wheel

- name: Install package and test dependencies
run: |
python -m pip install .
python -m pip install pytest

- name: Parser test suite
run: python -m pytest tests/test_parser.py -q

- name: CLI smoke test
run: |
codegenome --help
python -c "import codegenome; print(codegenome.__version__)"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ Thumbs.db
.env
.env.*
*.log

*.tex
10 changes: 10 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/codegenome.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions .windsurfrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# CodeGenome Knowledge Graph (MCP)

You are operating within a repository analyzed by CodeGenome, an architectural knowledge graph tool. This project contains a `.genome/` directory.

## Core Directives

1. **Mandatory MCP Usage**: When `.genome/watcher.db` exists, you MUST use CodeGenome MCP access for all codebase, architecture, dependency, or symbol queries whenever it is available.
2. **Access Order**: First use native CodeGenome MCP tools exposed in your context. If those tools are missing, you MAY try a local MCP HTTP endpoint such as `http://127.0.0.1:7331/mcp` when the user has started it or configured it. Treat this as MCP transport access, not as an arbitrary application HTTP API.
3. **Prefer Graph over Grep**: Use graph-backed MCP tools instead of raw file searching (`grep`) or reading entire files blindly. The graph provides semantic understanding.
4. **Fallback Gracefully**: If native MCP tools are missing and HTTP MCP access is unavailable, incompatible, or returns empty data, tell the user exactly what failed and what to configure. Then, if needed, read `.genome/graph.json` or `.genome/exports/*.md` before resorting to standard text searches.
5. **Keep Context Fresh**: After modifying code files, remind the user to run `codegenome analyze` or start the live evolution server `codegenome evolve --live` to keep the graph updated.

## Available MCP Capabilities

- **Discovery**: `search_nodes` (find symbols)
- **Relationships**: `get_neighbors` (imports, callers, callees)
- **Architecture**: `get_entry_points`, `get_dead_code`, `get_circular_deps`, `get_god_nodes`
- **Metrics**: `get_complexity`, `get_churn`, `get_graph` (summary statistics)
- **Evolution**: `get_timeline`, `get_changes` (architectural diffs)

## Constraints & Behaviors

- Only read `.genome/graph.json` or `.genome/exports/*.md` directly if native MCP tools and local HTTP MCP transport are unavailable or fail to surface enough context.
- Verify your MCP usage by monitoring tool call success. If native tools are missing, try the configured local HTTP MCP endpoint when possible. If both native and HTTP MCP access fail, politely ask the user to configure their editor's MCP settings to run `codegenome mcp-start` (stdio) or start the server with `codegenome mcp-start --transport http`.
24 changes: 24 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# CodeGenome Knowledge Graph (MCP)

You are operating within a repository analyzed by CodeGenome, an architectural knowledge graph tool. This project contains a `.genome/` directory.

## Core Directives

1. **Mandatory MCP Usage**: When `.genome/watcher.db` exists, you MUST use CodeGenome MCP access for all codebase, architecture, dependency, or symbol queries whenever it is available.
2. **Access Order**: First use native CodeGenome MCP tools exposed in your context. If those tools are missing, you MAY try a local MCP HTTP endpoint such as `http://127.0.0.1:7331/mcp` when the user has started it or configured it. Treat this as MCP transport access, not as an arbitrary application HTTP API.
3. **Prefer Graph over Grep**: Use graph-backed MCP tools instead of raw file searching (`grep`) or reading entire files blindly. The graph provides semantic understanding.
4. **Fallback Gracefully**: If native MCP tools are missing and HTTP MCP access is unavailable, incompatible, or returns empty data, tell the user exactly what failed and what to configure. Then, if needed, read `.genome/graph.json` or `.genome/exports/*.md` before resorting to standard text searches.
5. **Keep Context Fresh**: After modifying code files, remind the user to run `codegenome analyze` or start the live evolution server `codegenome evolve --live` to keep the graph updated.

## Available MCP Capabilities

- **Discovery**: `search_nodes` (find symbols)
- **Relationships**: `get_neighbors` (imports, callers, callees)
- **Architecture**: `get_entry_points`, `get_dead_code`, `get_circular_deps`, `get_god_nodes`
- **Metrics**: `get_complexity`, `get_churn`, `get_graph` (summary statistics)
- **Evolution**: `get_timeline`, `get_changes` (architectural diffs)

## Constraints & Behaviors

- Only read `.genome/graph.json` or `.genome/exports/*.md` directly if native MCP tools and local HTTP MCP transport are unavailable or fail to surface enough context.
- Verify your MCP usage by monitoring tool call success. If native tools are missing, try the configured local HTTP MCP endpoint when possible. If both native and HTTP MCP access fail, politely ask the user to configure their editor's MCP settings to run `codegenome mcp-start` (stdio) or start the server with `codegenome mcp-start --transport http`.
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Changelog

All notable changes to Codegenome are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.4] - 2026-06-01

### Added

- **Copyable TUI console outputs** — users can now select text in the log panes and press `Ctrl+C` to copy it to the clipboard.
- **LAN live graph sharing** — `codegenome evolve --live --lan` binds HTTP and WebSocket to `0.0.0.0` so other devices on the same network can open the live graph. The CLI prints a shareable LAN URL (for example `http://192.168.1.42:8000/graph.html?live=1`).
- **TUI MCP HTTP mode controls** — the dashboard now includes separate **Start MCP HTTP (Local)** and **Start MCP HTTP (LAN)** buttons so users can intentionally choose localhost-only or LAN exposure.
- **Git-aware file filtering** — the scanner respects workspace `.gitignore` and `.genomeignore` files, including nested ignore files in subdirectories, negation rules (`!pattern`), and anchored patterns.
- **TUI workspace info page** — after setting a workspace, the TUI shows tracked folders, file extensions, and discovered `.gitignore` files before you run analyze or evolve.
- **TUI live-evolve controls** — buttons for **Live Evolve (Local)**, **Live Evolve (LAN)**, and **Quit** to start or stop background processes from the dashboard.
- **Live graph AI chat** — the HTML graph UI includes an in-browser chat panel backed by OpenAI, Google Gemini, Groq, Ollama (local), and Ollama Cloud. API keys are stored under `.genome/ai-chat.json` and never echoed back to the browser.
- **Graph context profiles for AI chat** — selectable context sizes (`minimal`, `small`, `medium`, `full`, `max`) control how much neighborhood data is sent with each prompt.
- **MCP `query_graph` tool** — filter graph nodes by type, file path prefix, or symbol kind.
- **`codegenome mcp-start --transport` and `--port`** — start the MCP server over stdio (default) or HTTP from the modern CLI and TUI.
- **`pathspec` dependency** — powers gitignore-compatible pattern matching.

### Changed

- Default ignore list always excludes `.git/`, `.venv/`, `node_modules/`, `__pycache__/`, `*.pyc`, `.genome/`, and `.genomeignore` in addition to workspace ignore files.
- MCP server refreshes the latest timeline snapshot before tool reads so agents always see current graph data after `analyze` or live evolve.
- `codegenome mcp-start` adds `--lan` for intentional HTTP LAN binding from CLI/TUI workflows.
- Agent instruction templates (`codegenome rules`) now direct agents to use native MCP tools instead of raw HTTP/curl calls.

### Fixed

- MCP tool handlers return richer graph intelligence data (dead code, entry points, complexity, churn) with improved filtering for generated assets and public API symbols.
- Agent rules no longer reference misleading HTTP endpoints that caused agents to `curl` the server instead of using MCP transport.
- MCP server keeps localhost-only behavior by default and now requires an explicit remote HTTP opt-in (`--allow-remote-http`) for non-loopback hosts.
- Release lint blockers (unused imports and test lint violations) were resolved so full lint/test/build gates pass before upload.
- Tree-sitter dependency constraints now support Python 3.12+ installations (including macOS Apple Silicon) while preserving legacy pins for Python 3.11 compatibility (fixes [#1](https://github.com/Ogro-Projukti/codegenome/issues/1)).
- Updated tree-sitter `Parser` initialization to support both legacy and modern (`>=0.23`) API signatures without breaking runtime.

### Documentation

- CLI reference covers `--lan`, TUI live modes, ignore-rule behavior, and MCP transport options.
- README quick start includes the LAN evolve example.
- Release notes and upgrade instructions in `docs/release-0.1.4.md`.

[0.1.4]: https://github.com/Ogro-Projukti/codegenome/releases/tag/v0.1.4
39 changes: 39 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Turja"
given-names: "Md. Fatin Shadab"
orcid: "https://orcid.org/0009-0008-0026-2947"
affiliation: "United International University"
title: "CodeGenome"
version: "0.1.4"
date-released: "2026-05-30"
license: "MIT"
repository-code: "https://github.com/Ogro-Projukti/codegenome"
url: "https://codegenome.pages.dev/"
abstract: >-
CodeGenome is an open-source codebase analyzer that treats software architecture
as a connectome—a map of connections between functions, classes, files, and imports.
It builds a project-level dependency graph, provides a higher-level community view
using Leiden community detection, and features real-time updates via a filesystem observer.
An integrated Model Context Protocol (MCP) server lets AI agents query structural
architectural context directly instead of consuming raw source files.
keywords:
- "software-architecture"
- "code-analysis"
- "dependency-graphs"
- "community-detection"
- "model-context-protocol"
- "ai-assisted-development"
preferred-citation:
type: generic
authors:
- family-names: "Turja"
given-names: "Md. Fatin Shadab"
orcid: "https://orcid.org/0009-0008-0026-2947"
affiliation: "United International University"
title: "CodeGenome: A Real-Time Hierarchical Codebase Connectome Engine for AI-Assisted Development"
year: 2026
medium: "Technical Report"
publisher: "Ogro-Projukti"
url: "https://github.com/Ogro-Projukti/codegenome"
Loading
Loading