refactor(cli): rename plan lifecycle-list and lifecycle-apply to match specification
CI / build (push) Successful in 18s
CI / lint (push) Failing after 31s
CI / helm (push) Successful in 33s
CI / typecheck (push) Successful in 50s
CI / security (push) Failing after 51s
CI / coverage (push) Has been skipped
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Failing after 1m50s
CI / docker (push) Has been skipped
CI / quality (push) Successful in 3m43s
CI / integration_tests (push) Has been cancelled
CI / e2e_tests (push) Has been cancelled
CI / benchmark-publish (push) Has been cancelled
CI / status-check (push) Has been cancelled

Renames `plan lifecycle-list` to `plan list` and `plan lifecycle-apply` to `plan apply` to align with the specification's canonical command names. Removes legacy V2 plan commands that occupied those names.

- Renamed CLI command registrations from lifecycle-list/lifecycle-apply to list/apply
- Removed legacy V2 apply and list commands (~200 lines)
- Updated apply shortcut in main.py to delegate to v3 lifecycle
- Added defensive null check for plan existence in apply command
- Updated 63+ test, doc, and benchmark files for consistency

Closes #881

Co-authored-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
Co-committed-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
This commit was merged in pull request #1188.
This commit is contained in:
2026-04-02 19:09:04 +00:00
committed by Forgejo
parent 908d5854a3
commit 48cff5cfe0
71 changed files with 562 additions and 943 deletions
+6 -6
View File
@@ -7,10 +7,10 @@ The `agents plan` command group manages plans in the CleverAgents v3 plan lifecy
| Command | Description |
|--------------------------------|-----------------------------------------|
| `agents plan use` | Create plan from action + project(s) |
| `agents plan lifecycle-list` | List plans with optional filters |
| `agents plan list` | List plans with optional filters |
| `agents plan status` | Show plan status / details |
| `agents plan execute` | Run Strategize + Execute (auto-apply if profile permits) |
| `agents plan lifecycle-apply` | Transition to Apply and complete it |
| `agents plan apply` | Transition to Apply and complete it |
| `agents plan cancel` | Cancel a non-terminal plan |
| `agents plan diff` | Show ChangeSet as unified diff |
| `agents plan artifacts` | Show ChangeSet ID, sandbox refs, summary|
@@ -95,14 +95,14 @@ plans including automation profile and invariant count columns.
- **Invariants**: Count of attached invariants
- **Terminal**: Whether the plan is in a terminal state
## `agents plan lifecycle-list`
## `agents plan list`
List v3 lifecycle plans with optional filtering.
### Synopsis
```bash
agents plan lifecycle-list [REGEX] [OPTIONS]
agents plan list [REGEX] [OPTIONS]
```
### Options
@@ -151,7 +151,7 @@ reads after phase transitions. See
[CLI Executor Wiring](plan_execute.md#cli-executor-wiring-_get_plan_executor)
for details.
## `agents plan lifecycle-apply`
## `agents plan apply`
Transition a plan to Apply phase and complete it. Because Apply is a
destructive operation (it merges sandbox changesets into real project
@@ -166,7 +166,7 @@ completes the apply processing, driving the plan to the terminal
### Synopsis
```bash
agents plan lifecycle-apply [--yes|-y] [PLAN_ID] [--format FORMAT]
agents plan apply [--yes|-y] [PLAN_ID] [--format FORMAT]
```
### Options
+2 -2
View File
@@ -10,7 +10,7 @@ A **read-only plan** is created when the originating Action has
`read_only=True`. The flag propagates through the execution layers:
```
Plan.read_only -> CLI fail-fast guard (plan execute / plan lifecycle-apply)
Plan.read_only -> CLI fail-fast guard (plan execute / plan apply)
-> ExecuteStubActor.execute(read_only=...) -> ChangeSetCapture
-> ToolRuntime._enforce_capabilities (via ToolExecutionContext)
-> SkillContext.enforce_write_guard
@@ -79,7 +79,7 @@ reads `plan.read_only` from the plan model.
Location: `src/cleveragents/cli/commands/plan.py`
Both `plan execute` and `plan lifecycle-apply` check `plan.read_only`
Both `plan execute` and `plan apply` check `plan.read_only`
before calling the lifecycle service. If the plan is read-only, the
CLI prints an error and aborts without making any state transitions.