fix(cli): add missing --format flag to action create + wire real LLM actors into plan executor #963

Merged
freemo merged 3 commits from bugfix/m2-action-format-plan-executor into master 2026-03-16 00:08:09 +00:00

3 Commits

Author SHA1 Message Date
freemo dfa05a6909 fix(cli): wire real LLM actors into plan executor for production execution
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 26s
CI / quality (pull_request) Successful in 32s
CI / build (pull_request) Successful in 35s
CI / security (pull_request) Successful in 52s
CI / typecheck (pull_request) Successful in 56s
CI / e2e_tests (pull_request) Successful in 1m36s
CI / unit_tests (pull_request) Successful in 3m25s
CI / integration_tests (pull_request) Successful in 3m55s
CI / docker (pull_request) Successful in 57s
CI / coverage (pull_request) Successful in 6m54s
CI / lint (push) Successful in 14s
CI / quality (push) Successful in 35s
CI / typecheck (push) Successful in 39s
CI / security (push) Successful in 51s
CI / benchmark-regression (push) Has been skipped
CI / build (push) Successful in 21s
CI / e2e_tests (push) Successful in 2m14s
CI / unit_tests (push) Successful in 5m9s
CI / integration_tests (push) Successful in 5m29s
CI / docker (push) Successful in 1m6s
CI / coverage (push) Successful in 6m12s
CI / benchmark-publish (push) Successful in 20m51s
CI / benchmark-regression (pull_request) Successful in 37m16s
The `plan execute` CLI command only performed phase transitions
(Strategize → Execute) without ever invoking the `PlanExecutor` to
drive the strategize or execute actors.  `PlanExecutor.__init__`
unconditionally created `StrategizeStubActor()` and
`ExecuteStubActor()` which parse text locally and return empty
changesets — no real LLM call was made.

Added `_get_plan_executor()` helper that resolves `ProviderRegistry`
from the DI container and constructs `LLMStrategizeActor` /
`LLMExecuteActor` for real LLM invocations via LangChain.  Updated
`execute_plan` CLI command to detect plan phase/state and
automatically run the appropriate actor:

- Strategize/queued  → run strategize actor → transition to Execute
- Strategize/complete → phase transition only (backward compat)
- Execute/queued     → run execute actor → mark complete

New `llm_actors.py` module provides `LLMStrategizeActor` (task
decomposition into numbered steps) and `LLMExecuteActor` (code
generation with FILE: blocks).  Both resolve `provider/model` actor
names (e.g. `openai/gpt-4`) to live LangChain LLM instances.

`PlanExecutor.__init__` now accepts optional `strategize_actor` and
`execute_actor` parameters, falling back to stubs when None.
Existing mock-based BDD tests remain backward-compatible via duck-
typing fallback (MagicMock.phase is not a PlanPhase, so the legacy
`service.execute_plan()` path is taken).

Includes Behave BDD scenarios testing custom actor injection into
PlanExecutor.

ISSUES CLOSED: #960
2026-03-15 19:59:38 -04:00
freemo 2d423bdfcd fix(cli): add missing --format flag to action create command
The `action create` CLI command was the only action subcommand missing
the `--format`/`-f` parameter.  All other action subcommands (`list`,
`show`, `archive`) already accepted `--format` and routed through
`_print_action()`.  Running `action create --config action.yaml
--format plain` failed with a Typer unrecognized-option error.

Added the `fmt` parameter (with `--format`/`-f` aliases, defaulting
to `rich`) to the `create()` function signature and passed it through
to the existing `_print_action()` helper which already handles all
output formats.  Added Behave BDD scenarios for `--format plain` and
`--format json` to `action_cli_spec_alignment.feature`.

ISSUES CLOSED: #959
2026-03-15 19:33:11 -04:00
freemo 065171f21c test(e2e): E2E acceptance criteria for M2 (v3.1.0) — actor compiler and LLM integration
Add Robot Framework E2E test suite robot/e2e/m2_acceptance.robot exercising
M2 acceptance criteria with zero mocking. Test creates a temp git repo with
sample project files, registers a custom actor via CLI, sets up resource and
project, creates an action referencing the actor, and runs the full plan
lifecycle (use → execute strategize → execute → diff → apply). Validates
actor YAML compilation, skill registry, tool lifecycle, and LLM integration
through real CLI invocations with real provider API keys. Uses flexible
structural assertions and expected_rc=None for LLM-dependent commands.

ISSUES CLOSED: #742
2026-03-15 19:32:44 -04:00