UAT: agents action create CLI silently drops invariants, automation_profile, and optional actors (review_actor, estimation_actor, invariant_actor) from YAML config #4037

Open
opened 2026-04-06 08:57:10 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/action-create-cli-missing-fields
  • Commit Message: fix(cli): pass invariants, automation_profile, and optional actors in action create command
  • Milestone: (backlog — see note below)
  • Parent Epic: #368

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

Background and Context

The agents action create CLI command parses a full YAML config (including invariants, automation_profile, review_actor, estimation_actor, and invariant_actor) but silently discards these fields when calling the service layer. The create_action service method already accepts all these parameters — the bug is purely in the CLI call site.

Per docs/specification.md (line 18830): "When an action is used (via agents plan use), any invariants attached to the action are carried forward as plan-level invariants on the resulting plan. This allows teams to bake constraints directly into reusable templates."

What Was Tested

  • src/cleveragents/cli/commands/action.pycreate command (lines 229-253)
  • src/cleveragents/application/services/plan_lifecycle_service.pycreate_action method (lines 718-807)
  • docs/schema/action.schema.yaml — Action YAML schema definition
  • examples/actions/invariant-heavy.yaml — Example with invariants and invariant_actor
  • examples/actions/estimation-actor.yaml — Example with estimation_actor and review_actor

Current Behavior

The create command in src/cleveragents/cli/commands/action.py (lines 242-253) calls service.create_action() but does NOT pass the following fields parsed from the YAML:

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

The create_action service method DOES accept all these parameters (lines 729-733), but the CLI never passes them. As a result, any invariants, automation_profile, or optional actors defined in the YAML config are silently dropped when the action is created.

Expected Behavior

Per docs/schema/action.schema.yaml, the following fields are valid in an action YAML config:

  • invariants — list of constraint strings
  • automation_profile — default automation profile
  • review_actor — optional actor for reviewing results
  • estimation_actor — optional actor for cost/risk estimation
  • invariant_actor — optional actor for invariant reconciliation

When a user runs agents action create --config file.yaml, ALL fields defined in the YAML should be persisted to the created action.

Steps to Reproduce

  1. Create an action YAML file with invariants:
name: local/security-audit
description: "Security audit"
strategy_actor: local/strategist
execution_actor: local/executor
definition_of_done: "All findings documented"
invariants:
  - "Never modify production data"
automation_profile: supervised
review_actor: local/reviewer
estimation_actor: local/estimator
invariant_actor: local/invariant-resolver
  1. Run: agents action create --config security-audit.yaml
  2. Run: agents action show local/security-audit --format json
  3. Observe: invariants is [], automation_profile is null, review_actor is null, estimation_actor is null, invariant_actor is null

Acceptance Criteria

  • agents action create --config <file> persists invariants to the created action
  • agents action create --config <file> persists automation_profile to the created action
  • agents action create --config <file> persists review_actor to the created action
  • agents action create --config <file> persists estimation_actor to the created action
  • agents action create --config <file> persists invariant_actor to the created action
  • agents action show reflects all persisted fields correctly
  • No regression on existing create command behaviour for fields already passed

Supporting Information

  • Bug location: src/cleveragents/cli/commands/action.py, lines 242-253 (the create_action call)
  • Service method: src/cleveragents/application/services/plan_lifecycle_service.py, lines 718-807 (already accepts the missing params)
  • Proposed fix: Add the five missing keyword arguments to the create_action call in the CLI:
action = service.create_action(
    ...existing params...,
    invariants=action.invariants,
    automation_profile=action.automation_profile,
    review_actor=action.review_actor,
    estimation_actor=action.estimation_actor,
    invariant_actor=action.invariant_actor,
)

Subtasks

  • Add invariants, automation_profile, review_actor, estimation_actor, invariant_actor to the create_action call in src/cleveragents/cli/commands/action.py
  • Verify create_action service method signatures match (no changes expected)
  • Tests (Behave): Add/update scenario for agents action create with invariants and optional actors in YAML
  • Tests (Behave): Add scenario asserting all five fields are persisted and retrievable via agents action show
  • Tests (Robot): Add/update integration test for agents action create with full YAML config
  • 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.
  • 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-new-issue-creator

