Compare commits

3 Commits

Author SHA1 Message Date
Ed_
abe1c660ea conductor(tracks): Add two deferred future tracks
- aggregation_smarter_summaries: Sub-agent summarization, hash-based caching
- system_context_exposure: Expose hidden _SYSTEM_PROMPT for user customization
2026-03-22 12:43:47 -04:00
Ed_
dd520dd4db conductor(tracks): Add discussion_hub_panel_reorganization track
This track addresses the fragmented implementation of Session Context Snapshots
and Discussion Takes & Timeline Branching tracks (2026-03-11) which were
marked complete but the UI panel layout was not properly reorganized.

New track structure:
- Phase 1: Remove ui_summary_only, rename Context Hub to Project Settings
- Phase 2: Merge Session Hub into Discussion Hub (4 tabs)
- Phase 3: Context Composition tab (per-discussion file filter)
- Phase 4: DAW-style Takes timeline integration
- Phase 5: Final integration and cleanup

Also archives the two botched tracks and updates tracks.md.
2026-03-22 12:35:32 -04:00
Ed_
f6fe3baaf4 fix(gui): Skip empty strings in selectable to prevent ImGui ID assertion
Empty strings in bias_profiles.keys() and personas.keys() caused
imgui.selectable() to fail with 'Cannot have an empty ID at root of
window' assertion error. Added guards to skip empty names.
2026-03-22 11:16:52 -04:00
20 changed files with 624 additions and 47 deletions

View File

@@ -1,7 +1,7 @@
--- ---
description: Fast, read-only agent for exploring the codebase structure description: Fast, read-only agent for exploring the codebase structure
mode: subagent mode: subagent
model: MiniMax-M2.5 model: minimax-coding-plan/MiniMax-M2.7
temperature: 0.2 temperature: 0.2
permission: permission:
edit: deny edit: deny
@@ -78,4 +78,4 @@ Return concise findings with file:line references:
### Summary ### Summary
[One-paragraph summary of findings] [One-paragraph summary of findings]
``` ```

View File

@@ -1,7 +1,7 @@
--- ---
description: General-purpose agent for researching complex questions and executing multi-step tasks description: General-purpose agent for researching complex questions and executing multi-step tasks
mode: subagent mode: subagent
model: MiniMax-M2.5 model: minimax-coding-plan/MiniMax-M2.7
temperature: 0.3 temperature: 0.3
--- ---
@@ -81,4 +81,4 @@ Return detailed findings with evidence:
### Recommendations ### Recommendations
- [Suggested next steps if applicable] - [Suggested next steps if applicable]
``` ```

View File

@@ -1,7 +1,7 @@
--- ---
description: Tier 1 Orchestrator for product alignment, high-level planning, and track initialization description: Tier 1 Orchestrator for product alignment, high-level planning, and track initialization
mode: primary mode: primary
model: MiniMax-M2.5 model: minimax-coding-plan/MiniMax-M2.7
temperature: 0.5 temperature: 0.5
permission: permission:
edit: ask edit: ask
@@ -18,7 +18,7 @@ ONLY output the requested text. No pleasantries.
## Context Management ## Context Management
**MANUAL COMPACTION ONLY** Never rely on automatic context summarization. **MANUAL COMPACTION ONLY** <EFBFBD> Never rely on automatic context summarization.
Use `/compact` command explicitly when context needs reduction. Use `/compact` command explicitly when context needs reduction.
Preserve full context during track planning and spec creation. Preserve full context during track planning and spec creation.
@@ -105,7 +105,7 @@ Use `manual-slop_py_get_code_outline`, `manual-slop_py_get_definition`,
Document existing implementations with file:line references in a Document existing implementations with file:line references in a
"Current State Audit" section in the spec. "Current State Audit" section in the spec.
**FAILURE TO AUDIT = TRACK FAILURE** Previous tracks failed because specs **FAILURE TO AUDIT = TRACK FAILURE** <EFBFBD> Previous tracks failed because specs
asked to implement features that already existed. asked to implement features that already existed.
### 2. Identify Gaps, Not Features ### 2. Identify Gaps, Not Features
@@ -175,4 +175,4 @@ Focus: {One-sentence scope}
- Do NOT use native `edit` tool - use MCP tools - Do NOT use native `edit` tool - use MCP tools
- DO NOT SKIP A TEST IN PYTEST JUST BECAUSE ITS BROKEN AND HAS NO TRIVIAL SOLUTION OR FIX. - DO NOT SKIP A TEST IN PYTEST JUST BECAUSE ITS BROKEN AND HAS NO TRIVIAL SOLUTION OR FIX.
- DO NOT SIMPLIFY A TEST JUST BECAUSE IT HAS NO TRIVIAL SOLUTION TO FIX. - DO NOT SIMPLIFY A TEST JUST BECAUSE IT HAS NO TRIVIAL SOLUTION TO FIX.
- DO NOT CREATE MOCK PATCHES TO PSEUDO API CALLS OR HOOKS BECAUSE THE APP SOURCE WAS CHANGED. ADAPT TESTS PROPERLY. - DO NOT CREATE MOCK PATCHES TO PSEUDO API CALLS OR HOOKS BECAUSE THE APP SOURCE WAS CHANGED. ADAPT TESTS PROPERLY.

View File

