localize_fault
Rank suspect Python functions from a traceback or pytest failure log using stack-trace, call-graph, and token-overlap analysis, returning minimal line-numbered AST slices within a token budget.
Instructions
Rank suspect Python functions/methods from a traceback or pytest failure log using hybrid Stack-Trace + AST Call-Graph + BM25 token overlap, returning minimal line-numbered AST slices within a strict token budget.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"traceback_text": "<traceback_text>"
},
"name": "localize_fault"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_k | No | Maximum number of suspect functions to return. | |
| sources | No | Optional in-memory {rel_path: source_code} map instead of workspace_root. | |
| token_budget | No | Maximum token budget across returned AST code slices. | |
| include_tests | No | Whether to include test_* functions in ranked candidates. | |
| traceback_text | Yes | Raw Python traceback or pytest failure output. | |
| workspace_root | No | Path to the workspace directory containing Python files. |