Overview
Splat leverages Git repository information to provide context-aware debugging. By understanding.gitignore patterns, repository boundaries, and project structure, Splat focuses analysis on relevant code while respecting your project’s organization.
Project Root Detection
Finding the Repository Root
Splat identifies the project root to establish boundaries:relational.py
utils/utils.py
The project root is determined by the current working directory when Splat is invoked. This should typically be your Git repository root.
Why Root Detection Matters
Boundary Enforcement
Boundary Enforcement
Prevents Splat from analyzing system Python files or dependencies in virtual environments.
Path Resolution
Path Resolution
Enables correct resolution of absolute imports relative to project structure.
Context Scoping
Context Scoping
Ensures only relevant project files are sent to the LLM, reducing token usage.
File Filtering
Project File Validation
Before processing any file, Splat validates it’s within project bounds:utils/utils.py
Path Comparison
Theos.path.commonpath() function determines if a file is within the project:
.gitignore Integration (Future Enhancement)
The current codebase includes framework detection and language identification logic (see
detect_framework_or_language in utils/utils.py), suggesting future plans for .gitignore integration and smarter file filtering.Planned Features
Based on the codebase structure, future versions may include:Current Filtering Approach
While.gitignore integration isn’t implemented yet, Splat currently:
- Only processes files mentioned in error traces (basic mode)
- Only processes files imported by error trace files (relational mode with
-r) - Validates all files exist on the filesystem before inclusion
- Excludes files outside the project root
Repository Structure Analysis
Framework Detection
Splat includes comprehensive framework detection logic:utils/utils.py
While this function is currently marked as “NOT IMPLEMENTED” in the source, the infrastructure exists for framework-aware context collection in future versions.
Supported Frameworks
The detection system recognizes:Python
Django, Flask, FastAPI
JavaScript
Next.js, React, Vue, Angular, Express
Compiled
Go, Rust, Java, Kotlin, Scala
Dynamic
Ruby on Rails, Laravel, .NET
Functional
Haskell, Scala, Julia
Scripting
Perl, Lua, R
Detection Strategy
The framework detector uses three strategies:- Command Matching
- File Presence
- Extension Analysis
npm run dev → Next.jsContext Packaging
Repopack Integration
Splat uses a “mock repopack” function to bundle context:utils/utils.py
The function is named
run_mock_repopack suggesting it may integrate with the actual Repopack tool in the future for more sophisticated context packaging.Context Format
Files are concatenated with clear delimiters:Repository Metadata (Future)
Potential Git Integration
Future versions could leverage Git for:Recent Changes
Show files modified in recent commits to highlight potential error sources
Blame Analysis
Identify when and by whom error-prone code was introduced
Branch Context
Understand if errors are specific to certain branches
Commit Messages
Use commit history to understand code intent and changes
Example Implementation
Example: Git blame integration
This is a conceptual example and not currently implemented in Splat.
Working Directory Awareness
Path Resolution
Splat handles both absolute and relative paths:relational.py
Relative Path Handling
Error traces often contain relative paths:Best Practices
Run from Repository Root
Run from Repository Root
Always invoke Splat from your Git repository root to ensure correct path resolution:Not:
Use Absolute Paths in Commands
Use Absolute Paths in Commands
When possible, use absolute paths in your entrypoint:This eliminates ambiguity in path resolution.
Check .gitignore
Check .gitignore
Ensure your
.gitignore excludes files you don’t want analyzed (once this feature is implemented):Environment Isolation
Virtual Environment Handling
Splat automatically excludes virtual environment files:Workaround
To exclude venv files now, ensure your virtual environment is outside your project:Next Steps
How It Works
See how Git awareness fits into the overall architecture
Dependency Graphs
Learn how project structure affects dependency mapping