@@ -1,7 +1,7 @@
--- ---
description: Tier 2 Tech Lead for architectural design and track execution with persistent memory description: Tier 2 Tech Lead for architectural design and track execution with persistent memory
mode: primary mode: primary
model: MiniMax-M2.5 model: minimax-coding-plan/MiniMax-M2.7
temperature: 0.4 temperature: 0.4
permission: permission:
edit: ask edit: ask
@@ -14,9 +14,9 @@ ONLY output the requested text. No pleasantries.
## Context Management ## Context Management
**MANUAL COMPACTION ONLY** Never rely on automatic context summarization. **MANUAL COMPACTION ONLY** <EFBFBD> Never rely on automatic context summarization.
Use `/compact` command explicitly when context needs reduction. Use `/compact` command explicitly when context needs reduction.
You maintain PERSISTENT MEMORY throughout track execution do NOT apply Context Amnesia to your own session. You maintain PERSISTENT MEMORY throughout track execution <EFBFBD> do NOT apply Context Amnesia to your own session.
## CRITICAL: MCP Tools Only (Native Tools Banned) ## CRITICAL: MCP Tools Only (Native Tools Banned)
@@ -134,14 +134,14 @@ Before implementing:
- Zero-assertion ban: Tests MUST have meaningful assertions - Zero-assertion ban: Tests MUST have meaningful assertions
- Delegate test creation to Tier 3 Worker via Task tool - Delegate test creation to Tier 3 Worker via Task tool
- Run tests and confirm they FAIL as expected - Run tests and confirm they FAIL as expected
- **CONFIRM FAILURE** this is the Red phase - **CONFIRM FAILURE** <EFBFBD> this is the Red phase
### 3. Green Phase: Implement to Pass ### 3. Green Phase: Implement to Pass
- **Pre-delegation checkpoint**: Stage current progress (`git add .`) - **Pre-delegation checkpoint**: Stage current progress (`git add .`)
- Delegate implementation to Tier 3 Worker via Task tool - Delegate implementation to Tier 3 Worker via Task tool
- Run tests and confirm they PASS - Run tests and confirm they PASS
- **CONFIRM PASS** this is the Green phase - **CONFIRM PASS** <EFBFBD> this is the Green phase
### 4. Refactor Phase (Optional) ### 4. Refactor Phase (Optional)
@@ -213,4 +213,4 @@ When all tasks in a phase are complete:
- Do NOT use native `edit` tool - use MCP tools - Do NOT use native `edit` tool - use MCP tools
- DO NOT SKIP A TEST IN PYTEST JUST BECAUSE ITS BROKEN AND HAS NO TRIVIAL SOLUTION OR FIX. - DO NOT SKIP A TEST IN PYTEST JUST BECAUSE ITS BROKEN AND HAS NO TRIVIAL SOLUTION OR FIX.
- DO NOT SIMPLIFY A TEST JUST BECAUSE IT HAS NO TRIVIAL SOLUTION TO FIX. - DO NOT SIMPLIFY A TEST JUST BECAUSE IT HAS NO TRIVIAL SOLUTION TO FIX.
- DO NOT CREATE MOCK PATCHES TO PSEUDO API CALLS OR HOOKS BECAUSE THE APP SOURCE WAS CHANGED. ADAPT TESTS PROPERLY. - DO NOT CREATE MOCK PATCHES TO PSEUDO API CALLS OR HOOKS BECAUSE THE APP SOURCE WAS CHANGED. ADAPT TESTS PROPERLY.

View File

@@ -1,7 +1,7 @@
--- ---
description: Stateless Tier 3 Worker for surgical code implementation and TDD description: Stateless Tier 3 Worker for surgical code implementation and TDD
mode: subagent mode: subagent
model: MiniMax-M2.5 model: minimax-coding-plan/minimax-m2.7
temperature: 0.3 temperature: 0.3
permission: permission:
edit: allow edit: allow
@@ -133,4 +133,4 @@ If you cannot complete the task:
- Do NOT modify files outside the specified scope - Do NOT modify files outside the specified scope
- DO NOT SKIP A TEST IN PYTEST JUST BECAUSE ITS BROKEN AND HAS NO TRIVIAL SOLUTION OR FIX. - DO NOT SKIP A TEST IN PYTEST JUST BECAUSE ITS BROKEN AND HAS NO TRIVIAL SOLUTION OR FIX.
- DO NOT SIMPLIFY A TEST JUST BECAUSE IT HAS NO TRIVIAL SOLUTION TO FIX. - DO NOT SIMPLIFY A TEST JUST BECAUSE IT HAS NO TRIVIAL SOLUTION TO FIX.
- DO NOT CREATE MOCK PATCHES TO PSEUDO API CALLS OR HOOKS BECAUSE THE APP SOURCE WAS CHANGED. ADAPT TESTS PROPERLY. - DO NOT CREATE MOCK PATCHES TO PSEUDO API CALLS OR HOOKS BECAUSE THE APP SOURCE WAS CHANGED. ADAPT TESTS PROPERLY.

View File

@@ -1,7 +1,7 @@
--- ---
description: Stateless Tier 4 QA Agent for error analysis and diagnostics description: Stateless Tier 4 QA Agent for error analysis and diagnostics
mode: subagent mode: subagent
model: MiniMax-M2.5 model: minimax-coding-plan/MiniMax-M2.7
temperature: 0.2 temperature: 0.2
permission: permission:
edit: deny edit: deny
@@ -119,4 +119,4 @@ If you cannot analyze the error:
- Do NOT read full large files - use skeleton tools first - Do NOT read full large files - use skeleton tools first
- DO NOT SKIP A TEST IN PYTEST JUST BECAUSE ITS BROKEN AND HAS NO TRIVIAL SOLUTION OR FIX. - DO NOT SKIP A TEST IN PYTEST JUST BECAUSE ITS BROKEN AND HAS NO TRIVIAL SOLUTION OR FIX.
- DO NOT SIMPLIFY A TEST JUST BECAUSE IT HAS NO TRIVIAL SOLUTION TO FIX. - DO NOT SIMPLIFY A TEST JUST BECAUSE IT HAS NO TRIVIAL SOLUTION TO FIX.
- DO NOT CREATE MOCK PATCHES TO PSEUDO API CALLS OR HOOKS BECAUSE THE APP SOURCE WAS CHANGED. ADAPT TESTS PROPERLY. - DO NOT CREATE MOCK PATCHES TO PSEUDO API CALLS OR HOOKS BECAUSE THE APP SOURCE WAS CHANGED. ADAPT TESTS PROPERLY.

