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:
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "context_comp_decouple_20260510",
|
||||
"title": "Context Composition Decoupling",
|
||||
"phase": 6,
|
||||
"created": "2026-05-10",
|
||||
"status": "pending",
|
||||
"spec_file": "spec.md",
|
||||
"plan_file": "plan.md",
|
||||
"depends_on": [],
|
||||
"completion_checkpoints": []
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
# Implementation Plan: Context Composition Decoupling
|
||||
|
||||
## Phase 1: Core Data Model Changes
|
||||
Focus: Add view_mode field to FileItem, understand current coupling
|
||||
|
||||
- [ ] Task 1.1: Audit FileItem model in models.py - add view_mode and custom_slices fields
|
||||
- [ ] Task 1.2: Audit _render_context_composition_panel() to understand current coupling
|
||||
- [ ] Task 1.3: Audit _render_files_panel() to understand how Files & Media populates context
|
||||
- [ ] Task 1.4: Write tests for FileItem with view_mode and custom_slices
|
||||
|
||||
## Phase 2: Decouple Context Composition from Files & Media
|
||||
Focus: Remove auto-population inheritance, make Context Composition independent
|
||||
|
||||
- [ ] Task 2.1: Remove auto-population of context from Files & Media in context composition
|
||||
- [ ] Task 2.2: Add manual "Add Files" button to Context Composition (file picker from project whitelist)
|
||||
- [ ] Task 2.3: Implement "Add All" batch operation
|
||||
- [ ] Task 2.4: Write tests for decoupled context composition state
|
||||
|
||||
## Phase 3: Directory Grouping + File Stats
|
||||
Focus: Compact file listing with stats
|
||||
|
||||
- [ ] Task 3.1: Implement directory grouping helper to group files by relative path prefix
|
||||
- [ ] Task 3.2: Add file stats computation (line count, AST element count) - async
|
||||
- [ ] Task 3.3: Render file list with collapsible directory headers
|
||||
- [ ] Task 3.4: Display aggregate stats (total files, lines, AST elements)
|
||||
- [ ] Task 3.5: Write tests for directory grouping and stats
|
||||
|
||||
## Phase 4: View Mode Selection UI
|
||||
Focus: Per-file view mode dropdown (full/sig/def/custom)
|
||||
|
||||
- [ ] Task 4.1: Add view_mode dropdown to each file entry in Context Composition
|
||||
- [ ] Task 4.2: Implement custom view mode indicator (enabled when custom slices exist)
|
||||
- [ ] Task 4.3: Batch view mode change operations
|
||||
- [ ] Task 4.4: Write tests for view mode selection
|
||||
|
||||
## Phase 5: Context Presets Infrastructure
|
||||
Focus: Data structures for save/load (without UI)
|
||||
|
||||
- [ ] Task 5.1: Create ContextPreset and FileViewPreset data models
|
||||
- [ ] Task 5.2: Implement serialization for context presets (TOML)
|
||||
- [ ] Task 5.3: Write tests for context preset models
|
||||
|
||||
## Phase 6: Integration + Bug Fixes
|
||||
Focus: Ensure aggregate respects new view modes, fix any issues
|
||||
|
||||
- [ ] Task 6.1: Verify aggregate.py respects view_mode when composing context
|
||||
- [ ] Task 6.2: Test with gencpp project files
|
||||
- [ ] Task 6.3: Conductor - User Manual Verification
|
||||
@@ -0,0 +1,52 @@
|
||||
# Track Specification: Context Composition Decoupling
|
||||
|
||||
## Overview
|
||||
Decouple Files & Media from Context Composition, add directory grouping, file stats, and view mode selection per file. This is Phase 1 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
|
||||
- Files & Media panel lists project files with wildcards
|
||||
- Context Composition panel inherits files from Files & Media
|
||||
- View flags (agg/full/sig/def) sync visually between panels
|
||||
- `_render_context_composition_panel()` in gui_2.py:2794-2964
|
||||
|
||||
### Gaps to Fill (This Track's Scope)
|
||||
- Files & Media populates Context Composition automatically (coupled)
|
||||
- No directory grouping in file listings
|
||||
- No file stats (line count, AST element count)
|
||||
- View mode selection is limited (no custom view presets)
|
||||
- Context Composition is NOT independent selection - it's derived from Files & Media
|
||||
|
||||
## Goals
|
||||
1. Make Files & Media and Context Composition independent data sources
|
||||
2. Add directory grouping to file listings for compact display
|
||||
3. Add file stats per file and aggregate
|
||||
4. Implement proper view mode selection (full/sig/def/custom)
|
||||
5. User can add/remove files from Context Composition independently
|
||||
6. "Add all" and bulk add/remove operations
|
||||
|
||||
## Functional Requirements
|
||||
- Context Composition starts empty or from saved preset on discussion switch
|
||||
- User manually adds files FROM project whitelist (not auto-inherited)
|
||||
- Each file entry has: path, view_mode, custom_slices
|
||||
- Directory grouping with collapsible headers (`📁 relative/path/`)
|
||||
- File stats displayed: line count, AST element count per file
|
||||
- Aggregate stats for selection: total files, lines, AST elements
|
||||
- View mode dropdown per file: full, sig, def, custom
|
||||
- Batch operations: add all from whitelist, remove selected, etc.
|
||||
|
||||
## Non-Functional Requirements
|
||||
- No horizontal scrolling in file lists (directory grouping enables this)
|
||||
- Stats computed asynchronously to not block UI
|
||||
- FileItem model may need extension for view_mode field
|
||||
|
||||
## Architecture Reference
|
||||
- `src/gui_2.py:_render_context_composition_panel()` - main panel
|
||||
- `src/models.py:FileItem` - needs view_mode field extension
|
||||
- `src/aggregate.py` - respects view modes when composing context
|
||||
- `docs/superpowers/specs/2026-05-10-context-composition-redesign-design.md`
|
||||
|
||||
## Out of Scope
|
||||
- Slice visualization and annotations (Phase 2)
|
||||
- Context preset save/load (Phase 3)
|
||||
- Context preview before send (Phase 3)
|
||||
@@ -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
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "context_comp_slices_20260510",
|
||||
"title": "Context Composition Slice Visualization",
|
||||
"phase": 6,
|
||||
"created": "2026-05-10",
|
||||
"status": "pending",
|
||||
"spec_file": "spec.md",
|
||||
"plan_file": "plan.md",
|
||||
"depends_on": ["context_comp_decouple_20260510"],
|
||||
"completion_checkpoints": []
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
# Implementation Plan: Context Composition Slice Visualization
|
||||
|
||||
## Phase 1: Slice Data Model Extension
|
||||
Focus: Extend custom_slices to support tags and comments
|
||||
|
||||
- [ ] Task 1.1: Extend custom_slices schema to include tag and comment fields
|
||||
- [ ] Task 1.2: Update FileItem.to_dict() and from_dict() for new fields
|
||||
- [ ] Task 1.3: Write tests for custom_slices with annotations
|
||||
|
||||
## Phase 2: Slice Inspector Enhancement
|
||||
Focus: Visual AST highlighting with file content
|
||||
|
||||
- [ ] Task 2.1: Modify _render_ast_inspector_modal() to show file content with highlighted slices
|
||||
- [ ] Task 2.2: Add color coding for Sig vs Def elements in file content view
|
||||
- [ ] Task 2.3: Implement toggle buttons for each AST element in the content view
|
||||
- [ ] Task 2.4: Write tests for slice inspector rendering
|
||||
|
||||
## Phase 3: Slice Editor Visual Enhancement
|
||||
Focus: Visual slice editor with colored overlays
|
||||
|
||||
- [ ] Task 3.1: Enhance slice editor to show file content (not just line list)
|
||||
- [ ] Task 3.2: Add colored overlays for custom slices on the content
|
||||
- [ ] Task 3.3: Implement click-drag line range selection
|
||||
- [ ] Task 3.4: Add tag/comment input for custom slices
|
||||
- [ ] Task 3.5: Write tests for slice editor
|
||||
|
||||
## Phase 4: View Presets
|
||||
Focus: Named view configurations
|
||||
|
||||
- [ ] Task 4.1: Create FileViewPreset model
|
||||
- [ ] Task 4.2: Add preset selection dropdown to context composition
|
||||
- [ ] Task 4.3: Implement preset save/load to project config
|
||||
- [ ] Task 4.4: Write tests for view presets
|
||||
|
||||
## Phase 5: AST Slice Pre-population
|
||||
Focus: Show auto-resolved slices before user customizes
|
||||
|
||||
- [ ] Task 5.1: On file add to context, compute AST slices automatically
|
||||
- [ ] Task 5.2: Store pre-computed slices in FileItem for display
|
||||
- [ ] Task 5.3: User can modify/remove auto-slices
|
||||
- [ ] Task 5.4: Write tests for auto-slice computation
|
||||
|
||||
## Phase 6: Integration
|
||||
Focus: Connect all pieces together
|
||||
|
||||
- [ ] Task 6.1: Verify slice data flows correctly through context composition
|
||||
- [ ] Task 6.2: Test with C++ files from gencpp
|
||||
- [ ] Task 6.3: Conductor - User Manual Verification
|
||||
@@ -0,0 +1,63 @@
|
||||
# Track Specification: Context Composition Slice Visualization
|
||||
|
||||
## Overview
|
||||
Enhance slice visualization with visual editor, annotation support (tags/comments), and view presets. This is Phase 2 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
|
||||
- [Inspect] button opens AST inspector modal showing AST tree with Def/Sig/Hide toggles
|
||||
- [Slices] button opens Text Viewer with file content for slice management
|
||||
- FileItem.ast_mask stores mask per AST path (Def/Sig/Hide)
|
||||
- FileItem.custom_slices stores user-defined slices with line ranges
|
||||
|
||||
### Gaps to Fill (This Track's Scope)
|
||||
- Inspect popup shows AST but doesn't show file content with highlighted slices
|
||||
- Slices editor is just a list of line ranges - no visual representation
|
||||
- No annotation support (tags/comments) for custom slices
|
||||
- No view presets (named combinations of view settings)
|
||||
- AST-derived slices not shown before user creates custom slice
|
||||
|
||||
## Goals
|
||||
1. Slice inspector shows file content with AST-derived slices visually highlighted
|
||||
2. Custom slices have visual representation (colored ranges) in slice editor
|
||||
3. Each slice can have optional tag and comment annotation
|
||||
4. View presets allow naming and reusing view configurations
|
||||
5. User can toggle which AST elements are included in each view
|
||||
|
||||
## Functional Requirements
|
||||
### Slice Inspector (replaces Inspect button)
|
||||
- Opens as popup showing full file content with line numbers
|
||||
- AST-derived slices highlighted with distinct colors:
|
||||
- Sig elements: one color
|
||||
- Def elements: another color
|
||||
- User can toggle visibility of each AST element (Def/Sig/Hide)
|
||||
- Changes persist to FileItem.ast_mask
|
||||
|
||||
### Slice Editor (extends Slices button)
|
||||
- Visual file content display (not just line number list)
|
||||
- Custom slices shown as colored overlays on the content
|
||||
- Click-drag to select line range for new slice
|
||||
- Each custom slice has:
|
||||
- Line range
|
||||
- Tag (optional, e.g., "performance", "api", "bug")
|
||||
- Comment (optional, free-text explanation)
|
||||
- Remove/edit existing custom slices
|
||||
|
||||
### View Presets
|
||||
- Named presets defining default view + default slices per file type
|
||||
- Examples:
|
||||
- "Debug View" = full text + error-prone line slices
|
||||
- "API Surface" = sig + public API function slices
|
||||
- Presets project-scoped, saved in project config
|
||||
- User can select preset, then override for specific file
|
||||
|
||||
## Architecture Reference
|
||||
- `src/gui_2.py:_render_ast_inspector_modal()` - needs enhancement
|
||||
- `src/models.py:FileItem.ast_mask` - existing mask storage
|
||||
- `src/models.py:FileItem.custom_slices` - needs tag/comment support
|
||||
- `docs/superpowers/specs/2026-05-10-context-composition-redesign-design.md`
|
||||
|
||||
## Out of Scope
|
||||
- Context preset save/load UI (Phase 3)
|
||||
- Context preview before send (Phase 3)
|
||||
- Changes to Files & Media panel (Phase 1)
|
||||
Reference in New Issue
Block a user