docs(conductor): replace manual pruner with advanced interactive AST and Slice tracks

This commit is contained in:
2026-05-10 13:18:22 -04:00
parent 62d8573004
commit 6c83d097b1
12 changed files with 66 additions and 30 deletions
+9 -5
View File
@@ -10,7 +10,7 @@ This file tracks all major tracks for the project. Each track has its own detail
### Context Control & Workflow Enhancements ### Context Control & Workflow Enhancements
1. [ ] **Track: Granular AST Control (Signatures vs. Definitions)** 1. [x] **Track: Granular AST Control (Signatures vs. Definitions)**
*Link: [./tracks/granular_ast_control_20260510/](./tracks/granular_ast_control_20260510/)* *Link: [./tracks/granular_ast_control_20260510/](./tracks/granular_ast_control_20260510/)*
*Goal: Introduce 'AST Signatures' and 'AST Definitions' states in the Context Panel for C/C++ files.* *Goal: Introduce 'AST Signatures' and 'AST Definitions' states in the Context Panel for C/C++ files.*
@@ -18,11 +18,11 @@ This file tracks all major tracks for the project. Each track has its own detail
*Link: [./tracks/context_snapshotting_takes_20260510/](./tracks/context_snapshotting_takes_20260510/)* *Link: [./tracks/context_snapshotting_takes_20260510/](./tracks/context_snapshotting_takes_20260510/)*
*Goal: Snapshot and visually restore the Context Panel state when switching between Takes.* *Goal: Snapshot and visually restore the Context Panel state when switching between Takes.*
3. [ ] **Track: Manual Context Pruner / Intercept Modal** 3. [ ] **Track: Interactive Text Slice Highlighting**
*Link: [./tracks/manual_context_pruner_20260510/](./tracks/manual_context_pruner_20260510/)* *Link: [./tracks/interactive_text_slice_highlighting_20260510/](./tracks/interactive_text_slice_highlighting_20260510/)*
*Goal: Introduce a "Review Context Before Send" modal for manual pruning of RAG chunks and summaries.* *Goal: Allow highlighting text ranges to create fuzzy-anchored slices (Def, Sig, Hide) that survive file modifications.*
4. [ ] **Track: Context Batch Operations UX** 4. [x] **Track: Context Batch Operations UX**
*Link: [./tracks/context_batch_operations_ux_20260510/](./tracks/context_batch_operations_ux_20260510/)* *Link: [./tracks/context_batch_operations_ux_20260510/](./tracks/context_batch_operations_ux_20260510/)*
*Goal: Add multi-select and batch state modification capabilities to the Context Panel for rapid wrangling.* *Goal: Add multi-select and batch state modification capabilities to the Context Panel for rapid wrangling.*
@@ -30,6 +30,10 @@ This file tracks all major tracks for the project. Each track has its own detail
*Link: [./tracks/gencpp_project_init_20260510/](./tracks/gencpp_project_init_20260510/)* *Link: [./tracks/gencpp_project_init_20260510/](./tracks/gencpp_project_init_20260510/)*
*Goal: Configure manual_slop.toml in the gencpp repo to isolate conductor tracks, logs, and history.* *Goal: Configure manual_slop.toml in the gencpp repo to isolate conductor tracks, logs, and history.*
6. [ ] **Track: Interactive AST Tree Masking**
*Link: [./tracks/interactive_ast_tree_masking_20260510/](./tracks/interactive_ast_tree_masking_20260510/)*
*Goal: Inspect C/C++ ASTs in the GUI and mask individual classes/functions as Def, Sig, or Hide.*
--- ---
## Phase 5: Codebase Curation ## Phase 5: Codebase Curation
@@ -1,4 +1,4 @@
# Track: Manual Context Pruner / Intercept Modal # Track: Interactive AST Tree Masking
- [Specification](./spec.md) - [Specification](./spec.md)
- [Plan](./plan.md) - [Plan](./plan.md)
@@ -0,0 +1,5 @@
{
"id": "interactive_ast_tree_masking_20260510",
"title": "Interactive AST Tree Masking",
"status": "planned"
}
@@ -0,0 +1,9 @@
# Implementation Plan: Interactive AST Tree Masking
## Phase 1: AST Mask Model & Inspector UI
- [ ] Update `FileItem` in `src/models.py` with an `ast_mask: dict[str, str]` field (mapping symbol paths to 'def', 'sig', or 'hide').
- [ ] In `src/gui_2.py`, add an `[Inspect]` button to the Context Panel table.
- [ ] Implement `_render_ast_inspector_modal` in `src/gui_2.py`, fetching the outline via `ts_cpp_get_code_outline` and rendering it as an `imgui.tree_node` hierarchy with radio buttons.
## Phase 2: Dynamic Aggregation
- [ ] Update `src/aggregate.py`. When an `ast_mask` is present, it must parse the file, extract the requested definitions and signatures by their symbol names, and stitch them into a single coherent markdown block.
@@ -0,0 +1,11 @@
# Specification: Interactive AST Tree Masking
## Overview
Transform the Context Panel by allowing users to inspect the AST of C/C++ files and selectively mask individual symbols (classes, methods, functions). Instead of treating a file as a single unit, users can define an `ASTMask` to expose only what is relevant.
## Acceptance Criteria
- [ ] An `[Inspect]` button in the Context Panel opens an AST Outline window for the selected file.
- [ ] The Outline window renders a hierarchical tree of symbols using `tree-sitter`.
- [ ] Users can toggle individual nodes as `[Def]` (Definition), `[Sig]` (Signature), or `[Hide]`.
- [ ] `FileItem` model is updated to persist this `ASTMask` dictionary.
- [ ] `aggregate.py` dynamically stitches the file content based on the `ASTMask`, automatically resolving line numbers by symbol name to survive agent modifications.
@@ -0,0 +1,4 @@
# Track: Interactive Text Slice Highlighting
- [Specification](./spec.md)
- [Plan](./plan.md)
@@ -0,0 +1,5 @@
{
"id": "interactive_text_slice_highlighting_20260510",
"title": "Interactive Text Slice Highlighting",
"status": "planned"
}
@@ -0,0 +1,12 @@
# Implementation Plan: Interactive Text Slice Highlighting
## Phase 1: Slice Model & Fuzzy Anchors
- [ ] Update `FileItem` in `src/models.py` with a `custom_slices: list[dict]` field.
- [ ] Implement a `FuzzyAnchor` utility to generate and re-resolve slices based on contextual text hashing.
## Phase 2: Editor UI Integration
- [ ] In `src/gui_2.py`, add `[Edit Slices]` to the Context Panel.
- [ ] Enhance the `TextEditor` wrapper to support visual highlighting and a context menu for adding/removing slices.
## Phase 3: Aggregation Execution
- [ ] Update `src/aggregate.py` to respect `custom_slices` when building the final markdown text for a file.
@@ -0,0 +1,10 @@
# Specification: Interactive Text Slice Highlighting
## Overview
Allow users to define custom text slices in any file (not just C/C++) by highlighting code in a text editor and tagging it. Slices use a 'Fuzzy Anchor' heuristic to survive file modifications.
## Acceptance Criteria
- [ ] An `[Edit Slices]` button in the Context Panel opens the file in the `TextEditor` widget.
- [ ] Users can highlight text and use a context menu/button to tag the slice (e.g., Include, Exclude, Summarize).
- [ ] `FileItem` model is updated to persist `CustomSlices` with fuzzy anchors (hashed start/end context).
- [ ] `aggregate.py` dynamically resolves these slices during payload generation, falling back gracefully if anchors are lost.
@@ -1,5 +0,0 @@
{
"id": "manual_context_pruner_20260510",
"title": "Manual Context Pruner / Intercept Modal",
"status": "planned"
}
@@ -1,10 +0,0 @@
# Implementation Plan: Manual Context Pruner
## Phase 1: Aggregation Intercept
- [ ] Add `review_context_before_send` boolean flag to `AppController`.
- [ ] Update the `generate` workflow in `src/app_controller.py` to pause and trigger the UI modal if the flag is true.
## Phase 2: UI Modal
- [ ] Add `_render_context_pruner_modal` in `src/gui_2.py`.
- [ ] The modal must use a large `imgui.input_text_multiline` (or similar editor) to allow manual redaction.
- [ ] Handle the callback to resume the `generate` workflow with the modified string.
@@ -1,9 +0,0 @@
# Specification: Manual Context Pruner / Intercept Modal
## Overview
Introduce a "Review Context Before Send" toggle. When enabled, hitting "Send" opens a modal displaying the final, aggregated Markdown string. The user can manually delete lines, redact symbols, or prune irrelevant RAG chunks before giving the final approval to send the payload to the API.
## Acceptance Criteria
- [ ] A UI toggle exists for "Review Context Before Send".
- [ ] When enabled, sending a prompt opens a modal with a large text editor containing the fully aggregated markdown string (files + RAG chunks + prompt).
- [ ] User can edit the text and click "Approve and Send" or "Cancel".