Adds the missing --execution-env-priority flag to the agents plan use
command, aligning the CLI with the specification (spec line 12501).
The flag accepts fallback (default) or override and controls execution
environment routing precedence per ADR-043.
Domain model changes:
- Added ExecutionEnvPriority StrEnum with FALLBACK/OVERRIDE values.
- Changed execution_env_priority field type from str | None to
ExecutionEnvPriority | None for Pydantic-level enum validation.
- Added model_validator enforcing that execution_env_priority requires
execution_environment to be set (fail-fast domain invariant).
- Added execution_environment and execution_env_priority to
Plan.as_cli_dict() for programmatic output paths.
CLI changes:
- Added --execution-env-priority Typer option to use_action command.
- Validation: priority requires --execution-environment, enum value
check, case-insensitive input via .lower().
- Defaults to fallback when --execution-environment is set without
explicit priority.
- Updated _print_lifecycle_plan and _plan_spec_dict to display priority
using .value for consistent string output.
Persistence changes:
- Added execution_environment and execution_env_priority columns to
LifecyclePlanModel (String(20), nullable).
- Updated from_domain()/to_domain() for round-trip serialization
including ExecutionEnvPriority enum reconstruction.
- Updated LifecyclePlanRepository.update() to persist both fields.
- Added PlanLifecycleService.save_plan() public convenience method for
callers that need to re-persist after post-creation mutations.
- CLI use_action calls service.save_plan(plan) after applying overrides
so execution_env_priority survives across sessions.
- Added Alembic migration m4_003_plan_env_columns adding both columns
to the v3_plans table.
Tests:
- 8 Behave scenarios covering valid values, defaults, validation errors,
output display, JSON output, case-insensitive input, service
invocation verification (use_action.assert_called_once), and
persistence verification (save_plan.assert_called_once).
- 5 Robot Framework integration tests.
- Simplified Robot helper sys.path pattern to standard approach.
Changelog updated per CONTRIBUTING.md requirements.
ISSUES CLOSED: #886