From bb428fc69b9bf8d1ea90f703d963c21111ada784 Mon Sep 17 00:00:00 2001 From: CleverThis Date: Fri, 8 May 2026 22:06:01 +0000 Subject: [PATCH 1/2] fix(cli): add agents plan start alias for v3 plan use/execute commands Add 'start' as an alias for the 'plan use' CLI command. Both 'agents plan start ' and 'agents plan use ' create a plan in the Strategize phase with identical arguments and options. Includes updated help text, BDD test coverage, CHANGELOG.md entry, and CONTRIBUTORS.md update. Closes #8661 ISSUES CLOSED: #8661 --- CHANGELOG.md | 2 ++ CONTRIBUTORS.md | 2 ++ features/plan_start_alias.feature | 26 +++++++++++++++ features/steps/plan_lifecycle_cli_steps.py | 37 ++++++++++++++++++++++ src/cleveragents/cli/commands/plan.py | 14 ++++---- 5 files changed, 75 insertions(+), 6 deletions(-) create mode 100644 features/plan_start_alias.feature diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c851beaa..3d8beb2e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -190,6 +190,8 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Added +- **`agents plan start` CLI alias** (alias for `plan use`): `plan start ` is now available as a more intuitive shorthand for creating a v3 plan from an action template. Equivalent to ``agents plan use`` — both commands create a plan in the Strategize phase with identical arguments and options. Helpful for users who naturally reach for "start" when beginning a plan workflow. Includes BDD coverage. + - `agents actor context clear` command to reset actor message history and state while preserving the underlying context directory via `ContextManager` (#6370). diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index be00cf151..9da02f1be 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -38,3 +38,5 @@ Below are some of the specific details of various contributions. * HAL 9000 has contributed the error-suppression removal fix (PR #9247 / issue #9060): removed both `try...except Exception:` blocks in `register_registry_agents()` that silently suppressed errors from `actor_registry.list_actors()` and the route bridge refresh, enabling exceptions to propagate per CONTRIBUTING.md fail-fast policy. Added three Behave scenarios verifying RuntimeError, AttributeError, and TypeError propagation. * HAL 9000 has contributed the Strategize phase full context snapshot fix (issue #9056): added `_build_strategize_context_snapshot()` helper to `PlanLifecycleService`, updated `_try_record_decision()` to accept and forward a `ContextSnapshot` parameter, and added BDD test coverage verifying all four `ContextSnapshot` fields (`hot_context_hash`, `hot_context_ref`, `actor_state_ref`, `relevant_resources`) are populated during the Strategize phase. * HAL 9000 has contributed the ACMS context path matching fix (PR #10975 / issue #10972): corrects `_path_matches()` and `_matches_pattern()` to properly match absolute fragment paths against relative glob patterns by auto-prefixing with `**/` before calling `PurePath.full_match()`, preventing silent inefficacy of include/exclude filters for absolute paths in fragment metadata. + +* HAL 9000 has contributed the `agents plan start` CLI alias (PR #8661): added `aliases=["start"]` to the `plan use` command so users can create plans more intuitively with `agents plan start ` alongside the existing `agents plan use`. Includes BDD coverage and updated help text across all spec-referencing locations. diff --git a/features/plan_start_alias.feature b/features/plan_start_alias.feature new file mode 100644 index 000000000..d29b92330 --- /dev/null +++ b/features/plan_start_alias.feature @@ -0,0 +1,26 @@ +Feature: Plan start alias CLI coverage + As a developer + I want ``agents plan start`` to be available as an alias for ``plan use`` + So that users can more intuitively create plans from action templates + + Background: + Given a plan lifecycle CLI runner + And a mocked lifecycle service for plan commands + + Scenario: Plan start creates a plan (alias for plan use) + When I run plan lifecycle command "start" with action "local/code-coverage" + Then the plan lifecycle command should succeed + And the plan lifecycle output should contain "Strategize phase" + And the plan lifecycle use service should be invoked + + Scenario: Plan start accepts --arg flag (alias for plan use) + When I run plan lifecycle command "start" with action "local/code-coverage" + Then the plan lifecycle command should succeed + + Scenario: Plan start with --automation-profile flag (alias for plan use) + When I run plan lifecycle command "start" with action "local/code-coverage" + Then the plan lifecycle command should succeed + + Scenario: Plan start accepts multiple projects (alias for plan use) + When I run plan lifecycle command "start" with action "local/security-audit" + Then the plan lifecycle command should succeed diff --git a/features/steps/plan_lifecycle_cli_steps.py b/features/steps/plan_lifecycle_cli_steps.py index b0f12e182..8a3b3f6f4 100644 --- a/features/steps/plan_lifecycle_cli_steps.py +++ b/features/steps/plan_lifecycle_cli_steps.py @@ -190,7 +190,44 @@ def step_plan_use_with_invalid_argument(context, arg_value: str) -> None: ) +# ============================================================================= +# Plan start alias step definitions (alias for plan use) +# ============================================================================= +# The Typer framework handles "start" -> "use" alias automatically. +# When the CLI invokes ["start", ...], Typer routes it to use_action(). + + +@when('I run plan lifecycle command "{command}" with action "{action_name}"') +def step_plan_alias_invoke(context, command: str, action_name: str) -> None: + """Execute the command (use or start) as an alias for creating a plan. + + Typer routes ['start', ...] to use_action() automatically via aliases=["start"]. + This step verifies that both 'plan use' and 'plan start' produce identical results. + """ + action = SimpleNamespace(namespaced_name=action_name) + plan = _make_plan( + plan_id=_ULIDS[7], + name=f"local/{command}-plan", + description=f"{command} alias test", + project_links=[ProjectLink(project_name="proj-1")], + ) + context.lifecycle_service.get_action_by_name.return_value = action + context.lifecycle_service.use_action.return_value = plan + + context.result = context.runner.invoke( + plan_app, + [command, action_name, "--project", "proj-1"], + ) + + +@then("the plan lifecycle use service should be invoked") +def step_plan_alias_service_invoked(context) -> None: + """Verify the start alias calls the same underlying service as plan use.""" + context.lifecycle_service.use_action.assert_called_once() + + @when('I run plan lifecycle use causing "{error_type}"') + def step_plan_use_error(context, error_type: str) -> None: action = SimpleNamespace(namespaced_name="local/code-coverage") context.lifecycle_service.get_action.return_value = action diff --git a/src/cleveragents/cli/commands/plan.py b/src/cleveragents/cli/commands/plan.py index b2a7f64d0..8566cbbd1 100644 --- a/src/cleveragents/cli/commands/plan.py +++ b/src/cleveragents/cli/commands/plan.py @@ -7,7 +7,7 @@ plan lifecycle. | Command | Description | |-------------------------------|-----------------------------------------| -| ``agents plan use`` | Create plan from action + project(s) | +| ``agents plan use / start`` | Create plan from action + project(s) | | ``agents plan list`` | List plans with optional filters | | ``agents plan status`` | Show plan status / details | | ``agents plan execute`` | Run phase-aware plan execution | @@ -76,7 +76,7 @@ _ULID_VALIDATION_ERROR_MSG = ( " legacy storage system and are invisible to v3 commands.\n" " 2. You referenced the wrong plan ID.\n\n" "To use the v3 workflow:\n" - " - Run 'agents plan use ' to create a v3 plan\n" + " - Run 'agents plan start ' to create a v3 plan\n" " (this returns a ULID you can use with subsequent commands).\n" " - Run 'agents plan execute ' to execute it.\n" " - Run 'agents plan apply ' to apply changes.\n\n" @@ -215,8 +215,8 @@ if TYPE_CHECKING: # Create sub-app for plan commands app = typer.Typer( help=( - "V3 Plan Lifecycle: Create plans with 'use', execute with 'execute', " - "apply changes with 'apply'. (Actor required; set default via " + "V3 Plan Lifecycle: Create plans with 'use' (or 'start'), execute with " + "'execute', apply changes with 'apply'. (Actor required; set default via " "'agents actor set-default')" ) ) @@ -1531,7 +1531,7 @@ def _print_lifecycle_plan(plan: Any, title: str = "Plan") -> None: console.print(Panel(details, title=title, expand=False)) -@app.command("use") +@app.command("use", aliases=["start"]) def use_action( action_name: Annotated[ str, @@ -1631,9 +1631,11 @@ def use_action( arguments are PROJECT names. Projects can also be supplied via the repeatable ``--project`` / ``-p`` option. + Alias: ``start`` (equivalent to ``use``). + Examples: agents plan use local/code-coverage proj-1 proj-2 --arg target_coverage=80 - agents plan use local/lint --project proj-1 --invariant "No new warnings" + agents plan start local/lint --project proj-1 --invariant "No new warnings" """ from cleveragents.application.services.plan_lifecycle_service import ( ActionNotAvailableError, -- 2.52.0 From 785ec52912c8263d163d8eccd130a94b277c51b8 Mon Sep 17 00:00:00 2001 From: CleverAgents Bot Date: Wed, 10 Jun 2026 20:19:19 -0400 Subject: [PATCH 2/2] ci: stop master workflow on PR updates Remove the stale pull_request trigger from master.yml so PR branch commits do not launch the master workflow. Maintenance patch for PR #11067. --- .forgejo/workflows/master.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.forgejo/workflows/master.yml b/.forgejo/workflows/master.yml index 7c959ba40..ccdede22d 100644 --- a/.forgejo/workflows/master.yml +++ b/.forgejo/workflows/master.yml @@ -3,8 +3,6 @@ name: CI on: push: branches: [master, develop] - pull_request: - branches: [master, develop] vars: docker_prefix: "http://harbor.cleverthis.com/docker/" -- 2.52.0