UAT: agents invariant add --plan and --action flags are not repeatable as required by spec #6784

Open
opened 2026-04-10 02:05:51 +00:00 by HAL9000 · 0 comments
Owner

What Was Tested

Code analysis of the add command signature in src/cleveragents/cli/commands/invariant.py.

Expected Behavior (From Spec)

Per docs/specification.md §agents invariant add (line 17886), the command syntax shows [--plan PLAN_ID]... and [--action ACTION]... (the ... notation signifying repeatability):

agents invariant add [--global] [(--project|-p) PROJECT] [--plan PLAN_ID]...
                     [--action ACTION]... <INVARIANT_TEXT>

And the argument descriptions (lines 17897-17898) confirm:

  • --plan PLAN_ID: Attach to a plan (plan-level invariant). Repeatable.
  • --action ACTION: Attach to an action (action-level invariant). Repeatable.

Line 17900 explicitly states:

"--plan and --action can be repeated to attach the same invariant to multiple plans or actions."

This means the following should be valid:

agents invariant add --plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J --plan 01HXM9D3F5G6H7J8K9L0M1N2O3 "Use parameterized SQL"
agents invariant add --action local/code-coverage --action local/deploy "No prod secrets in tests"

Actual Behavior

The add command declares --plan and --action as str | None (single optional strings), not as list[str]:

# src/cleveragents/cli/commands/invariant.py lines 121-122
plan: Annotated[str | None, typer.Option("--plan", help="Plan ID (ULID)")] = None,
action: Annotated[str | None, typer.Option("--action", help="Action name")] = None,

Additionally, _resolve_scope() is designed for a single plan and single action value, and the add command only creates one invariant record regardless. The implementation cannot accept multiple --plan or --action values.

Steps to Reproduce

# This should attach the invariant to two plans but currently only processes one (or errors)
agents invariant add --plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J --plan 01HXM9D3ZK4Q7C2B3F2R4VYABC "Use parameterized SQL"

Impact

Users cannot attach the same invariant to multiple plans or actions in a single command, forcing them to issue separate add commands — directly violating the spec's repeatability contract.


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

## What Was Tested Code analysis of the `add` command signature in `src/cleveragents/cli/commands/invariant.py`. ## Expected Behavior (From Spec) Per `docs/specification.md` §agents invariant add (line 17886), the command syntax shows `[--plan PLAN_ID]...` and `[--action ACTION]...` (the `...` notation signifying repeatability): ``` agents invariant add [--global] [(--project|-p) PROJECT] [--plan PLAN_ID]... [--action ACTION]... <INVARIANT_TEXT> ``` And the argument descriptions (lines 17897-17898) confirm: > - `--plan PLAN_ID`: Attach to a plan (plan-level invariant). **Repeatable.** > - `--action ACTION`: Attach to an action (action-level invariant). **Repeatable.** Line 17900 explicitly states: > "`--plan` and `--action` can be repeated to attach the same invariant to multiple plans or actions." This means the following should be valid: ```bash agents invariant add --plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J --plan 01HXM9D3F5G6H7J8K9L0M1N2O3 "Use parameterized SQL" agents invariant add --action local/code-coverage --action local/deploy "No prod secrets in tests" ``` ## Actual Behavior The `add` command declares `--plan` and `--action` as `str | None` (single optional strings), not as `list[str]`: ```python # src/cleveragents/cli/commands/invariant.py lines 121-122 plan: Annotated[str | None, typer.Option("--plan", help="Plan ID (ULID)")] = None, action: Annotated[str | None, typer.Option("--action", help="Action name")] = None, ``` Additionally, `_resolve_scope()` is designed for a single `plan` and single `action` value, and the `add` command only creates **one** invariant record regardless. The implementation cannot accept multiple `--plan` or `--action` values. ## Steps to Reproduce ```bash # This should attach the invariant to two plans but currently only processes one (or errors) agents invariant add --plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J --plan 01HXM9D3ZK4Q7C2B3F2R4VYABC "Use parameterized SQL" ``` ## Impact Users cannot attach the same invariant to multiple plans or actions in a single command, forcing them to issue separate `add` commands — directly violating the spec's repeatability contract. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.4.0 milestone 2026-04-10 02:05:58 +00:00
HAL9000 self-assigned this 2026-04-10 06:07:14 +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#6784
No description provided.