feat(telemetry): Integrate AI usage telemetry into update-tasks
This commit applies the standard telemetry pattern to the update-tasks command and its corresponding MCP tool.
Key Changes:
1. Core Logic (scripts/modules/task-manager/update-tasks.js):
- The call to generateTextService now includes commandName: 'update-tasks' and outputType.
- The full response { mainResult, telemetryData } is captured.
- mainResult (the AI-generated text) is used for parsing the updated task JSON.
- If running in CLI mode (outputFormat === 'text'), displayAiUsageSummary is called with the telemetryData.
- The function now returns { success: true, updatedTasks: ..., telemetryData: ... }.
2. Direct Function (mcp-server/src/core/direct-functions/update-tasks.js):
- The call to the core updateTasks function now passes the necessary context for telemetry (commandName, outputType).
- The successful response object now correctly extracts coreResult.telemetryData and includes it in the data.telemetryData field returned to the MCP client.
This commit is contained in:
@@ -110,7 +110,7 @@ export async function updateTaskByIdDirect(args, log, context = {}) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Execute core updateTaskById function with proper parameters
|
// Execute core updateTaskById function with proper parameters
|
||||||
const updatedTask = await updateTaskById(
|
const coreResult = await updateTaskById(
|
||||||
tasksPath,
|
tasksPath,
|
||||||
taskId,
|
taskId,
|
||||||
prompt,
|
prompt,
|
||||||
@@ -118,19 +118,26 @@ export async function updateTaskByIdDirect(args, log, context = {}) {
|
|||||||
{
|
{
|
||||||
mcpLog: logWrapper,
|
mcpLog: logWrapper,
|
||||||
session,
|
session,
|
||||||
projectRoot
|
projectRoot,
|
||||||
|
commandName: 'update-task',
|
||||||
|
outputType: 'mcp'
|
||||||
},
|
},
|
||||||
'json'
|
'json'
|
||||||
);
|
);
|
||||||
|
|
||||||
// Check if the core function indicated the task wasn't updated (e.g., status was 'done')
|
// Check if the core function returned null or an object without success
|
||||||
if (updatedTask === null) {
|
if (!coreResult || coreResult.updatedTask === null) {
|
||||||
// Core function logs the reason, just return success with info
|
// Core function logs the reason, just return success with info
|
||||||
const message = `Task ${taskId} was not updated (likely already completed).`;
|
const message = `Task ${taskId} was not updated (likely already completed).`;
|
||||||
logWrapper.info(message);
|
logWrapper.info(message);
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
data: { message: message, taskId: taskId, updated: false },
|
data: {
|
||||||
|
message: message,
|
||||||
|
taskId: taskId,
|
||||||
|
updated: false,
|
||||||
|
telemetryData: coreResult?.telemetryData
|
||||||
|
},
|
||||||
fromCache: false
|
fromCache: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -146,7 +153,8 @@ export async function updateTaskByIdDirect(args, log, context = {}) {
|
|||||||
tasksPath: tasksPath,
|
tasksPath: tasksPath,
|
||||||
useResearch: useResearch,
|
useResearch: useResearch,
|
||||||
updated: true,
|
updated: true,
|
||||||
updatedTask: updatedTask
|
updatedTask: coreResult.updatedTask,
|
||||||
|
telemetryData: coreResult.telemetryData
|
||||||
},
|
},
|
||||||
fromCache: false
|
fromCache: false
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -373,7 +373,9 @@ async function expandTask(
|
|||||||
);
|
);
|
||||||
if (taskIndex === -1) throw new Error(`Task ${taskId} not found`);
|
if (taskIndex === -1) throw new Error(`Task ${taskId} not found`);
|
||||||
const task = data.tasks[taskIndex];
|
const task = data.tasks[taskIndex];
|
||||||
logger.info(`Expanding task ${taskId}: ${task.title}`);
|
logger.info(
|
||||||
|
`Expanding task ${taskId}: ${task.title}${useResearch ? ' with research' : ''}`
|
||||||
|
);
|
||||||
// --- End Task Loading/Filtering ---
|
// --- End Task Loading/Filtering ---
|
||||||
|
|
||||||
// --- Handle Force Flag: Clear existing subtasks if force=true ---
|
// --- Handle Force Flag: Clear existing subtasks if force=true ---
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ import {
|
|||||||
import {
|
import {
|
||||||
getStatusWithColor,
|
getStatusWithColor,
|
||||||
startLoadingIndicator,
|
startLoadingIndicator,
|
||||||
stopLoadingIndicator
|
stopLoadingIndicator,
|
||||||
|
displayAiUsageSummary
|
||||||
} from '../ui.js';
|
} from '../ui.js';
|
||||||
|
|
||||||
import { generateTextService } from '../ai-services-unified.js';
|
import { generateTextService } from '../ai-services-unified.js';
|
||||||
@@ -94,10 +95,6 @@ function parseUpdatedTaskFromText(text, expectedTaskId, logFn, isMCP) {
|
|||||||
// It worked! Use this as the primary cleaned response.
|
// It worked! Use this as the primary cleaned response.
|
||||||
cleanedResponse = potentialJsonFromBraces;
|
cleanedResponse = potentialJsonFromBraces;
|
||||||
parseMethodUsed = 'braces';
|
parseMethodUsed = 'braces';
|
||||||
report(
|
|
||||||
'info',
|
|
||||||
'Successfully parsed JSON content extracted between first { and last }.'
|
|
||||||
);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
report(
|
report(
|
||||||
'info',
|
'info',
|
||||||
@@ -376,27 +373,125 @@ The changes described in the prompt should be thoughtfully applied to make the t
|
|||||||
const userPrompt = `Here is the task to update:\n${taskDataString}\n\nPlease update this task based on the following new context:\n${prompt}\n\nIMPORTANT: In the task JSON above, any subtasks with "status": "done" or "status": "completed" should be preserved exactly as is. Build your changes around these completed items.\n\nReturn only the updated task as a valid JSON object.`;
|
const userPrompt = `Here is the task to update:\n${taskDataString}\n\nPlease update this task based on the following new context:\n${prompt}\n\nIMPORTANT: In the task JSON above, any subtasks with "status": "done" or "status": "completed" should be preserved exactly as is. Build your changes around these completed items.\n\nReturn only the updated task as a valid JSON object.`;
|
||||||
// --- End Build Prompts ---
|
// --- End Build Prompts ---
|
||||||
|
|
||||||
let updatedTask;
|
|
||||||
let loadingIndicator = null;
|
let loadingIndicator = null;
|
||||||
if (outputFormat === 'text') {
|
let aiServiceResponse = null;
|
||||||
|
|
||||||
|
if (!isMCP && outputFormat === 'text') {
|
||||||
loadingIndicator = startLoadingIndicator(
|
loadingIndicator = startLoadingIndicator(
|
||||||
useResearch ? 'Updating task with research...\n' : 'Updating task...\n'
|
useResearch ? 'Updating task with research...\n' : 'Updating task...\n'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let responseText = '';
|
|
||||||
try {
|
try {
|
||||||
// --- Call Unified AI Service (generateTextService) ---
|
const serviceRole = useResearch ? 'research' : 'main';
|
||||||
const role = useResearch ? 'research' : 'main';
|
aiServiceResponse = await generateTextService({
|
||||||
|
role: serviceRole,
|
||||||
responseText = await generateTextService({
|
session: session,
|
||||||
prompt: userPrompt,
|
projectRoot: projectRoot,
|
||||||
systemPrompt: systemPrompt,
|
systemPrompt: systemPrompt,
|
||||||
role,
|
prompt: userPrompt,
|
||||||
session,
|
commandName: 'update-task',
|
||||||
projectRoot
|
outputType: isMCP ? 'mcp' : 'cli'
|
||||||
});
|
});
|
||||||
// --- End AI Service Call ---
|
|
||||||
|
if (loadingIndicator)
|
||||||
|
stopLoadingIndicator(loadingIndicator, 'AI update complete.');
|
||||||
|
|
||||||
|
// Use mainResult (text) for parsing
|
||||||
|
const updatedTask = parseUpdatedTaskFromText(
|
||||||
|
aiServiceResponse.mainResult,
|
||||||
|
taskId,
|
||||||
|
logFn,
|
||||||
|
isMCP
|
||||||
|
);
|
||||||
|
|
||||||
|
// --- Task Validation/Correction (Keep existing logic) ---
|
||||||
|
if (!updatedTask || typeof updatedTask !== 'object')
|
||||||
|
throw new Error('Received invalid task object from AI.');
|
||||||
|
if (!updatedTask.title || !updatedTask.description)
|
||||||
|
throw new Error('Updated task missing required fields.');
|
||||||
|
// Preserve ID if AI changed it
|
||||||
|
if (updatedTask.id !== taskId) {
|
||||||
|
report('warn', `AI changed task ID. Restoring original ID ${taskId}.`);
|
||||||
|
updatedTask.id = taskId;
|
||||||
|
}
|
||||||
|
// Preserve status if AI changed it
|
||||||
|
if (
|
||||||
|
updatedTask.status !== taskToUpdate.status &&
|
||||||
|
!prompt.toLowerCase().includes('status')
|
||||||
|
) {
|
||||||
|
report(
|
||||||
|
'warn',
|
||||||
|
`AI changed task status. Restoring original status '${taskToUpdate.status}'.`
|
||||||
|
);
|
||||||
|
updatedTask.status = taskToUpdate.status;
|
||||||
|
}
|
||||||
|
// Preserve completed subtasks (Keep existing logic)
|
||||||
|
if (taskToUpdate.subtasks?.length > 0) {
|
||||||
|
if (!updatedTask.subtasks) {
|
||||||
|
report(
|
||||||
|
'warn',
|
||||||
|
'Subtasks removed by AI. Restoring original subtasks.'
|
||||||
|
);
|
||||||
|
updatedTask.subtasks = taskToUpdate.subtasks;
|
||||||
|
} else {
|
||||||
|
const completedOriginal = taskToUpdate.subtasks.filter(
|
||||||
|
(st) => st.status === 'done' || st.status === 'completed'
|
||||||
|
);
|
||||||
|
completedOriginal.forEach((compSub) => {
|
||||||
|
const updatedSub = updatedTask.subtasks.find(
|
||||||
|
(st) => st.id === compSub.id
|
||||||
|
);
|
||||||
|
if (
|
||||||
|
!updatedSub ||
|
||||||
|
JSON.stringify(updatedSub) !== JSON.stringify(compSub)
|
||||||
|
) {
|
||||||
|
report(
|
||||||
|
'warn',
|
||||||
|
`Completed subtask ${compSub.id} was modified or removed. Restoring.`
|
||||||
|
);
|
||||||
|
// Remove potentially modified version
|
||||||
|
updatedTask.subtasks = updatedTask.subtasks.filter(
|
||||||
|
(st) => st.id !== compSub.id
|
||||||
|
);
|
||||||
|
// Add back original
|
||||||
|
updatedTask.subtasks.push(compSub);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Deduplicate just in case
|
||||||
|
const subtaskIds = new Set();
|
||||||
|
updatedTask.subtasks = updatedTask.subtasks.filter((st) => {
|
||||||
|
if (!subtaskIds.has(st.id)) {
|
||||||
|
subtaskIds.add(st.id);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
report('warn', `Duplicate subtask ID ${st.id} removed.`);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// --- End Task Validation/Correction ---
|
||||||
|
|
||||||
|
// --- Update Task Data (Keep existing) ---
|
||||||
|
data.tasks[taskIndex] = updatedTask;
|
||||||
|
// --- End Update Task Data ---
|
||||||
|
|
||||||
|
// --- Write File and Generate (Unchanged) ---
|
||||||
|
writeJSON(tasksPath, data);
|
||||||
|
report('success', `Successfully updated task ${taskId}`);
|
||||||
|
await generateTaskFiles(tasksPath, path.dirname(tasksPath));
|
||||||
|
// --- End Write File ---
|
||||||
|
|
||||||
|
// --- Display CLI Telemetry ---
|
||||||
|
if (outputFormat === 'text' && aiServiceResponse.telemetryData) {
|
||||||
|
displayAiUsageSummary(aiServiceResponse.telemetryData, 'cli'); // <<< ADD display
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- Return Success with Telemetry ---
|
||||||
|
return {
|
||||||
|
updatedTask: updatedTask, // Return the updated task object
|
||||||
|
telemetryData: aiServiceResponse.telemetryData // <<< ADD telemetryData
|
||||||
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Catch errors from generateTextService
|
// Catch errors from generateTextService
|
||||||
if (loadingIndicator) stopLoadingIndicator(loadingIndicator);
|
if (loadingIndicator) stopLoadingIndicator(loadingIndicator);
|
||||||
@@ -405,114 +500,7 @@ The changes described in the prompt should be thoughtfully applied to make the t
|
|||||||
report('error', 'Please ensure API keys are configured correctly.');
|
report('error', 'Please ensure API keys are configured correctly.');
|
||||||
}
|
}
|
||||||
throw error; // Re-throw error
|
throw error; // Re-throw error
|
||||||
} finally {
|
|
||||||
if (loadingIndicator) stopLoadingIndicator(loadingIndicator);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Parse and Validate Response ---
|
|
||||||
try {
|
|
||||||
// Pass logFn and isMCP flag to the parser
|
|
||||||
updatedTask = parseUpdatedTaskFromText(
|
|
||||||
responseText,
|
|
||||||
taskId,
|
|
||||||
logFn,
|
|
||||||
isMCP
|
|
||||||
);
|
|
||||||
} catch (parseError) {
|
|
||||||
report(
|
|
||||||
'error',
|
|
||||||
`Failed to parse updated task from AI response: ${parseError.message}`
|
|
||||||
);
|
|
||||||
if (getDebugFlag(session)) {
|
|
||||||
report('error', `Raw AI Response:\n${responseText}`);
|
|
||||||
}
|
|
||||||
throw new Error(
|
|
||||||
`Failed to parse valid updated task from AI response: ${parseError.message}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// --- End Parse/Validate ---
|
|
||||||
|
|
||||||
// --- Task Validation/Correction (Keep existing logic) ---
|
|
||||||
if (!updatedTask || typeof updatedTask !== 'object')
|
|
||||||
throw new Error('Received invalid task object from AI.');
|
|
||||||
if (!updatedTask.title || !updatedTask.description)
|
|
||||||
throw new Error('Updated task missing required fields.');
|
|
||||||
// Preserve ID if AI changed it
|
|
||||||
if (updatedTask.id !== taskId) {
|
|
||||||
report('warn', `AI changed task ID. Restoring original ID ${taskId}.`);
|
|
||||||
updatedTask.id = taskId;
|
|
||||||
}
|
|
||||||
// Preserve status if AI changed it
|
|
||||||
if (
|
|
||||||
updatedTask.status !== taskToUpdate.status &&
|
|
||||||
!prompt.toLowerCase().includes('status')
|
|
||||||
) {
|
|
||||||
report(
|
|
||||||
'warn',
|
|
||||||
`AI changed task status. Restoring original status '${taskToUpdate.status}'.`
|
|
||||||
);
|
|
||||||
updatedTask.status = taskToUpdate.status;
|
|
||||||
}
|
|
||||||
// Preserve completed subtasks (Keep existing logic)
|
|
||||||
if (taskToUpdate.subtasks?.length > 0) {
|
|
||||||
if (!updatedTask.subtasks) {
|
|
||||||
report('warn', 'Subtasks removed by AI. Restoring original subtasks.');
|
|
||||||
updatedTask.subtasks = taskToUpdate.subtasks;
|
|
||||||
} else {
|
|
||||||
const completedOriginal = taskToUpdate.subtasks.filter(
|
|
||||||
(st) => st.status === 'done' || st.status === 'completed'
|
|
||||||
);
|
|
||||||
completedOriginal.forEach((compSub) => {
|
|
||||||
const updatedSub = updatedTask.subtasks.find(
|
|
||||||
(st) => st.id === compSub.id
|
|
||||||
);
|
|
||||||
if (
|
|
||||||
!updatedSub ||
|
|
||||||
JSON.stringify(updatedSub) !== JSON.stringify(compSub)
|
|
||||||
) {
|
|
||||||
report(
|
|
||||||
'warn',
|
|
||||||
`Completed subtask ${compSub.id} was modified or removed. Restoring.`
|
|
||||||
);
|
|
||||||
// Remove potentially modified version
|
|
||||||
updatedTask.subtasks = updatedTask.subtasks.filter(
|
|
||||||
(st) => st.id !== compSub.id
|
|
||||||
);
|
|
||||||
// Add back original
|
|
||||||
updatedTask.subtasks.push(compSub);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// Deduplicate just in case
|
|
||||||
const subtaskIds = new Set();
|
|
||||||
updatedTask.subtasks = updatedTask.subtasks.filter((st) => {
|
|
||||||
if (!subtaskIds.has(st.id)) {
|
|
||||||
subtaskIds.add(st.id);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
report('warn', `Duplicate subtask ID ${st.id} removed.`);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// --- End Task Validation/Correction ---
|
|
||||||
|
|
||||||
// --- Update Task Data (Keep existing) ---
|
|
||||||
data.tasks[taskIndex] = updatedTask;
|
|
||||||
// --- End Update Task Data ---
|
|
||||||
|
|
||||||
// --- Write File and Generate (Keep existing) ---
|
|
||||||
writeJSON(tasksPath, data);
|
|
||||||
report('success', `Successfully updated task ${taskId}`);
|
|
||||||
await generateTaskFiles(tasksPath, path.dirname(tasksPath));
|
|
||||||
// --- End Write File ---
|
|
||||||
|
|
||||||
// --- Final CLI Output (Keep existing) ---
|
|
||||||
if (outputFormat === 'text') {
|
|
||||||
/* ... success boxen ... */
|
|
||||||
}
|
|
||||||
// --- End Final CLI Output ---
|
|
||||||
|
|
||||||
return updatedTask; // Return the updated task
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// General error catch
|
// General error catch
|
||||||
// --- General Error Handling (Keep existing) ---
|
// --- General Error Handling (Keep existing) ---
|
||||||
|
|||||||
@@ -94,10 +94,6 @@ function parseUpdatedTasksFromText(text, expectedCount, logFn, isMCP) {
|
|||||||
// It worked! Use this as the primary cleaned response.
|
// It worked! Use this as the primary cleaned response.
|
||||||
cleanedResponse = potentialJsonFromArray;
|
cleanedResponse = potentialJsonFromArray;
|
||||||
parseMethodUsed = 'brackets';
|
parseMethodUsed = 'brackets';
|
||||||
report(
|
|
||||||
'info',
|
|
||||||
'Successfully parsed JSON content extracted between first [ and last ].'
|
|
||||||
);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
report(
|
report(
|
||||||
'info',
|
'info',
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ Apply telemetry pattern from telemetry.mdc:
|
|||||||
* Verify `handleApiResult` correctly passes `data.telemetryData` through.
|
* Verify `handleApiResult` correctly passes `data.telemetryData` through.
|
||||||
|
|
||||||
|
|
||||||
## 10. Telemetry Integration for update-task-by-id [pending]
|
## 10. Telemetry Integration for update-task-by-id [done]
|
||||||
### Dependencies: None
|
### Dependencies: None
|
||||||
### Description: Integrate AI usage telemetry capture and propagation for the update-task-by-id functionality.
|
### Description: Integrate AI usage telemetry capture and propagation for the update-task-by-id functionality.
|
||||||
### Details:
|
### Details:
|
||||||
|
|||||||
@@ -41,6 +41,12 @@ Key implementation details:
|
|||||||
- Add commands to export telemetry data for manual analysis
|
- Add commands to export telemetry data for manual analysis
|
||||||
- Create visualization tools for local telemetry data
|
- Create visualization tools for local telemetry data
|
||||||
|
|
||||||
|
6. Focus on user-facing benefits:
|
||||||
|
- Implement personal usage dashboards showing the user's own patterns
|
||||||
|
- Add productivity insights based on collected telemetry
|
||||||
|
- Create features that allow users to optimize their workflow based on their usage data
|
||||||
|
- Ensure all telemetry collection provides immediate value to the user
|
||||||
|
|
||||||
# Test Strategy:
|
# Test Strategy:
|
||||||
The testing strategy for the expanded telemetry system should be comprehensive and cover all aspects of the implementation:
|
The testing strategy for the expanded telemetry system should be comprehensive and cover all aspects of the implementation:
|
||||||
|
|
||||||
@@ -74,6 +80,7 @@ The testing strategy for the expanded telemetry system should be comprehensive a
|
|||||||
- Test different telemetry level configurations
|
- Test different telemetry level configurations
|
||||||
- Manually verify the accuracy of collected metrics
|
- Manually verify the accuracy of collected metrics
|
||||||
- Test the export functionality and analyze the exported data
|
- Test the export functionality and analyze the exported data
|
||||||
|
- Validate that user-facing insights and dashboards provide accurate and useful information
|
||||||
|
|
||||||
6. Privacy Compliance Testing:
|
6. Privacy Compliance Testing:
|
||||||
- Verify no PII is stored without proper anonymization
|
- Verify no PII is stored without proper anonymization
|
||||||
@@ -84,6 +91,11 @@ The testing strategy for the expanded telemetry system should be comprehensive a
|
|||||||
- Verify existing functionality continues to work with the expanded telemetry
|
- Verify existing functionality continues to work with the expanded telemetry
|
||||||
- Ensure the system is designed to be compatible with future server integration
|
- Ensure the system is designed to be compatible with future server integration
|
||||||
|
|
||||||
|
8. User Experience Testing:
|
||||||
|
- Test the usability of personal dashboards and insights features
|
||||||
|
- Gather feedback on the usefulness of telemetry-based recommendations
|
||||||
|
- Verify users can easily understand their own usage patterns
|
||||||
|
|
||||||
# Subtasks:
|
# Subtasks:
|
||||||
## 1. Implement Additional Telemetry Data Collection Points [pending]
|
## 1. Implement Additional Telemetry Data Collection Points [pending]
|
||||||
### Dependencies: None
|
### Dependencies: None
|
||||||
@@ -115,3 +127,9 @@ Create a telemetry sanitization layer that removes or hashes PII before storage.
|
|||||||
### Details:
|
### Details:
|
||||||
Implement a developer console command to toggle telemetry debug mode. Create a UI panel that displays collected telemetry data when in debug mode. Add detailed logging of telemetry events to the application log when debugging is enabled. Create commands to export telemetry data in various formats (JSON, CSV) for manual analysis. Implement basic visualization tools for local telemetry data to help users understand their own usage patterns.
|
Implement a developer console command to toggle telemetry debug mode. Create a UI panel that displays collected telemetry data when in debug mode. Add detailed logging of telemetry events to the application log when debugging is enabled. Create commands to export telemetry data in various formats (JSON, CSV) for manual analysis. Implement basic visualization tools for local telemetry data to help users understand their own usage patterns.
|
||||||
|
|
||||||
|
## 6. Develop User-Facing Telemetry Benefits [pending]
|
||||||
|
### Dependencies: 81.1, 81.2
|
||||||
|
### Description: Create features that provide immediate value to users based on their telemetry data, focusing on personal insights and workflow optimization.
|
||||||
|
### Details:
|
||||||
|
Implement a personal usage dashboard that visualizes the user's command usage patterns, feature adoption, and productivity trends. Create a 'productivity insights' feature that offers personalized recommendations based on usage patterns. Add workflow optimization suggestions that help users discover more efficient ways to use the application. Develop weekly/monthly usage reports that users can view to track their own progress. Ensure all telemetry collection has a direct benefit to the user in the absence of server-side analysis.
|
||||||
|
|
||||||
|
|||||||
@@ -5006,7 +5006,7 @@
|
|||||||
"title": "Telemetry Integration for update-task-by-id",
|
"title": "Telemetry Integration for update-task-by-id",
|
||||||
"description": "Integrate AI usage telemetry capture and propagation for the update-task-by-id functionality.",
|
"description": "Integrate AI usage telemetry capture and propagation for the update-task-by-id functionality.",
|
||||||
"details": "\\\nApply telemetry pattern from telemetry.mdc:\n\n1. **Core (`scripts/modules/task-manager/update-task-by-id.js`):**\n * Modify AI service call to include `commandName: \\'update-task\\'` and `outputType`.\n * Receive `{ mainResult, telemetryData }`.\n * Return object including `telemetryData`.\n * Handle CLI display via `displayAiUsageSummary` if applicable.\n\n2. **Direct (`mcp-server/src/core/direct-functions/update-task-by-id.js`):**\n * Pass `commandName`, `outputType: \\'mcp\\'` to core.\n * Pass `outputFormat: \\'json\\'` if applicable.\n * Receive `{ ..., telemetryData }` from core.\n * Return `{ success: true, data: { ..., telemetryData } }`.\n\n3. **Tool (`mcp-server/src/tools/update-task.js`):**\n * Verify `handleApiResult` correctly passes `data.telemetryData` through.\n",
|
"details": "\\\nApply telemetry pattern from telemetry.mdc:\n\n1. **Core (`scripts/modules/task-manager/update-task-by-id.js`):**\n * Modify AI service call to include `commandName: \\'update-task\\'` and `outputType`.\n * Receive `{ mainResult, telemetryData }`.\n * Return object including `telemetryData`.\n * Handle CLI display via `displayAiUsageSummary` if applicable.\n\n2. **Direct (`mcp-server/src/core/direct-functions/update-task-by-id.js`):**\n * Pass `commandName`, `outputType: \\'mcp\\'` to core.\n * Pass `outputFormat: \\'json\\'` if applicable.\n * Receive `{ ..., telemetryData }` from core.\n * Return `{ success: true, data: { ..., telemetryData } }`.\n\n3. **Tool (`mcp-server/src/tools/update-task.js`):**\n * Verify `handleApiResult` correctly passes `data.telemetryData` through.\n",
|
||||||
"status": "pending",
|
"status": "done",
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"parentTaskId": 77
|
"parentTaskId": 77
|
||||||
},
|
},
|
||||||
@@ -5148,8 +5148,8 @@
|
|||||||
"status": "pending",
|
"status": "pending",
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"priority": "medium",
|
"priority": "medium",
|
||||||
"details": "This task builds upon the existing telemetry infrastructure (Tasks #77 and #80) to provide more comprehensive insights into how users interact with the application, while storing data locally until a server endpoint becomes available.\n\nKey implementation details:\n1. Identify and implement additional telemetry data points:\n - Command execution frequency and timing metrics\n - Feature usage patterns (which commands/features are most/least used)\n - Performance metrics (execution time, memory usage, etc.)\n - Error rates and types\n - Session duration and activity patterns\n - System environment information (OS, Node version, etc.)\n\n2. Implement a local telemetry storage system:\n - Create a robust local storage mechanism to hold telemetry data indefinitely\n - Implement data aggregation to combine similar events and reduce storage size\n - Add data retention policies to prevent excessive local storage usage\n - Implement configurable storage limits and cleanup procedures\n - Design the storage format to be compatible with future server transmission\n\n3. Add privacy-preserving mechanisms:\n - Ensure all personally identifiable information is properly anonymized\n - Implement data minimization principles (only collect what's necessary)\n - Add user-configurable telemetry levels (basic, enhanced, full)\n - Provide clear documentation on what data is collected and how it's used\n\n4. Design for future server integration:\n - Create a pluggable transmission architecture that can be connected to a server later\n - Define API contracts and data formats for future server endpoints\n - Add configuration options for server URLs and authentication that will be used later\n - Implement feature flags to easily enable server transmission when available\n\n5. Add telemetry debugging capabilities:\n - Create a developer mode to view telemetry data being collected\n - Implement logging of telemetry events (when in debug mode)\n - Add commands to export telemetry data for manual analysis\n - Create visualization tools for local telemetry data",
|
"details": "This task builds upon the existing telemetry infrastructure (Tasks #77 and #80) to provide more comprehensive insights into how users interact with the application, while storing data locally until a server endpoint becomes available.\n\nKey implementation details:\n1. Identify and implement additional telemetry data points:\n - Command execution frequency and timing metrics\n - Feature usage patterns (which commands/features are most/least used)\n - Performance metrics (execution time, memory usage, etc.)\n - Error rates and types\n - Session duration and activity patterns\n - System environment information (OS, Node version, etc.)\n\n2. Implement a local telemetry storage system:\n - Create a robust local storage mechanism to hold telemetry data indefinitely\n - Implement data aggregation to combine similar events and reduce storage size\n - Add data retention policies to prevent excessive local storage usage\n - Implement configurable storage limits and cleanup procedures\n - Design the storage format to be compatible with future server transmission\n\n3. Add privacy-preserving mechanisms:\n - Ensure all personally identifiable information is properly anonymized\n - Implement data minimization principles (only collect what's necessary)\n - Add user-configurable telemetry levels (basic, enhanced, full)\n - Provide clear documentation on what data is collected and how it's used\n\n4. Design for future server integration:\n - Create a pluggable transmission architecture that can be connected to a server later\n - Define API contracts and data formats for future server endpoints\n - Add configuration options for server URLs and authentication that will be used later\n - Implement feature flags to easily enable server transmission when available\n\n5. Add telemetry debugging capabilities:\n - Create a developer mode to view telemetry data being collected\n - Implement logging of telemetry events (when in debug mode)\n - Add commands to export telemetry data for manual analysis\n - Create visualization tools for local telemetry data\n\n6. Focus on user-facing benefits:\n - Implement personal usage dashboards showing the user's own patterns\n - Add productivity insights based on collected telemetry\n - Create features that allow users to optimize their workflow based on their usage data\n - Ensure all telemetry collection provides immediate value to the user",
|
||||||
"testStrategy": "The testing strategy for the expanded telemetry system should be comprehensive and cover all aspects of the implementation:\n\n1. Unit Tests:\n - Test each telemetry collection function in isolation\n - Verify proper anonymization of sensitive data\n - Test aggregation logic with various input scenarios\n - Validate local storage mechanisms with different data volumes\n - Test data retention and cleanup policies\n\n2. Integration Tests:\n - Verify telemetry data is properly stored locally\n - Test the complete flow from data collection to local storage\n - Validate that the storage format is suitable for future server transmission\n - Test different application states (startup, shutdown, crash recovery)\n - Verify proper handling of storage failures\n\n3. End-to-End Tests:\n - Create automated E2E tests that perform various user actions and verify telemetry is captured\n - Test with simulated long-term usage to verify storage efficiency\n - Verify that aggregated data accurately represents the performed actions\n\n4. Performance Tests:\n - Measure the performance impact of the expanded telemetry system\n - Test with large volumes of telemetry data to ensure efficient handling\n - Verify memory usage remains within acceptable limits\n - Test CPU utilization during telemetry collection and storage operations\n\n5. Manual Testing:\n - Verify telemetry debug mode correctly displays collected data\n - Test different telemetry level configurations\n - Manually verify the accuracy of collected metrics\n - Test the export functionality and analyze the exported data\n\n6. Privacy Compliance Testing:\n - Verify no PII is stored without proper anonymization\n - Test opt-out functionality works correctly\n - Ensure telemetry levels properly restrict data collection as configured\n\n7. Regression Testing:\n - Verify existing functionality continues to work with the expanded telemetry\n - Ensure the system is designed to be compatible with future server integration",
|
"testStrategy": "The testing strategy for the expanded telemetry system should be comprehensive and cover all aspects of the implementation:\n\n1. Unit Tests:\n - Test each telemetry collection function in isolation\n - Verify proper anonymization of sensitive data\n - Test aggregation logic with various input scenarios\n - Validate local storage mechanisms with different data volumes\n - Test data retention and cleanup policies\n\n2. Integration Tests:\n - Verify telemetry data is properly stored locally\n - Test the complete flow from data collection to local storage\n - Validate that the storage format is suitable for future server transmission\n - Test different application states (startup, shutdown, crash recovery)\n - Verify proper handling of storage failures\n\n3. End-to-End Tests:\n - Create automated E2E tests that perform various user actions and verify telemetry is captured\n - Test with simulated long-term usage to verify storage efficiency\n - Verify that aggregated data accurately represents the performed actions\n\n4. Performance Tests:\n - Measure the performance impact of the expanded telemetry system\n - Test with large volumes of telemetry data to ensure efficient handling\n - Verify memory usage remains within acceptable limits\n - Test CPU utilization during telemetry collection and storage operations\n\n5. Manual Testing:\n - Verify telemetry debug mode correctly displays collected data\n - Test different telemetry level configurations\n - Manually verify the accuracy of collected metrics\n - Test the export functionality and analyze the exported data\n - Validate that user-facing insights and dashboards provide accurate and useful information\n\n6. Privacy Compliance Testing:\n - Verify no PII is stored without proper anonymization\n - Test opt-out functionality works correctly\n - Ensure telemetry levels properly restrict data collection as configured\n\n7. Regression Testing:\n - Verify existing functionality continues to work with the expanded telemetry\n - Ensure the system is designed to be compatible with future server integration\n\n8. User Experience Testing:\n - Test the usability of personal dashboards and insights features\n - Gather feedback on the usefulness of telemetry-based recommendations\n - Verify users can easily understand their own usage patterns",
|
||||||
"subtasks": [
|
"subtasks": [
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
@@ -5195,6 +5195,18 @@
|
|||||||
"details": "Implement a developer console command to toggle telemetry debug mode. Create a UI panel that displays collected telemetry data when in debug mode. Add detailed logging of telemetry events to the application log when debugging is enabled. Create commands to export telemetry data in various formats (JSON, CSV) for manual analysis. Implement basic visualization tools for local telemetry data to help users understand their own usage patterns.",
|
"details": "Implement a developer console command to toggle telemetry debug mode. Create a UI panel that displays collected telemetry data when in debug mode. Add detailed logging of telemetry events to the application log when debugging is enabled. Create commands to export telemetry data in various formats (JSON, CSV) for manual analysis. Implement basic visualization tools for local telemetry data to help users understand their own usage patterns.",
|
||||||
"status": "pending",
|
"status": "pending",
|
||||||
"testStrategy": "Verify debug mode correctly displays all telemetry events. Test data export functionality with various output formats. Ensure visualizations accurately represent the underlying data. Test with large datasets to verify performance."
|
"testStrategy": "Verify debug mode correctly displays all telemetry events. Test data export functionality with various output formats. Ensure visualizations accurately represent the underlying data. Test with large datasets to verify performance."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 6,
|
||||||
|
"title": "Develop User-Facing Telemetry Benefits",
|
||||||
|
"description": "Create features that provide immediate value to users based on their telemetry data, focusing on personal insights and workflow optimization.",
|
||||||
|
"dependencies": [
|
||||||
|
1,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"details": "Implement a personal usage dashboard that visualizes the user's command usage patterns, feature adoption, and productivity trends. Create a 'productivity insights' feature that offers personalized recommendations based on usage patterns. Add workflow optimization suggestions that help users discover more efficient ways to use the application. Develop weekly/monthly usage reports that users can view to track their own progress. Ensure all telemetry collection has a direct benefit to the user in the absence of server-side analysis.",
|
||||||
|
"status": "pending",
|
||||||
|
"testStrategy": "Test dashboard visualizations with various usage patterns. Verify recommendations are relevant and helpful based on simulated usage data. Conduct usability testing to ensure insights are presented in an understandable way. Test with different user profiles to ensure recommendations are appropriately personalized."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user