UAT: agents invariant add rich output does not match spec — missing panel, wrong field labels, and no "✓ OK" confirmation line #3192

Open
opened 2026-04-05 07:36:56 +00:00 by freemo · 3 comments
Owner

Metadata

  • Branch: fix/invariant-add-rich-output-format
  • Commit Message: fix(cli/invariant): align invariant add rich output with spec panel and confirmation line
  • Milestone: None (backlog)
  • Parent Epic: #362

Backlog note: This issue was discovered during autonomous operation
on milestone v3.3.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Description

The agents invariant add command's rich output format does not match the specification defined in docs/specification.md §17792–17856.

Expected behavior (from spec)

The rich output should display a bordered panel titled "Invariant Added" containing:

  • Invariant: — the constraint text
  • Scope: — the scope (global / project / plan / action)
  • ID: — the invariant ID prefixed with inv_ (e.g., inv_01HXM9A1B)
  • Optionally: Project:, Plan:, or Action: field showing the scope source

Followed by a ✓ OK Invariant added confirmation line.

Spec example:

$ 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

The current implementation in src/cleveragents/cli/commands/invariant.py (add() function) outputs plain text without a panel:

[green]Invariant added:[/green] {inv.id}
  Text:   {inv.text}
  Scope:  {inv.scope.value}
  Source: {inv.source_name}

Issues identified:

  1. No rich panel with border — just plain text with inline markup
  2. No ✓ OK Invariant added confirmation line after the output block
  3. ID is a raw ULID without the required inv_ prefix
  4. Shows generic Source: label instead of scope-specific labels (Project:, Plan:, Action:)
  5. Uses Text: instead of Invariant: as the field label

Steps to reproduce

  1. Run agents invariant add --global "Never delete production data"
  2. Observe the output format — it does not match the spec panel layout

Code location

src/cleveragents/cli/commands/invariant.py, add() function

Subtasks

  • Read docs/specification.md §17792–17856 to confirm all required output fields and layout
  • Update add() in src/cleveragents/cli/commands/invariant.py to render a Rich Panel titled "Invariant Added"
  • Change field label from Text:Invariant:
  • Change field label from Source: → scope-specific label (Project: / Plan: / Action:) when applicable; omit for global scope
  • Prefix the invariant ID with inv_ in the output (e.g., inv_01HXM9A1B)
  • Add ✓ OK Invariant added confirmation line after the panel
  • Write/update Behave unit tests in features/ covering all output variants (global, project, plan, action scope)
  • Write/update Robot Framework integration test in robot/ verifying the rendered output end-to-end
  • Verify nox -e lint, nox -e typecheck, nox -e unit_tests, nox -e integration_tests all pass
  • Verify coverage remains ≥ 97%

