diff --git a/latest/Global.md b/latest/Global.md index 93a009d..15ed53c 100644 --- a/latest/Global.md +++ b/latest/Global.md @@ -36,7 +36,7 @@ This is the strict, non-negotiable operational loop I follow for every user requ ### The Loop: Plan -> Act -> Document -> Repeat -1. **Plan**: I will analyze the user's request and the Memory Bank to create a step-by-step implementation plan in `currentTask.md`. +1. **Plan**: I will analyze the user's request and the Memory Bank to create a step-by-step implementation plan within the designated **Task-Scoped Workspace**. 2. **Act**: I will execute a single, discrete step from the plan using one tool per message. 3. **Document**: After every action, I will complete the **Mandatory Post-Action Checkpoint** to ensure the Memory Bank is updated with any new knowledge. This is the most critical step for ensuring continuity. @@ -80,9 +80,16 @@ This section is a comprehensive reference for each file in my Memory Bank, detai ``` ### Task Execution (Ephemeral) -* **`.roo_memory_bank/tmp/currentTask.md`**: The "Workbench" - A single, temporary file containing the plan and a running journal for the currently active task. To be reviewed and distilled upon task completion. -Any files other than the mentioned files if present must be moved to "tmp" directory. +All task-specific, temporary, or ephemeral files (like plans, drafts, or logs for a current task) MUST be placed in a dedicated **Task-Scoped Workspace**. This prevents context-clobbering during complex, multi-mode tasks. + +* **Task-Scoped Workspace**: A dedicated directory for the currently active task. + * **Location**: `.roo_memory_bank/tmp/task_123/` + * **Purpose**: To isolate all plans, journals, and temporary files for a single task, creating a clean audit trail and preventing state loss when switching modes. +* **Key Files**: + * `orchestration_plan.md`: The master plan file, created and managed by the Orchestrator mode. + * `01-planning.md`, `02-implementation.md`, etc.: Sequentially numbered journal files created by sub-modes. + --- ## 4. The Manual: Workflows & Standards @@ -93,13 +100,13 @@ This section provides practical guidelines for applying my core doctrine and pro - **Debugging (Audit Trail Approach)**: A systematic investigation process: Observe -> Hypothesize -> Execute & Document -> Iterate -> Synthesize. - **Refactoring (Safety-First Approach)**: A process to de-risk changes: Define Scope -> Gather Info -> Plan -> Execute & Verify -> Synthesize. - **The `Code Analysis` Phase (Universally Mandatory)**: This is the mandatory first phase for any task involving reading or modifying code. This rule is absolute. - 2. **Consult the Flesh**: With the updated index, read `code_knowledge.md` to retrieve any existing documented knowledge about the specific code components relevant to the current task. + 2. **Consult the Flesh**: With the updated index, read `.roo_memory_bank/project_knowledge.md` to retrieve any existing documented knowledge about the specific code components relevant to the current task. ### 4.2. Task Management Guidelines -- **Creating a Task**: Update `currentTask.md` with objectives, a detailed plan, and an "Impact Analysis" for refactors. -- **During a Task**: Keep `currentTask.md` updated with progress, notes, and challenges. -- **Completing a Task**: Ensure `currentTask.md` is complete, summarize learnings, and update all relevant memory files. -- **Task Interruption**: Leave detailed notes in `currentTask.md` on status and next steps. +- **Creating a Task**: The Orchestrator creates a new Task-Scoped Workspace (e.g., `.roo_memory_bank/tmp/task_123/`) and an `orchestration_plan.md` within it. +- **During a Task**: Each sub-mode creates and updates its own sequentially numbered journal file (e.g., `01-planning.md`, `02-implementation.md`) within the shared task workspace. +- **Completing a Task**: Ensure all journals within the workspace are complete, then summarize learnings into the permanent Memory Bank files. +- **Task Interruption**: Leave detailed notes in the current journal file (e.g., `02-implementation.md`) on status and next steps. ### 4.3. Quality, Safety, and Performance Standards - **Quality**: Produce complete, runnable code with proper error handling and documentation. @@ -118,7 +125,7 @@ This final section contains the ultimate rules of engagement that govern my oper 3. **Memory Bank Files**: Project-specific context and patterns. 4. **The rest of this Document**: Guiding principles and reference material. -If a user instruction conflicts with a documented pattern, I will follow the user's instruction but may note the deviation in `currentTask.md`. +If a user instruction conflicts with a documented pattern, I will follow the user's instruction but may note the deviation in the current task's journal file (e.g., `02-implementation.md`). ### 5.2. Critical Operational Notes - **Pre-Condensation Memory Bank Update**: Before condensing memory, I **MUST** update my memory-bank. diff --git a/latest/OrchestratorMode.md b/latest/OrchestratorMode.md index a992a55..b663017 100644 --- a/latest/OrchestratorMode.md +++ b/latest/OrchestratorMode.md @@ -419,30 +419,42 @@ graph TD ## Context Management Protocol -### Information Flow -1. **Capture** essential information from each mode's output -2. **Filter** relevant details for subsequent tasks -3. **Enrich** context with orchestrator-level insights -4. **Pass** structured context to next mode +### Task-Scoped Workspace Workflow (MANDATORY) -### Context Template +To prevent state loss and context overwriting during complex tasks, the Orchestrator MUST use a dedicated directory for each task. This workflow replaces the legacy single-file approach. + +1. **Workspace Initialization**: Upon starting a new task, create a unique **Task-Scoped Workspace** directory. + * **Location**: `.roo_memory_bank/tmp/task_/` + +2. **Master Plan Creation**: Within the new workspace, create and maintain the `orchestration_plan.md` file. This is the master plan containing high-level goals, sub-task breakdowns, and the status of each step. + +3. **Task Delegation**: Use the `new_task` or `switch_mode` tool to delegate a specific sub-task. The instructions **MUST** include: + * The path to the shared **Task-Scoped Workspace**. + * The unique, sequentially-numbered filename the sub-mode **MUST** use for its journal (e.g., `01-planning.md`, `02-implementation.md`). + +4. **Monitoring & Resumption**: After a sub-mode completes, review its journal file (e.g., `01_planning_journal.md`), update the `orchestration_plan.md` with the outcome, and delegate the next step. + +### Delegation Context Template +When delegating, use this structure within the `` tag: ```markdown -## Task Context for [Mode Name] -### Objective -[Clear, specific goal] +## Task Context for [Specialized Mode Name] -### Prerequisites -- Previous outcome: [Summary from prior task] -- Key decisions: [Important choices made] -- Constraints: [Any limitations discovered] +**Role Reminder**: You are in [Mode Name] - [brief role description] -### Required Inputs -- Files: [Specific paths] -- Data: [Variables, parameters] -- Standards: [Applicable guidelines] +**Overall Objective**: [Copy of the high-level user goal from orchestration_plan.md] -### Expected Deliverable -[Precise description of what this mode should produce] +**Current Sub-Task Objective**: [Clear, specific goal for this sub-mode] + +**Workspace**: +- **Task Directory**: `[path to .roo_memory_bank/tmp/task_YYYYMMDD-HHMMSS/]` +- **Your Journal File**: `[e.g., 02-implementation.md]` +- **Master Plan (Read-Only)**: `orchestration_plan.md` + +**Context from Previous Steps**: +- [Summary of relevant decisions or outputs from prior journals] + +**Required Deliverables**: +- [Specific outputs expected in the journal file] ``` ## Synthesis Strategies