add trace hints and skill integration (PR-TRACE-3)#248
Conversation
- Extend generate_hints with output_kind="trace" and four hint templates (budget hit, pruned drilldown, cross-service boundary, high fanout trace) - Add trace recommendation to neighbors/describe high-fanout hints - Update SKILL.md preamble, decision tree, and tool reference with trace - Add "trace" to StructuredHint.tool Literal in mcp_v2.py - Add 5 new tests (4 hint unit tests + 1 integration test) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Review: PR-TRACE-3 — trace hints and skill integrationOverall this is clean and well-tested. Approve with a few minor suggestions: What looks good
Suggestions (non-blocking)1. Duplicate high-fanout trace hint in 2. "prune_roles": list(payload.get("prune_roles") or ["DTO", "EXCEPTION", "UTILITY"]),3. Cross-service advisory references 4. 5. Integration test |
- Extract _high_fanout_trace_hint() helper (review point 1) - Use user's prune_roles in budget-hit hint if supplied (point 2) - Include from_id in cross-service hint reason (point 3) - Split stats guard so cross-service hints work without stats (point 4) - Add clarifying comment for fan_out_cap=0 in integration test (point 5) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* add trace hints and skill integration (PR-TRACE-3) - Extend generate_hints with output_kind="trace" and four hint templates (budget hit, pruned drilldown, cross-service boundary, high fanout trace) - Add trace recommendation to neighbors/describe high-fanout hints - Update SKILL.md preamble, decision tree, and tool reference with trace - Add "trace" to StructuredHint.tool Literal in mcp_v2.py - Add 5 new tests (4 hint unit tests + 1 integration test) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * address PR-TRACE-3 review feedback - Extract _high_fanout_trace_hint() helper (review point 1) - Use user's prune_roles in budget-hit hint if supplied (point 2) - Include from_id in cross-service hint reason (point 3) - Split stats guard so cross-service hints work without stats (point 4) - Add clarifying comment for fan_out_cap=0 in integration test (point 5) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Summary
generate_hintswithoutput_kind="trace"supporting four hint templates: budget hit, pruned drilldown, cross-service boundary, and high fanout trace recommendationtracerecommendation toneighbors/describehigh-fanout hint paths (when CALLS ≥ 10)skills/explore-codebase/SKILL.mdwith trace Q-class, four new decision tree rows, and trace tool reference section"trace"toStructuredHint.toolLiteral inmcp_v2.py(one-line fix required for trace hints to flow through the hint → output pipeline)Changes
mcp_hints.py_trace_structured_hints()with budget hit, pruned drilldown, cross-service boundary, and high fanout trace hints. New labels:LABEL_BUDGET_HIT,LABEL_PRUNED_DRILLDOWN,LABEL_CROSS_SERVICE_BOUNDARY,LABEL_HIGH_FANOUT_TRACE. Trace recommendation added to neighbors and describe high-fanout paths.mcp_v2.py"trace"toStructuredHint.toolLiteral (line 181)skills/explore-codebase/SKILL.mdtraceQ-class), 4 new decision tree rows,tracetool reference sectiontests/test_mcp_hints.pytest_hint_trace_budget_hit,test_hint_trace_pruned_edges,test_hint_trace_cross_service_boundary,test_hint_neighbors_high_fanout_mentions_tracetests/test_mcp_trace.pytest_trace_bank_chat_cross_service_http_flowTest plan
tests/test_mcp_hints.py+tests/test_mcp_trace.py).venv/bin/ruff check .clean.venv/bin/python -m pytest tests -vgreen (647 passed, 8 skipped)mcp_trace.py,kuzu_queries.py,server.py,build_ast_graph.pygit diff experimental -- mcp_trace.pyis empty🤖 Generated with Claude Code