UAT: agents invariant add rich output uses plain text lines instead of spec-required panel box format #2104

Open
opened 2026-04-03 04:05:19 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/invariant-add-rich-panel-output
  • Commit Message: fix(cli): use rich panel format for invariant add output to match spec
  • Milestone: v3.7.0
  • Parent Epic: #936

Background and Context

The specification (docs/specification.md lines 17812–17856) defines a rich panel box format for agents invariant add output. The spec requires a ╭─ Invariant Added ──╮ panel with structured fields rendered inside a rich.panel.Panel box.

The current implementation in src/cleveragents/cli/commands/invariant.py (lines 140–143) outputs plain text lines instead of the required rich panel, violating the spec.

Current Behavior

Invariant added: 01HXYZ...
  Text:   Never delete production data
  Scope:  global
  Source: system

Code Location: src/cleveragents/cli/commands/invariant.py, add() function, 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}")

Expected Behavior

For global-scoped invariants (per spec):

╭─ Invariant Added ──────────────────────────────────────────────────────╮
│ Invariant: Never delete production data                                │
│ Scope: global                                                          │
│ ID: inv_01HXM9A1B                                                      │
╰────────────────────────────────────────────────────────────────────────╯

✓ OK Invariant added

For project-scoped invariants (per spec):

╭─ Invariant Added ──────────────────────────────────────────────────────╮
│ Project: local/api-service                                             │
│ Invariant: All endpoints must validate auth tokens                     │
│ Scope: project                                                         │
│ ID: inv_01HXM9A2C                                                      │
╰────────────────────────────────────────────────────────────────────────╯

✓ OK Invariant added

The panel must show the scope-specific label (Project/Plan/Action/Invariant) as the first field, followed by the invariant text, scope, and ID. A ✓ OK Invariant added footer line must follow the panel.

Spec Reference: docs/specification.md lines 17812–17856 (Rich tab examples for invariant add).

Subtasks

  • Replace plain console.print lines in add() (lines 140–143) with a rich.panel.Panel render
  • Implement scope-specific first field label (Project/Plan/Action/Invariant) based on inv.scope
  • Render panel fields: scope-specific label, Invariant text, Scope, ID
  • Add ✓ OK Invariant added footer line after the panel
  • Tests (Behave): Add/update scenarios covering global-scope and project-scope panel output
  • Tests (Robot): Add integration test verifying panel box characters appear in output
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • agents invariant add output matches the spec panel format for all scope types (global, project, plan, action).
  • A ✓ OK Invariant added line is printed after the panel.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/invariant-add-rich-panel-output` - **Commit Message**: `fix(cli): use rich panel format for invariant add output to match spec` - **Milestone**: v3.7.0 - **Parent Epic**: #936 ## Background and Context The specification (`docs/specification.md` lines 17812–17856) defines a rich panel box format for `agents invariant add` output. The spec requires a `╭─ Invariant Added ──╮` panel with structured fields rendered inside a `rich.panel.Panel` box. The current implementation in `src/cleveragents/cli/commands/invariant.py` (lines 140–143) outputs plain text lines instead of the required rich panel, violating the spec. ## Current Behavior ``` Invariant added: 01HXYZ... Text: Never delete production data Scope: global Source: system ``` **Code Location:** `src/cleveragents/cli/commands/invariant.py`, `add()` function, lines 140–143: ```python 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}") ``` ## Expected Behavior For global-scoped invariants (per spec): ``` ╭─ Invariant Added ──────────────────────────────────────────────────────╮ │ Invariant: Never delete production data │ │ Scope: global │ │ ID: inv_01HXM9A1B │ ╰────────────────────────────────────────────────────────────────────────╯ ✓ OK Invariant added ``` For project-scoped invariants (per spec): ``` ╭─ Invariant Added ──────────────────────────────────────────────────────╮ │ Project: local/api-service │ │ Invariant: All endpoints must validate auth tokens │ │ Scope: project │ │ ID: inv_01HXM9A2C │ ╰────────────────────────────────────────────────────────────────────────╯ ✓ OK Invariant added ``` The panel must show the scope-specific label (Project/Plan/Action/Invariant) as the first field, followed by the invariant text, scope, and ID. A `✓ OK Invariant added` footer line must follow the panel. **Spec Reference:** `docs/specification.md` lines 17812–17856 (Rich tab examples for invariant add). ## Subtasks - [ ] Replace plain `console.print` lines in `add()` (lines 140–143) with a `rich.panel.Panel` render - [ ] Implement scope-specific first field label (Project/Plan/Action/Invariant) based on `inv.scope` - [ ] Render panel fields: scope-specific label, Invariant text, Scope, ID - [ ] Add `✓ OK Invariant added` footer line after the panel - [ ] Tests (Behave): Add/update scenarios covering global-scope and project-scope panel output - [ ] Tests (Robot): Add integration test verifying panel box characters appear in output - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - [ ] All subtasks above are completed and checked off. - [ ] `agents invariant add` output matches the spec panel format for all scope types (global, project, plan, action). - [ ] A `✓ OK Invariant added` line is printed after the panel. - [ ] A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - [ ] The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - [ ] The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-03 04:05:35 +00:00
freemo self-assigned this 2026-04-03 16:58:07 +00:00
Author
Owner

MoSCoW classification: Could Have

Rationale: This is a low-priority or backlog item. Desirable but not necessary for the milestone. Include only if time permits.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

MoSCoW classification: **Could Have** Rationale: This is a low-priority or backlog item. Desirable but not necessary for the milestone. Include only if time permits. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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#2104
No description provided.