UAT: agents invariant add rich output doesn't use spec-required Panel format — shows plain text instead #5470

Open
opened 2026-04-09 06:56:35 +00:00 by HAL9000 · 1 comment
Owner

Summary

The agents invariant add command's rich output format uses plain console.print() text instead of the spec-required Panel format. The spec shows a bordered panel with structured fields, but the implementation outputs unformatted text.

Expected Behavior (from spec)

$ agents invariant add --global "All public APIs must maintain backward compatibility"

╭─ Invariant Added ──────────────────────────────────────────────────────╮
│ Invariant: All public APIs must maintain backward compatibility        │
│ Scope: global                                                          │
│ ID: inv_01HXM9A1B                                                      │
╰────────────────────────────────────────────────────────────────────────╯

✓ OK Invariant added

Actual Behavior

# src/cleveragents/cli/commands/invariant.py lines 140-143
console.print(f"[green]Invariant added:[/green] {inv.id}")
console.print(f"  Text:   {inv.text}")
console.print(f"  Scope:  {inv.scope.value}")
console.print(f"  Source: {inv.source_name}")

This produces:

Invariant added: inv_01HXM9A1B
  Text:   All public APIs must maintain backward compatibility
  Scope:  global
  Source: system

Problems:

  1. No Panel border — just plain indented text
  2. Field labels don't match spec (Text: vs Invariant:, Source: vs not shown in spec)
  3. No ✓ OK Invariant added success line
  4. The scope-specific fields (e.g., Project:, Plan:, Action:) are not shown when applicable

Code Location

  • File: src/cleveragents/cli/commands/invariant.py
  • Function: add() at line 112
  • Lines: 140-143 (the rich output section)

Spec Reference

  • docs/specification.md lines 17884–17948: agents invariant add section with Rich output examples showing Panel format for each scope

Impact

  • Rich output is inconsistent with the spec and other commands
  • Users see a different format than documented
  • Scope-specific context (project name, plan ID, action name) is not shown in the output

Subtasks

  • Replace plain console.print() calls with Panel output in invariant add
  • Show scope-specific fields: Project: for project scope, Plan: for plan scope, Action: for action scope
  • Add ✓ OK Invariant added success line
  • Ensure field labels match spec: Invariant: (not Text:), Scope:, ID:
  • Add unit tests for rich output format

Definition of Done

  • Rich output uses Panel with title "Invariant Added"
  • Panel shows Invariant:, Scope:, ID: fields
  • Scope-specific fields shown when applicable (Project/Plan/Action)
  • Success line ✓ OK Invariant added shown after panel
  • JSON/YAML/plain formats continue to work correctly

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Summary The `agents invariant add` command's rich output format uses plain `console.print()` text instead of the spec-required `Panel` format. The spec shows a bordered panel with structured fields, but the implementation outputs unformatted text. ## Expected Behavior (from spec) ``` $ agents invariant add --global "All public APIs must maintain backward compatibility" ╭─ Invariant Added ──────────────────────────────────────────────────────╮ │ Invariant: All public APIs must maintain backward compatibility │ │ Scope: global │ │ ID: inv_01HXM9A1B │ ╰────────────────────────────────────────────────────────────────────────╯ ✓ OK Invariant added ``` ## Actual Behavior ```python # src/cleveragents/cli/commands/invariant.py lines 140-143 console.print(f"[green]Invariant added:[/green] {inv.id}") console.print(f" Text: {inv.text}") console.print(f" Scope: {inv.scope.value}") console.print(f" Source: {inv.source_name}") ``` This produces: ``` Invariant added: inv_01HXM9A1B Text: All public APIs must maintain backward compatibility Scope: global Source: system ``` Problems: 1. No `Panel` border — just plain indented text 2. Field labels don't match spec (`Text:` vs `Invariant:`, `Source:` vs not shown in spec) 3. No `✓ OK Invariant added` success line 4. The scope-specific fields (e.g., `Project:`, `Plan:`, `Action:`) are not shown when applicable ## Code Location - **File**: `src/cleveragents/cli/commands/invariant.py` - **Function**: `add()` at line 112 - **Lines**: 140-143 (the rich output section) ## Spec Reference - `docs/specification.md` lines 17884–17948: `agents invariant add` section with Rich output examples showing Panel format for each scope ## Impact - Rich output is inconsistent with the spec and other commands - Users see a different format than documented - Scope-specific context (project name, plan ID, action name) is not shown in the output ## Subtasks - [ ] Replace plain `console.print()` calls with `Panel` output in `invariant add` - [ ] Show scope-specific fields: `Project:` for project scope, `Plan:` for plan scope, `Action:` for action scope - [ ] Add `✓ OK Invariant added` success line - [ ] Ensure field labels match spec: `Invariant:` (not `Text:`), `Scope:`, `ID:` - [ ] Add unit tests for rich output format ## Definition of Done - Rich output uses `Panel` with title "Invariant Added" - Panel shows `Invariant:`, `Scope:`, `ID:` fields - Scope-specific fields shown when applicable (Project/Plan/Action) - Success line `✓ OK Invariant added` shown after panel - JSON/YAML/plain formats continue to work correctly --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 06:59:18 +00:00
Author
Owner

Label compliance fix applied:

  • Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md

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

Label compliance fix applied: - Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: 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.

Reference
cleveragents/cleveragents-core#5470
No description provided.