Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
7522aef
refactor: Implement Python src-layout directory structure
claude Nov 6, 2025
961f59c
fix: Update version file path in .bumpversion.toml
claude Nov 6, 2025
c9f8c24
chore: organize scripts and cleanup project structure
claude Nov 6, 2025
7c9806c
chore: remove scripts/README.md
claude Nov 6, 2025
a995025
refactor: Remove all backward compatibility code and fully adopt src-…
claude Nov 6, 2025
fd5aec4
docs: Update all documentation for src-layout migration (v0.8.0)
claude Nov 6, 2025
119ecf4
docs: add comprehensive architecture overview and REST API usage guide
royisme Nov 7, 2025
393317c
chore: configure documentation for Cloudflare path-based routing
royisme Nov 7, 2025
d10cfbf
Revert "chore: configure documentation for Cloudflare path-based rout…
royisme Nov 7, 2025
abe932b
chore: update docs URL to vantagecraft.dev path routing
royisme Nov 7, 2025
82e2ada
docs: update mkdocs.yml
royisme Nov 7, 2025
74a0198
fix: Update all build script and path references for src-layout
claude Nov 7, 2025
84b8d68
fix: Update all test import paths for src-layout migration
claude Nov 7, 2025
d03b6bd
fix: Remove eager imports from services package to avoid dependency i…
claude Nov 7, 2025
08eba8d
fix: Update dynamic imports in test_mcp_integration.py
claude Nov 7, 2025
3465013
fix: Replace src.codebase_rag imports with codebase_rag imports insid…
claude Nov 7, 2025
2a9c148
Initial plan
Copilot Nov 7, 2025
f94e642
fix: Update import paths to use new subpackage structure and fix synt…
Copilot Nov 7, 2025
f79bd0c
Merge pull request #22 from royisme/copilot/sub-pr-21
royisme Nov 7, 2025
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
2 changes: 1 addition & 1 deletion .bumpversion.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "src/__version__.py"
filename = "src/codebase_rag/__version__.py"
search = '__version__ = "{current_version}"'
replace = '__version__ = "{new_version}"'

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
echo "pyproject.toml version: $PROJECT_VERSION"

# Get version from __version__.py
VERSION_PY=$(grep '__version__ = ' src/__version__.py | cut -d'"' -f2)
VERSION_PY=$(grep '__version__ = ' src/codebase_rag/__version__.py | cut -d'"' -f2)
echo "__version__.py version: $VERSION_PY"

# Validate Python version file
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
bun-version: latest

- name: Build Frontend
run: ./build-frontend.sh
run: ./scripts/build-frontend.sh

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
bun-version: latest

- name: Build Frontend
run: ./build-frontend.sh
run: ./scripts/build-frontend.sh

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
bun-version: latest

- name: Build Frontend
run: ./build-frontend.sh
run: ./scripts/build-frontend.sh

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ jobs:
- name: Notify deployment
run: |
echo "📚 Documentation deployed successfully!"
echo "🔗 URL: https://code-graph.vantagecraft.dev"
echo "🔗 URL: https://vantagecraft.dev/docs/code-graph/"
15 changes: 6 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \

# Copy application source code for local package installation
COPY pyproject.toml README.md ./
COPY api ./api
COPY core ./core
COPY services ./services
COPY mcp_tools ./mcp_tools
COPY src ./src
COPY *.py ./

# Install local package (without dependencies, already installed)
Expand Down Expand Up @@ -95,15 +92,15 @@ COPY --from=builder /usr/local/bin/uvicorn /usr/local/bin/
COPY --chown=appuser:appuser . .