View File

@@ -1,4 +1,4 @@
# Project Tracks # Project Tracks
This file tracks all major tracks for the project. Each track has its own detailed plan in its respective folder. This file tracks all major tracks for the project. Each track has its own detailed plan in its respective folder.
@@ -35,9 +35,17 @@ This file tracks all major tracks for the project. Each track has its own detail
7. [ ] **Track: Optimization pass for Data-Oriented Python heuristics** 7. [ ] **Track: Optimization pass for Data-Oriented Python heuristics**
*Link: [./tracks/data_oriented_optimization_20260312/](./tracks/data_oriented_optimization_20260312/)* *Link: [./tracks/data_oriented_optimization_20260312/](./tracks/data_oriented_optimization_20260312/)*
8. [x] **Track: Rich Thinking Trace Handling** - *Parse and display AI thinking/reasoning traces* 8. [x] **Track: Rich Thinking Trace Handling** - *Parse and display AI thinking/reasoning traces*
*Link: [./tracks/thinking_trace_handling_20260313/](./tracks/thinking_trace_handling_20260313/)* *Link: [./tracks/thinking_trace_handling_20260313/](./tracks/thinking_trace_handling_20260313/)*
9. [ ] **Track: Smarter Aggregation with Sub-Agent Summarization**
*Link: [./tracks/aggregation_smarter_summaries_20260322/](./tracks/aggregation_smarter_summaries_20260322/)*
*Goal: Sub-agent summarization during aggregation pass, hash-based caching for file summaries, smart outline generation for code vs text files.*
10. [ ] **Track: System Context Exposure**
*Link: [./tracks/system_context_exposure_20260322/](./tracks/system_context_exposure_20260322/)*
*Goal: Expose hidden _SYSTEM_PROMPT from ai_client.py to users for customization via AI Settings.*
--- ---
### GUI Overhauls & Visualizations ### GUI Overhauls & Visualizations
@@ -67,14 +75,18 @@ This file tracks all major tracks for the project. Each track has its own detail
*Link: [./tracks/presets_ai_settings_ux_20260311/](./tracks/presets_ai_settings_ux_20260311/)* *Link: [./tracks/presets_ai_settings_ux_20260311/](./tracks/presets_ai_settings_ux_20260311/)*
*Goal: Improve the layout, scaling, and control ergonomics of the Preset windows (Personas, Prompts, Tools) and AI Settings panel. Includes dual-control sliders and categorized tool management.* *Goal: Improve the layout, scaling, and control ergonomics of the Preset windows (Personas, Prompts, Tools) and AI Settings panel. Includes dual-control sliders and categorized tool management.*
8. [x] **Track: Session Context Snapshots & Visibility** 8. [x] ~~**Track: Session Context Snapshots & Visibility**~~ (Archived 2026-03-22 - Replaced by discussion_hub_panel_reorganization)
*Link: [./tracks/session_context_snapshots_20260311/](./tracks/session_context_snapshots_20260311/)* *Link: [./tracks/session_context_snapshots_20260311/](./tracks/session_context_snapshots_20260311/)*
*Goal: Session-scoped context management, saving Context Presets, MMA assignment, and agent-focused session filtering in the UI.* *Goal: Session-scoped context management, saving Context Presets, MMA assignment, and agent-focused session filtering in the UI.*
9. [x] **Track: Discussion Takes & Timeline Branching** 9. [x] ~~**Track: Discussion Takes & Timeline Branching**~~ (Archived 2026-03-22 - Replaced by discussion_hub_panel_reorganization)
*Link: [./tracks/discussion_takes_branching_20260311/](./tracks/discussion_takes_branching_20260311/)* *Link: [./tracks/discussion_takes_branching_20260311/](./tracks/discussion_takes_branching_20260311/)*
*Goal: Non-linear discussion timelines via tabbed "takes", message branching, and synthesis generation workflows.* *Goal: Non-linear discussion timelines via tabbed "takes", message branching, and synthesis generation workflows.*
12. [ ] **Track: Discussion Hub Panel Reorganization**
*Link: [./tracks/discussion_hub_panel_reorganization_20260322/](./tracks/discussion_hub_panel_reorganization_20260322/)*
*Goal: Properly merge Session Hub into Discussion Hub (4 tabs: Discussion | Context Composition | Snapshot | Takes), establish Files & Media as project-level inventory, deprecate ui_summary_only, implement Context Composition and DAW-style Takes.*
10. [ ] **Track: Undo/Redo History Support** 10. [ ] **Track: Undo/Redo History Support**
*Link: [./tracks/undo_redo_history_20260311/](./tracks/undo_redo_history_20260311/)* *Link: [./tracks/undo_redo_history_20260311/](./tracks/undo_redo_history_20260311/)*
*Goal: Robust, non-provider based undo/redo for text inputs, UI controls, discussion mutations, and context management. Includes hotkey support and a history list view.* *Goal: Robust, non-provider based undo/redo for text inputs, UI controls, discussion mutations, and context management. Includes hotkey support and a history list view.*

View File

@@ -0,0 +1,17 @@
{
"name": "aggregation_smarter_summaries",
"created": "2026-03-22",
"status": "future",
"priority": "medium",
"affected_files": [
"src/aggregate.py",
"src/file_cache.py",
"src/ai_client.py",
"src/models.py"
],
"related_tracks": [
"discussion_hub_panel_reorganization (in_progress)",
"system_context_exposure (future)"
],
"notes": "Deferred from discussion_hub_panel_reorganization planning. Improves aggregation with sub-agent summarization and hash-based caching."
}

