-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathanalyze-implicit.cjs
More file actions
91 lines (79 loc) · 3.78 KB
/
analyze-implicit.cjs
File metadata and controls
91 lines (79 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
const { createGlobalRegistry } = require('./dist/tools/registry.js');
const registry = createGlobalRegistry(false);
const tools = Array.from(registry.keys()).sort();
console.log('Tool Analysis for Implicit Operation Candidates\n');
console.log('Total tools:', tools.length, '\n');
// Categorize by implicit potential
const metadata = tools.filter(t =>
['list_categories', 'list_tags', 'list_importance_levels', 'list_users', 'list_stages'].includes(t)
);
const userContext = tools.filter(t => t === 'get_current_user');
const get = tools.filter(t => t.startsWith('get_') && !userContext.includes(t));
const list = tools.filter(t => (t.startsWith('list_') || t.startsWith('search_')) && !metadata.includes(t));
const crud = tools.filter(t => t.match(/^(create|update|delete|close|reopen|add|remove)_/));
const other = tools.filter(t =>
!metadata.includes(t) && !userContext.includes(t) &&
!get.includes(t) && !list.includes(t) && !crud.includes(t)
);
console.log('=== IMPLICIT OPERATION CANDIDATES ===\n');
console.log('Metadata queries (already cached, called internally):');
metadata.forEach(t => console.log(' -', t));
console.log(' Status: Used by name resolution (resolveTagIds, resolveCategoryId, etc.)');
console.log(' Recommendation: KEEP - useful for exploring project structure\n');
console.log('User context (called internally):');
userContext.forEach(t => console.log(' -', t));
console.log(' Status: Used by get_my_tasks, assign_work_item_to_me, etc.');
console.log(' Recommendation: KEEP - useful for debugging auth\n');
console.log('=== ALWAYS EXPLICIT (Keep) ===');
console.log('Get operations (' + get.length + '): Query single item by ID');
console.log('List operations (' + list.length + '): Query collections');
console.log('CRUD operations (' + crud.length + '): Mutate state');
console.log('Other utilities (' + other.length + '): Workflows, cache, etc.\n');
// Analyze actual implicit candidates
console.log('=== DEEP ANALYSIS: True Implicit Candidates ===\n');
const implicitCandidates = [
{
tool: 'list_work_item_dependencies',
calledBy: ['get_dependency_tree', 'get_blocking_items'],
reason: 'Raw dependency list - higher-level tools provide better UX',
recommendation: 'CONSIDER removing - use get_dependency_tree instead'
},
{
tool: 'assign_work_item',
calledBy: ['update_work_items'],
reason: 'Assigning users is just update_work_items with assignedUserIds',
recommendation: 'CONSIDER removing - redundant with update_work_items'
},
{
tool: 'unassign_work_item',
calledBy: ['update_work_items'],
reason: 'Unassigning is just update_work_items with empty assignedUserIds',
recommendation: 'CONSIDER removing - redundant with update_work_items'
},
{
tool: 'assign_work_item_to_me',
calledBy: ['Workflow shortcut'],
reason: 'Convenience wrapper - calls get_current_user + update_work_items',
recommendation: 'KEEP - useful shortcut, clear user intent'
},
{
tool: 'upload_attachment',
calledBy: ['Explicit file operations'],
reason: 'File upload is explicit operation',
recommendation: 'KEEP - cannot be implicit'
}
];
implicitCandidates.forEach(c => {
console.log(`Tool: ${c.tool}`);
console.log(` Called by: ${Array.isArray(c.calledBy) ? c.calledBy.join(', ') : c.calledBy}`);
console.log(` Reason: ${c.reason}`);
console.log(` Recommendation: ${c.recommendation}`);
console.log('');
});
console.log('=== SUMMARY ===');
console.log('Strong candidates for removal (3 tools):');
console.log(' 1. assign_work_item → update_work_items({ assignedUserIds: [...] })');
console.log(' 2. unassign_work_item → update_work_items({ assignedUserIds: [] })');
console.log(' 3. list_work_item_dependencies → use get_dependency_tree instead');
console.log('');
console.log('After removal: 90 → 87 tools (-3)');