Definition of Done

  • agents invariant add renders a bordered Rich panel titled "Invariant Added"
  • Panel contains Invariant:, Scope:, ID: fields (and optional scope-source field) matching spec §17792–17856
  • ID field displays the inv_-prefixed identifier
  • A ✓ OK Invariant added line appears after the panel
  • Scope-specific source labels (Project:, Plan:, Action:) are used where applicable
  • Behave unit tests cover all scope variants and pass
  • Robot Framework integration test passes
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/invariant-add-rich-output-format` - **Commit Message**: `fix(cli/invariant): align invariant add rich output with spec panel and confirmation line` - **Milestone**: None (backlog) - **Parent Epic**: #362 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.3.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Description The `agents invariant add` command's rich output format does not match the specification defined in `docs/specification.md` §17792–17856. ### Expected behavior (from spec) The rich output should display a bordered panel titled **"Invariant Added"** containing: - `Invariant:` — the constraint text - `Scope:` — the scope (`global` / `project` / `plan` / `action`) - `ID:` — the invariant ID prefixed with `inv_` (e.g., `inv_01HXM9A1B`) - Optionally: `Project:`, `Plan:`, or `Action:` field showing the scope source Followed by a `✓ OK Invariant added` confirmation line. **Spec example:** ``` $ 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 The current implementation in `src/cleveragents/cli/commands/invariant.py` (`add()` function) outputs plain text without a panel: ``` [green]Invariant added:[/green] {inv.id} Text: {inv.text} Scope: {inv.scope.value} Source: {inv.source_name} ``` **Issues identified:** 1. No rich panel with border — just plain text with inline markup 2. No `✓ OK Invariant added` confirmation line after the output block 3. ID is a raw ULID without the required `inv_` prefix 4. Shows generic `Source:` label instead of scope-specific labels (`Project:`, `Plan:`, `Action:`) 5. Uses `Text:` instead of `Invariant:` as the field label ### Steps to reproduce 1. Run `agents invariant add --global "Never delete production data"` 2. Observe the output format — it does not match the spec panel layout ### Code location `src/cleveragents/cli/commands/invariant.py`, `add()` function ## Subtasks - [ ] Read `docs/specification.md` §17792–17856 to confirm all required output fields and layout - [ ] Update `add()` in `src/cleveragents/cli/commands/invariant.py` to render a Rich `Panel` titled "Invariant Added" - [ ] Change field label from `Text:` → `Invariant:` - [ ] Change field label from `Source:` → scope-specific label (`Project:` / `Plan:` / `Action:`) when applicable; omit for global scope - [ ] Prefix the invariant ID with `inv_` in the output (e.g., `inv_01HXM9A1B`) - [ ] Add `✓ OK Invariant added` confirmation line after the panel - [ ] Write/update Behave unit tests in `features/` covering all output variants (global, project, plan, action scope) - [ ] Write/update Robot Framework integration test in `robot/` verifying the rendered output end-to-end - [ ] Verify `nox -e lint`, `nox -e typecheck`, `nox -e unit_tests`, `nox -e integration_tests` all pass - [ ] Verify coverage remains ≥ 97% ## Definition of Done - [ ] `agents invariant add` renders a bordered Rich panel titled "Invariant Added" - [ ] Panel contains `Invariant:`, `Scope:`, `ID:` fields (and optional scope-source field) matching spec §17792–17856 - [ ] ID field displays the `inv_`-prefixed identifier - [ ] A `✓ OK Invariant added` line appears after the panel - [ ] Scope-specific source labels (`Project:`, `Plan:`, `Action:`) are used where applicable - [ ] Behave unit tests cover all scope variants and pass - [ ] Robot Framework integration test passes - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.2.0 milestone 2026-04-05 07:49:43 +00:00
freemo modified the milestone from v3.2.0 to v3.5.0 2026-04-05 08:06:10 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified — clear spec-vs-implementation mismatch with specific section references
  • Priority: Backlog (unchanged) — CLI output formatting issue, does not affect functionality
  • Milestone: v3.5.0 — invariant management is part of the Autonomy Hardening milestone scope
  • MoSCoW: Could Have — output formatting polish. The command works correctly; the output just doesn't match the spec's panel format. Desirable but not blocking.
  • Parent Epic: #362 (referenced in issue body)

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

Issue triaged by project owner: - **State**: Verified — clear spec-vs-implementation mismatch with specific section references - **Priority**: Backlog (unchanged) — CLI output formatting issue, does not affect functionality - **Milestone**: v3.5.0 — invariant management is part of the Autonomy Hardening milestone scope - **MoSCoW**: Could Have — output formatting polish. The command works correctly; the output just doesn't match the spec's panel format. Desirable but not blocking. - **Parent Epic**: #362 (referenced in issue body) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Author
Owner

Milestone Triage Decision: Moved to Backlog

This CLI output formatting issue has been moved out of v3.5.0 during aggressive milestone triage. While important for spec compliance, it does not block core autonomy hardening functionality.

Reasoning:

  • v3.5.0 focus: Essential autonomy hardening (guard enforcement, A2A facade, plan lifecycle)
  • This issue: CLI output formatting (invariant add) - low usage feature
  • Impact: UX consistency, not functional capability

Will be addressed in a future milestone focused on CLI polish and spec compliance.

**Milestone Triage Decision: Moved to Backlog** This CLI output formatting issue has been moved out of v3.5.0 during aggressive milestone triage. While important for spec compliance, it does not block core autonomy hardening functionality. **Reasoning:** - v3.5.0 focus: Essential autonomy hardening (guard enforcement, A2A facade, plan lifecycle) - This issue: CLI output formatting (`invariant add`) - low usage feature - Impact: UX consistency, not functional capability Will be addressed in a future milestone focused on CLI polish and spec compliance.
freemo removed this from the v3.5.0 milestone 2026-04-06 22:39:54 +00:00
Author
Owner

This issue has been moved to the backlog as part of an aggressive grooming of the v3.5.0 milestone. It has been deemed non-critical for the minimal viability of the milestone and will be addressed in a future release.

This issue has been moved to the backlog as part of an aggressive grooming of the v3.5.0 milestone. It has been deemed non-critical for the minimal viability of the milestone and will be addressed in a future release.
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
#362 Epic: Security & Safety Hardening
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3192
No description provided.