Epic: Output Rendering Pipeline Integration — Wire Commands to OutputSession Framework #936

Open
opened 2026-03-14 01:14:05 +00:00 by freemo · 2 comments
Owner

Background and Context

The specification defines an Output Rendering Framework (spec §Output Rendering Framework) with a formal architecture: OutputSession, Element Handles, Element Events, Materialization Strategies, ElementRenderer Protocol, RendererRegistry, and format-specific renderers. Every CLI command must produce structured output matching the spec envelope: {command, status, exit_code, data, timing, messages}.

The current implementation has:

  • OutputSession with element handle lifecycle (functional in cli/output/session.py)
  • Element handles: PanelHandle, TableHandle, StatusHandle, ProgressHandle
  • All 6 format-specific materializers exist
  • Format selection with terminal capability detection

However:

  • CLI commands do not use OutputSession — commands still use the old format_output() path; the OutputSession framework is not integrated
  • Rich materializer is a stub — delegates to color renderer, no rich library integration
  • Spec envelope mismatch — code uses {command, session_id, elements, exit_code, timing, metadata} instead of {command, status, exit_code, data, timing, messages}
  • No RendererRegistry — hard-coded dispatch instead of pluggable registry (tracked by #917)

Note: #884 covers envelope alignment and #917 covers RendererRegistry. This Epic coordinates the full integration.

Expected Behavior

All CLI commands must produce output through the OutputSession pipeline, using the spec-defined envelope format, with a functional Rich materializer for interactive terminal use.

Acceptance Criteria

  • All CLI commands route output through OutputSession (not direct format_output())
  • Output envelope matches spec: {command, status, exit_code, data, timing, messages}
  • Rich materializer uses the rich library for live terminal rendering (panels, tables, spinners, progress bars)
  • Streaming materialization mode supports progressive real-time output for --stream commands
  • RendererRegistry dispatches element types to per-format renderers (coordinates with #917)
  • All output format tabs in the spec are reproducible by the implementation

Subtasks

  • Refactor CLI commands to use OutputSession instead of format_output() — system commands (version, info, diagnostics, init)
  • Refactor CLI commands — session commands
  • Refactor CLI commands — project commands
  • Refactor CLI commands — actor commands
  • Refactor CLI commands — plan commands
  • Refactor CLI commands — resource, tool, skill, action, config, invariant, validation, lsp commands
  • Implement functional Rich materializer with rich Live Display integration
  • Implement streaming materialization mode for --stream
  • Align output envelope to spec structure (coordinates with #884)
  • Tests (Behave): Add scenarios for each output format
  • Tests (Robot): Add integration tests for command output structure
  • Verify coverage >=97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This epic is complete when all child issues are closed AND every CLI command produces structured output through the OutputSession framework, the Rich materializer provides interactive terminal rendering, and all output formats match the specification examples.

## Background and Context The specification defines an Output Rendering Framework (spec §Output Rendering Framework) with a formal architecture: OutputSession, Element Handles, Element Events, Materialization Strategies, ElementRenderer Protocol, RendererRegistry, and format-specific renderers. Every CLI command must produce structured output matching the spec envelope: `{command, status, exit_code, data, timing, messages}`. The current implementation has: - `OutputSession` with element handle lifecycle (functional in `cli/output/session.py`) - Element handles: `PanelHandle`, `TableHandle`, `StatusHandle`, `ProgressHandle` - All 6 format-specific materializers exist - Format selection with terminal capability detection However: - **CLI commands do not use OutputSession** — commands still use the old `format_output()` path; the OutputSession framework is not integrated - **Rich materializer is a stub** — delegates to color renderer, no `rich` library integration - **Spec envelope mismatch** — code uses `{command, session_id, elements, exit_code, timing, metadata}` instead of `{command, status, exit_code, data, timing, messages}` - **No RendererRegistry** — hard-coded dispatch instead of pluggable registry (tracked by #917) Note: #884 covers envelope alignment and #917 covers RendererRegistry. This Epic coordinates the full integration. ## Expected Behavior All CLI commands must produce output through the OutputSession pipeline, using the spec-defined envelope format, with a functional Rich materializer for interactive terminal use. ## Acceptance Criteria - [ ] All CLI commands route output through `OutputSession` (not direct `format_output()`) - [ ] Output envelope matches spec: `{command, status, exit_code, data, timing, messages}` - [ ] Rich materializer uses the `rich` library for live terminal rendering (panels, tables, spinners, progress bars) - [ ] Streaming materialization mode supports progressive real-time output for `--stream` commands - [ ] `RendererRegistry` dispatches element types to per-format renderers (coordinates with #917) - [ ] All output format tabs in the spec are reproducible by the implementation ## Subtasks - [ ] Refactor CLI commands to use `OutputSession` instead of `format_output()` — system commands (version, info, diagnostics, init) - [ ] Refactor CLI commands — session commands - [ ] Refactor CLI commands — project commands - [ ] Refactor CLI commands — actor commands - [ ] Refactor CLI commands — plan commands - [ ] Refactor CLI commands — resource, tool, skill, action, config, invariant, validation, lsp commands - [ ] Implement functional Rich materializer with `rich` Live Display integration - [ ] Implement streaming materialization mode for `--stream` - [ ] Align output envelope to spec structure (coordinates with #884) - [ ] Tests (Behave): Add scenarios for each output format - [ ] Tests (Robot): Add integration tests for command output structure - [ ] Verify coverage >=97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This epic is complete when all child issues are closed AND every CLI command produces structured output through the OutputSession framework, the Rich materializer provides interactive terminal rendering, and all output formats match the specification examples.
freemo added this to the v3.5.0 milestone 2026-03-14 01:15:49 +00:00
Author
Owner

Parent Legendary: cleverthis/cleveragents#3 — Core Functionality

Blocked by:

  • #933 (A2A Protocol) — CLI commands must route through A2A before OutputSession wiring

Coordinates with:

  • #884 (output envelope alignment) — envelope format change
  • #917 (RendererRegistry) — pluggable renderer dispatch
## Dependency Links **Parent Legendary**: [cleverthis/cleveragents#3 — Core Functionality](https://git.cleverthis.com/cleverthis/cleveragents/issues/3) **Blocked by**: - #933 (A2A Protocol) — CLI commands must route through A2A before OutputSession wiring **Coordinates with**: - #884 (output envelope alignment) — envelope format change - #917 (RendererRegistry) — pluggable renderer dispatch
freemo self-assigned this 2026-03-14 04:27:20 +00:00
freemo self-assigned this 2026-04-02 06:13:55 +00:00
Author
Owner

Label compliance fix applied:

  • Replaced orphaned label State/In Progress with valid label State/In progress
  • Reason: State/In Progress (capital P) is an orphaned label that no longer exists in the repository's label list. The correct label is State/In progress (lowercase p, ID: 1322).

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: ca-backlog-groomer

Label compliance fix applied: - Replaced orphaned label `State/In Progress` with valid label `State/In progress` - Reason: `State/In Progress` (capital P) is an orphaned label that no longer exists in the repository's label list. The correct label is `State/In progress` (lowercase p, ID: 1322). --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks Depends on
Reference
cleveragents/cleveragents-core#936
No description provided.