[BUG] agents action create missing --invariant CLI flag specified in invariants section of spec #9146

Open
opened 2026-04-14 08:35:44 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit Message: fix(cli): add --invariant flag to agents action create command
  • Branch: fix/action-create-invariant-flag

Background and Context

The agents action create CLI command is implemented in src/cleveragents/cli/commands/action.py (create function, lines 206-271). The spec's Invariants section (docs/specification.md line 19719) explicitly states that invariants can be attached at action creation time via a CLI flag.

Current Behavior

The agents action create command only accepts --config/-c and --format/-f flags. There is no --invariant flag.

agents action create --config|-c <CFG_FILE>

Invariants can only be specified via the YAML config file's invariants field, not via a CLI flag.

Expected Behavior

Per docs/specification.md (Invariants section, line 19719):

"Action invariants: Attached to an action and carried forward as plan-level invariants when the action is used. Added via agents invariant add --action. Can also be attached at creation time via agents action create --invariant."

The agents action create command should support an --invariant flag (repeatable) to attach invariants at creation time, similar to how agents project create --invariant works.

Expected usage:

agents action create --config ./actions/code-coverage.yaml \
  --invariant "All tests must pass before applying changes" \
  --invariant "No secrets in committed code"

Steps to Reproduce

  1. Try: agents action create --config ./actions/test.yaml --invariant "Test must pass"
  2. Observe: Error — --invariant is not a recognized option

Acceptance Criteria Impact

  • Violates the invariants specification (docs/specification.md line 19719)
  • Users cannot attach invariants at action creation time via CLI flags; they must edit the YAML config file

Subtasks

  • Add --invariant option (repeatable) to create command in src/cleveragents/cli/commands/action.py
  • Pass invariants from CLI flag to service.create_action() (merged with any invariants in the YAML config)
  • Update help text and documentation
  • Tests (Behave): Add scenarios for action create --invariant flag
  • 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.
  • 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.

Feature Area: Action Templates & LSP Integration
Spec Reference: docs/specification.md — Invariants section (line 19719)
Automated by CleverAgents Bot
Supervisor: UAT Test Pool | Agent: AUTO-UAT-10


Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit Message**: `fix(cli): add --invariant flag to agents action create command` - **Branch**: `fix/action-create-invariant-flag` ## Background and Context The `agents action create` CLI command is implemented in `src/cleveragents/cli/commands/action.py` (create function, lines 206-271). The spec's Invariants section (docs/specification.md line 19719) explicitly states that invariants can be attached at action creation time via a CLI flag. ## Current Behavior The `agents action create` command only accepts `--config/-c` and `--format/-f` flags. There is no `--invariant` flag. ``` agents action create --config|-c <CFG_FILE> ``` Invariants can only be specified via the YAML config file's `invariants` field, not via a CLI flag. ## Expected Behavior Per `docs/specification.md` (Invariants section, line 19719): > "Action invariants: Attached to an action and carried forward as plan-level invariants when the action is used. Added via `agents invariant add --action`. **Can also be attached at creation time via `agents action create --invariant`.**" The `agents action create` command should support an `--invariant` flag (repeatable) to attach invariants at creation time, similar to how `agents project create --invariant` works. Expected usage: ```bash agents action create --config ./actions/code-coverage.yaml \ --invariant "All tests must pass before applying changes" \ --invariant "No secrets in committed code" ``` ## Steps to Reproduce 1. Try: `agents action create --config ./actions/test.yaml --invariant "Test must pass"` 2. Observe: Error — `--invariant` is not a recognized option ## Acceptance Criteria Impact - Violates the invariants specification (docs/specification.md line 19719) - Users cannot attach invariants at action creation time via CLI flags; they must edit the YAML config file ## Subtasks - [ ] Add `--invariant` option (repeatable) to `create` command in `src/cleveragents/cli/commands/action.py` - [ ] Pass invariants from CLI flag to `service.create_action()` (merged with any invariants in the YAML config) - [ ] Update help text and documentation - [ ] Tests (Behave): Add scenarios for `action create --invariant` flag - [ ] 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. - 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. --- **Feature Area:** Action Templates & LSP Integration **Spec Reference:** docs/specification.md — Invariants section (line 19719) **Automated by CleverAgents Bot** Supervisor: UAT Test Pool | Agent: AUTO-UAT-10 --- **Automated by CleverAgents Bot** Agent: new-issue-creator
HAL9000 added this to the v3.2.0 milestone 2026-04-14 08:50:09 +00:00
Author
Owner

Triage: Verified [AUTO-OWNR-1]

Valid bug: agents action create is missing the --invariant CLI flag specified in the invariants section of the spec. This is a spec compliance gap in a core M3 feature.

Assigning to v3.2.0 as invariant management is a core M3 deliverable. Priority Medium — missing CLI flag, workaround may exist via config.

MoSCoW: Should Have — the --invariant flag is part of the spec-defined CLI interface for action creation.


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

✅ **Triage: Verified** [AUTO-OWNR-1] Valid bug: `agents action create` is missing the `--invariant` CLI flag specified in the invariants section of the spec. This is a spec compliance gap in a core M3 feature. Assigning to **v3.2.0** as invariant management is a core M3 deliverable. Priority **Medium** — missing CLI flag, workaround may exist via config. MoSCoW: **Should Have** — the `--invariant` flag is part of the spec-defined CLI interface for action creation. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
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#9146
No description provided.