# Copy pre-built frontend (if exists)
# Run ./build-frontend.sh before docker build to generate frontend/dist
# Run ./scripts/build-frontend.sh before docker build to generate frontend/dist
# If frontend/dist doesn't exist, the app will run as API-only (no web UI)
RUN if [ -d frontend/dist ]; then \
mkdir -p static && \
cp -r frontend/dist/* static/ && \
echo "✅ Frontend copied to static/"; \
else \
echo "⚠️ No frontend/dist found - running as API-only"; \
echo " Run ./build-frontend.sh to build frontend"; \
echo " Run ./scripts/build-frontend.sh to build frontend"; \
fi

# Switch to non-root user
Expand All @@ -129,6 +126,6 @@ EXPOSE 8000 8080
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8080/api/v1/health || exit 1

# Default command - starts HTTP API (not MCP)
# For MCP service, run on host: python start_mcp.py
CMD ["python", "start.py"]
# Default command - starts both MCP and Web services (dual-port mode)
# Alternative: python -m codebase_rag --mcp (MCP only) or --web (Web only)
CMD ["python", "-m", "codebase_rag"]
4 changes: 2 additions & 2 deletions docker/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Base Docker image for Code Graph Knowledge System
#
# IMPORTANT: Frontend MUST be pre-built before docker build:
# ./build-frontend.sh
# ./scripts/build-frontend.sh
#
# This Dockerfile expects frontend/dist/ to exist

Expand Down Expand Up @@ -53,7 +53,7 @@ COPY --chown=appuser:appuser services ./services
COPY --chown=appuser:appuser mcp_tools ./mcp_tools
COPY --chown=appuser:appuser start.py start_mcp.py mcp_server.py config.py main.py ./

# Copy pre-built frontend (MUST exist - run ./build-frontend.sh first)
# Copy pre-built frontend (MUST exist - run ./scripts/build-frontend.sh first)
COPY --chown=appuser:appuser frontend/dist ./static

USER appuser
Expand Down
12 changes: 4 additions & 8 deletions docker/Dockerfile.full
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Full Docker image - All features (LLM + Embedding required)
#
# IMPORTANT: Frontend MUST be pre-built before docker build:
# ./build-frontend.sh
# ./scripts/build-frontend.sh
#
# This Dockerfile expects frontend/dist/ to exist

Expand Down Expand Up @@ -48,13 +48,9 @@ COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/pytho
COPY --from=builder /usr/local/bin/uvicorn /usr/local/bin/

# Copy application code
COPY --chown=appuser:appuser api ./api
COPY --chown=appuser:appuser core ./core
COPY --chown=appuser:appuser services ./services
COPY --chown=appuser:appuser mcp_tools ./mcp_tools
COPY --chown=appuser:appuser start.py start_mcp.py mcp_server.py config.py main.py ./
COPY --chown=appuser:appuser src ./src

# Copy pre-built frontend (MUST exist - run ./build-frontend.sh first)
# Copy pre-built frontend (MUST exist - run ./scripts/build-frontend.sh first)
COPY --chown=appuser:appuser frontend/dist ./static

USER appuser
Expand All @@ -67,4 +63,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8080/api/v1/health || exit 1

# Start application (dual-port mode)
CMD ["python", "main.py"]
CMD ["python", "-m", "codebase_rag"]
12 changes: 4 additions & 8 deletions docker/Dockerfile.minimal
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Minimal Docker image - Code Graph only (No LLM required)
#
# IMPORTANT: Frontend MUST be pre-built before docker build:
# ./build-frontend.sh
# ./scripts/build-frontend.sh
#
# This Dockerfile expects frontend/dist/ to exist

Expand Down Expand Up @@ -48,13 +48,9 @@ COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/pytho
COPY --from=builder /usr/local/bin/uvicorn /usr/local/bin/

# Copy application code
COPY --chown=appuser:appuser api ./api
COPY --chown=appuser:appuser core ./core
COPY --chown=appuser:appuser services ./services
COPY --chown=appuser:appuser mcp_tools ./mcp_tools
COPY --chown=appuser:appuser start.py start_mcp.py mcp_server.py config.py main.py ./
COPY --chown=appuser:appuser src ./src

# Copy pre-built frontend (MUST exist - run ./build-frontend.sh first)
# Copy pre-built frontend (MUST exist - run ./scripts/build-frontend.sh first)
COPY --chown=appuser:appuser frontend/dist ./static

USER appuser
Expand All @@ -67,4 +63,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8080/api/v1/health || exit 1

# Start application (dual-port mode)
CMD ["python", "main.py"]
CMD ["python", "-m", "codebase_rag"]
12 changes: 4 additions & 8 deletions docker/Dockerfile.standard
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Standard Docker image - Code Graph + Memory Store (Embedding required)
#
# IMPORTANT: Frontend MUST be pre-built before docker build:
# ./build-frontend.sh
# ./scripts/build-frontend.sh
#
# This Dockerfile expects frontend/dist/ to exist

Expand Down Expand Up @@ -48,13 +48,9 @@ COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/pytho
COPY --from=builder /usr/local/bin/uvicorn /usr/local/bin/

# Copy application code
COPY --chown=appuser:appuser api ./api
COPY --chown=appuser:appuser core ./core
COPY --chown=appuser:appuser services ./services
COPY --chown=appuser:appuser mcp_tools ./mcp_tools
COPY --chown=appuser:appuser start.py start_mcp.py mcp_server.py config.py main.py ./
COPY --chown=appuser:appuser src ./src

# Copy pre-built frontend (MUST exist - run ./build-frontend.sh first)
# Copy pre-built frontend (MUST exist - run ./scripts/build-frontend.sh first)
COPY --chown=appuser:appuser frontend/dist ./static

USER appuser
Expand All @@ -67,4 +63,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8080/api/v1/health || exit 1

# Start application (dual-port mode)
CMD ["python", "main.py"]
CMD ["python", "-m", "codebase_rag"]
1 change: 0 additions & 1 deletion docs/CNAME

This file was deleted.

2 changes: 1 addition & 1 deletion docs/api/mcp-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The MCP server provides AI assistants (like Claude Desktop, VS Code with MCP, et

```bash
# Using start script
python start_mcp.py
python -m codebase_rag --mcp

# Using uv (recommended)
uv run mcp_client
Expand Down
48 changes: 24 additions & 24 deletions docs/api/python-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ OPENROUTER_MODEL=anthropic/claude-3-opus
### Import Services

```python
from services.neo4j_knowledge_service import Neo4jKnowledgeService
from services.memory_store import MemoryStore, memory_store
from services.graph_service import Neo4jGraphService, graph_service
from services.code_ingestor import CodeIngestor, get_code_ingestor
from services.task_queue import TaskQueue, task_queue
from config import settings
from src.codebase_rag.services.knowledge import Neo4jKnowledgeService
from src.codebase_rag.services.memory import MemoryStore, memory_store
from src.codebase_rag.services.code import Neo4jGraphService, graph_service
from src.codebase_rag.services.code import CodeIngestor, get_code_ingestor
from src.codebase_rag.services.tasks import TaskQueue, task_queue
from src.codebase_rag.config import settings
```

### Service Initialization Pattern
Expand Down Expand Up @@ -148,7 +148,7 @@ Primary service for knowledge graph operations with LlamaIndex integration.
### Initialization

```python
from services.neo4j_knowledge_service import Neo4jKnowledgeService
from src.codebase_rag.services.knowledge import Neo4jKnowledgeService

# Create instance
knowledge_service = Neo4jKnowledgeService()
Expand Down Expand Up @@ -405,7 +405,7 @@ Project memory persistence for AI agents.
### Initialization

```python
from services.memory_store import memory_store
from src.codebase_rag.services.memory import memory_store

# Initialize (async)
await memory_store.initialize()
Expand Down Expand Up @@ -627,7 +627,7 @@ Low-level Neo4j graph operations.
### Initialization

```python
from services.graph_service import graph_service
from src.codebase_rag.services.code import graph_service

# Connect to Neo4j
await graph_service.connect()
Expand Down Expand Up @@ -791,8 +791,8 @@ Repository code ingestion service.
### Initialization

```python
from services.code_ingestor import get_code_ingestor
from services.graph_service import graph_service
from src.codebase_rag.services.code import get_code_ingestor
from src.codebase_rag.services.code import graph_service

# Initialize graph service first
await graph_service.connect()
Expand Down Expand Up @@ -882,7 +882,7 @@ Asynchronous task queue management.
### Initialization

```python
from services.task_queue import task_queue, TaskStatus
from src.codebase_rag.services.tasks import task_queue, TaskStatus

# Start task queue
await task_queue.start()
Expand Down Expand Up @@ -921,7 +921,7 @@ async def submit_task(

**Example**:
```python
from services.task_processors import process_document_task
from src.codebase_rag.services.tasks import process_document_task

task_id = await task_queue.submit_task(
task_func=process_document_task,
Expand Down Expand Up @@ -1005,7 +1005,7 @@ def get_queue_stats() -> Dict[str, int]:
Access configuration settings.

```python
from config import settings
from src.codebase_rag.config import settings

# Neo4j settings
print(settings.neo4j_uri)
Expand Down Expand Up @@ -1034,7 +1034,7 @@ print(settings.top_k)
### Get Current Model Info

```python
from config import get_current_model_info
from src.codebase_rag.config import get_current_model_info

model_info = get_current_model_info()
print(f"LLM: {model_info['llm']}")
Expand All @@ -1049,7 +1049,7 @@ print(f"Embedding: {model_info['embedding']}")

```python
import asyncio
from services.neo4j_knowledge_service import Neo4jKnowledgeService
from src.codebase_rag.services.knowledge import Neo4jKnowledgeService

async def main():
# Initialize service
Expand Down Expand Up @@ -1087,7 +1087,7 @@ asyncio.run(main())

```python
import asyncio
from services.memory_store import memory_store
from src.codebase_rag.services.memory import memory_store

async def main():
# Initialize
Expand Down Expand Up @@ -1128,9 +1128,9 @@ asyncio.run(main())

```python
import asyncio
from services.graph_service import graph_service
from services.code_ingestor import get_code_ingestor
from services.git_utils import git_utils
from src.codebase_rag.services.code import graph_service
from src.codebase_rag.services.code import get_code_ingestor
from src.codebase_rag.services.git_utils import git_utils

async def main():
# Connect to Neo4j
Expand Down Expand Up @@ -1178,8 +1178,8 @@ asyncio.run(main())

```python
import asyncio
from services.task_queue import task_queue, TaskStatus
from services.task_processors import process_document_task
from src.codebase_rag.services.tasks import task_queue, TaskStatus
from src.codebase_rag.services.tasks import process_document_task

async def main():
# Start task queue
Expand Down Expand Up @@ -1318,7 +1318,7 @@ result = await session.run("MATCH (n) RETURN n LIMIT 10")
### 4. Set Appropriate Timeouts

```python
from config import settings
from src.codebase_rag.config import settings

# Adjust timeouts for large operations
settings.operation_timeout = 300 # 5 minutes
Expand Down Expand Up @@ -1439,7 +1439,7 @@ for item in items:

```python
# 60x faster for updates
from services.git_utils import git_utils
from src.codebase_rag.services.git_utils import git_utils

if git_utils.is_git_repo(repo_path):
changed_files = git_utils.get_changed_files(repo_path)
Expand Down
4 changes: 2 additions & 2 deletions docs/architecture/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -1482,7 +1482,7 @@ Critical for avoiding circular dependencies:

```python
# 1. Configuration (no dependencies)
from config import settings
from src.codebase_rag.config import settings

# 2. Storage layer (no app dependencies)
neo4j_connection = Neo4jGraphStore(...)
Expand Down Expand Up @@ -1555,7 +1555,7 @@ class Settings(BaseSettings):

Components access configuration:
```python
from config import settings
from src.codebase_rag.config import settings

# Use in service
self.timeout = settings.operation_timeout
Expand Down
Loading
Loading