bug(cli): invariant add and list missing -p short flag for --project #9001

Open
opened 2026-04-14 04:39:36 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit Message: fix(cli): add -p short flag alias for --project in invariant add and list
  • Branch: fix/invariant-project-short-flag

Background and Context

The agents invariant add and agents invariant list command specifications (docs/specification.md §17886, §18062) define --project with a -p short alias:

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

The current CLI implementation in src/cleveragents/cli/commands/invariant.py declares --project without the -p short alias in both add and list_invariants commands.

This was discovered during [AUTO-UAT-4] UAT testing of v3.2.0 invariant commands.

Current Behavior

The --project flag in both invariant add and invariant list is declared without the -p short alias:

# src/cleveragents/cli/commands/invariant.py line 118-120 (add command)
project: Annotated[
    str | None, typer.Option("--project", help="Project name")
] = None,

# line 155-157 (list command)
project: Annotated[
    str | None, typer.Option("--project", help="Filter by project")
] = None,

Running agents invariant add -p myproject "some constraint" fails with an unrecognized option error.

Expected Behavior

Per docs/specification.md §17886 and §18062, the --project flag should accept -p as a short alias in both invariant add and invariant list:

# add command
project: Annotated[
    str | None, typer.Option("--project", "-p", help="Project name")
] = None,

# list command
project: Annotated[
    str | None, typer.Option("--project", "-p", help="Filter by project")
] = None,

Acceptance Criteria

  • agents invariant add -p PROJECT "text" works identically to agents invariant add --project PROJECT "text"
  • agents invariant list -p PROJECT works identically to agents invariant list --project PROJECT
  • BDD scenarios cover the -p short flag for both commands
  • All existing invariant CLI tests continue to pass
  • Coverage ≥ 97% via nox -s coverage_report

Subtasks

  • Add -p short alias to --project option in invariant add command
  • Add -p short alias to --project option in invariant list command
  • Add BDD scenarios for -p short flag usage
  • Run nox (all default sessions), fix any errors
  • Verify coverage ≥ 97% via nox -s coverage_report

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • 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 details.
  • 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.

Filed by [AUTO-UAT-4] UAT Test Worker — v3.2.0 Invariants UAT


Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit Message**: `fix(cli): add -p short flag alias for --project in invariant add and list` - **Branch**: `fix/invariant-project-short-flag` ## Background and Context The `agents invariant add` and `agents invariant list` command specifications (docs/specification.md §17886, §18062) define `--project` with a `-p` short alias: ``` agents invariant add [--global] [(--project|-p) PROJECT] [--plan PLAN_ID]... agents invariant list [--global] [(--project|-p) PROJECT] [--plan PLAN_ID] [--action ACTION] ``` The current CLI implementation in `src/cleveragents/cli/commands/invariant.py` declares `--project` without the `-p` short alias in both `add` and `list_invariants` commands. This was discovered during [AUTO-UAT-4] UAT testing of v3.2.0 invariant commands. ## Current Behavior The `--project` flag in both `invariant add` and `invariant list` is declared without the `-p` short alias: ```python # src/cleveragents/cli/commands/invariant.py line 118-120 (add command) project: Annotated[ str | None, typer.Option("--project", help="Project name") ] = None, # line 155-157 (list command) project: Annotated[ str | None, typer.Option("--project", help="Filter by project") ] = None, ``` Running `agents invariant add -p myproject "some constraint"` fails with an unrecognized option error. ## Expected Behavior Per `docs/specification.md` §17886 and §18062, the `--project` flag should accept `-p` as a short alias in both `invariant add` and `invariant list`: ```python # add command project: Annotated[ str | None, typer.Option("--project", "-p", help="Project name") ] = None, # list command project: Annotated[ str | None, typer.Option("--project", "-p", help="Filter by project") ] = None, ``` ## Acceptance Criteria - [ ] `agents invariant add -p PROJECT "text"` works identically to `agents invariant add --project PROJECT "text"` - [ ] `agents invariant list -p PROJECT` works identically to `agents invariant list --project PROJECT` - [ ] BDD scenarios cover the `-p` short flag for both commands - [ ] All existing invariant CLI tests continue to pass - [ ] Coverage ≥ 97% via `nox -s coverage_report` ## Subtasks - [ ] Add `-p` short alias to `--project` option in `invariant add` command - [ ] Add `-p` short alias to `--project` option in `invariant list` command - [ ] Add BDD scenarios for `-p` short flag usage - [ ] Run `nox` (all default sessions), fix any errors - [ ] Verify coverage ≥ 97% via `nox -s coverage_report` ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - 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 details. - 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. --- *Filed by [AUTO-UAT-4] UAT Test Worker — v3.2.0 Invariants UAT* --- **Automated by CleverAgents Bot** Agent: new-issue-creator
Author
Owner

Verified — CLI spec violation: -p short flag missing from invariant add and invariant list. Consistent with other CLI flag issues in v3.2.0. MoSCoW: Must-have. Priority: High.


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

✅ **Verified** — CLI spec violation: `-p` short flag missing from `invariant add` and `invariant list`. Consistent with other CLI flag issues in v3.2.0. MoSCoW: Must-have. Priority: High. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
HAL9000 added this to the v3.2.0 milestone 2026-04-14 05:28:30 +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#9001
No description provided.