## Metadata - **Branch**: `fix/action-create-cli-missing-fields` - **Commit Message**: `fix(cli): pass invariants, automation_profile, and optional actors in action create command` - **Milestone**: *(backlog — see note below)* - **Parent Epic**: #368 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.6.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Background and Context The `agents action create` CLI command parses a full YAML config (including `invariants`, `automation_profile`, `review_actor`, `estimation_actor`, and `invariant_actor`) but silently discards these fields when calling the service layer. The `create_action` service method already accepts all these parameters — the bug is purely in the CLI call site. Per `docs/specification.md` (line 18830): *"When an action is used (via `agents plan use`), any invariants attached to the action are carried forward as plan-level invariants on the resulting plan. This allows teams to bake constraints directly into reusable templates."* ## What Was Tested - `src/cleveragents/cli/commands/action.py` — `create` command (lines 229-253) - `src/cleveragents/application/services/plan_lifecycle_service.py` — `create_action` method (lines 718-807) - `docs/schema/action.schema.yaml` — Action YAML schema definition - `examples/actions/invariant-heavy.yaml` — Example with invariants and invariant_actor - `examples/actions/estimation-actor.yaml` — Example with estimation_actor and review_actor ## Current Behavior The `create` command in `src/cleveragents/cli/commands/action.py` (lines 242-253) calls `service.create_action()` but does NOT pass the following fields parsed from the YAML: ```python # Current code (lines 242-253) — 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, # MISSING: invariants=action.invariants # MISSING: automation_profile=action.automation_profile # MISSING: review_actor=action.review_actor # MISSING: estimation_actor=action.estimation_actor # MISSING: invariant_actor=action.invariant_actor ) ``` The `create_action` service method DOES accept all these parameters (lines 729-733), but the CLI never passes them. As a result, any invariants, automation_profile, or optional actors defined in the YAML config are silently dropped when the action is created. ## Expected Behavior Per `docs/schema/action.schema.yaml`, the following fields are valid in an action YAML config: - `invariants` — list of constraint strings - `automation_profile` — default automation profile - `review_actor` — optional actor for reviewing results - `estimation_actor` — optional actor for cost/risk estimation - `invariant_actor` — optional actor for invariant reconciliation When a user runs `agents action create --config file.yaml`, ALL fields defined in the YAML should be persisted to the created action. ## Steps to Reproduce 1. Create an action YAML file with invariants: ```yaml name: local/security-audit description: "Security audit" strategy_actor: local/strategist execution_actor: local/executor definition_of_done: "All findings documented" invariants: - "Never modify production data" automation_profile: supervised review_actor: local/reviewer estimation_actor: local/estimator invariant_actor: local/invariant-resolver ``` 2. Run: `agents action create --config security-audit.yaml` 3. Run: `agents action show local/security-audit --format json` 4. Observe: `invariants` is `[]`, `automation_profile` is `null`, `review_actor` is `null`, `estimation_actor` is `null`, `invariant_actor` is `null` ## Acceptance Criteria - [ ] `agents action create --config <file>` persists `invariants` to the created action - [ ] `agents action create --config <file>` persists `automation_profile` to the created action - [ ] `agents action create --config <file>` persists `review_actor` to the created action - [ ] `agents action create --config <file>` persists `estimation_actor` to the created action - [ ] `agents action create --config <file>` persists `invariant_actor` to the created action - [ ] `agents action show` reflects all persisted fields correctly - [ ] No regression on existing `create` command behaviour for fields already passed ## Supporting Information - **Bug location**: `src/cleveragents/cli/commands/action.py`, lines 242-253 (the `create_action` call) - **Service method**: `src/cleveragents/application/services/plan_lifecycle_service.py`, lines 718-807 (already accepts the missing params) - **Proposed fix**: Add the five missing keyword arguments to the `create_action` call in the CLI: ```python action = service.create_action( ...existing params..., invariants=action.invariants, automation_profile=action.automation_profile, review_actor=action.review_actor, estimation_actor=action.estimation_actor, invariant_actor=action.invariant_actor, ) ``` ## Subtasks - [ ] Add `invariants`, `automation_profile`, `review_actor`, `estimation_actor`, `invariant_actor` to the `create_action` call in `src/cleveragents/cli/commands/action.py` - [ ] Verify `create_action` service method signatures match (no changes expected) - [ ] Tests (Behave): Add/update scenario for `agents action create` with invariants and optional actors in YAML - [ ] Tests (Behave): Add scenario asserting all five fields are persisted and retrievable via `agents action show` - [ ] Tests (Robot): Add/update integration test for `agents action create` with full YAML config - [ ] 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. - 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-new-issue-creator
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:11:48 +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.

Blocks
#368 Epic: Subplans & Parallelism
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#4037
No description provided.