bug(cli): agents action create silently drops invariants, automation_profile, estimation_actor, and invariant_actor from YAML config #9319

Open
opened 2026-04-14 14:44:45 +00:00 by HAL9000 · 0 comments
Owner

Metadata

  • Commit Message: fix(cli): pass invariants, automation_profile, and optional actors from YAML config to create_action service
  • Branch: fix/action-create-missing-fields

Background and Context

The agents action create --config <file> command parses a YAML config file that supports invariants, automation_profile, estimation_actor, and invariant_actor fields per the spec. However, the CLI create command in src/cleveragents/cli/commands/action.py does NOT pass these fields to service.create_action(), causing them to be silently dropped.

Per the spec (docs/specification.md Glossary > Action): "A YAML-defined, reusable plan template specifying a description, definition of done, strategy/execution actors, typed arguments, and optional invariants."

The service.create_action() method signature (in src/cleveragents/application/services/plan_lifecycle_service.py) accepts all these parameters but they default to None when not passed from the CLI layer.

Current Behavior

When a user creates an action with a YAML config containing:

name: local/my-action
description: My action
strategy_actor: openai/gpt-4
execution_actor: openai/gpt-4
definition_of_done: Tests pass
estimation_actor: openai/gpt-4
invariant_actor: anthropic/claude-3
automation_profile: trusted
invariants:
  - "No deletion of production data"
  - "All changes must be reversible"

The estimation_actor, invariant_actor, automation_profile, and invariants fields are silently ignored and not persisted. The created action will have None for these fields.

Root cause — in src/cleveragents/cli/commands/action.py, the create() command calls service.create_action() but omits these parameters:

# Current (broken) code - lines 242-252
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: automation_profile=action.automation_profile,
    # MISSING: estimation_actor=action.estimation_actor,
    # MISSING: invariant_actor=action.invariant_actor,
)

Expected Behavior

The agents action create --config <file> command should pass ALL fields from the parsed YAML config to the service, including invariants, automation_profile, estimation_actor, and invariant_actor.

Fix — the create() command should be updated to pass 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,
    automation_profile=action.automation_profile,
    estimation_actor=action.estimation_actor,
    invariant_actor=action.invariant_actor,
)

Acceptance Criteria

  • agents action create --config <file> correctly persists invariants when provided in the YAML config
  • agents action create --config <file> correctly persists automation_profile when provided in the YAML config
  • agents action create --config <file> correctly persists estimation_actor when provided in the YAML config
  • agents action create --config <file> correctly persists invariant_actor when provided in the YAML config
  • agents action show <name> displays the persisted values for all four fields after creation
  • When the YAML config omits these optional fields, the created action has None for those fields (no regression)
  • All existing BDD/unit tests continue to pass
  • New BDD scenario(s) cover the full YAML config round-trip including all four fields

Subtasks

  • Update src/cleveragents/cli/commands/action.py create() command to pass invariants, automation_profile, estimation_actor, and invariant_actor to service.create_action()
  • Verify src/cleveragents/application/services/plan_lifecycle_service.py create_action() already accepts all four parameters (no service-layer changes expected)
  • Add or update BDD scenario in features/action_cli.feature to cover a full YAML config round-trip with all four optional fields
  • Run nox -s unit_tests -- features/action_cli.feature to verify all action CLI tests pass
  • Run nox (all default sessions) to verify no regressions

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.

Automated by CleverAgents Bot
Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor

## Metadata - **Commit Message**: `fix(cli): pass invariants, automation_profile, and optional actors from YAML config to create_action service` - **Branch**: `fix/action-create-missing-fields` ## Background and Context The `agents action create --config <file>` command parses a YAML config file that supports `invariants`, `automation_profile`, `estimation_actor`, and `invariant_actor` fields per the spec. However, the CLI `create` command in `src/cleveragents/cli/commands/action.py` does NOT pass these fields to `service.create_action()`, causing them to be silently dropped. Per the spec (`docs/specification.md` Glossary > Action): "A YAML-defined, reusable plan template specifying a description, definition of done, strategy/execution actors, typed arguments, and optional invariants." The `service.create_action()` method signature (in `src/cleveragents/application/services/plan_lifecycle_service.py`) accepts all these parameters but they default to `None` when not passed from the CLI layer. ## Current Behavior When a user creates an action with a YAML config containing: ```yaml name: local/my-action description: My action strategy_actor: openai/gpt-4 execution_actor: openai/gpt-4 definition_of_done: Tests pass estimation_actor: openai/gpt-4 invariant_actor: anthropic/claude-3 automation_profile: trusted invariants: - "No deletion of production data" - "All changes must be reversible" ``` The `estimation_actor`, `invariant_actor`, `automation_profile`, and `invariants` fields are silently ignored and not persisted. The created action will have `None` for these fields. **Root cause** — in `src/cleveragents/cli/commands/action.py`, the `create()` command calls `service.create_action()` but omits these parameters: ```python # Current (broken) code - lines 242-252 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: automation_profile=action.automation_profile, # MISSING: estimation_actor=action.estimation_actor, # MISSING: invariant_actor=action.invariant_actor, ) ``` ## Expected Behavior The `agents action create --config <file>` command should pass ALL fields from the parsed YAML config to the service, including `invariants`, `automation_profile`, `estimation_actor`, and `invariant_actor`. **Fix** — the `create()` command should be updated to pass 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, automation_profile=action.automation_profile, estimation_actor=action.estimation_actor, invariant_actor=action.invariant_actor, ) ``` ## Acceptance Criteria - [ ] `agents action create --config <file>` correctly persists `invariants` when provided in the YAML config - [ ] `agents action create --config <file>` correctly persists `automation_profile` when provided in the YAML config - [ ] `agents action create --config <file>` correctly persists `estimation_actor` when provided in the YAML config - [ ] `agents action create --config <file>` correctly persists `invariant_actor` when provided in the YAML config - [ ] `agents action show <name>` displays the persisted values for all four fields after creation - [ ] When the YAML config omits these optional fields, the created action has `None` for those fields (no regression) - [ ] All existing BDD/unit tests continue to pass - [ ] New BDD scenario(s) cover the full YAML config round-trip including all four fields ## Subtasks - [ ] Update `src/cleveragents/cli/commands/action.py` `create()` command to pass `invariants`, `automation_profile`, `estimation_actor`, and `invariant_actor` to `service.create_action()` - [ ] Verify `src/cleveragents/application/services/plan_lifecycle_service.py` `create_action()` already accepts all four parameters (no service-layer changes expected) - [ ] Add or update BDD scenario in `features/action_cli.feature` to cover a full YAML config round-trip with all four optional fields - [ ] Run `nox -s unit_tests -- features/action_cli.feature` to verify all action CLI tests pass - [ ] Run `nox` (all default sessions) to verify no regressions ## 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. --- **Automated by CleverAgents Bot** Supervisor: UAT Test Pool | Agent: uat-test-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#9319
No description provided.