View File

@@ -0,0 +1,49 @@
# Implementation Plan: Smarter Aggregation with Sub-Agent Summarization
## Phase 1: Hash-Based Summary Cache
Focus: Implement file hashing and cache storage
- [ ] Task: Research existing file hash implementations in codebase
- [ ] Task: Design cache storage format (file-based vs project state)
- [ ] Task: Implement hash computation for aggregation files
- [ ] Task: Implement summary cache storage and retrieval
- [ ] Task: Add cache invalidation when file content changes
- [ ] Task: Write tests for hash computation and cache
- [ ] Task: Conductor - User Manual Verification 'Phase 1: Hash-Based Summary Cache'
## Phase 2: Sub-Agent Summarization
Focus: Implement sub-agent summarization during aggregation
- [ ] Task: Audit current aggregate.py flow
- [ ] Task: Define summarization prompt strategy for code vs text files
- [ ] Task: Implement sub-agent invocation during aggregation
- [ ] Task: Handle provider-specific differences in sub-agent calls
- [ ] Task: Write tests for sub-agent summarization
- [ ] Task: Conductor - User Manual Verification 'Phase 2: Sub-Agent Summarization'
## Phase 3: Tiered Aggregation Strategy
Focus: Respect tier-level aggregation configuration
- [ ] Task: Audit how tiers receive context currently
- [ ] Task: Implement tier-level aggregation strategy selection
- [ ] Task: Connect tier strategy to Persona configuration
- [ ] Task: Write tests for tiered aggregation
- [ ] Task: Conductor - User Manual Verification 'Phase 3: Tiered Aggregation Strategy'
## Phase 4: UI Integration
Focus: Expose cache status and controls in UI
- [ ] Task: Add cache status indicator to Files & Media panel
- [ ] Task: Add "Clear Summary Cache" button
- [ ] Task: Add aggregation configuration to Project Settings or AI Settings
- [ ] Task: Write tests for UI integration
- [ ] Task: Conductor - User Manual Verification 'Phase 4: UI Integration'
## Phase 5: Cache Persistence & Optimization
Focus: Ensure cache persists and is performant
- [ ] Task: Implement persistent cache storage to disk
- [ ] Task: Add cache size management (max entries, LRU)
- [ ] Task: Performance testing with large codebases
- [ ] Task: Write tests for persistence
- [ ] Task: Conductor - User Manual Verification 'Phase 5: Cache Persistence & Optimization'

View File

@@ -0,0 +1,103 @@
# Specification: Smarter Aggregation with Sub-Agent Summarization
## 1. Overview
This track improves the context aggregation system to use sub-agent passes for intelligent summarization and hash-based caching to avoid redundant work.
**Current Problem:**
- Aggregation is a simple pass that either injects full file content or a basic skeleton
- No intelligence applied to determine what level of detail is needed
- Same files get re-summarized on every discussion start even if unchanged
**Goal:**
- Use a sub-agent during aggregation pass for high-tier agents to generate succinct summaries
- Cache summaries based on file hash - only re-summarize if file changed
- Smart outline generation for code files, summary for text files
## 2. Current State Audit
### Existing Aggregation Behavior
- `aggregate.py` handles context aggregation
- `file_cache.py` provides AST parsing and skeleton generation
- Per-file flags: `Auto-Aggregate` (summarize), `Force Full` (inject raw)
- No caching of summarization results
### Provider API Considerations
- Different providers have different prompt/caching mechanisms
- Need to verify how each provider handles system context and caching
- May need provider-specific aggregation strategies
## 3. Functional Requirements
### 3.1 Hash-Based Summary Cache
- Generate SHA256 hash of file content
- Store summaries in a cache (file-based or in project state)
- Before summarizing, check if file hash matches cached summary
- Cache invalidation when file content changes
### 3.2 Sub-Agent Summarization Pass
- During aggregation, optionally invoke sub-agent for summarization
- Sub-agent generates concise summary of file purpose and key points
- Different strategies for:
- Code files: AST-based outline + key function signatures
- Text files: Paragraph-level summary
- Config files: Key-value extraction
### 3.3 Tiered Aggregation Strategy
- Tier 3/4 workers: Get skeleton outlines (fast, cheap)
- Tier 2 (Tech Lead): Get summaries with key details
- Tier 1 (Orchestrator): May get full content or enhanced summaries
- Configurable per-agent via Persona
### 3.4 Cache Persistence
- Summaries persist across sessions
- Stored in project directory or centralized cache location
- Manual cache clear option in UI
## 4. Data Model
### 4.1 Summary Cache Entry
```python
{
"file_path": str,
"file_hash": str, # SHA256 of content
"summary": str,
"outline": str, # For code files
"generated_at": str, # ISO timestamp
"generator_tier": str, # Which tier generated it
}
```
### 4.2 Aggregation Config
```toml
[aggregation]
default_mode = "summarize" # "full", "summarize", "outline"
cache_enabled = true
cache_dir = ".slop_cache"
```
## 5. UI Changes
- Add "Clear Summary Cache" button in Files & Media or Context Composition
- Show cached status indicator on files (similar to AST cache indicator)
- Configuration in AI Settings or Project Settings
## 6. Acceptance Criteria
- [ ] File hash computed before summarization
- [ ] Summary cache persists across app restarts
- [ ] Sub-agent generates better summaries than basic skeleton
- [ ] Aggregation respects tier-level configuration
- [ ] Cache can be manually cleared
- [ ] Provider APIs handle aggregated context correctly
## 7. Out of Scope
- Changes to provider API internals
- Vector store / embeddings for RAG (separate track)
- Changes to Session Hub / Discussion Hub layout
## 8. Dependencies
- `aggregate.py` - main aggregation logic
- `file_cache.py` - AST parsing and caching
- `ai_client.py` - sub-agent invocation
- `models.py` - may need new config structures

