archiving tracks
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# Manual Skeleton Context Injection
|
||||
|
||||
**Track ID:** manual_skeleton_injection_20260306
|
||||
|
||||
**Status:** Planned
|
||||
|
||||
**See Also:**
|
||||
- [Spec](./spec.md)
|
||||
- [Plan](./plan.md)
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"id": "manual_skeleton_injection_20260306",
|
||||
"name": "Manual Skeleton Context Injection",
|
||||
"status": "planned",
|
||||
"created_at": "2026-03-06T00:00:00Z",
|
||||
"updated_at": "2026-03-06T00:00:00Z",
|
||||
"type": "feature",
|
||||
"priority": "medium"
|
||||
}
|
||||
34
conductor/archive/manual_skeleton_injection_20260306/plan.md
Normal file
34
conductor/archive/manual_skeleton_injection_20260306/plan.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Implementation Plan: Manual Skeleton Context Injection (manual_skeleton_injection_20260306)
|
||||
|
||||
> **Reference:** [Spec](./spec.md) | [Architecture Guide](../../../docs/guide_architecture.md)
|
||||
|
||||
## Phase 1: UI Foundation
|
||||
Focus: Add file injection button and state
|
||||
|
||||
- [x] Task 1.1: Initialize MMA Environment (fbe02eb)
|
||||
- [x] Task 1.2: Add injection state variables (fbe02eb)
|
||||
- [x] Task 1.3: Add inject button to discussion panel (fbe02eb)
|
||||
|
||||
## Phase 2: File Selection
|
||||
Focus: File picker and path validation
|
||||
|
||||
- [x] Task 2.1: Create file selection modal (fbe02eb)
|
||||
- [x] Task 2.2: Validate selected path (fbe02eb)
|
||||
|
||||
## Phase 3: Preview Generation
|
||||
Focus: Generate and display skeleton/full preview
|
||||
|
||||
- [x] Task 3.1: Implement preview update function (fbe02eb)
|
||||
- [x] Task 3.2: Add mode toggle (fbe02eb)
|
||||
- [x] Task 3.3: Display preview (fbe02eb)
|
||||
|
||||
## Phase 4: Inject Action
|
||||
Focus: Append to discussion input
|
||||
|
||||
- [x] Task 4.1: Implement inject button (fbe02eb)
|
||||
|
||||
## Phase 5: Testing
|
||||
Focus: Verify all functionality
|
||||
|
||||
- [x] Task 5.1: Write unit tests (fbe02eb)
|
||||
- [x] Task 5.2: Conductor - Phase Verification (fbe02eb)
|
||||
113
conductor/archive/manual_skeleton_injection_20260306/spec.md
Normal file
113
conductor/archive/manual_skeleton_injection_20260306/spec.md
Normal file
@@ -0,0 +1,113 @@
|
||||
# Track Specification: Manual Skeleton Context Injection (manual_skeleton_injection_20260306)
|
||||
|
||||
## Overview
|
||||
Add UI controls to manually inject file skeletons into discussions. Allow user to preview skeleton content before sending to AI, with option to toggle between skeleton and full file.
|
||||
|
||||
## Current State Audit
|
||||
|
||||
### Already Implemented (DO NOT re-implement)
|
||||
|
||||
#### ASTParser (src/file_cache.py)
|
||||
- **`ASTParser` class**: Uses tree-sitter for Python parsing
|
||||
- **`get_skeleton(code: str) -> str`**: Returns file skeleton (signatures/docstrings preserved, function bodies replaced with `...`)
|
||||
- **`get_curated_view(code: str) -> str`**: Returns curated view preserving `@core_logic` and `# [HOT]` decorated function bodies
|
||||
|
||||
#### MCP Tools (src/mcp_client.py)
|
||||
- **`py_get_skeleton(path, language)`**: Tool #15 - generates skeleton
|
||||
- **`py_get_definition(path, name)`**: Tool #18 - gets specific definition
|
||||
- **Both available to AI during discussion**
|
||||
|
||||
#### Context Building (src/aggregate.py)
|
||||
- **`build_file_items()`**: Creates file items from project config
|
||||
- **`build_tier*_context()`**: Tier-specific context builders already use skeleton logic
|
||||
|
||||
### Gaps to Fill (This Track's Scope)
|
||||
- No UI for manual skeleton preview/injection
|
||||
- No toggle between skeleton and full file
|
||||
- No inject-to-discussion button
|
||||
|
||||
## Architectural Constraints
|
||||
|
||||
### Non-Blocking Preview
|
||||
- Skeleton generation MUST NOT block UI
|
||||
- Use existing `ASTParser.get_skeleton()` - already fast (<100ms)
|
||||
|
||||
### Preview Size Limit
|
||||
- Truncate preview at 500 lines
|
||||
- Show "... (truncated)" notice if exceeded
|
||||
|
||||
## Architecture Reference
|
||||
|
||||
### Key Integration Points
|
||||
|
||||
| File | Lines | Purpose |
|
||||
|------|-------|---------|
|
||||
| `src/gui_2.py` | ~1300-1400 | Discussion panel - add injection UI |
|
||||
| `src/file_cache.py` | 30-80 | `ASTParser.get_skeleton()` |
|
||||
| `src/aggregate.py` | 119-145 | `build_file_items()` |
|
||||
|
||||
### UI Integration Pattern
|
||||
```python
|
||||
# In discussion panel:
|
||||
if imgui.button("Inject File"):
|
||||
# Open file picker
|
||||
self._inject_file_path = selected_path
|
||||
self._inject_mode = "skeleton" # or "full"
|
||||
# Preview in child window
|
||||
preview = ASTParser("python").get_skeleton(content) if skeleton_mode else content
|
||||
# Inject button appends to input text
|
||||
```
|
||||
|
||||
## Functional Requirements
|
||||
|
||||
### FR1: File Selection
|
||||
- Button "Inject File" in discussion panel
|
||||
- Opens file browser limited to project files
|
||||
- Path validation against project's `files.base_dir`
|
||||
|
||||
### FR2: Mode Toggle
|
||||
- Radio buttons: "Skeleton" / "Full File"
|
||||
- Default: Skeleton
|
||||
- Switching regenerates preview
|
||||
|
||||
### FR3: Preview Display
|
||||
- Child window showing preview content
|
||||
- Monospace font
|
||||
- Scrollable, max 500 lines displayed
|
||||
- Line numbers optional
|
||||
|
||||
### FR4: Inject Action
|
||||
- Button "Inject to Discussion"
|
||||
- Appends content to input text area
|
||||
- Format: `## File: {path}\n\`\`\`python\n{content}\n\`\`\``
|
||||
|
||||
## Non-Functional Requirements
|
||||
|
||||
| Requirement | Constraint |
|
||||
|-------------|------------|
|
||||
| Preview Time | <100ms for typical file |
|
||||
| Memory | Preview limited to 50KB |
|
||||
|
||||
## Testing Requirements
|
||||
|
||||
### Unit Tests
|
||||
- Test skeleton generation for sample files
|
||||
- Test truncation at 500 lines
|
||||
|
||||
### Integration Tests
|
||||
- Inject file, verify appears in discussion
|
||||
- Toggle modes, verify preview updates
|
||||
|
||||
## Out of Scope
|
||||
- Definition lookup (separate track: on_demand_def_lookup)
|
||||
- Multi-file injection
|
||||
- Custom skeleton configuration
|
||||
|
||||
## Acceptance Criteria
|
||||
- [ ] "Inject File" button in discussion panel
|
||||
- [ ] File browser limits to project files
|
||||
- [ ] Skeleton/Full toggle works
|
||||
- [ ] Preview displays correctly
|
||||
- [ ] Inject appends to input
|
||||
- [ ] Large file truncation works
|
||||
- [ ] 1-space indentation maintained
|
||||
Reference in New Issue
Block a user