BUG-HUNT: [spec-alignment] CLI agents action create silently drops review_actor, estimation_actor, invariant_actor, automation_profile, invariants, and apply_actor from YAML config #6392

Open
opened 2026-04-09 21:00:07 +00:00 by HAL9000 · 0 comments
Owner

Bug Report: [spec-alignment] — CLI agents action create silently drops key YAML fields

Severity Assessment

  • Impact: Actions created via agents action create --config <file> will silently lose all optional actor fields (review_actor, estimation_actor, invariant_actor, apply_actor), automation_profile, and invariants — even when those fields are specified in the YAML configuration. Plans created from the action will have None actors where the user specified one, and will be missing action-level invariants entirely.
  • Likelihood: This fires for every action that specifies any of these optional fields in its YAML config — a common case per the spec.
  • Priority: High

Location

  • File: src/cleveragents/cli/commands/action.py
  • Function: create()
  • Lines: ~242–254

Description

The create() command in the CLI correctly parses the YAML file and builds a full Action domain object via Action.from_config() (which correctly extracts all fields). However, when it calls service.create_action(), it only passes a subset of the action's fields. The following fields are silently dropped:

Field Effect of Being Dropped
review_actor Plans from this action will never have a review actor
estimation_actor Plans will skip cost/risk estimation
invariant_actor Plans will skip invariant reconciliation
apply_actor Plans will have no Apply-phase actor
automation_profile Plans will not inherit the action's automation profile
invariants Plan-level invariants from the action spec are never propagated

Evidence

# src/cleveragents/cli/commands/action.py  lines ~242–254
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: review_actor, estimation_actor, invariant_actor,
    # ❌          apply_actor, automation_profile, invariants
)

The service.create_action() signature already accepts all the missing fields:

# src/cleveragents/application/services/plan_lifecycle_service.py  lines ~718–733
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,        # ← never passed from CLI
    estimation_actor: str | None = None,    # ← never passed from CLI
    invariant_actor: str | None = None,     # ← never passed from CLI
    automation_profile: str | None = None,  # ← never passed from CLI
    invariants: list[str] | None = None,    # ← never passed from CLI
    ...

Action.from_config() correctly extracts these fields from the YAML:

# src/cleveragents/domain/models/core/action.py  lines ~645–656
return cls(
    ...
    review_actor=config.get("review_actor"),
    apply_actor=config.get("apply_actor"),
    estimation_actor=config.get("estimation_actor"),
    invariant_actor=config.get("invariant_actor"),
    automation_profile=config.get("automation_profile"),
    invariants=config.get("invariants", []),
    ...
)

So the bug is squarely in the CLI create() call — the values are extracted correctly but then discarded.

Expected Behavior

Per the specification, all fields declared in the action YAML config file should be persisted when the action is created. agents action create --config <file> should result in an Action record with all fields from the YAML file, including review_actor, estimation_actor, invariant_actor, apply_actor, automation_profile, and invariants.

Actual Behavior

An action created from a YAML that specifies e.g.:

review_actor: openai/gpt-4
invariants:
  - "All tests must pass"
automation_profile: safe

Will be persisted as if none of those fields were specified. Plans created from this action will be missing the review actor and invariants.

Suggested Fix

Pass all fields from the parsed action object to service.create_action():

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,
    # Add these missing fields:
    review_actor=action.review_actor,
    estimation_actor=action.estimation_actor,
    invariant_actor=action.invariant_actor,
    automation_profile=action.automation_profile,
    invariants=action.invariants,
)

Note: apply_actor is not yet a parameter of create_action(); a separate fix is needed to add it to the service signature.

Category

spec-alignment, error-handling

TDD Note

After this bug issue is verified, a corresponding Type/Testing issue will be created for TDD. The test will use tags: @tdd_issue, @tdd_issue_<this-issue-number>, and @tdd_expected_fail to prove the bug exists before fixing it.


Automated by CleverAgents Bot
Supervisor: Bug Hunting | Agent: bug-hunter

