UAT: agents action create CLI silently drops invariants, estimation_actor, invariant_actor, and automation_profile from YAML config — fields not passed to service.create_action() #6237

Open
opened 2026-04-09 17:56:10 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Branch: bugfix/m4-action-create-missing-fields
  • Commit Message: fix(cli): pass invariants, estimation_actor, invariant_actor, automation_profile to service.create_action()
  • Milestone: v3.3.0
  • Parent Epic: See orphan note below — no action CLI Epic found; requires manual linking

Summary

agents action create --config <file> silently drops four fields that are defined in the action YAML configuration file and supported by the domain model. These fields are parsed correctly by ActionConfigSchema and populated in the Action domain object, but the CLI create command does not pass them to service.create_action().

Affected Fields

The following fields are silently dropped when agents action create calls service.create_action():

Field YAML Key Service Param Status
Invariants invariants invariants Not passed
Estimation actor estimation_actor estimation_actor Not passed
Invariant actor invariant_actor invariant_actor Not passed
Automation profile automation_profile automation_profile Not passed

Code Location

File: src/cleveragents/cli/commands/action.py

Buggy call (lines ~290-302):

action = service.create_action(
    name=str(action.namespaced_name),
    definition_of_done=action.definition_of_done,
    strategy_actor=action.strategy_actor,
    execution_actor=action.execution_actor,
    description=action.description,
    long_description=action.long_description,
    arguments=action.arguments,
    reusable=action.reusable,
    read_only=action.read_only,
    tags=action.tags,
    # MISSING: invariants=action.invariants,
    # MISSING: estimation_actor=action.estimation_actor,
    # MISSING: invariant_actor=action.invariant_actor,
    # MISSING: automation_profile=action.automation_profile,
)

Service signature (in plan_lifecycle_service.py) accepts all these parameters:

def create_action(
    self,
    name: str,
    description: str,
    definition_of_done: str,
    strategy_actor: str,
    execution_actor: str,
    long_description: str | None = None,
    arguments: list[ActionArgument] | None = None,
    reusable: bool = True,
    read_only: bool = False,
    review_actor: str | None = None,
    estimation_actor: str | None = None,   # ← supported but not passed
    invariant_actor: str | None = None,    # ← supported but not passed
    automation_profile: str | None = None, # ← supported but not passed
    invariants: list[str] | None = None,   # ← supported but not passed
    created_by: str | None = None,
    tags: list[str] | None = None,
) -> Action:

Current Behavior

When agents action create --config <file> is run with a YAML file containing invariants, invariant_actor, estimation_actor, or automation_profile, those fields are parsed and loaded into the Action domain object but are silently dropped — they are never forwarded to service.create_action(). The persisted action has null/empty values for all four fields.

Steps to Reproduce

  1. Create an action YAML file with invariants and optional actors:
name: local/security-audit
description: Security audit
strategy_actor: local/security-strategist
execution_actor: local/security-scanner
invariant_actor: local/invariant-resolver
estimation_actor: local/estimator
automation_profile: supervised
definition_of_done: All critical findings identified.
invariants:
  - "Never modify production database during audit"
  - "All findings must include reproducible steps"
  1. Run: agents action create --config security-audit.yaml

  2. Run: agents action show local/security-audit --format json

Expected Behavior

The created action should have:

  • invariant_actor: local/invariant-resolver
  • estimation_actor: local/estimator
  • automation_profile: supervised
  • invariants: ["Never modify production database during audit", "All findings must include reproducible steps"]

Actual Behavior

All four fields are null/empty in the persisted action. The invariants defined in the YAML are silently dropped and will NOT be carried forward when the action is used to create plans via agents plan use.

Impact

This is a critical data loss bug:

  • Invariants defined in action YAML are never persisted → they will not be enforced during plan execution
  • Invariant actor is never persisted → invariant reconciliation will not run for plans created from this action
  • Estimation actor is never persisted → cost estimation will not run for plans created from this action
  • Automation profile is never persisted → plans will use the global default profile instead of the action-specified one

Fix

In src/cleveragents/cli/commands/action.py, update the service.create_action() call to include the missing fields:

action = service.create_action(
    name=str(action.namespaced_name),
    definition_of_done=action.definition_of_done,
    strategy_actor=action.strategy_actor,
    execution_actor=action.execution_actor,
    description=action.description,
    long_description=action.long_description,
    arguments=action.arguments,
    reusable=action.reusable,
    read_only=action.read_only,
    tags=action.tags,
    invariants=action.invariants,              # ADD
    estimation_actor=action.estimation_actor,  # ADD
    invariant_actor=action.invariant_actor,    # ADD
    automation_profile=action.automation_profile,  # ADD
)

Verification

UAT test script confirmed: running inspect.getsource(create) on the CLI create function shows none of these four fields are passed to service.create_action().

Subtasks

  • In src/cleveragents/cli/commands/action.py, add invariants=action.invariants to the service.create_action() call
  • In src/cleveragents/cli/commands/action.py, add estimation_actor=action.estimation_actor to the service.create_action() call
  • In src/cleveragents/cli/commands/action.py, add invariant_actor=action.invariant_actor to the service.create_action() call
  • In src/cleveragents/cli/commands/action.py, add automation_profile=action.automation_profile to the service.create_action() call
  • Tests (Behave): Add/update scenario in features/ verifying all four fields are persisted when agents action create --config is used with a YAML containing these fields
  • Tests (Robot): Add integration test verifying round-trip: create action with YAML → show action → all four fields present
  • Add @tdd_issue tag to regression test scenarios
  • 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.
  • agents action create --config <file> correctly persists invariants, estimation_actor, invariant_actor, and automation_profile from the YAML config.
  • agents action show <name> confirms all four fields are present after creation.
  • 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: new-issue-creator