View File

@@ -0,0 +1,22 @@
{
"name": "discussion_hub_panel_reorganization",
"created": "2026-03-22",
"status": "in_progress",
"priority": "high",
"affected_files": [
"src/gui_2.py",
"src/models.py",
"src/project_manager.py",
"tests/test_gui_context_presets.py",
"tests/test_discussion_takes.py"
],
"replaces": [
"session_context_snapshots_20260311",
"discussion_takes_branching_20260311"
],
"related_tracks": [
"aggregation_smarter_summaries (future)",
"system_context_exposure (future)"
],
"notes": "These earlier tracks were marked complete but the UI panel reorganization was not properly implemented. This track consolidates and properly executes the intended UX."
}

View File

@@ -0,0 +1,55 @@
# Implementation Plan: Discussion Hub Panel Reorganization
## Phase 1: Cleanup & Project Settings Rename
Focus: Remove redundant ui_summary_only, rename Context Hub, establish project-level vs discussion-level separation
- [ ] Task: Audit current ui_summary_only usages and document behavior to deprecate
- [ ] Task: Remove ui_summary_only checkbox from _render_projects_panel (gui_2.py)
- [ ] Task: Rename Context Hub to "Project Settings" in _gui_func tab bar
- [ ] Task: Remove Context Presets tab from Project Settings (Context Hub)
- [ ] Task: Update references in show_windows dict and any help text
- [ ] Task: Write tests verifying ui_summary_only removal doesn't break existing functionality
- [ ] Task: Conductor - User Manual Verification 'Phase 1: Cleanup & Project Settings Rename'
## Phase 2: Merge Session Hub into Discussion Hub
Focus: Move Session Hub tabs into Discussion Hub, eliminate separate Session Hub window
- [ ] Task: Audit Session Hub (_render_session_hub) tab content
- [ ] Task: Add Snapshot tab to Discussion Hub containing Aggregate MD + System Prompt preview
- [ ] Task: Remove Session Hub window from _gui_func
- [ ] Task: Add Discussion Hub tab bar structure (Discussion | Context Composition | Snapshot | Takes)
- [ ] Task: Write tests for new tab structure rendering
- [ ] Task: Conductor - User Manual Verification 'Phase 2: Merge Session Hub into Discussion Hub'
## Phase 3: Context Composition Tab
Focus: Per-discussion file filter with save/load preset functionality
- [ ] Task: Write tests for Context Composition state management
- [ ] Task: Create _render_context_composition_panel method
- [ ] Task: Implement file/screenshot selection display (filtered from Files & Media)
- [ ] Task: Implement per-file flags display (Auto-Aggregate, Force Full)
- [ ] Task: Implement Save as Preset / Load Preset buttons
- [ ] Task: Connect Context Presets storage to this panel
- [ ] Task: Update Persona editor to reference Context Composition presets
- [ ] Task: Write tests for Context Composition preset save/load
- [ ] Task: Conductor - User Manual Verification 'Phase 3: Context Composition Tab'
## Phase 4: Takes Timeline Integration
Focus: DAW-style branching with proper visual timeline and synthesis
- [ ] Task: Audit existing takes data structure and synthesis_formatter
- [ ] Task: Enhance takes data model with parent_entry and parent_take tracking
- [ ] Task: Implement Branch from Entry action in discussion history
- [ ] Task: Implement visual timeline showing take divergence
- [ ] Task: Integrate synthesis panel into Takes tab
- [ ] Task: Implement take selection for synthesis
- [ ] Task: Write tests for take branching and synthesis
- [ ] Task: Conductor - User Manual Verification 'Phase 4: Takes Timeline Integration'
## Phase 5: Final Integration & Cleanup
Focus: Ensure all panels work together, remove dead code
- [ ] Task: Run full test suite to verify no regressions
- [ ] Task: Remove dead code from ui_summary_only references
- [ ] Task: Update conductor/tracks.md to mark old session_context_snapshots and discussion_takes_branching as archived/replaced
- [ ] Task: Conductor - User Manual Verification 'Phase 5: Final Integration & Cleanup'

View File

