7.7 KiB
Implementation Plan: Manual Skeleton Context Injection (manual_skeleton_injection_20260306)
Phase 1: File Selection UI
- Task: Initialize MMA Environment
- Task: Implement file picker
- WHERE: src/gui_2.py
- WHAT: Browse files for skeleton
- HOW: imgui.file_picker or custom
- SAFETY: Path validation
Phase 2: Skeleton Preview
- Task: Generate preview
- WHERE: src/gui_2.py
- WHAT: Show skeleton before inject
- HOW: Call skeleton generation
- SAFETY: Handle large files
- Task: Implement inject button
- WHERE: src/gui_2.py
- WHAT: Inject into discussion
- HOW: Append to context
Phase 3: Full Read Option
- Task: Add full read toggle
- WHERE: src/gui_2.py
- WHAT: Option for full file
- HOW: Checkbox/switch
Phase 4: Verification
- Task: Test injection flow
- Task: Conductor - Phase Verification
Phase 1: Skeleton Preview
-
Task: Implement inject button
-
WHERE: src/gui_2.py discussion panel
-
how: Call ASTParser.get_skeleton() for preview
-
Display preview
-
on preview change, regenerate skeleton via
get_skeleton() -
Show "Skeleton" or "Full" toggle in preview
-
on "Inject", append to discussion input
-
-
Task: Add toggle logic
- where: src/gui_2.py
- how: imgui.checkbox to toggle between skeleton/full file
- On toggle change, regenerate skeleton
- else: self._skeleton_mode = True self._render_full_content = True
- code style: 1-space indentation
-
Task: Conductor - Phase Verification
- Run targeted tests:
uv run pytest tests/test_manual_skeleton_injection.py -v - Verify skeleton preview works
- Run targeted tests:
-
Task: Conductor - Phase Verification
- Run:
uv run pytest tests/test_manual_skeleton_injection.py -v - Verify skeleton preview works
- Run:
-
Task: Write unit tests for skeleton generation
- where:
tests/test_manual_skeleton_injection.py(new file) - what: Test extraction returns only specified functions
- how: Parse code, with regex, extract names matching
function_nameslist - return combined signatures + docstrings
- else: return []
- Include
@core_logicdecorator, (if present)
- where:
-
Task: Write integration test
- where:
tests/test_manual_skeleton_injection.py(new file) - what: Test targeted extraction returns only specified functions
- how: Use existing
AST.parse viatree_sitter_python` - Return extracted nodes
- Also add curated view (hot paths) and
- In
run_worker_lifecycle,: check if ticket is in context_requirements and callget_curated_view()for full content (hot paths).
- where:
-
Task: Write integration test
- where:
tests/test_context_pruning.py(new file) - what: Test integration of worker lifecycle with curated context
- how: Create test file with known functions, verify they're extracted
- where:
-
Task: Write integration test
- where:
tests/test_context_pruning.py(new file) - what: Test integration of curated view
- how: Use
aggregate.build_tier3_context()and
- where:
-
- Task: Implement performance tests
- where:
tests/test_performance_monitor.py(new file) - what: Test Performance monitor history storage
- how: Add `_history: deque with maxlen=100
- in
end_frame()store metrics
- where:
- Task: Implement performance tests
-
Task: Implement graph rendering
- where: src/gui_2.py diagnostics panel
- how: Get CPU/RAM data from
performance_monitor.get_history() - Render graphs using imgui.plot_lines() or imgui.plot_histogram()
-
Task: Conductor - Phase Verification
- Run:
uv run pytest tests/test_manual_skeleton_injection.py -v - Verify skeleton preview works
- Run:
-
Task: Write unit tests for performance dashboard
- where:
tests/test_performance_dashboard.py(new file) - what: Test performance dashboard
- how: Test history storage limits - [x] Performance_monitor.add_history() if value is None: self._history = deque(maxlen=100) self._history = data imgui.plot_lines("CPU", data) imgui.plot_histogram("Frame Time", data) imgui.text("History: N points") imgui.end() imgui.text("Session Stats") imgui.text(f"Total: ${self._session_cost_total:.2f}") imgui.end_child()
Token timeline
time.sleep(0.5) # Check for slow operations time.sleep(0.5) for i, range(len(tickets): t = t. completed t.status = "completed" else: t.status = "in_progress" # Session stats header if imgui.collapsing_header("Session Statistics"): imgui.text_wrapped(f"Tokens: {sum(t['input'] + t['output']):,}") imgui.text(f"Cost projection: ${cost_tracker.estimate_cost(t['model'], t['input'], t['output']) * 1.0:.4f}") # Cost projection burn_rate = tokens_per minute * sum(t['input'] / t['output'] * 60) time.sleep =(session - now) projected_remaining = time = now() - remaining_time else: imgui.text(f"Projected cost: ${projected_cost(t['model'], t['input'], t['output']) * 1.0:.4f}") imgui.end_child()Efficiency Score
efficiency_score = tokens_per useful change ratio (if > 0 else 0) efficiency_text = summary imgui.text_wrapped(f"Efficiency Score: {efficiency_score:.2f}") imgui.end_child()
Session summary
if imgui.collapsing_header("Session Summary"): imgui.text_wrapped("## Session") - Total:** tokens - Completed: status: {len(completed)} tickets - Blocked: tickets marked as blocked with reason: {reason} for t_status in self.track.tickets: if t.blocked_reason: imgui.text_wrapped(f" Blocked: {reason}") imgui.text(f"Tickets blocked: {len(blocked)} tickets") imgui.end()
Controls
imgui.separator() imgui.text("Controls")
# Per-ticket block controls imgui.combo with options: block, execute, skip - where:
block else: imgui.text("Unblocked") imgui.indent_same_indent()
# Priority field
imgui.combo("priority", options: high/medium/low)
if imgui.begin_combo("Priority", item=0):
imgui.end_combo()
elif ticket.status == "completed":
imgui.text_wrapped(f" Completed")
elif ticket.status == "blocked":
imgui.text_wrapped(f" blocked: {reason}")
imgui.indent_same_indent()
imgui.end()
# Footer
imgui.text_wrapped("Session Stats")
# Tier Usage table (if imgui.begin_table("Tier Usage"))
{
imgui.table_next_row()
for tier in ["Tier 1", "Tier 2", "Tier 3", "Tier 4"]:
imgui.table_set_column_index(1)
imgui.text(f"Tier {tier}")
imgui.table_next_row()
for ticket in tickets:
imgui.text(f" {ticket.id}")
imgui.text(f" {ticket.status}")
imgui.text(f" {ticket.priority}")
imgui.text("")
imgui.end_table()
imgui.text_wrapped(f"Session total: ${self._session_cost_total:.2f}")
imgui.end_child()
t.end_table()
imgui.text_wrapped("## Ticket Queue Management")
imgui.text("Priority")
imgui.combo("priority", options: high/medium/low)
imgui.same_line()
imgui.text_wrapped(f" {priority}")
imgui.end()
# Drag-drop reordering
imgui.combo("Reorder", options: top/bottom/after")
imgui.text("Top")
imgui.text("Bottom")
else
imgui.text("Bulk Actions")
imgui.text("Apply to: execute/skip/block")
imgui.end_child()
# Footer
imgui.end_table()