refinement of upcoming tracks

This commit is contained in:
2026-03-06 15:41:33 -05:00
parent 3ce6a2ec8a
commit fca40fd8da
24 changed files with 2388 additions and 391 deletions

View File

@@ -1,21 +1,35 @@
# Track Specification: Tool Usage Analytics (tool_usage_analytics_20260306)
## Overview
Analytics panel showing most-used tools, average execution time, and failure rates. Uses existing tool_log_callback data.
Analytics panel showing most-used tools, average execution time, failure rates.
## Architectural Constraints
- **Efficient Aggregation**: Analytics MUST use efficient data structures.
- **Memory Bounds**: History MUST be bounded to prevent growth.
## Current State Audit
### Already Implemented
- **`ai_client.tool_log_callback`**: Called when tool executes
- **`mcp_client.dispatch()`**: Routes tool calls
- **No aggregation or storage**
### Gaps to Fill
- No tool usage tracking
- No execution time tracking
- No failure rate tracking
## Functional Requirements
- **Usage Ranking**: Show most-used tools ranked by count.
- **Avg Time**: Display average execution time per tool.
- **Failure Rate**: Track and display failure percentage per tool.
- **Time Series**: Show usage over time.
- Track tool name, execution time, success/failure
- Aggregate by tool name
- Display ranking by usage count
- Show average time per tool
- Show failure percentage
## Key Integration Points
| File | Purpose |
|-----|---------|
| `src/ai_client.py` | Hook into tool_log_callback |
| `src/gui_2.py` | Analytics panel rendering |
## Acceptance Criteria
- [ ] Tool ranking displayed.
- [ ] Average times accurate.
- [ ] Failure rates tracked.
- [ ] Time series visualization works.
- [ ] Uses existing tool_log_callback.
- [ ] Tool ranking displayed
- [ ] Average times accurate
- [ ] Failure rates tracked
- [ ] 1-space indentation