Pipeline Overview
The error processing pipeline transforms raw subprocess failures into structured, contextualized data ready for LLM analysis.Stage-by-Stage Breakdown
Stage 1: Error Capture
Location:relational.py:14-20
Splat intentionally runs failing code in a subprocess to capture stderr:
traceback: Full stderr output with stack traceerror_information: String representation of the error object
Stage 2: Stack Trace Parsing
Location:utils.py:47-74
Extracts file paths from Python error traces using regex:
File "([^"]+)"- Matches standard Python traceback format\b(\S+\.py)\b- Matches standalone .py filenames
Stage 3: Dependency Graph Construction
Location:utils.py:130-189
When -r flag is used, builds an adjacency list of file dependencies:
Stage 4: Nth-Degree Traversal
Location:utils.py:108-122
Collects all files related to error files through graph traversal:
Stage 5: Context Packaging
Location:utils.py:81-100
Reads file contents and packages them for LLM consumption:
Pipeline Flow Diagram
Import Resolution Strategy
Location:utils.py:162-177
The system tries multiple paths to resolve imports:
-
Package imports (e.g.,
from foo.bar import baz): -
Relative imports (same directory):
-
Absolute imports (from project root):
Error Handling
The pipeline gracefully handles: 1. Syntax errors in source files:utils.py:152-153.
2. Missing files:
utils.py:71-72.
3. Non-project files:
utils.py:38-39.
Performance Considerations
Time Complexity
| Stage | Complexity | Notes |
|---|---|---|
| Stack parsing | O(n) | n = lines in traceback |
| Graph building | O(V + E) | V = files, E = imports |
| BFS traversal | O(V + E) | Standard graph traversal |
| File reading | O(k × m) | k = files, m = avg file size |
Space Complexity
- Graph storage: O(V + E)
- File contents: O(total file size)
- Visited set: O(V)
Optimization: Deduplication
Files are tracked in sets to prevent redundant processing:Common Edge Cases
Case 1: Circular Dependencies
processed_files set prevents infinite recursion
Case 2: External Dependencies
Case 3: Dynamic Imports
Next Steps
LLM Integration
Learn how parsed data feeds into LLM prompts
Architecture Overview
Return to system overview