UAT: agents invariant list --effective cannot specify action scope — no --action flag when computing effective invariant set #3134

Open
opened 2026-04-05 06:44:22 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: fix/invariant-list-effective-action-scope
  • Commit Message: fix(cli): pass action_name to get_effective_invariants in list --effective
  • Milestone: None (Backlog)
  • Parent Epic: #394

Description

The agents invariant list --effective command does not support specifying an action name, meaning action-scoped invariants are silently excluded from the effective invariant set computation.

Per ADR-016, the effective invariant set is computed from all four scopes: plan, action, project, and global. However, the current CLI handler and service method have no way to pass an action_name through to get_effective_invariants().

What was tested

Code-level analysis of:

  • src/cleveragents/cli/commands/invariant.py, list_invariants() function
  • src/cleveragents/application/services/invariant_service.py, list_invariants() method

Expected behavior

The agents invariant list --effective command should support specifying an action name so that action-scoped invariants are included in the effective set computation:

# This should work but currently doesn't:
agents invariant list --effective --action deploy-service

Actual behavior

The list_invariants CLI command's --effective path only passes plan_id or project_name to get_effective_invariants(). There is no way to specify an action name:

# In list_invariants() CLI handler:
invariants = service.list_invariants(
    scope=scope,
    source_name=source_name,
    effective=effective,
)

# In list_invariants() service method:
if effective:
    return self.get_effective_invariants(
        plan_id=source_name if scope == InvariantScope.PLAN else None,
        project_name=source_name if scope == InvariantScope.PROJECT else None,
        # ← no action_name passed!
    )

Impact

Users cannot compute the effective invariant set for a specific action context via the CLI. Action-scoped invariants are silently excluded from --effective output.

Dependencies

This issue depends on #3128 (get_effective_invariants() missing action_name parameter). Both must be fixed together.

Backlog note: This issue was discovered during autonomous operation
on milestone invariant-management. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Subtasks

  • Add --action option to list_invariants CLI command for use with --effective
  • Update list_invariants() CLI handler to extract action_name and pass it to the service
  • Update InvariantService.list_invariants() signature to accept action_name parameter
  • Update InvariantService.list_invariants() to pass action_name through to get_effective_invariants()
  • Update CLI help text to document the --action + --effective combination
  • Add BDD scenario for agents invariant list --effective --action <name>
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • list_invariants CLI command updated to pass action_name to get_effective_invariants() when --effective --action <name> is used
  • InvariantService.list_invariants() updated to pass action_name through to get_effective_invariants()
  • Help text updated to document the --action + --effective combination
  • BDD scenario added for agents invariant list --effective --action <name>
  • 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-uat-tester

## Metadata - **Branch**: `fix/invariant-list-effective-action-scope` - **Commit Message**: `fix(cli): pass action_name to get_effective_invariants in list --effective` - **Milestone**: None (Backlog) - **Parent Epic**: #394 ## Description The `agents invariant list --effective` command does not support specifying an action name, meaning action-scoped invariants are silently excluded from the effective invariant set computation. Per ADR-016, the effective invariant set is computed from all four scopes: **plan**, **action**, **project**, and **global**. However, the current CLI handler and service method have no way to pass an `action_name` through to `get_effective_invariants()`. ### What was tested Code-level analysis of: - `src/cleveragents/cli/commands/invariant.py`, `list_invariants()` function - `src/cleveragents/application/services/invariant_service.py`, `list_invariants()` method ### Expected behavior The `agents invariant list --effective` command should support specifying an action name so that action-scoped invariants are included in the effective set computation: ```bash # This should work but currently doesn't: agents invariant list --effective --action deploy-service ``` ### Actual behavior The `list_invariants` CLI command's `--effective` path only passes `plan_id` or `project_name` to `get_effective_invariants()`. There is no way to specify an action name: ```python # In list_invariants() CLI handler: invariants = service.list_invariants( scope=scope, source_name=source_name, effective=effective, ) # In list_invariants() service method: if effective: return self.get_effective_invariants( plan_id=source_name if scope == InvariantScope.PLAN else None, project_name=source_name if scope == InvariantScope.PROJECT else None, # ← no action_name passed! ) ``` ### Impact Users cannot compute the effective invariant set for a specific action context via the CLI. Action-scoped invariants are silently excluded from `--effective` output. ### Dependencies This issue depends on #3128 (`get_effective_invariants()` missing `action_name` parameter). Both must be fixed together. > **Backlog note:** This issue was discovered during autonomous operation > on milestone invariant-management. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Subtasks - [ ] Add `--action` option to `list_invariants` CLI command for use with `--effective` - [ ] Update `list_invariants()` CLI handler to extract `action_name` and pass it to the service - [ ] Update `InvariantService.list_invariants()` signature to accept `action_name` parameter - [ ] Update `InvariantService.list_invariants()` to pass `action_name` through to `get_effective_invariants()` - [ ] Update CLI help text to document the `--action` + `--effective` combination - [ ] Add BDD scenario for `agents invariant list --effective --action <name>` - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - [ ] `list_invariants` CLI command updated to pass `action_name` to `get_effective_invariants()` when `--effective --action <name>` is used - [ ] `InvariantService.list_invariants()` updated to pass `action_name` through to `get_effective_invariants()` - [ ] Help text updated to document the `--action` + `--effective` combination - [ ] BDD scenario added for `agents invariant list --effective --action <name>` - [ ] 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-uat-tester
freemo added this to the v3.5.0 milestone 2026-04-05 06:53:15 +00:00
Author
Owner

Milestone Triage Decision: Moved to Backlog

This CLI feature enhancement has been moved out of v3.5.0 during aggressive milestone triage. It represents an edge case feature that does not block core autonomy hardening functionality.

Reasoning:

  • v3.5.0 focus: Essential autonomy hardening (guard enforcement, A2A facade, plan lifecycle)
  • This issue: Action-specific invariant listing - edge case CLI feature
  • Impact: Advanced CLI functionality, not core capability

Will be addressed in a future milestone focused on CLI feature completeness.

**Milestone Triage Decision: Moved to Backlog** This CLI feature enhancement has been moved out of v3.5.0 during aggressive milestone triage. It represents an edge case feature that does not block core autonomy hardening functionality. **Reasoning:** - v3.5.0 focus: Essential autonomy hardening (guard enforcement, A2A facade, plan lifecycle) - This issue: Action-specific invariant listing - edge case CLI feature - Impact: Advanced CLI functionality, not core capability Will be addressed in a future milestone focused on CLI feature completeness.
freemo removed this from the v3.5.0 milestone 2026-04-06 22:40:54 +00:00
Author
Owner

This issue has been moved to the backlog as part of an aggressive grooming of the v3.5.0 milestone. It has been deemed non-critical for the minimal viability of the milestone and will be addressed in a future release.

This issue has been moved to the backlog as part of an aggressive grooming of the v3.5.0 milestone. It has been deemed non-critical for the minimal viability of the milestone and will be addressed in a future release.
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#3134
No description provided.