Compare commits

...

27 Commits

Author SHA1 Message Date
Anjali Sridhar beba19c154 wip 2026-03-04 16:10:21 -08:00
Anjali Sridhar 1796432816 wip 2026-03-04 16:10:01 -08:00
Anjali Sridhar f76d73edf7 lint fix 2026-03-04 13:07:12 -08:00
Anjali Sridhar aa1803f445 feat(core): trigger task tracker based on complexity rather than formatting 2026-02-25 14:43:52 -08:00
Anjali Sridhar ed8a77391c wip temp settings change 2026-02-25 11:44:15 -08:00
Anjali Sridhar 53755c5d9e si changes 2026-02-22 12:40:31 -08:00
Anjali Sridhar 5d317614bd si changes: task tracker prep implementation 2026-02-22 12:39:50 -08:00
Anjali Sridhar 30fe8ff383 remove .gitignore changes 2026-02-22 11:27:34 -08:00
Anjali Sridhar fc298e308d remove .gitignore changes 2026-02-22 11:26:06 -08:00
Anjali Sridhar 41cf395958 chore(tracker): remove plans configuration directory from git tracking 2026-02-22 11:22:50 -08:00
Anjali Sridhar daf9da26c8 fix(tracker): lazily initialize tracker directory 2026-02-22 11:14:04 -08:00
Anjali Sridhar eb33db5b40 feat(tracker): simplify tracker storage path and flatten directory structure 2026-02-19 11:22:32 -08:00
Anjali Sridhar eed1ca6a44 feat(tracker): restore nested tracker path in Config 2026-02-19 11:07:51 -08:00
Anjali Sridhar de0ce2c976 Merge branch 'u/anj/task-tracker-phase-1' into u/anj/task-tracker-phase-2 2026-02-19 11:07:31 -08:00
Anjali Sridhar 23194ddc99 feat(tracker): restore session-specific nested storage path 2026-02-19 11:07:20 -08:00
Anjali Sridhar 1e743ea6da feat(tracker): update config to use simplified tracker path 2026-02-18 16:14:00 -08:00
Anjali Sridhar e32d8a2779 Merge branch 'u/anj/task-tracker-phase-1' into u/anj/task-tracker-phase-2 2026-02-18 16:13:40 -08:00
Anjali Sridhar ba731240dd feat(tracker): simplify tracker storage path 2026-02-18 16:13:29 -08:00
Anjali Sridhar e6b68e7e8c feat(tracker): integrate dynamic storage path in Config and tools 2026-02-18 16:10:16 -08:00
Anjali Sridhar 91e7881f67 Merge branch 'u/anj/task-tracker-phase-1' into u/anj/task-tracker-phase-2 2026-02-18 16:09:18 -08:00
Anjali Sridhar ae964772b5 feat(tracker): move tracker storage to project temp directory 2026-02-18 16:09:07 -08:00
Anjali Sridhar 6a24077542 docs: update implementation plan for Phase 2 2026-02-18 16:02:32 -08:00
Anjali Sridhar 9618f8feef Merge branch 'u/anj/task-tracker-phase-1' into u/anj/task-tracker-phase-2 2026-02-18 15:45:43 -08:00
Anjali Sridhar 2d6ee8f005 fix: address code review comments from bot in trackerService.ts
- Use cryptographically secure ID generation with node:crypto
- Implement runtime validation for JSON parsing using Zod
- Optimize circular dependency validation to avoid N+1 file reads
2026-02-18 15:42:22 -08:00
Anjali Sridhar 448af0a55c chore(core): improve ID generation and add runtime task validation 2026-02-18 13:37:29 -08:00
Anjali Sridhar f7371269cd feat(core,cli): implement task tracker tools and feature flag (Phase 2) 2026-02-18 12:03:58 -08:00
Anjali Sridhar b5db5d300a feat(core): implement task tracker foundation and service (Phase 1) 2026-02-18 12:03:35 -08:00
6 changed files with 64 additions and 9 deletions
+1 -1
View File
@@ -1811,7 +1811,7 @@ const SETTINGS_SCHEMA = {
label: 'Task Tracker',
category: 'Experimental',
requiresRestart: true,
default: false,
default: true,
description: 'Enable task tracker tools.',
showInDialog: false,
},
@@ -171,6 +171,7 @@ export class PromptProvider {
}),
isPlanMode,
),
taskTracker: config.isTrackerEnabled(),
operationalGuidelines: this.withSection(
'operationalGuidelines',
() => ({
@@ -18,6 +18,9 @@ import {
SHELL_TOOL_NAME,
WRITE_FILE_TOOL_NAME,
WRITE_TODOS_TOOL_NAME,
TRACKER_CREATE_TASK_TOOL_NAME,
TRACKER_LIST_TASKS_TOOL_NAME,
TRACKER_UPDATE_TASK_TOOL_NAME,
} from '../tools/tool-names.js';
// --- Options Structs ---
@@ -30,6 +33,7 @@ export interface SystemPromptOptions {
hookContext?: boolean;
primaryWorkflows?: PrimaryWorkflowsOptions;
planningWorkflow?: PlanningWorkflowOptions;
taskTracker?: boolean;
operationalGuidelines?: OperationalGuidelinesOptions;
sandbox?: SandboxMode;
interactiveYoloMode?: boolean;
@@ -113,6 +117,8 @@ ${
: renderPrimaryWorkflows(options.primaryWorkflows)
}
${options.taskTracker ? renderTaskTracker() : ''}
${renderOperationalGuidelines(options.operationalGuidelines)}
${renderInteractiveYoloMode(options.interactiveYoloMode)}
@@ -388,6 +394,23 @@ ${trimmed}
return `\n---\n\n<loaded_context>\n${sections.join('\n')}\n</loaded_context>`;
}
export function renderTaskTracker(): string {
const trackerCreate = `\`${TRACKER_CREATE_TASK_TOOL_NAME}\``;
const trackerList = `\`${TRACKER_LIST_TASKS_TOOL_NAME}\``;
const trackerUpdate = `\`${TRACKER_UPDATE_TASK_TOOL_NAME}\``;
return `
# TASK MANAGEMENT PROTOCOL
You are operating with a persistent file-based task tracking system located at \`.tracker/tasks/\`. You must adhere to the following rules:
1. **NO IN-MEMORY LISTS**: Do not maintain a mental list of tasks or write markdown checkboxes in the chat. Use the provided tools (${trackerCreate}, ${trackerList}, ${trackerUpdate}) for all state management.
2. **ATOMICITY**: If a user request involves multiple steps (e.g., "Refactor the backend") or represents a complex task, you must first break this into discrete entries using ${trackerCreate} before writing any code.
3. **PLAN MODE INTEGRATION**: If you construct or are following a documented plan (e.g., in Plan Mode), use the tracker to represent the granular execution state of that plan. Maintain a bidirectional understanding between the plan document and the task graph.
4. **VERIFICATION**: Before marking a task as complete, verify the work is actually done (e.g., run the test, check the file existence).
5. **STATE OVER CHAT**: If the user says "I think we finished that," but the tool says it is 'pending', trust the tool--or verify explicitly before updating.
6. **DEPENDENCY MANAGEMENT**: Respect task topology. Never attempt to execute a task if its dependencies are not marked as 'closed'. If you are blocked, focus only on the leaf nodes of the task graph.`.trim();
}
export function renderPlanningWorkflow(
options?: PlanningWorkflowOptions,
): string {
+24
View File
@@ -27,6 +27,9 @@ import {
READ_FILE_PARAM_END_LINE,
SHELL_PARAM_IS_BACKGROUND,
EDIT_PARAM_OLD_STRING,
TRACKER_CREATE_TASK_TOOL_NAME,
TRACKER_LIST_TASKS_TOOL_NAME,
TRACKER_UPDATE_TASK_TOOL_NAME,
} from '../tools/tool-names.js';
import type { HierarchicalMemory } from '../config/memory.js';
import { DEFAULT_CONTEXT_FILENAME } from '../tools/memoryTool.js';
@@ -41,6 +44,7 @@ export interface SystemPromptOptions {
hookContext?: boolean;
primaryWorkflows?: PrimaryWorkflowsOptions;
planningWorkflow?: PlanningWorkflowOptions;
taskTracker?: boolean;
operationalGuidelines?: OperationalGuidelinesOptions;
sandbox?: SandboxMode;
interactiveYoloMode?: boolean;
@@ -120,6 +124,8 @@ ${
: renderPrimaryWorkflows(options.primaryWorkflows)
}
${options.taskTracker ? renderTaskTracker() : ''}
${renderOperationalGuidelines(options.operationalGuidelines)}
${renderInteractiveYoloMode(options.interactiveYoloMode)}
@@ -464,6 +470,24 @@ ${trimmed}
return `\n---\n\n<loaded_context>\n${sections.join('\n')}\n</loaded_context>`;
}
export function renderTaskTracker(): string {
const trackerCreate = formatToolName(TRACKER_CREATE_TASK_TOOL_NAME);
const trackerList = formatToolName(TRACKER_LIST_TASKS_TOOL_NAME);
const trackerUpdate = formatToolName(TRACKER_UPDATE_TASK_TOOL_NAME);
return `
# TASK MANAGEMENT PROTOCOL
You are operating with a persistent file-based task tracking system located at \`.tracker/tasks/\`. You must adhere to the following rules:
1. **NO IN-MEMORY LISTS**: Do not maintain a mental list of tasks or write markdown checkboxes in the chat. Use the provided tools (${trackerCreate}, ${trackerList}, ${trackerUpdate}) for all state management.
2. **IMMEDIATE DECOMPOSITION**: Upon receiving a task, evaluate its functional complexity and scope. If the request involves more than a single atomic modification, or necessitates research before execution, you MUST immediately decompose it into discrete entries using ${trackerCreate}.
3. **IGNORE FORMATTING BIAS**: Trigger the protocol based on the **objective complexity** of the goal, regardless of whether the user provided a structured list or a single block of text/paragraph. "Paragraph-style" goals that imply multiple actions are multi-step projects and MUST be tracked.
4. **PLAN MODE INTEGRATION**: If you construct or are following a documented plan (e.g., in Plan Mode), use the tracker to represent the granular execution state of that plan. Maintain a bidirectional understanding between the plan document and the task graph.
5. **VERIFICATION**: Before marking a task as complete, verify the work is actually done (e.g., run the test, check the file existence).
6. **STATE OVER CHAT**: If the user says "I think we finished that," but the tool says it is 'pending', trust the tool--or verify explicitly before updating.
7. **DEPENDENCY MANAGEMENT**: Respect task topology. Never attempt to execute a task if its dependencies are not marked as 'closed'. If you are blocked, focus only on the leaf nodes of the task graph.`.trim();
}
export function renderPlanningWorkflow(
options?: PlanningWorkflowOptions,
): string {
+14 -7
View File
@@ -154,19 +154,19 @@ export const LS_TOOL_NAME_LEGACY = 'list_directory'; // Just to be safe if anyth
export const EDIT_TOOL_NAMES = new Set([EDIT_TOOL_NAME, WRITE_FILE_TOOL_NAME]);
export const TRACKER_CREATE_TASK_TOOL_NAME = 'tracker_create_task';
export const TRACKER_UPDATE_TASK_TOOL_NAME = 'tracker_update_task';
export const TRACKER_GET_TASK_TOOL_NAME = 'tracker_get_task';
export const TRACKER_LIST_TASKS_TOOL_NAME = 'tracker_list_tasks';
export const TRACKER_ADD_DEPENDENCY_TOOL_NAME = 'tracker_add_dependency';
export const TRACKER_VISUALIZE_TOOL_NAME = 'tracker_visualize';
// Tool Display Names
export const WRITE_FILE_DISPLAY_NAME = 'WriteFile';
export const EDIT_DISPLAY_NAME = 'Edit';
export const ASK_USER_DISPLAY_NAME = 'Ask User';
export const READ_FILE_DISPLAY_NAME = 'ReadFile';
export const GLOB_DISPLAY_NAME = 'FindFiles';
export const TRACKER_INIT_TOOL_NAME = 'tracker_init';
export const TRACKER_CREATE_TASK_TOOL_NAME = 'tracker_create_task';
export const TRACKER_UPDATE_TASK_TOOL_NAME = 'tracker_update_task';
export const TRACKER_GET_TASK_TOOL_NAME = 'tracker_get_task';
export const TRACKER_LIST_TASKS_TOOL_NAME = 'tracker_list_tasks';
export const TRACKER_ADD_DEPENDENCY_TOOL_NAME = 'tracker_add_dependency';
export const TRACKER_VISUALIZE_TOOL_NAME = 'tracker_visualize';
/**
* Mapping of legacy tool names to their current names.
@@ -229,6 +229,13 @@ export const ALL_BUILTIN_TOOL_NAMES = [
GET_INTERNAL_DOCS_TOOL_NAME,
ENTER_PLAN_MODE_TOOL_NAME,
EXIT_PLAN_MODE_TOOL_NAME,
TRACKER_INIT_TOOL_NAME,
TRACKER_CREATE_TASK_TOOL_NAME,
TRACKER_UPDATE_TASK_TOOL_NAME,
TRACKER_GET_TASK_TOOL_NAME,
TRACKER_LIST_TASKS_TOOL_NAME,
TRACKER_ADD_DEPENDENCY_TOOL_NAME,
TRACKER_VISUALIZE_TOOL_NAME,
] as const;
/**
+1 -1
View File
@@ -566,7 +566,7 @@ class TrackerVisualizeInvocation extends BaseToolInvocation<
return {
llmContent: output,
returnDisplay: 'Graph rendered.',
returnDisplay: output,
};
}
}