ECC 2.0 TUI Dashboard
Relevant source files
The following files were used as context for generating this wiki page:
The ECC 2.0 TUI Dashboard is the primary operator interface for the ECC 2.0 agentic control plane. Built using Rust, it leverages ratatui and crossterm to provide a high-performance terminal user interface for orchestrating, monitoring, and analyzing AI coding agent sessions. It serves as a visual wrapper for the underlying session management and observability systems, allowing developers to manage complex automated workflows directly from their terminal.
The dashboard integrates real-time session output tracking, resource utilization metrics via specialized widgets, and risk-aware observability modules that score tool calls on a 4-axis analysis. This allows the operator to maintain situational awareness over autonomous agent activities, ensuring security and efficiency during large-scale code modifications.
Sources: research/ecc2-codebase-analysis.md:4-30, ecc2/src/tui/mod.rs
Architecture and UI Components
The TUI is structured around a main application loop that coordinates rendering and event handling. The core architecture separates the visual representation (panes and widgets) from the underlying session data.
Main Application Loop
The application lifecycle is managed within app.rs, which handles the initialization of the terminal backend, input event processing, and the periodic UI refresh cycle.
Sources: ecc2/src/tui/app.rs
The flow represents the standard Ratatui event loop pattern used in the ECC 2.0 TUI to ensure responsive interaction.
Sources: ecc2/src/tui/app.rs, research/ecc2-codebase-analysis.md:126-140
Dashboard Layout
The dashboard is logically divided into specialized panes to maximize operator efficiency:
- Sessions Pane: Lists active and historical agent sessions with enforced state transitions (e.g.,
Pending → Running). - Output Pane: Displays real-time logs and ring-buffered session output (limited to 1000 lines).
- Metrics Pane: Visualizes token usage, costs, and resource consumption.
- Log Pane: Shows internal system events and observability alerts.
Sources: research/ecc2-codebase-analysis.md:15-30, research/ecc2-codebase-analysis.md:182-192
UI Components and Custom Widgets
The ECC 2.0 TUI utilizes custom widgets for specialized data visualization, most notably for monitoring resource consumption and observability scores.
TokenMeter Widget
The TokenMeter is a custom widget defined in widgets.rs that provides a visual representation of budget utilization (tokens or cost). It uses defined thresholds to change color based on usage percentage:
- Safe: Usage below 70%.
- Warning: Usage between 70% and 90%.
- Critical: Usage exceeding 90%.
Sources: ecc2/src/tui/widgets.rs:1-50, research/ecc2-codebase-analysis.md:162-165
UI Feature Summary
| Component | Functionality | Primary Source |
|---|---|---|
TableState | Manages stateful selection within session lists. | research/ecc2-codebase-analysis.md |
RingBuffer | Manages a 1000-line limit for session output display. | research/ecc2-codebase-analysis.md |
TokenMeter | Custom widget for rendering budget/usage progress bars. | ecc2/src/tui/widgets.rs |
RiskScore | Axis-based visualization of tool call safety levels. | ecc2/src/observability/mod.rs |
Observability and Risk Scoring
A critical component of the dashboard is its integration with the observability module, which performs a 4-axis risk analysis on every tool call made by the agents.
Risk Axis Analysis
Each tool call is evaluated based on:
- Base Tool Risk: The inherent danger of the tool (e.g.,
bashvsread). - File Sensitivity: Whether the tool targets sensitive files (e.g.,
.env, secrets). - Blast Radius: The scope of files affected by the change.
- Irreversibility: The difficulty of undoing the action (e.g.,
git push --force).
Sources: ecc2/src/observability/mod.rs, research/ecc2-codebase-analysis.md:30-35
This diagram illustrates how the TUI dashboard serves as the visual confirmation layer for the automated risk scoring system.
Sources: ecc2/src/observability/mod.rs, research/ecc2-codebase-analysis.md:144-160
Implementation Details
The TUI implementation adheres to strict coding standards, utilizing anyhow::Result for error propagation and ensuring zero unsafe blocks.
Key Data Structures
// ecc2/src/tui/widgets.rs - simplified logic
pub struct TokenMeter {
pub label: String,
pub value: u64,
pub limit: u64,
}
impl Widget for TokenMeter {
fn render(self, area: Rect, buf: &mut Buffer) {
// Logic to calculate percentage and determine color
// < 70%: Green, 70-90%: Yellow, > 90%: Red
}
}
Sources: ecc2/src/tui/widgets.rs:5-40
Session State Transitions
The dashboard reflects the following enforced state machine transitions:
| From State | Valid To State |
|---|---|
Pending | Running, Failed, Stopped |
Running | Idle, Completed, Failed, Stopped |
Idle | Running, Completed, Stopped |
| Sources: research/ecc2-codebase-analysis.md:25-29 |
Conclusion
The ECC 2.0 TUI Dashboard provides a robust, low-latency control plane for autonomous agent sessions. By combining idiomatic Rust TUI patterns with deep observability integration, it enables operators to monitor complex workflows with high situational awareness and safety. Future development priorities include implementing the currently stubbed new_session dialog and expanding the comms module for inter-agent coordination within the dashboard view.
Sources: research/ecc2-codebase-analysis.md:210-235