Private
Public Access
0
0

chore(conductor): Add new tracks for Phase 7

- Add 'structural_file_editor_20260601' track.
- Add 'discussion_metrics_and_compression_20260601' track.
This commit is contained in:
2026-06-02 00:25:10 -04:00
parent 4baaadd88d
commit 797f283f44
10 changed files with 178 additions and 105 deletions
+11 -1
View File
@@ -298,5 +298,15 @@ This file tracks all major tracks for the project. Each track has its own detail
---
- [ ] **Track: UX Refinements for Context Composition and Discussion Entries**
- [~] **Track: UX Refinements for Context Composition and Discussion Entries**
*Link: [./tracks/context_composition_ux_20260601/](./tracks/context_composition_ux_20260601/)*
---
- [ ] **Track: Combine AST Inspector and Slices Editor into a unified Structural File Editor**
*Link: [./tracks/structural_file_editor_20260601/](./tracks/structural_file_editor_20260601/)*
---
- [ ] **Track: Add per-response token metrics and AI-assisted history compression**
*Link: [./tracks/discussion_metrics_and_compression_20260601/](./tracks/discussion_metrics_and_compression_20260601/)*
@@ -0,0 +1,5 @@
# Track discussion_metrics_and_compression_20260601 Context
- [Specification](./spec.md)
- [Implementation Plan](./plan.md)
- [Metadata](./metadata.json)
@@ -0,0 +1,8 @@
{
"track_id": "discussion_metrics_and_compression_20260601",
"type": "feature",
"status": "new",
"created_at": "2026-06-01T00:00:00Z",
"updated_at": "2026-06-01T00:00:00Z",
"description": "Add per-response token metrics and AI-assisted history compression"
}
@@ -0,0 +1,19 @@
# Implementation Plan: Discussion Metrics and Compression
## Phase 1: Metrics Visibility
- [ ] Task: Update UI for Token Metrics
- [ ] Modify `_render_comms_history_panel` and `render_discussion_entry` in `src/gui_2.py` to extract and prominently display `usage` stats (input, output, cache) from the entry payloads.
## Phase 2: Compression Helper Agent
- [ ] Task: Implement Compression Agent
- [ ] Create a new agent definition or function in `src/ai_client.py` (or a dedicated module) capable of receiving a discussion history and a system prompt instructing it to summarize and compact the history.
- [ ] Task: Implement UI Triggers
- [ ] Add a "Compress Discussion" button to the Discussion Hub UI.
- [ ] Wire the button to dispatch the compression task to the background executor and display a loading indicator.
- [ ] Upon completion, replace the older entries with the generated summary block.
## Phase 3: Verification
- [ ] Task: Verification
- [ ] Verify token metrics are visible per response.
- [ ] Run the "Compress Discussion" tool on a heavy discussion and verify the history is successfully summarized without losing core context.
- [ ] Task: Conductor - User Manual Verification 'Phase 3: Verification' (Protocol in workflow.md)
@@ -0,0 +1,21 @@
# Specification: Discussion Metrics and Compression
## 1. Overview
The user requested better visibility into token usage on a per-response and per-discussion basis, rather than just session-wide totals. Additionally, the current history truncation is deemed too naive. The user wants a smarter compression strategy utilizing a helper agent to summarize, categorize, and compact discussion entries (especially tool/vendor logs) when the token limit is approached.
## 2. Functional Requirements
* **Per-Response Metrics:** Update the Comms History and Discussion Hub panels to display token usage (input/output/cache) and remaining quota for each specific response.
* **Discussion-Level Metrics:** Add a summary of total token usage for the active discussion.
* **Helper Agent Compression:**
* Implement an asynchronous helper agent capable of analyzing a `discussion`'s history.
* The agent should categorize entries (e.g., tool calls, user prompts, AI thinking) and generate a compacted summary.
* Provide UI options to trigger this compression manually or set thresholds for automatic suggestions.
* **New Session Prompt:** Allow the AI to generate a "summary prompt" and "target prompt" to effortlessly transition a heavy, exhausted discussion into a fresh session with adjusted context.
## 3. Non-Functional Requirements
* **Performance:** The helper agent must run asynchronously to avoid blocking the main GUI thread.
## 4. Acceptance Criteria
* Token metrics are clearly visible per entry in the Comms History.
* A new "Compress Discussion" button triggers the helper agent, which successfully produces a compacted history.
* The system can transition an exhausted discussion into a new one using an AI-generated summary.
@@ -0,0 +1,5 @@
# Track structural_file_editor_20260601 Context
- [Specification](./spec.md)
- [Implementation Plan](./plan.md)
- [Metadata](./metadata.json)
@@ -0,0 +1,8 @@
{
"track_id": "structural_file_editor_20260601",
"type": "feature",
"status": "new",
"created_at": "2026-06-01T00:00:00Z",
"updated_at": "2026-06-01T00:00:00Z",
"description": "Combine AST Inspector and Slices Editor into a unified Structural File Editor"
}
@@ -0,0 +1,17 @@
# Implementation Plan: Structural File Editor
## Phase 1: Unification
- [ ] Task: Create Structural File Editor Modal
- [ ] Add `app.show_structural_editor_modal = False` to `App.__init__`.
- [ ] Create `render_structural_file_editor_modal(app: App)` in `src/gui_2.py`.
- [ ] Port the tree rendering logic from `render_ast_inspector_modal` into this new modal.
- [ ] Port the custom slice management UI from `render_slices_editor_modal` into this new modal, positioning it logically alongside or above the AST tree.
- [ ] Task: Update File Row UI
- [ ] In `render_context_files_table`, replace the separate "AST" and "Slices" buttons with a single "Structure" button that sets `app.show_structural_editor_modal = True` and sets the target file.
## Phase 2: Verification
- [ ] Task: Verification
- [ ] Open the Structural File Editor for a complex Python file.
- [ ] Verify both AST nodes and custom slices are visible and interactive.
- [ ] Verify that adding a custom slice works correctly within the unified interface.
- [ ] Task: Conductor - User Manual Verification 'Phase 2: Verification' (Protocol in workflow.md)
@@ -0,0 +1,18 @@
# Specification: Structural File Editor
## 1. Overview
The user wants to combine the current AST Inspector and Slices Editor into a single, unified "Structural File Editor". This modal will provide a comprehensive visualization of both auto-detected AST elements and user-defined custom slices, allowing users to precisely tailor the context sent to the AI, especially in combination with "skeleton" or other filtered view modes.
## 2. Functional Requirements
* **Unified Interface:** Merge the UI elements of `render_ast_inspector_modal` and `render_slices_editor_modal` into a new `render_structural_file_editor_modal`.
* **Visualization:** Display a unified graph or list showing the file's structure. This includes AST nodes (classes, functions, etc.) and custom slices seamlessly integrated.
* **Custom Slices:** Allow users to define arbitrary text ranges as "custom slices" that exist independently of the AST graph but are visualized alongside it.
* **Filtering:** The editor must clearly indicate which parts of the file will be included based on the current `view_mode` (e.g., if `view_mode='skeleton'`, only signatures and explicitly selected custom slices/AST nodes are included).
## 3. Non-Functional Requirements
* **Performance:** The unified editor must remain responsive even for large files with complex ASTs.
## 4. Acceptance Criteria
* Clicking a "Structure" or "Edit Slices" button on a file opens the new unified modal.
* The modal clearly displays both AST elements and custom slices.
* Users can add, modify, and delete custom slices within this single interface.