@@ -0,0 +1,137 @@
# Specification: Discussion Hub Panel Reorganization
## 1. Overview
This track addresses the fragmented implementation of Session Context Snapshots and Discussion Takes & Timeline Branching tracks (2026-03-11). Those tracks were marked complete but the UI panel layout was not properly reorganized.
**Goal:** Create a coherent Discussion Hub that absorbs Session Hub functionality, establishes Files & Media as project-level file inventory, and properly implements Context Composition and DAW-style Takes branching.
## 2. Current State Audit (as of 2026-03-22)
### Already Implemented (DO NOT re-implement)
- `ui_summary_only` checkbox in Projects panel
- Session Hub as separate window with tabs: Aggregate MD | System Prompt
- Context Hub with tabs: Projects | Paths | Context Presets
- Context Presets save/load mechanism in project TOML
- `_render_synthesis_panel()` method (gui_2.py:2612-2643) - basic synthesis UI
- Takes data structure in `project['discussion']['discussions']`
- Per-file `Auto-Aggregate` and `Force Full` flags in Files & Media
### Gaps to Fill (This Track's Scope)
1. `ui_summary_only` is redundant with per-file flags - deprecate it
2. Context Hub renamed to "Project Settings" (remove Context Presets tab)
3. Session Hub merged into Discussion Hub as tabs
4. Files & Media stays separate as project-level inventory
5. Context Composition tab in Discussion Hub for per-discussion filter
6. Context Presets accessible via Context Composition (save/load filters)
7. DAW-style Takes timeline properly integrated into Discussion Hub
8. Synthesis properly integrated with Take selection
## 3. Panel Layout Target
| Panel | Location | Purpose |
|-------|----------|---------|
| **AI Settings** | Separate dockable | Provider, model, system prompts, tool presets, bias profiles |
| **Files & Media** | Separate dockable | Project-level file inventory (addressable files) |
| **Project Settings** | Context Hub → rename | Git dir, paths, project list (NO context stuff) |
| **Discussion Hub** | Main hub | All discussion-related UI (tabs below) |
| **MMA Dashboard** | Separate dockable | Multi-agent orchestration |
| **Operations Hub** | Separate dockable | Tool calls, comms history, external tools |
| **Diagnostics** | Separate dockable | Telemetry, logs |
**Discussion Hub Tabs:**
1. **Discussion** - Main conversation view (current implementation)
2. **Context Composition** - File/screenshot filter + presets (NEW)
3. **Snapshot** - Aggregate MD + System Prompt preview (moved from Session Hub)
4. **Takes** - DAW-style timeline branching + synthesis (integrated, not separate panel)
## 4. Functional Requirements
### 4.1 Deprecate ui_summary_only
- Remove `ui_summary_only` checkbox from Projects panel
- Per-file flags (`Auto-Aggregate`, `Force Full`) are the intended mechanism
- Document migration path for users
### 4.2 Rename Context Hub → Project Settings
- Context Hub tab bar: Projects | Paths
- Remove "Context Presets" tab
- All context-related functionality moves to Discussion Hub → Context Composition
### 4.3 Merge Session Hub into Discussion Hub
- Session Hub window eliminated
- Its content becomes tabs in Discussion Hub:
- **Snapshot tab**: Aggregate MD preview, System Prompt preview, "Copy" buttons
- These were previously in Session Hub
### 4.4 Context Composition Tab (NEW)
- Shows currently selected files/screenshots for THIS discussion
- Per-file flags: Auto-Aggregate, Force Full
- **"Save as Preset"** / **"Load Preset"** buttons
- Dropdown to select from saved presets
- Relationship to Files & Media:
- Files & Media = the inventory (project-level)
- Context Composition = selected filter for current discussion
### 4.5 Takes Timeline (DAW-Style)
- **New Take**: Start fresh discussion thread
- **Branch Take**: Fork from any discussion entry
- **Switch Take**: Make a take the active discussion
- **Rename/Delete Take**
- All takes share the same Files & Media (not duplicated)
- Non-destructive branching
- Visual timeline showing divergence points
### 4.6 Synthesis Integration
- User selects 2+ takes via checkboxes
- Click "Synthesize" button
- AI generates "resolved" response considering all selected approaches
- Result appears as new take
- Accessible from Discussion Hub → Takes tab
## 5. Data Model Changes
### 5.1 Discussion State Structure
```python
# Per discussion in project['discussion']['discussions']
{
"name": str,
"history": [
{"role": "user"|"assistant", "content": str, "ts": str, "files_injected": [...]}
],
"parent_entry": Optional[int], # index of parent message if branched
"parent_take": Optional[str], # name of parent take if branched
}
```
### 5.2 Context Preset Format
```toml
[context_preset.my_filter]
files = ["path/to/file_a.py"]
auto_aggregate = true
force_full = false
screenshots = ["path/to/shot1.png"]
```
## 6. Non-Functional Requirements
- All changes must not break existing tests
- New tests required for new functionality
- Follow 1-space indentation Python code style
- No comments unless explicitly requested
## 7. Acceptance Criteria
- [ ] `ui_summary_only` removed from Projects panel
- [ ] Context Hub renamed to Project Settings
- [ ] Session Hub window eliminated
- [ ] Discussion Hub has 4 tabs: Discussion, Context Composition, Snapshot, Takes
- [ ] Context Composition allows save/load of filter presets
- [ ] Takes can be branched from any entry
- [ ] Takes timeline shows divergence visually
- [ ] Synthesis works with 2+ selected takes
- [ ] All existing tests still pass
- [ ] New tests cover new functionality
## 8. Out of Scope
- Aggregation improvements (sub-agent summarization, hash-based caching) - separate future track
- System prompt exposure (`_SYSTEM_PROMPT` in ai_client.py) - separate future track
- Session sophistication (Session as container for multiple discussions) - deferred

View File

@@ -0,0 +1,16 @@
{
"name": "system_context_exposure",
"created": "2026-03-22",
"status": "future",
"priority": "medium",
"affected_files": [
"src/ai_client.py",
"src/gui_2.py",
"src/models.py"
],
"related_tracks": [
"discussion_hub_panel_reorganization (in_progress)",
"aggregation_smarter_summaries (future)"
],
"notes": "Deferred from discussion_hub_panel_reorganization planning. The _SYSTEM_PROMPT in ai_client.py is hidden from users - this exposes it for customization."
}

View File

@@ -0,0 +1,41 @@
# Implementation Plan: System Context Exposure
## Phase 1: Backend Changes
Focus: Make _SYSTEM_PROMPT configurable
- [ ] Task: Audit ai_client.py system prompt flow
- [ ] Task: Move _SYSTEM_PROMPT to configurable storage
- [ ] Task: Implement load/save of base system prompt
- [ ] Task: Modify _get_combined_system_prompt() to use config
- [ ] Task: Write tests for configurable system prompt
- [ ] Task: Conductor - User Manual Verification 'Phase 1: Backend Changes'
## Phase 2: UI Implementation
Focus: Add base prompt editor to AI Settings
- [ ] Task: Add UI controls to _render_system_prompts_panel
- [ ] Task: Implement checkbox for "Use Default Base"
- [ ] Task: Implement collapsible base prompt editor
- [ ] Task: Add "Reset to Default" button
- [ ] Task: Write tests for UI controls
- [ ] Task: Conductor - User Manual Verification 'Phase 2: UI Implementation'
## Phase 3: Persistence & Provider Testing
Focus: Ensure persistence and cross-provider compatibility
- [ ] Task: Verify base prompt persists across app restarts
- [ ] Task: Test with Gemini provider
- [ ] Task: Test with Anthropic provider
- [ ] Task: Test with DeepSeek provider
- [ ] Task: Test with Gemini CLI adapter
- [ ] Task: Conductor - User Manual Verification 'Phase 3: Persistence & Provider Testing'
## Phase 4: Safety & Defaults
Focus: Ensure users can recover from bad edits
- [ ] Task: Implement confirmation dialog before saving custom base
- [ ] Task: Add validation for empty/invalid prompts
- [ ] Task: Document the base prompt purpose in UI
- [ ] Task: Add "Show Diff" between default and custom
- [ ] Task: Write tests for safety features
- [ ] Task: Conductor - User Manual Verification 'Phase 4: Safety & Defaults'