## Metadata - **Branch**: `bugfix/m4-action-create-missing-fields` - **Commit Message**: `fix(cli): pass invariants, estimation_actor, invariant_actor, automation_profile to service.create_action()` - **Milestone**: v3.3.0 - **Parent Epic**: _See orphan note below — no action CLI Epic found; requires manual linking_ ## Summary `agents action create --config <file>` silently drops four fields that are defined in the action YAML configuration file and supported by the domain model. These fields are parsed correctly by `ActionConfigSchema` and populated in the `Action` domain object, but the CLI `create` command does not pass them to `service.create_action()`. ## Affected Fields The following fields are **silently dropped** when `agents action create` calls `service.create_action()`: | Field | YAML Key | Service Param | Status | |-------|----------|---------------|--------| | Invariants | `invariants` | `invariants` | ❌ Not passed | | Estimation actor | `estimation_actor` | `estimation_actor` | ❌ Not passed | | Invariant actor | `invariant_actor` | `invariant_actor` | ❌ Not passed | | Automation profile | `automation_profile` | `automation_profile` | ❌ Not passed | ## Code Location **File**: `src/cleveragents/cli/commands/action.py` **Buggy call** (lines ~290-302): ```python action = service.create_action( name=str(action.namespaced_name), definition_of_done=action.definition_of_done, strategy_actor=action.strategy_actor, execution_actor=action.execution_actor, description=action.description, long_description=action.long_description, arguments=action.arguments, reusable=action.reusable, read_only=action.read_only, tags=action.tags, # MISSING: invariants=action.invariants, # MISSING: estimation_actor=action.estimation_actor, # MISSING: invariant_actor=action.invariant_actor, # MISSING: automation_profile=action.automation_profile, ) ``` **Service signature** (in `plan_lifecycle_service.py`) accepts all these parameters: ```python def create_action( self, name: str, description: str, definition_of_done: str, strategy_actor: str, execution_actor: str, long_description: str | None = None, arguments: list[ActionArgument] | None = None, reusable: bool = True, read_only: bool = False, review_actor: str | None = None, estimation_actor: str | None = None, # ← supported but not passed invariant_actor: str | None = None, # ← supported but not passed automation_profile: str | None = None, # ← supported but not passed invariants: list[str] | None = None, # ← supported but not passed created_by: str | None = None, tags: list[str] | None = None, ) -> Action: ``` ## Current Behavior When `agents action create --config <file>` is run with a YAML file containing `invariants`, `invariant_actor`, `estimation_actor`, or `automation_profile`, those fields are parsed and loaded into the `Action` domain object but are **silently dropped** — they are never forwarded to `service.create_action()`. The persisted action has `null`/empty values for all four fields. ## Steps to Reproduce 1. Create an action YAML file with invariants and optional actors: ```yaml name: local/security-audit description: Security audit strategy_actor: local/security-strategist execution_actor: local/security-scanner invariant_actor: local/invariant-resolver estimation_actor: local/estimator automation_profile: supervised definition_of_done: All critical findings identified. invariants: - "Never modify production database during audit" - "All findings must include reproducible steps" ``` 2. Run: `agents action create --config security-audit.yaml` 3. Run: `agents action show local/security-audit --format json` ## Expected Behavior The created action should have: - `invariant_actor: local/invariant-resolver` - `estimation_actor: local/estimator` - `automation_profile: supervised` - `invariants: ["Never modify production database during audit", "All findings must include reproducible steps"]` ## Actual Behavior All four fields are `null`/empty in the persisted action. The invariants defined in the YAML are silently dropped and will NOT be carried forward when the action is used to create plans via `agents plan use`. ## Impact This is a **critical data loss bug**: - **Invariants** defined in action YAML are never persisted → they will not be enforced during plan execution - **Invariant actor** is never persisted → invariant reconciliation will not run for plans created from this action - **Estimation actor** is never persisted → cost estimation will not run for plans created from this action - **Automation profile** is never persisted → plans will use the global default profile instead of the action-specified one ## Fix In `src/cleveragents/cli/commands/action.py`, update the `service.create_action()` call to include the missing fields: ```python action = service.create_action( name=str(action.namespaced_name), definition_of_done=action.definition_of_done, strategy_actor=action.strategy_actor, execution_actor=action.execution_actor, description=action.description, long_description=action.long_description, arguments=action.arguments, reusable=action.reusable, read_only=action.read_only, tags=action.tags, invariants=action.invariants, # ADD estimation_actor=action.estimation_actor, # ADD invariant_actor=action.invariant_actor, # ADD automation_profile=action.automation_profile, # ADD ) ``` ## Verification UAT test script confirmed: running `inspect.getsource(create)` on the CLI `create` function shows none of these four fields are passed to `service.create_action()`. ## Subtasks - [ ] In `src/cleveragents/cli/commands/action.py`, add `invariants=action.invariants` to the `service.create_action()` call - [ ] In `src/cleveragents/cli/commands/action.py`, add `estimation_actor=action.estimation_actor` to the `service.create_action()` call - [ ] In `src/cleveragents/cli/commands/action.py`, add `invariant_actor=action.invariant_actor` to the `service.create_action()` call - [ ] In `src/cleveragents/cli/commands/action.py`, add `automation_profile=action.automation_profile` to the `service.create_action()` call - [ ] Tests (Behave): Add/update scenario in `features/` verifying all four fields are persisted when `agents action create --config` is used with a YAML containing these fields - [ ] Tests (Robot): Add integration test verifying round-trip: create action with YAML → show action → all four fields present - [ ] Add `@tdd_issue` tag to regression test scenarios - [ ] 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. - `agents action create --config <file>` correctly persists `invariants`, `estimation_actor`, `invariant_actor`, and `automation_profile` from the YAML config. - `agents action show <name>` confirms all four fields are present after creation. - 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: new-issue-creator
HAL9000 added this to the v3.3.0 milestone 2026-04-09 17:56:32 +00:00
Author
Owner

Verified — Critical data-loss bug: CLI silently drops required fields when creating actions. This directly breaks v3.3.0 acceptance criteria. MoSCoW: Must Have — core functionality gap that must be fixed before v3.3.0 ships.


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

✅ **Verified** — Critical data-loss bug: CLI silently drops required fields when creating actions. This directly breaks v3.3.0 acceptance criteria. **MoSCoW: Must Have** — core functionality gap that must be fixed before v3.3.0 ships. --- **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.

Reference
cleveragents/cleveragents-core#6237
No description provided.