Rewrites comprehensive_gui_ux_20260228 spec and plan using deep analysis of the actual gui_2.py implementation (3078 lines). The previous spec asked to implement features that already exist (Track Browser, DAG tree, epic planning, approval dialogs, token table, performance monitor). The new spec: - Documents 15 already-implemented features with exact line references - Identifies 8 actual gaps (tier stream panels, DAG editing, cost tracking, conductor lifecycle forms, track-scoped discussions, approval indicators, track proposal editing, stream scrollability) - Rewrites all 5 phases with surgical task descriptions referencing exact gui_2.py line ranges, function names, and data structures - Each task specifies the precise imgui API calls to use - References docs/guide_architecture.md for threading constraints - References docs/guide_mma.md for Ticket/Track data structures Also adds architecture documentation fallback references to: - conductor/workflow.md (new principle #9) - conductor/product.md (new Architecture Reference section) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7.3 KiB
7.3 KiB
Track Specification: Comprehensive Conductor & MMA GUI UX
Overview
This track enhances the existing MMA orchestration GUI from its current functional-but-minimal state to a production-quality control surface. The existing implementation already has a working Track Browser, DAG tree visualizer, epic planning flow, approval dialogs, and token usage table. This track focuses on the gaps: dedicated tier stream panels, DAG editing, track-scoped discussions, conductor lifecycle GUI forms, cost tracking, and visual polish.
Current State Audit (as of 08e003a)
Already Implemented (DO NOT re-implement)
- Track Browser table (
_render_mma_dashboard, lines 2633-2660): Title, status, progress bar, Load button per track. - Epic Planning (
_render_projects_panel, lines 1968-1983 +_cb_plan_epic): Input field + "Plan Epic (Tier 1)" button, background thread orchestration. - Track Proposal Modal (
_render_track_proposal_modal, lines 2146-2173): Shows proposed tracks, Start/Accept/Cancel. - Step Mode toggle: Checkbox for "Step Mode (HITL)" with
self.mma_step_mode. - Active Track Info: Description + ticket progress bar.
- Token Usage Table: Per-tier input/output display in a 3-column ImGui table.
- Tier 1 Strategy Stream:
mma_streams.get("Tier 1")rendered as read-only multiline (150px). - Task DAG Tree (
_render_ticket_dag_node, lines 2726-2785): Recursive tree with color-coded status (gray/yellow/green/red/orange), tooltips showing ID/target/description/dependencies/worker-stream, Retry/Skip buttons. - Spawn Interceptor (
MMASpawnApprovalDialog): Editable prompt, context_md, abort capability. - MMA Step Approval (
MMAApprovalDialog): Editable payload, approve/reject. - Script Confirmation (
ConfirmDialog): Editable script, approve/reject. - Comms History Panel (
_render_comms_history_panel, lines 2859-2984). - Tool Calls Panel (
_render_tool_calls_panel, lines 2787-2857). - Performance Monitor: FPS, Frame Time, CPU, Input Lag via
perf_monitor.
Gaps to Fill (This Track's Scope)
- Tier Stream Panels: Only Tier 1 gets a dedicated text box. Tier 2/3/4 streams exist in
mma_streamsdict but have no dedicated UI. Tier 3 output is tooltip-only on DAG nodes. No Tier 2 (Tech Lead) or Tier 4 (QA) visibility at all. - DAG Editing: Can Retry/Skip tickets but cannot reorder, insert, or delete tasks from the GUI.
- Conductor Lifecycle Forms:
/conductor:setupand/conductor:newTrackhave no GUI equivalents — they're CLI-only. Users must use slash commands or the epic planning flow. - Track-Scoped Discussion: Discussions are global. When a track is active, the discussion panel should optionally isolate to that track's context.
project_manager.load_track_history()exists but isn't wired to the GUI. - Cost Estimation: Token counts are displayed but not converted to estimated cost per tier or per track.
- Approval State Indicators: The dashboard doesn't visually indicate when a spawn/step/tool approval is pending.
pending_mma_spawn_approval,pending_mma_step_approval,pending_tool_approvalare tracked but not rendered. - Track Proposal Editing: The modal shows proposed tracks read-only. No ability to edit track titles, goals, or remove unwanted tracks before accepting.
- Stream Scrollability: Tier 1 stream is a 150px non-scrolling text box. Needs proper scrollable, resizable panels for all tier streams.
Goals
- Tier Stream Visibility: Dedicated, scrollable panels for all 4 tier output streams (Tier 1 Strategy, Tier 2 Tech Lead, Tier 3 Worker, Tier 4 QA) with auto-scroll and copy support.
- DAG Manipulation: Add/remove tickets from the active track's DAG via the GUI, with dependency validation.
- Conductor GUI Forms: Setup and track creation forms that invoke the same logic as the CLI slash commands.
- Track-Scoped Discussions: Switch the discussion panel to track-specific history when a track is active.
- Cost Tracking: Per-tier and per-track cost estimation based on model pricing.
- Approval Indicators: Clear visual cues (blinking, color changes) when any approval gate is pending.
- Track Proposal Editing: Allow editing/removing proposed tracks before acceptance.
- Polish & Density: Make the dashboard information-dense and responsive to the MMA engine's state.
Functional Requirements
Tier Stream Panels
- Four collapsible/expandable text regions in the MMA dashboard, one per tier.
- Auto-scroll to bottom on new content. Toggle for manual scroll lock.
- Each stream populated from
self.mma_streamskeyed by tier prefix. - Tier 3 streams: aggregate all
"Tier 3: T-xxx"keyed entries, render with ticket ID headers.
DAG Editing
- "Add Ticket" button: opens an inline form (ID, description, target_file, depends_on dropdown).
- "Remove Ticket" button on each DAG node (with confirmation).
- Changes must update
self.active_tickets, rebuild the ConductorEngine'sTrackDAG, and push state via_push_state.
Conductor Lifecycle Forms
- "Setup Conductor" button that reads
conductor/workflow.md,conductor/tech-stack.md,conductor/product.mdand displays a readiness summary. - "New Track" form: name, description, type dropdown. Creates the track directory structure under
conductor/tracks/.
Track-Scoped Discussion
- When
self.active_trackis set, add a toggle "Track Discussion" that switches toproject_manager.load_track_history(track_id). - Saving flushes to the track's history file instead of the project's.
Cost Tracking
- Model pricing table (configurable or hardcoded initial version).
- Compute
cost = (input_tokens / 1M) * input_price + (output_tokens / 1M) * output_priceper tier. - Display as additional column in the existing token usage table.
Approval Indicators
- When
_pending_mma_spawnis not None: flash the "MMA Dashboard" tab header or show a blinking indicator. - When
_pending_mma_approvalis not None: similar. - When
_pending_ask_dialogis True: similar. - Use
imgui.push_style_colorto tint the relevant UI region.
Track Proposal Editing
- Make track titles and goals editable in the proposal modal.
- Add a "Remove" button per proposed track.
- Edited data flows back to
self.proposed_tracksbefore acceptance.
Non-Functional Requirements
- Thread Safety: All new data mutations from background threads must go through
_pending_gui_tasks. No direct GUI state writes from non-main threads. - No New Dependencies: Use only existing Dear PyGui / imgui-bundle APIs.
- Performance: New panels must not degrade FPS below 30 under normal operation. Verify via
get_ui_performance.
Architecture Reference
- Threading model and
_process_pending_gui_tasksaction catalog: docs/guide_architecture.md - MMA data structures (Ticket, Track, WorkerContext): docs/guide_mma.md
- Hook API for testing: docs/guide_tools.md
- Simulation patterns: docs/guide_simulations.md
Out of Scope
- Automated "Auto-Fix" loops without user intervention.
- Remote management via web browser.
- Visual diagram generation (Dear PyGui node editor for DAG — future track).
- Docking/floating multi-viewport layout (requires imgui docking branch investigation — future track).