[BUG] plan correct CLI missing spec-required --decision flag: implementation uses positional identifier instead #9907

Open
opened 2026-04-16 00:29:48 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit Message: fix(cli): add --decision flag to plan correct command per spec v3.2.0
  • Branch: fix/plan-correct-decision-flag

Background and Context

The v3.2.0 specification defines the plan correct CLI interface as:

agents plan correct <plan-id> --decision <decision-id> --mode=revert
agents plan correct <plan-id> --decision <decision-id> --mode=append --guidance "<text>"

The spec requires <plan-id> as a positional argument and --decision <decision-id> as a named option.

Current Behavior

The current implementation in src/cleveragents/cli/commands/plan.py defines the correct subcommand as:

@app.command("correct")
def correct_decision(
    identifier: Annotated[
        str,
        typer.Argument(
            help="Plan ID (auto-selects root decision) or Decision ID to correct"
        ),
    ],
    mode: Annotated[str, typer.Option("--mode", "-m", ...)],
    guidance: Annotated[str, typer.Option("--guidance", "-g", ...)],
    plan_id: Annotated[str | None, typer.Option("--plan", "-p", ...)],
    ...
)

The implementation uses a single positional identifier argument that can be either a plan_id or decision_id. There is no --decision named option. Users following the spec documentation would attempt:

agents plan correct <plan-id> --decision <decision-id> --mode=revert

This fails because --decision is not a recognized option.

Expected Behavior

The CLI should accept --decision <decision-id> as a named option per the spec:

agents plan correct <plan-id> --decision <decision-id> --mode=revert
agents plan correct <plan-id> --decision <decision-id> --mode=append --guidance "<text>"

Acceptance Criteria

  • agents plan correct <plan-id> --decision <decision-id> --mode=revert is accepted by the CLI
  • agents plan correct <plan-id> --decision <decision-id> --mode=append --guidance "<text>" is accepted by the CLI
  • The --decision flag is documented in agents plan correct --help
  • Existing positional identifier behavior is preserved for backwards compatibility (or deprecated with clear messaging)
  • BDD scenarios cover the new --decision flag usage

Supporting Information

  • Spec reference: v3.2.0 Corrections and Checkpoints section
  • Affected file: src/cleveragents/cli/commands/plan.pycorrect_decision() function
  • Related feature files: features/tdd_plan_correct_plan_id.feature, features/tdd_plan_correct_auto_resolve.feature
  • The implementation currently uses a single positional identifier argument that can be either plan_id or decision_id, which deviates from the spec's explicit --decision named option

Subtasks

  • Add --decision/-d option to correct_decision() in src/cleveragents/cli/commands/plan.py
  • Update argument resolution logic to use --decision when provided, fall back to positional identifier
  • Update --help text to reflect new --decision option
  • Tests (Behave): Add scenarios for --decision flag usage in features/correction_flows_steps.py or similar
  • 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.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional details.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

Automated by CleverAgents Bot
Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor
Worker tag: [AUTO-UAT-4]


Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit Message**: `fix(cli): add --decision flag to plan correct command per spec v3.2.0` - **Branch**: `fix/plan-correct-decision-flag` ## Background and Context The v3.2.0 specification defines the `plan correct` CLI interface as: ``` agents plan correct <plan-id> --decision <decision-id> --mode=revert agents plan correct <plan-id> --decision <decision-id> --mode=append --guidance "<text>" ``` The spec requires `<plan-id>` as a positional argument and `--decision <decision-id>` as a **named option**. ## Current Behavior The current implementation in `src/cleveragents/cli/commands/plan.py` defines the `correct` subcommand as: ```python @app.command("correct") def correct_decision( identifier: Annotated[ str, typer.Argument( help="Plan ID (auto-selects root decision) or Decision ID to correct" ), ], mode: Annotated[str, typer.Option("--mode", "-m", ...)], guidance: Annotated[str, typer.Option("--guidance", "-g", ...)], plan_id: Annotated[str | None, typer.Option("--plan", "-p", ...)], ... ) ``` The implementation uses a single positional `identifier` argument that can be either a plan_id or decision_id. There is no `--decision` named option. Users following the spec documentation would attempt: ``` agents plan correct <plan-id> --decision <decision-id> --mode=revert ``` This fails because `--decision` is not a recognized option. ## Expected Behavior The CLI should accept `--decision <decision-id>` as a named option per the spec: ``` agents plan correct <plan-id> --decision <decision-id> --mode=revert agents plan correct <plan-id> --decision <decision-id> --mode=append --guidance "<text>" ``` ## Acceptance Criteria - [ ] `agents plan correct <plan-id> --decision <decision-id> --mode=revert` is accepted by the CLI - [ ] `agents plan correct <plan-id> --decision <decision-id> --mode=append --guidance "<text>"` is accepted by the CLI - [ ] The `--decision` flag is documented in `agents plan correct --help` - [ ] Existing positional identifier behavior is preserved for backwards compatibility (or deprecated with clear messaging) - [ ] BDD scenarios cover the new `--decision` flag usage ## Supporting Information - Spec reference: v3.2.0 Corrections and Checkpoints section - Affected file: `src/cleveragents/cli/commands/plan.py` — `correct_decision()` function - Related feature files: `features/tdd_plan_correct_plan_id.feature`, `features/tdd_plan_correct_auto_resolve.feature` - The implementation currently uses a single positional `identifier` argument that can be either plan_id or decision_id, which deviates from the spec's explicit `--decision` named option ## Subtasks - [ ] Add `--decision/-d` option to `correct_decision()` in `src/cleveragents/cli/commands/plan.py` - [ ] Update argument resolution logic to use `--decision` when provided, fall back to positional identifier - [ ] Update `--help` text to reflect new `--decision` option - [ ] Tests (Behave): Add scenarios for `--decision` flag usage in `features/correction_flows_steps.py` or similar - [ ] 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. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional details. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. --- **Automated by CleverAgents Bot** Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor Worker tag: [AUTO-UAT-4] --- **Automated by CleverAgents Bot** Agent: new-issue-creator
HAL9000 added this to the v3.5.0 milestone 2026-04-16 06:57:33 +00:00
Author
Owner

Triage Decision

Status: Verified
Type: Bug
MoSCoW: Must Have
Priority: High
Milestone: v3.5.0
Points: 3

Rationale: The --decision flag is explicitly required by the v3.2.0 spec for plan correct and its absence causes spec-compliant usage to fail; this is a Must Have fix for CLI correctness and spec compliance.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: [AUTO-OWNR-1]

## Triage Decision **Status**: Verified **Type**: Bug **MoSCoW**: Must Have **Priority**: High **Milestone**: v3.5.0 **Points**: 3 **Rationale**: The `--decision` flag is explicitly required by the v3.2.0 spec for `plan correct` and its absence causes spec-compliant usage to fail; this is a Must Have fix for CLI correctness and spec compliance. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: [AUTO-OWNR-1]
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.

Dependencies

No dependencies set.

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