## Bug Report: [spec-alignment] — CLI `agents action create` silently drops key YAML fields ### Severity Assessment - **Impact**: Actions created via `agents action create --config <file>` will **silently lose** all optional actor fields (`review_actor`, `estimation_actor`, `invariant_actor`, `apply_actor`), `automation_profile`, and `invariants` — even when those fields are specified in the YAML configuration. Plans created from the action will have `None` actors where the user specified one, and will be missing action-level invariants entirely. - **Likelihood**: This fires for every action that specifies any of these optional fields in its YAML config — a common case per the spec. - **Priority**: High ### Location - **File**: `src/cleveragents/cli/commands/action.py` - **Function**: `create()` - **Lines**: ~242–254 ### Description The `create()` command in the CLI correctly parses the YAML file and builds a full `Action` domain object via `Action.from_config()` (which correctly extracts all fields). However, when it calls `service.create_action()`, it only passes a **subset** of the action's fields. The following fields are silently dropped: | Field | Effect of Being Dropped | |---|---| | `review_actor` | Plans from this action will never have a review actor | | `estimation_actor` | Plans will skip cost/risk estimation | | `invariant_actor` | Plans will skip invariant reconciliation | | `apply_actor` | Plans will have no Apply-phase actor | | `automation_profile` | Plans will not inherit the action's automation profile | | `invariants` | Plan-level invariants from the action spec are never propagated | ### Evidence ```python # src/cleveragents/cli/commands/action.py lines ~242–254 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: review_actor, estimation_actor, invariant_actor, # ❌ apply_actor, automation_profile, invariants ) ``` The `service.create_action()` signature already accepts all the missing fields: ```python # src/cleveragents/application/services/plan_lifecycle_service.py lines ~718–733 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, # ← never passed from CLI estimation_actor: str | None = None, # ← never passed from CLI invariant_actor: str | None = None, # ← never passed from CLI automation_profile: str | None = None, # ← never passed from CLI invariants: list[str] | None = None, # ← never passed from CLI ... ``` `Action.from_config()` correctly extracts these fields from the YAML: ```python # src/cleveragents/domain/models/core/action.py lines ~645–656 return cls( ... review_actor=config.get("review_actor"), apply_actor=config.get("apply_actor"), estimation_actor=config.get("estimation_actor"), invariant_actor=config.get("invariant_actor"), automation_profile=config.get("automation_profile"), invariants=config.get("invariants", []), ... ) ``` So the bug is squarely in the CLI `create()` call — the values are extracted correctly but then discarded. ### Expected Behavior Per the specification, all fields declared in the action YAML config file should be persisted when the action is created. `agents action create --config <file>` should result in an `Action` record with all fields from the YAML file, including `review_actor`, `estimation_actor`, `invariant_actor`, `apply_actor`, `automation_profile`, and `invariants`. ### Actual Behavior An action created from a YAML that specifies e.g.: ```yaml review_actor: openai/gpt-4 invariants: - "All tests must pass" automation_profile: safe ``` Will be persisted as if none of those fields were specified. Plans created from this action will be missing the review actor and invariants. ### Suggested Fix Pass all fields from the parsed `action` object to `service.create_action()`: ```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, # Add these missing fields: review_actor=action.review_actor, estimation_actor=action.estimation_actor, invariant_actor=action.invariant_actor, automation_profile=action.automation_profile, invariants=action.invariants, ) ``` Note: `apply_actor` is not yet a parameter of `create_action()`; a separate fix is needed to add it to the service signature. ### Category spec-alignment, error-handling ### TDD Note After this bug issue is verified, a corresponding Type/Testing issue will be created for TDD. The test will use tags: `@tdd_issue`, `@tdd_issue_<this-issue-number>`, and `@tdd_expected_fail` to prove the bug exists before fixing it. --- **Automated by CleverAgents Bot** Supervisor: Bug Hunting | Agent: bug-hunter
HAL9000 added this to the v3.2.0 milestone 2026-04-09 21:09:20 +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.

Dependencies

No dependencies set.

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