View File

@@ -0,0 +1,120 @@
# Specification: System Context Exposure
## 1. Overview
This track exposes the hidden system prompt from `ai_client.py` to users for customization.
**Current Problem:**
- `_SYSTEM_PROMPT` in `ai_client.py` (lines ~118-143) is hardcoded
- It contains foundational instructions: "You are a helpful coding assistant with access to a PowerShell tool..."
- Users can only see/appending their custom portion via `_custom_system_prompt`
- The base prompt that defines core agent capabilities is invisible
**Goal:**
- Make `_SYSTEM_PROMPT` visible and editable in the UI
- Allow users to customize the foundational agent instructions
- Maintain sensible defaults while enabling expert customization
## 2. Current State Audit
### Hidden System Prompt Location
`src/ai_client.py`:
```python
_SYSTEM_PROMPT: str = (
"You are a helpful coding assistant with access to a PowerShell tool (run_powershell) and MCP tools (file access: read_file, list_directory, search_files, get_file_summary, web access: web_search, fetch_url). "
"When calling file/directory tools, always use the 'path' parameter for the target path. "
...
)
```
### Related State
- `_custom_system_prompt` - user-defined append/injection
- `_get_combined_system_prompt()` - merges both
- `set_custom_system_prompt()` - setter for user portion
### UI Current State
- AI Settings → System Prompts shows global and project prompts
- These are injected as `[USER SYSTEM PROMPT]` after `_SYSTEM_PROMPT`
- But `_SYSTEM_PROMPT` itself is never shown
## 3. Functional Requirements
### 3.1 Base System Prompt Visibility
- Add "Base System Prompt" section in AI Settings
- Display current `_SYSTEM_PROMPT` content
- Allow editing with syntax highlighting (it's markdown text)
### 3.2 Default vs Custom Base
- Maintain default base prompt as reference
- User can reset to default if they mess it up
- Show diff between default and custom
### 3.3 Persistence
- Custom base prompt stored in config or project TOML
- Loaded on app start
- Applied before `_custom_system_prompt` in `_get_combined_system_prompt()`
### 3.4 Provider Considerations
- Some providers handle system prompts differently
- Verify behavior across Gemini, Anthropic, DeepSeek
- May need provider-specific base prompts
## 4. Data Model
### 4.1 Config Storage
```toml
[ai_settings]
base_system_prompt = """..."""
use_default_base = true
```
### 4.2 Combined Prompt Order
1. `_SYSTEM_PROMPT` (or custom base if enabled)
2. `[USER SYSTEM PROMPT]` (from AI Settings global/project)
3. Tooling strategy (from bias engine)
## 5. UI Design
**Location:** AI Settings panel → System Prompts section
```
┌─ System Prompts ──────────────────────────────┐
│ ☑ Use Default Base System Prompt │
│ │
│ Base System Prompt (collapsed by default): │
│ ┌──────────────────────────────────────────┐ │
│ │ You are a helpful coding assistant... │ │
│ └──────────────────────────────────────────┘ │
│ │
│ [Show Editor] [Reset to Default] │
│ │
│ Global System Prompt: │
│ ┌──────────────────────────────────────────┐ │
│ │ [current global prompt content] │ │
│ └──────────────────────────────────────────┘ │
└──────────────────────────────────────────────┘
```
When "Show Editor" clicked:
- Expand to full editor for base prompt
- Syntax highlighting for markdown
- Character count
## 6. Acceptance Criteria
- [ ] `_SYSTEM_PROMPT` visible in AI Settings
- [ ] User can edit base system prompt
- [ ] Changes persist across app restarts
- [ ] "Reset to Default" restores original
- [ ] Provider APIs receive modified prompt correctly
- [ ] No regression in agent behavior with defaults
## 7. Out of Scope
- Changes to actual agent behavior logic
- Changes to tool definitions or availability
- Changes to aggregation or context handling
## 8. Dependencies
- `ai_client.py` - `_SYSTEM_PROMPT` and `_get_combined_system_prompt()`
- `gui_2.py` - AI Settings panel rendering
- `models.py` - Config structures

View File

@@ -1,6 +1,6 @@
[ai] [ai]
provider = "gemini_cli" provider = "minimax"
model = "gemini-2.5-flash-lite" model = "MiniMax-M2.5"
temperature = 0.0 temperature = 0.0
top_p = 1.0 top_p = 1.0
max_tokens = 32000 max_tokens = 32000
@@ -61,7 +61,7 @@ Diagnostics = false
"Session Hub" = false "Session Hub" = false
[theme] [theme]
palette = "10x Dark" palette = "Nord Dark"
font_path = "fonts/Inter-Regular.ttf" font_path = "fonts/Inter-Regular.ttf"
font_size = 16.0 font_size = 16.0
scale = 1.0 scale = 1.0

View File

@@ -74,8 +74,8 @@ Collapsed=0
DockId=0xAFC85805,2 DockId=0xAFC85805,2
[Window][Theme] [Window][Theme]
Pos=0,249 Pos=0,976
Size=32,951 Size=635,951
Collapsed=0 Collapsed=0
DockId=0x00000002,2 DockId=0x00000002,2
@@ -91,8 +91,8 @@ Collapsed=0
DockId=0x00000010,0 DockId=0x00000010,0
[Window][Context Hub] [Window][Context Hub]
Pos=0,249 Pos=0,976
Size=32,951 Size=635,951
Collapsed=0 Collapsed=0
DockId=0x00000002,1 DockId=0x00000002,1
@@ -103,26 +103,26 @@ Collapsed=0
DockId=0x0000000D,0 DockId=0x0000000D,0
[Window][Discussion Hub] [Window][Discussion Hub]
Pos=807,26 Pos=1936,24
Size=873,1174 Size=1468,1903
Collapsed=0 Collapsed=0
DockId=0x00000013,0 DockId=0x00000013,0
[Window][Operations Hub] [Window][Operations Hub]
Pos=34,26 Pos=637,24
Size=771,1174 Size=1297,1903
Collapsed=0 Collapsed=0
DockId=0x00000005,0 DockId=0x00000005,0
[Window][Files & Media] [Window][Files & Media]
Pos=0,249 Pos=0,976
Size=32,951 Size=635,951
Collapsed=0 Collapsed=0
DockId=0x00000002,0 DockId=0x00000002,0
[Window][AI Settings] [Window][AI Settings]
Pos=0,26 Pos=0,24
Size=32,221 Size=635,950
Collapsed=0 Collapsed=0
DockId=0x00000001,0 DockId=0x00000001,0
@@ -513,12 +513,12 @@ Column 1 Weight=1.0000
DockNode ID=0x00000008 Pos=3125,170 Size=593,1157 Split=Y DockNode ID=0x00000008 Pos=3125,170 Size=593,1157 Split=Y
DockNode ID=0x00000009 Parent=0x00000008 SizeRef=1029,147 Selected=0x0469CA7A DockNode ID=0x00000009 Parent=0x00000008 SizeRef=1029,147 Selected=0x0469CA7A
DockNode ID=0x0000000A Parent=0x00000008 SizeRef=1029,145 Selected=0xDF822E02 DockNode ID=0x0000000A Parent=0x00000008 SizeRef=1029,145 Selected=0xDF822E02
DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,26 Size=1680,1174 Split=X DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,24 Size=3404,1903 Split=X
DockNode ID=0x00000003 Parent=0xAFC85805 SizeRef=2175,1183 Split=X DockNode ID=0x00000003 Parent=0xAFC85805 SizeRef=2175,1183 Split=X
DockNode ID=0x0000000B Parent=0x00000003 SizeRef=404,1186 Split=X Selected=0xF4139CA2 DockNode ID=0x0000000B Parent=0x00000003 SizeRef=404,1186 Split=X Selected=0xF4139CA2
DockNode ID=0x00000007 Parent=0x0000000B SizeRef=1071,858 Split=Y Selected=0x8CA2375C DockNode ID=0x00000007 Parent=0x0000000B SizeRef=1071,858 Split=Y Selected=0x8CA2375C
DockNode ID=0x00000001 Parent=0x00000007 SizeRef=824,1037 CentralNode=1 Selected=0x7BD57D6A DockNode ID=0x00000001 Parent=0x00000007 SizeRef=824,950 CentralNode=1 Selected=0x7BD57D6A
DockNode ID=0x00000002 Parent=0x00000007 SizeRef=824,951 Selected=0x1DCB2623 DockNode ID=0x00000002 Parent=0x00000007 SizeRef=824,951 Selected=0x8CA2375C
DockNode ID=0x0000000E Parent=0x0000000B SizeRef=2767,858 Split=X Selected=0x418C7449 DockNode ID=0x0000000E Parent=0x0000000B SizeRef=2767,858 Split=X Selected=0x418C7449
DockNode ID=0x00000012 Parent=0x0000000E SizeRef=1297,402 Split=Y Selected=0x418C7449 DockNode ID=0x00000012 Parent=0x0000000E SizeRef=1297,402 Split=Y Selected=0x418C7449
DockNode ID=0x00000005 Parent=0x00000012 SizeRef=876,1749 Selected=0x418C7449 DockNode ID=0x00000005 Parent=0x00000012 SizeRef=876,1749 Selected=0x418C7449

View File

@@ -71,5 +71,6 @@
"logs/**", "logs/**",
"*.log" "*.log"
] ]
} },
"plugin": ["superpowers@git+https://github.com/obra/superpowers.git"]
} }

View File

@@ -2652,6 +2652,8 @@ def hello():
if imgui.selectable("None", not self.ui_active_persona)[0]: if imgui.selectable("None", not self.ui_active_persona)[0]:
self.ui_active_persona = "" self.ui_active_persona = ""
for pname in sorted(personas.keys()): for pname in sorted(personas.keys()):
if not pname:
continue
if imgui.selectable(pname, pname == self.ui_active_persona)[0]: if imgui.selectable(pname, pname == self.ui_active_persona)[0]:
self.ui_active_persona = pname self.ui_active_persona = pname
if pname in personas: if pname in personas:
@@ -4219,6 +4221,8 @@ def hello():
from src import ai_client from src import ai_client
ai_client.set_bias_profile(None) ai_client.set_bias_profile(None)
for bname in sorted(self.controller.bias_profiles.keys()): for bname in sorted(self.controller.bias_profiles.keys()):
if not bname:
continue
if imgui.selectable(bname, bname == getattr(self, 'ui_active_bias_profile', ""))[0]: if imgui.selectable(bname, bname == getattr(self, 'ui_active_bias_profile', ""))[0]:
self.ui_active_bias_profile = bname self.ui_active_bias_profile = bname
from src import ai_client from src import ai_client