CLI command structure still has legacy and v3 plan lifecycles - removal of legacy CLI commands #4181

Closed
opened 2026-04-06 18:39:59 +00:00 by CoreRasurae · 1 comment
Member

Metadata

  • Commit Message: fix(cli): remove legacy plan commands from help output
  • Branch: fix/cli-legacy-removal

Background and Context

CleverAgents supports two incompatible plan lifecycle modes:

  1. Legacy mode (agents tellagents buildagents apply): Human-readable plan names, deprecated workflow
  2. V3 mode (agents plan useagents plan executeagents plan apply): ULID-based plan IDs, current architecture

These workflows are intentionally separated and cannot be mixed. However, the CLI help output does not clearly distinguish between them, and the specification (docs/specification.md and ADR-021) documents only the v3 command structure. This creates confusion for users and inconsistency in architectural documentation.

Current Behavior

Problem 1: Missing specification documentation

  • No architectural guidance on the legacy → v3 transition

Problem 2: No visual separation in CLI help

  • agents plan --help shows v3 commands
  • Legacy commands exist as top-level agents tell, agents build, etc., with no clear grouping
  • Help output doesn't indicate legacy status or deprecation
  • Users cannot easily understand command hierarchy or which workflow to use

Problem 3: Inconsistent command naming

  • Legacy workflow references agents apply in output (lines 942-943 in plan.py)
  • V3 has agents plan apply <PLAN_ID>
  • Legacy apply command itself is not implemented as a CLI command—only as internal functions
  • This creates a gap: users are told to run agents apply but must use agents build + (missing command)

Expected Behavior

  1. Remove all label commands from the CLI:

    • Legacy commands are to be removed from the CLI application
    • V3 commands should be the only shown
  2. Specification documents both workflows:

    • docs/specification.md or a ADR documents should not reference legacy commands in any way
    • if they make sure to create a Forgejo issue to handle those
  3. CLI help clearly indicates command status:

    • Remove legacy commands from the help and documentation

Acceptance Criteria

  • Help output for agents plan --help only shows v3 commands in a group or frame
  • The command group is labeled ("V3 Plan Lifecycle")
  • docs/specification.md or a related document clearly documents v3 CLI structures
  • Migration guidance from legacy to v3 is provided in a dedicated guide
  • Example help output before and after demonstrates the improvement

Supporting Information

Key files involved:

  • src/cleveragents/cli/commands/plan.py (lines 56-72: error message showing incompatibility; lines 844-1319: legacy commands; lines 1598-4000: v3 commands)
  • docs/specification.md (CLI Commands section, lines 199-368)
  • docs/adr/ADR-021-cli-and-output-rendering.md (command structure definition)

Error message acknowledging the gap:
The existing error message (lines 56-72 in plan.py) already documents incompatibility but only appears on failure, not in --help.

Subtasks

  • Analyze current CLI help rendering in src/cleveragents/cli/commands/plan.py and src/cleveragents/cli/formatting.py
  • Design new help output structure with only v3 section
  • Add migration guide from legacy to v3 in a dedicated guide (Legacy_to_V3_Guide.md)
  • Remove legacy command help text
  • Tests (Behave): Verify help output contains expected sections and labels
  • Verify coverage >=97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off
  • Help output for agents plan --help clearly documents v3 commands only and they are visually grouped with appropriate labeling
  • Migration guidance from legacy to v3 is documented
  • All new functionality is covered by tests (unit and integration)
  • Test coverage remains >=97%
  • All Behave scenarios pass
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly
  • The commit is pushed to the remote on the fix/cli-legacy-removal branch
  • A pull request is submitted to master, reviewed, and merged before this issue is marked State/Completed

Before/After Example (Proposed)

BEFORE (current help output - conceptual):

$ agents plan --help

Usage: agents plan [OPTIONS] COMMAND [ARGS]...

Commands:
  apply      Apply a plan, transitioning from Execute to Apply phase...
  artifacts  Show artifacts from a plan execution...
  cancel     Cancel a non-terminal plan...
  execute    Begin execution of the strategy...
  list       List plans with optional filters...
  new        Create a new empty plan and switch to it...
  status     Show plan status / details...
  use        Create plan from action + project(s)...

Problems: No separation. new command mixed in. No deprecation indicators.

AFTER (proposed):

$ agents plan --help

