Skip to content

feat(stacktrace): smart stack trace mapping for 4 languages#29

Merged
lexasub merged 1 commit intomainfrom
feat/stacktrace-analysis
Mar 12, 2026
Merged

feat(stacktrace): smart stack trace mapping for 4 languages#29
lexasub merged 1 commit intomainfrom
feat/stacktrace-analysis

Conversation

@lexasub
Copy link
Owner

@lexasub lexasub commented Mar 11, 2026

Description

Add stack trace analysis feature for Python, C++, Java, and Rust with AST mapping and LLM-powered root cause analysis.

This PR introduces:

  • StackTraceService — service for parsing and analyzing stack traces from 4 languages
  • AST mapping — maps stack trace frames to code entities with context snippets
  • Root cause analysis — LLM-based analysis with suggested fixes
  • Similar issues detection — finds similar patterns in the codebase
  • CLI commandast-rag analyze-stacktrace for manual analysis
  • MCP toolanalyze_stacktrace for agent workflows

Related Issue

Fixes #(issue number)

Type of Change

  • New feature (non-breaking change that adds functionality)

Checklist

  • My code follows the code style of this project
  • I have added tests that prove my fix/feature works
  • All new and existing tests passed (pytest tests/ -v)
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Testing

# Unit tests
pytest tests/test_stack_trace.py -v

# CLI test — analyze from file
ast-rag analyze-stacktrace error.log

# CLI test — analyze from stdin
python test.py 2>&1 | ast-rag analyze-stacktrace

# CLI test — JSON output
ast-rag analyze-stacktrace error.log -o json

# CLI test — skip AST mapping (faster)
ast-rag analyze-stacktrace error.log --no-ast-mapping

# MCP integration (via MCP client)
# Tool: analyze_stacktrace

- Add StackTraceService with root cause analysis
- Parsers for Python, C++, Java, Rust
- Auto-detect language from stack trace format
- Map frames to AST nodes with code snippets
- Add CLI command: ast-rag analyze-stacktrace
- Add MCP tool: analyze_stacktrace
- Add 34 unit tests
- Remove summarize command (moved to separate branch)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@github-project-automation github-project-automation bot moved this to Backlog in raged kanban Mar 11, 2026
@lexasub lexasub marked this pull request as ready for review March 12, 2026 22:07
@lexasub lexasub merged commit b4966aa into main Mar 12, 2026
1 check failed
@github-project-automation github-project-automation bot moved this from Backlog to Done in raged kanban Mar 12, 2026
@lexasub lexasub deleted the feat/stacktrace-analysis branch March 12, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant