UAT: agents invariant list --effective output missing conflict resolution details — spec requires "Conflicts Resolved" section #5072

Open
opened 2026-04-09 00:54:40 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: ACMS and Context Management — Invariants — invariant list --effective

Severity: Medium (missing information in output; effective invariant list itself is correct)


What Was Tested

Code-level analysis of:

  • src/cleveragents/cli/commands/invariant.pylist_invariants() function (lines 150–243)
  • src/cleveragents/application/services/invariant_service.pyget_effective_invariants() (lines 167–202)

Expected Behavior (from spec)

The specification (§CLI Commands — agents invariant list, lines 18092–18106) shows that when --effective is used with --plan, the output must include a Conflicts Resolved section:

╭─ Effective Invariants (Plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J) ──────────────────────────────────╮
│ ID              Source   Text                                                             │
│ ──────────────  ───────  ──────────────────────────────────────────────────────           │
│ inv_01HXM9A1B  global   All public APIs must maintain backward compatibility              │
│ inv_01HXM9A2C  project  All endpoints must validate auth tokens                           │
│ inv_01HXM9G3A  plan     All database queries must use parameterized statements            │
╰───────────────────────────────────────────────────────────────────────────────────────────╯

│ Conflicts Resolved: 1                                                              │
│   Global "Use shared DB pool" overridden by plan "All database queries must use    │
│   parameterized statements"                                                        │

✓ OK 3 effective invariants (1 global, 1 project, 1 plan; 1 conflict resolved)

Key requirements:

  1. The table title should be "Effective Invariants (Plan <PLAN_ID>)" or "Effective Invariants (Project )"
  2. A Conflicts Resolved section showing which invariants were overridden and by what
  3. The success message should include scope breakdown: "(N global, N project, N plan; N conflict resolved)"

Actual Behavior (bug)

The list_invariants() function (lines 218–239) renders a generic table titled "Invariants (N total)" without:

  1. The "Effective Invariants" title variant when --effective is used
  2. Any conflict resolution information
  3. The scope breakdown in the success message

The get_effective_invariants() service method returns only the merged list of invariants — it does not return conflict records. The InvariantReconciliationActor.run() does produce ConflictRecord objects, but this information is not surfaced through the invariant list --effective CLI path.


Code Locations

  • src/cleveragents/cli/commands/invariant.pylist_invariants() function, lines 150–243
  • src/cleveragents/application/services/invariant_service.pyget_effective_invariants(), lines 167–202

Fix Required

  1. When --effective is used, change the table title to "Effective Invariants (Plan )" or "Effective Invariants (Project )".
  2. After the table, render a "Conflicts Resolved" section listing each conflict with the winner and overridden invariant text.
  3. Update the success message to include scope breakdown: "N effective invariants (N global, N project, N plan; N conflict resolved)".
  4. The get_effective_invariants() service method (or a new get_effective_invariants_with_conflicts() method) should return both the merged invariant list and the conflict records so the CLI can display them.

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

## Bug Report **Feature Area:** ACMS and Context Management — Invariants — `invariant list --effective` **Severity:** Medium (missing information in output; effective invariant list itself is correct) --- ## What Was Tested Code-level analysis of: - `src/cleveragents/cli/commands/invariant.py` — `list_invariants()` function (lines 150–243) - `src/cleveragents/application/services/invariant_service.py` — `get_effective_invariants()` (lines 167–202) --- ## Expected Behavior (from spec) The specification (§CLI Commands — `agents invariant list`, lines 18092–18106) shows that when `--effective` is used with `--plan`, the output must include a **Conflicts Resolved** section: ``` ╭─ Effective Invariants (Plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J) ──────────────────────────────────╮ │ ID Source Text │ │ ────────────── ─────── ────────────────────────────────────────────────────── │ │ inv_01HXM9A1B global All public APIs must maintain backward compatibility │ │ inv_01HXM9A2C project All endpoints must validate auth tokens │ │ inv_01HXM9G3A plan All database queries must use parameterized statements │ ╰───────────────────────────────────────────────────────────────────────────────────────────╯ │ Conflicts Resolved: 1 │ │ Global "Use shared DB pool" overridden by plan "All database queries must use │ │ parameterized statements" │ ✓ OK 3 effective invariants (1 global, 1 project, 1 plan; 1 conflict resolved) ``` Key requirements: 1. The table title should be "Effective Invariants (Plan <PLAN_ID>)" or "Effective Invariants (Project <PROJECT>)" 2. A **Conflicts Resolved** section showing which invariants were overridden and by what 3. The success message should include scope breakdown: "(N global, N project, N plan; N conflict resolved)" --- ## Actual Behavior (bug) The `list_invariants()` function (lines 218–239) renders a generic table titled "Invariants (N total)" without: 1. The "Effective Invariants" title variant when `--effective` is used 2. Any conflict resolution information 3. The scope breakdown in the success message The `get_effective_invariants()` service method returns only the merged list of invariants — it does not return conflict records. The `InvariantReconciliationActor.run()` does produce `ConflictRecord` objects, but this information is not surfaced through the `invariant list --effective` CLI path. --- ## Code Locations - `src/cleveragents/cli/commands/invariant.py` — `list_invariants()` function, lines 150–243 - `src/cleveragents/application/services/invariant_service.py` — `get_effective_invariants()`, lines 167–202 --- ## Fix Required 1. When `--effective` is used, change the table title to "Effective Invariants (Plan <ID>)" or "Effective Invariants (Project <NAME>)". 2. After the table, render a "Conflicts Resolved" section listing each conflict with the winner and overridden invariant text. 3. Update the success message to include scope breakdown: "N effective invariants (N global, N project, N plan; N conflict resolved)". 4. The `get_effective_invariants()` service method (or a new `get_effective_invariants_with_conflicts()` method) should return both the merged invariant list and the conflict records so the CLI can display them. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 01:01:44 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — Spec compliance bug; deviates from documented behavior
  • Milestone: v3.2.0
  • Story Points: 3 — M
  • MoSCoW: Must Have — Spec compliance is required

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — Spec compliance bug; deviates from documented behavior - **Milestone**: v3.2.0 - **Story Points**: 3 — M - **MoSCoW**: Must Have — Spec compliance is required --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: 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.

Dependencies

No dependencies set.

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