╭─ Plan Lifecycle (V3 ) ─────────────────────────────╮
│ Plans are ULID-identified                                                                        │
│ and progress through: Strategize → Execute → Apply                     │
│                                                                                                                     │
│   use        Create a v3 plan from an action + project(s)                      │
│   execute    Run strategize and execute phases                                 │
│   apply      Commit changes (Execute → Apply)                                  │
│   list       List all v3 plans with filtering                                                  │
│   status     Show detailed plan status                                                   │
│   cancel     Cancel a non-terminal plan                                                │
│   diff       Show the unified diff of plan changes                                 │
│   artifacts  Show plan artifacts and sandbox refs                              │
│   errors     Show error decisions and recovery hints                         │
│   explain    Explain a specific decision                                                  │
│   tree       Show the decision tree for a plan                                        │
│   correct    Correct a decision in a completed plan                            │
│   prompt     Send guidance to continue execution                            │
│   resume     Resume a paused plan                                                      │ 
│   rollback   Rollback to a previous checkpoint                                    │
│   revert     Revert plan to previous phase                                            │
╰───────────────────────────────────────────╯

Improvements: Clear visual identification, status indicators, migration guidance.

## Metadata - **Commit Message**: `fix(cli): remove legacy plan commands from help output` - **Branch**: `fix/cli-legacy-removal` ## Background and Context CleverAgents supports two incompatible plan lifecycle modes: 1. **Legacy mode** (`agents tell` → `agents build` → `agents apply`): Human-readable plan names, deprecated workflow 2. **V3 mode** (`agents plan use` → `agents plan execute` → `agents plan apply`): ULID-based plan IDs, current architecture These workflows are intentionally separated and cannot be mixed. However, the CLI help output does not clearly distinguish between them, and the specification (docs/specification.md and ADR-021) documents only the v3 command structure. This creates confusion for users and inconsistency in architectural documentation. ## Current Behavior **Problem 1: Missing specification documentation** - No architectural guidance on the legacy → v3 transition **Problem 2: No visual separation in CLI help** - `agents plan --help` shows v3 commands - Legacy commands exist as top-level `agents tell`, `agents build`, etc., with no clear grouping - Help output doesn't indicate legacy status or deprecation - Users cannot easily understand command hierarchy or which workflow to use **Problem 3: Inconsistent command naming** - Legacy workflow references `agents apply` in output (lines 942-943 in plan.py) - V3 has `agents plan apply <PLAN_ID>` - Legacy `apply` command itself is not implemented as a CLI command—only as internal functions - This creates a gap: users are told to run `agents apply` but must use `agents build` + (missing command) ## Expected Behavior 1. **Remove all label commands from the CLI**: - Legacy commands are to be removed from the CLI application - V3 commands should be the only shown 2. **Specification documents both workflows**: - docs/specification.md or a ADR documents should not reference legacy commands in any way - if they make sure to create a Forgejo issue to handle those 3. **CLI help clearly indicates command status**: - Remove legacy commands from the help and documentation ## Acceptance Criteria - [ ] Help output for `agents plan --help` only shows v3 commands in a group or frame - [ ] The command group is labeled ("V3 Plan Lifecycle") - [ ] docs/specification.md or a related document clearly documents v3 CLI structures - [ ] Migration guidance from legacy to v3 is provided in a dedicated guide - [ ] Example help output before and after demonstrates the improvement ## Supporting Information **Key files involved:** - `src/cleveragents/cli/commands/plan.py` (lines 56-72: error message showing incompatibility; lines 844-1319: legacy commands; lines 1598-4000: v3 commands) - `docs/specification.md` (CLI Commands section, lines 199-368) - `docs/adr/ADR-021-cli-and-output-rendering.md` (command structure definition) **Error message acknowledging the gap:** The existing error message (lines 56-72 in plan.py) already documents incompatibility but only appears on failure, not in `--help`. ## Subtasks - [ ] Analyze current CLI help rendering in `src/cleveragents/cli/commands/plan.py` and `src/cleveragents/cli/formatting.py` - [ ] Design new help output structure with only v3 section - [ ] Add migration guide from legacy to v3 in a dedicated guide (Legacy_to_V3_Guide.md) - [ ] Remove legacy command help text - [ ] Tests (Behave): Verify help output contains expected sections and labels - [ ] Verify coverage >=97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off - Help output for `agents plan --help` clearly documents v3 commands only and they are visually grouped with appropriate labeling - Migration guidance from legacy to v3 is documented - All new functionality is covered by tests (unit and integration) - Test coverage remains >=97% - All Behave scenarios pass - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly - The commit is pushed to the remote on the `fix/cli-legacy-removal` branch - A pull request is submitted to `master`, reviewed, and merged before this issue is marked `State/Completed` --- ## Before/After Example (Proposed) **BEFORE** (current help output - conceptual): ``` $ agents plan --help Usage: agents plan [OPTIONS] COMMAND [ARGS]... Commands: apply Apply a plan, transitioning from Execute to Apply phase... artifacts Show artifacts from a plan execution... cancel Cancel a non-terminal plan... execute Begin execution of the strategy... list List plans with optional filters... new Create a new empty plan and switch to it... status Show plan status / details... use Create plan from action + project(s)... ``` Problems: No separation. `new` command mixed in. No deprecation indicators. **AFTER** (proposed): ``` $ agents plan --help ╭─ Plan Lifecycle (V3 ) ─────────────────────────────╮ │ Plans are ULID-identified │ │ and progress through: Strategize → Execute → Apply │ │ │ │ use Create a v3 plan from an action + project(s) │ │ execute Run strategize and execute phases │ │ apply Commit changes (Execute → Apply) │ │ list List all v3 plans with filtering │ │ status Show detailed plan status │ │ cancel Cancel a non-terminal plan │ │ diff Show the unified diff of plan changes │ │ artifacts Show plan artifacts and sandbox refs │ │ errors Show error decisions and recovery hints │ │ explain Explain a specific decision │ │ tree Show the decision tree for a plan │ │ correct Correct a decision in a completed plan │ │ prompt Send guidance to continue execution │ │ resume Resume a paused plan │ │ rollback Rollback to a previous checkpoint │ │ revert Revert plan to previous phase │ ╰───────────────────────────────────────────╯ ``` Improvements: Clear visual identification, status indicators, migration guidance.
Author
Member

