UAT: agents invariant add/list missing -p shorthand for --project flag #3529

Open
opened 2026-04-05 18:58:29 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/invariant-project-shorthand-flag
  • Commit Message: fix(cli): add -p shorthand alias for --project flag in invariant add and list commands
  • Milestone: Backlog (none assigned)
  • Parent Epic: #394

Background and context

The agents invariant add and agents invariant list commands are missing the -p shorthand alias for the --project flag. The CLI specification explicitly defines (--project|-p) notation for both commands, meaning both forms must be accepted as equivalent flags.

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.

Current behavior

The implementation defines only --project (no -p shorthand):

# invariant add (lines 118-120):
project: Annotated[
    str | None, typer.Option("--project", help="Project name")
] = None,

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

Running agents invariant add -p myapp "text" or agents invariant list -p myapp fails with:

Error: No such option: -p

Expected behavior

Both --project and -p should be accepted as equivalent flags, matching the spec:

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

The fix is to include -p in both typer.Option() calls:

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

Supporting information

  • Spec reference: docs/specification.md §17794-17795 (invariant add synopsis) and §17970-17971 (invariant list synopsis)
  • Code location: src/cleveragents/cli/commands/invariant.py lines 118-120 (add) and 155-157 (list)
  • Discovered via UAT code analysis comparing implementation against spec

Steps to Reproduce

  1. Run agents invariant add -p myapp "test invariant"
  2. Observe: Error: No such option: -p

Subtasks

  • Add -p shorthand to typer.Option("--project", "-p", ...) in invariant add command (line ~119)
  • Add -p shorthand to typer.Option("--project", "-p", ...) in invariant list command (line ~156)
  • Tests (Behave): Add/update scenarios verifying -p shorthand works for both commands
  • Tests (Robot): Add integration test exercising -p shorthand for invariant add and invariant list
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

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 lines providing relevant details about the implementation.
  • 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.
  • All nox stages pass.
  • Coverage >= 97%.

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

## Metadata - **Branch**: `fix/invariant-project-shorthand-flag` - **Commit Message**: `fix(cli): add -p shorthand alias for --project flag in invariant add and list commands` - **Milestone**: Backlog (none assigned) - **Parent Epic**: #394 ## Background and context The `agents invariant add` and `agents invariant list` commands are missing the `-p` shorthand alias for the `--project` flag. The CLI specification explicitly defines `(--project|-p)` notation for both commands, meaning both forms must be accepted as equivalent flags. > **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. ## Current behavior The implementation defines only `--project` (no `-p` shorthand): ```python # invariant add (lines 118-120): project: Annotated[ str | None, typer.Option("--project", help="Project name") ] = None, # invariant list (lines 155-157): project: Annotated[ str | None, typer.Option("--project", help="Filter by project") ] = None, ``` Running `agents invariant add -p myapp "text"` or `agents invariant list -p myapp` fails with: ``` Error: No such option: -p ``` ## Expected behavior Both `--project` and `-p` should be accepted as equivalent flags, matching the spec: ``` agents invariant add [--global] [(--project|-p) PROJECT] [--plan PLAN_ID]... [--action ACTION]... <INVARIANT_TEXT> agents invariant list [--global] [(--project|-p) PROJECT] [--plan PLAN_ID] [--action ACTION] [--effective] [<REGEX>] ``` The fix is to include `-p` in both `typer.Option()` calls: ```python project: Annotated[ str | None, typer.Option("--project", "-p", help="Project name") ] = None, ``` ## Supporting information - **Spec reference**: `docs/specification.md` §17794-17795 (`invariant add` synopsis) and §17970-17971 (`invariant list` synopsis) - **Code location**: `src/cleveragents/cli/commands/invariant.py` lines 118-120 (add) and 155-157 (list) - Discovered via UAT code analysis comparing implementation against spec ## Steps to Reproduce 1. Run `agents invariant add -p myapp "test invariant"` 2. Observe: `Error: No such option: -p` ## Subtasks - [ ] Add `-p` shorthand to `typer.Option("--project", "-p", ...)` in `invariant add` command (line ~119) - [ ] Add `-p` shorthand to `typer.Option("--project", "-p", ...)` in `invariant list` command (line ~156) - [ ] Tests (Behave): Add/update scenarios verifying `-p` shorthand works for both commands - [ ] Tests (Robot): Add integration test exercising `-p` shorthand for `invariant add` and `invariant list` - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## 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 lines providing relevant details about the implementation. - 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. - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Low — Missing -p shorthand is a minor UX gap. The full --project flag works correctly. This is a cosmetic CLI improvement.
  • Milestone: v3.3.0 — Invariant CLI is part of the Decision Framework (Epic #394).
  • Story Points: 1 — XS — Trivial fix: add "-p" to two typer.Option() calls and update tests.
  • MoSCoW: Could Have — The spec defines the -p shorthand, but the full --project flag works. This is a minor convenience improvement.
  • Parent Epic: #394 (Decision Framework)

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Low — Missing `-p` shorthand is a minor UX gap. The full `--project` flag works correctly. This is a cosmetic CLI improvement. - **Milestone**: v3.3.0 — Invariant CLI is part of the Decision Framework (Epic #394). - **Story Points**: 1 — XS — Trivial fix: add `"-p"` to two `typer.Option()` calls and update tests. - **MoSCoW**: Could Have — The spec defines the `-p` shorthand, but the full `--project` flag works. This is a minor convenience improvement. - **Parent Epic**: #394 (Decision Framework) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo added this to the v3.3.0 milestone 2026-04-05 19:37:47 +00:00
freemo removed this from the v3.3.0 milestone 2026-04-06 20:53:04 +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.

Blocks
#394 Epic: Decision Framework
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3529
No description provided.