conductor: add phase 6 context composition redesign tracks

- context_comp_decouple_20260510: Decouple Files & Media from Context Composition, directory grouping, file stats
- context_comp_slices_20260510: Slice visualization with annotations, view presets
- context_comp_presets_20260510: Context preset save/load with validation, context preview
- Depends_on chain: presets -> slices -> decouple
This commit is contained in:
2026-05-10 22:12:03 -04:00
parent f9cc89c877
commit de3dfec4de
10 changed files with 372 additions and 1 deletions
@@ -0,0 +1,11 @@
{
"id": "context_comp_presets_20260510",
"title": "Context Composition Presets",
"phase": 6,
"created": "2026-05-10",
"status": "pending",
"spec_file": "spec.md",
"plan_file": "plan.md",
"depends_on": ["context_comp_slices_20260510"],
"completion_checkpoints": []
}
@@ -0,0 +1,49 @@
# Implementation Plan: Context Composition Presets
## Phase 1: Context Preset Data Models
Focus: Create models and serialization
- [ ] Task 1.1: Create ContextPreset and ContextFileEntry models
- [ ] Task 1.2: Implement relative path storage (relative to project root)
- [ ] Task 1.3: Add to_dict() and from_dict() methods
- [ ] Task 1.4: Write tests for preset models
## Phase 2: Preset Persistence
Focus: Save/load presets to project config
- [ ] Task 2.1: Add ContextPresetManager class (follows PresetManager pattern)
- [ ] Task 2.2: Add save_context_preset() to AppController
- [ ] Task 2.3: Add load_context_preset() to AppController
- [ ] Task 2.4: Write tests for preset persistence
## Phase 3: Save Preset UI
Focus: UI for saving presets with validation
- [ ] Task 3.1: Add [Save] button and dialog to Context Composition
- [ ] Task 3.2: Implement validation (check files exist before save)
- [ ] Task 3.3: Warning dialog for missing files with options
- [ ] Task 3.4: Write tests for save UI
## Phase 4: Load Preset UI
Focus: UI for loading presets with validation
- [ ] Task 4.1: Add preset selector dropdown to Context Composition
- [ ] Task 4.2: Implement load validation (check files exist after load)
- [ ] Task 4.3: Missing file highlighting in red
- [ ] Task 4.4: Write tests for load UI
## Phase 5: Context Preview
Focus: Show what will be sent to agent
- [ ] Task 5.1: Add [Preview] button to Context Composition
- [ ] Task 5.2: Collapsed preview: file list + view modes
- [ ] Task 5.3: Expanded preview: actual text/slices
- [ ] Task 5.4: Token estimate display
- [ ] Task 5.5: Write tests for preview
## Phase 6: Integration + Validation
Focus: End-to-end testing
- [ ] Task 6.1: Full workflow test: save preset, close, reload, load preset
- [ ] Task 6.2: Test with gencpp project files
- [ ] Task 6.3: Conductor - User Manual Verification
@@ -0,0 +1,66 @@
# Track Specification: Context Composition Presets
## Overview
Implement Context Preset save/load with validation, and Context Preview before sending to agent. This is Phase 3 of the Context Composition Redesign per spec at `docs/superpowers/specs/2026-05-10-context-composition-redesign-design.md`.
## Current State Audit (as of 2026-05-10)
### Already Implemented
- Preset system exists for system prompts, tool presets, personas
- ProjectManager handles TOML save/load
- Context Composition stores FileItem entries with flags
### Gaps to Fill (This Track's Scope)
- No Context Preset model for saving file+view+slices compositions
- No save/load UI for Context Presets in Context Composition panel
- No validation when loading preset (missing files warn user)
- No Context Preview showing what will be sent to agent
## Goals
1. Context Preset model with name, description, files list
2. Save Context Preset to project config
3. Load Context Preset populates Context Composition
4. Missing file validation on load with user choice
5. Context Preview before send showing exact context text
## Functional Requirements
### Context Preset Model
- Contains: name, description, list of ContextFileEntry
- ContextFileEntry: relative_path, view_mode, custom_slices
- All paths stored as relative to project root
- Serializes to TOML in project config
### Save Preset UI
- [Save] button in Context Composition
- Dialog: enter preset name + optional description
- Validation before save:
- Check all files exist in project
- If files missing: warn user, offer to save without or cancel
### Load Preset UI
- Dropdown selector for preset selection
- On load: clear Context Composition, populate from preset
- If file missing from preset: highlight in red, warn user
- User can proceed with missing files or re-path
### Context Preview
- "Preview" button/tab showing what will be sent
- Per file: view mode, line ranges, tags, comments
- Collapsed view: just file list + view modes
- Expanded view: actual text/slices that will be sent
- Token estimate for total context
### Stale Preset Handling
- If project changes and preset references moved/renamed files:
- On load: detect and warn
- User can save preset without invalid files
- Or ignore warning and proceed
## Architecture Reference
- `src/project_manager.py` - existing preset save/load patterns
- `src/presets.py` - existing preset manager patterns to follow
- `docs/superpowers/specs/2026-05-10-context-composition-redesign-design.md`
## Out of Scope
- Slice visualization (Phase 2)
- Files & Media changes (Phase 1)
- RAG configuration changes