This issue describes an architectural gap in CLI command structure and documentation. Per CONTRIBUTING.md guidelines, it should be linked to a suitable parent Epic.

Suggested Parent Epics

  1. #364 - Epic: Additional CLI Commands & UX (currently closed/completed)

    • Most directly relevant: covers CLI commands, action/plan extensions, and output rendering
    • Status: Closed as of v3.1.0 completion (2026-02-28)
    • Could be reopened for this scope, or this could be a follow-up to that epic
  2. #933 - Epic: A2A Protocol Compliance (open, v3.4.0 milestone)

    • Broader scope: ensures all CLI commands route through A2A protocol operations
    • Includes specification/documentation updates
    • Parent epic for protocol-level work

Architecture

This issue represents work that should be captured as a Child Issue of whichever epic covers CLI/UX/presentation layer improvements. The work specifically addresses:

  • Specification gap: Legacy vs v3 command structures undocumented
  • CLI UX gap: No visual separation of deprecated vs current commands
  • Architectural clarity: Need explicit documentation of intentional incompatibility

Next Steps for Maintainer

Please assign this issue to the appropriate parent epic using Forgejo's dependency system. Once verified and milestone-assigned, this issue will be ready for implementation.


Issue #4181 Status: Awaiting epic link assignment (State: Unverified) | Labels: State/Unverified, Type/Bug, Priority/Backlog, needs feedback

## Parent Epic Link Pending This issue describes an **architectural gap** in CLI command structure and documentation. Per CONTRIBUTING.md guidelines, it should be linked to a suitable parent Epic. ### Suggested Parent Epics 1. **#364 - Epic: Additional CLI Commands & UX** (currently closed/completed) - Most directly relevant: covers CLI commands, action/plan extensions, and output rendering - Status: Closed as of v3.1.0 completion (2026-02-28) - Could be reopened for this scope, or this could be a follow-up to that epic 2. **#933 - Epic: A2A Protocol Compliance** (open, v3.4.0 milestone) - Broader scope: ensures all CLI commands route through A2A protocol operations - Includes specification/documentation updates - Parent epic for protocol-level work ### Architecture This issue represents work that should be captured as a **Child Issue** of whichever epic covers CLI/UX/presentation layer improvements. The work specifically addresses: - **Specification gap**: Legacy vs v3 command structures undocumented - **CLI UX gap**: No visual separation of deprecated vs current commands - **Architectural clarity**: Need explicit documentation of intentional incompatibility ### Next Steps for Maintainer Please assign this issue to the appropriate parent epic using Forgejo's dependency system. Once verified and milestone-assigned, this issue will be ready for implementation. --- **Issue #4181 Status**: Awaiting epic link assignment (State: Unverified) | Labels: State/Unverified, Type/Bug, Priority/Backlog, needs feedback
CoreRasurae changed title from CLI command structure lacks separation and documentation between legacy and v3 plan lifecycles to CLI command structure still has legacy and v3 plan lifecycles - removal of legacy CLI commands 2026-04-07 16:01:41 +00:00
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:12:36 +00:00
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.

Reference
cleveragents/cleveragents-core#4181
No description provided.