UAT: agents invariant list JSON/YAML output structure does not match spec — missing scope, plan_id, effective, conflicts_resolved envelope fields #6537

Open
opened 2026-04-09 21:16:14 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Feature Area

Invariants & Automation Profiles

Spec Reference

docs/specification.md lines 18140-18163 (JSON output for agents invariant list --plan <ID> --effective):

{
  "command": "invariant list",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "scope": "plan",
    "plan_id": "01HXM8C2ZK4Q7C2B3F2R4VYV6J",
    "effective": true,
    "invariants": [
      { "id": "inv_01HXM9A1B", "source": "global", "text": "All public APIs must maintain backward compatibility" },
      { "id": "inv_01HXM9A2C", "source": "project", "text": "All endpoints must validate auth tokens" },
      { "id": "inv_01HXM9G3A", "source": "plan", "text": "All database queries must use parameterized statements" }
    ],
    "conflicts_resolved": [
      {
        "overridden": { "source": "global", "text": "Use shared DB pool" },
        "by": { "source": "plan", "text": "All database queries must use parameterized statements" }
      }
    ]
  },
  "messages": ["3 effective invariants (1 global, 1 project, 1 plan; 1 conflict resolved)"]
}

Expected Behavior

The JSON/YAML output for agents invariant list should include:

  • data.scope — the scope being listed (global, project, plan, action)
  • data.plan_id — when --plan is used
  • data.effective — boolean, true when --effective is used
  • data.invariants — array of {id, source, text} objects (not full invariant dicts)
  • data.conflicts_resolved — array of conflict resolution records (when --effective)
  • messages — human-readable summary like "3 effective invariants (1 global, 1 project, 1 plan; 1 conflict resolved)"

Actual Behavior

The implementation returns a flat array of full invariant dicts (with id, text, scope, source_name, active, created_at) without the spec-required envelope structure. The conflicts_resolved field is completely absent.

Code Location

  • src/cleveragents/cli/commands/invariant.pylist_invariants() command, non-rich output block (line ~175-185)
  • src/cleveragents/cli/commands/invariant.py_invariant_dict() function (line ~98)

Severity

Backlog — JSON/YAML output format issue. Rich output is functional (though also has format issues per separate bug).


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

## Bug Report ### Feature Area Invariants & Automation Profiles ### Spec Reference `docs/specification.md` lines 18140-18163 (JSON output for `agents invariant list --plan <ID> --effective`): ```json { "command": "invariant list", "status": "ok", "exit_code": 0, "data": { "scope": "plan", "plan_id": "01HXM8C2ZK4Q7C2B3F2R4VYV6J", "effective": true, "invariants": [ { "id": "inv_01HXM9A1B", "source": "global", "text": "All public APIs must maintain backward compatibility" }, { "id": "inv_01HXM9A2C", "source": "project", "text": "All endpoints must validate auth tokens" }, { "id": "inv_01HXM9G3A", "source": "plan", "text": "All database queries must use parameterized statements" } ], "conflicts_resolved": [ { "overridden": { "source": "global", "text": "Use shared DB pool" }, "by": { "source": "plan", "text": "All database queries must use parameterized statements" } } ] }, "messages": ["3 effective invariants (1 global, 1 project, 1 plan; 1 conflict resolved)"] } ``` ### Expected Behavior The JSON/YAML output for `agents invariant list` should include: - `data.scope` — the scope being listed (global, project, plan, action) - `data.plan_id` — when `--plan` is used - `data.effective` — boolean, true when `--effective` is used - `data.invariants` — array of `{id, source, text}` objects (not full invariant dicts) - `data.conflicts_resolved` — array of conflict resolution records (when `--effective`) - `messages` — human-readable summary like "3 effective invariants (1 global, 1 project, 1 plan; 1 conflict resolved)" ### Actual Behavior The implementation returns a flat array of full invariant dicts (with `id`, `text`, `scope`, `source_name`, `active`, `created_at`) without the spec-required envelope structure. The `conflicts_resolved` field is completely absent. ### Code Location - `src/cleveragents/cli/commands/invariant.py` — `list_invariants()` command, non-rich output block (line ~175-185) - `src/cleveragents/cli/commands/invariant.py` — `_invariant_dict()` function (line ~98) ### Severity **Backlog** — JSON/YAML output format issue. Rich output is functional (though also has format issues per separate bug). --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 21:28:38 +00:00
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#6537
No description provided.