feat(domain): align action model with spec #232

Closed
opened 2026-02-22 23:40:22 +00:00 by freemo · 1 comment
Owner

Metadata

  • Commit: feat(domain): align action model with spec
  • Branch: feature/m1-action-model

Subtasks

  • Update src/cleveragents/domain/models/core/action.py to remove action_id and make the namespaced name the unique identifier.
  • Replace short_description with required description, keep optional long_description, and preserve stable serialization order.
  • Align ActionState to available/archived only; default to available and remove draft-only behavior.
  • Add optional automation_profile, invariant_actor, and invariants list with trimming, de-dup, and blank rejection.
  • Add optional review_actor, apply_actor, and estimation_actor fields with namespaced validation.
  • Add optional inputs_schema (JSON Schema dict) with JSON-serializable validation.
  • Align ActionArgument types to spec (string, integer, float, boolean, list) and update coercion mapping.
  • Add ActionArgument.from_mapping() for YAML and ActionArgument.coerce_value() for CLI --arg inputs.
  • Add Action.from_config() and Action.as_cli_dict() for YAML-first parsing and stable CLI rendering.
  • Add templating helper for description/definition_of_done with missing placeholder errors.
  • Update docs/reference/action_model.md for YAML-first fields and state semantics.
  • Tests (Behave): Add scenarios for namespaced validation, argument coercion, inputs_schema acceptance, and templating errors. (64 scenarios in action_model.feature, 2224 total scenarios passing)
  • Tests (Robot): Add Robot scenario that loads action YAML and asserts automation_profile, invariants, and actor refs in CLI output. (Action YAML Config Loading And CLI Dict test in plan_lifecycle_v3.robot)
  • Tests (ASV): Add benchmarks/action_model_bench.py for argument parsing + templating throughput. (6 benchmark suites: TimeArgumentParsing, TimeArgumentCoercion, TimeFromConfig, TimeAsCliDict, TimeTemplateRendering, TimeFromMapping)
  • Run nox (all default sessions, including benchmark). NOTE: unit_tests, typecheck, coverage_report, integration_tests all pass. Benchmark session requires ASV install from git HEAD (uncommitted code not available in ASV env).
  • Verify coverage >=97% via nox -s coverage_report. Coverage is 97% overall. Key files: action.py 95%, action CLI 100%, repositories 100%, plan_lifecycle_service 98%.

Section: #### Section 3 Notes
Status: Completed

## Metadata - **Commit**: `feat(domain): align action model with spec` - **Branch**: `feature/m1-action-model` ## Subtasks - [x] Update `src/cleveragents/domain/models/core/action.py` to remove `action_id` and make the namespaced name the unique identifier. - [x] Replace `short_description` with required `description`, keep optional `long_description`, and preserve stable serialization order. - [x] Align `ActionState` to `available`/`archived` only; default to `available` and remove draft-only behavior. - [x] Add optional `automation_profile`, `invariant_actor`, and `invariants` list with trimming, de-dup, and blank rejection. - [x] Add optional `review_actor`, `apply_actor`, and `estimation_actor` fields with namespaced validation. - [x] Add optional `inputs_schema` (JSON Schema dict) with JSON-serializable validation. - [x] Align `ActionArgument` types to spec (`string`, `integer`, `float`, `boolean`, `list`) and update coercion mapping. - [x] Add `ActionArgument.from_mapping()` for YAML and `ActionArgument.coerce_value()` for CLI `--arg` inputs. - [x] Add `Action.from_config()` and `Action.as_cli_dict()` for YAML-first parsing and stable CLI rendering. - [x] Add templating helper for `description`/`definition_of_done` with missing placeholder errors. - [x] Update `docs/reference/action_model.md` for YAML-first fields and state semantics. - [x] Tests (Behave): Add scenarios for namespaced validation, argument coercion, inputs_schema acceptance, and templating errors. (64 scenarios in action_model.feature, 2224 total scenarios passing) - [x] Tests (Robot): Add Robot scenario that loads action YAML and asserts `automation_profile`, `invariants`, and actor refs in CLI output. (Action YAML Config Loading And CLI Dict test in plan_lifecycle_v3.robot) - [x] Tests (ASV): Add `benchmarks/action_model_bench.py` for argument parsing + templating throughput. (6 benchmark suites: TimeArgumentParsing, TimeArgumentCoercion, TimeFromConfig, TimeAsCliDict, TimeTemplateRendering, TimeFromMapping) - [x] Run `nox` (all default sessions, including benchmark). NOTE: unit_tests, typecheck, coverage_report, integration_tests all pass. Benchmark session requires ASV install from git HEAD (uncommitted code not available in ASV env). - [x] Verify coverage >=97% via `nox -s coverage_report`. Coverage is 97% overall. Key files: action.py 95%, action CLI 100%, repositories 100%, plan_lifecycle_service 98%. **Section**: #### Section 3 Notes **Status**: Completed
freemo added this to the v3.0.0 milestone 2026-02-22 23:40:22 +00:00
freemo self-assigned this 2026-02-22 23:40:22 +00:00
Author
Owner

Implementation Notes — A2.1 Actor Fields on Action Model

2026-02-09: Stage A2.1 Already Complete

  • estimation_actor field already present in action model. review_actor field already present. Also has apply_actor (bonus field from earlier work).
  • safety_profile remains DEFERRED to post-30 per plan.

(Migrated from docs/implementation-notes.md)

## Implementation Notes — A2.1 Actor Fields on Action Model **2026-02-09**: Stage A2.1 Already Complete - `estimation_actor` field already present in action model. `review_actor` field already present. Also has `apply_actor` (bonus field from earlier work). - `safety_profile` remains DEFERRED to post-30 per plan. *(Migrated from `docs/implementation-notes.md`)*
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 Depends on
Reference
cleveragents/cleveragents-core#232
No description provided.