[BUG] agents plan correct: undocumented --plan/-p flag not in specification signature #9279

Open
opened 2026-04-14 13:54:56 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit Message: fix(cli): align plan correct CLI signature with specification
  • Branch: fix/plan-correct-cli-spec-alignment

Background and Context

The agents plan correct CLI command in src/cleveragents/cli/commands/plan.py (function correct_decision) exposes a --plan/-p flag and a --format/-f flag that are not present in the specification.

The specification (docs/specification.md, §CLI Commands — plan) defines the command signature as:

agents plan correct --mode (revert|append) (--guidance|-g) <GUIDANCE>
                   [--dry-run] [--yes|-y] <DECISION_ID>

The current implementation signature is:

def correct_decision(
    identifier: str,          # positional: Plan ID or Decision ID
    mode: str,                # --mode / -m  (spec only shows --mode, no -m shorthand)
    guidance: str,            # --guidance / -g  ✅
    dry_run: bool,            # --dry-run  ✅
    yes: bool,                # --yes / -y  ✅
    plan_id: str | None,      # --plan / -p  ← NOT IN SPEC
    fmt: str,                 # --format / -f  ← NOT IN SPEC
)

The --plan/-p flag was added as a workaround for Bug #1025 (tracked as @tdd_issue_4285 in features/tdd_plan_correct_auto_resolve.feature), where _resolve_active_plan_id() fails in isolated environments. However, this workaround introduces a CLI flag that is not part of the specification, creating a divergence between the spec and the implementation.

Additionally, the --mode flag has a -m shorthand in the implementation, but the spec only shows --mode without a shorthand.

Current Behavior

Running agents plan correct --help shows:

  • --plan/-p flag (not in spec)
  • --format/-f flag (not in spec)
  • --mode/-m shorthand (spec only shows --mode)

Expected Behavior

The agents plan correct command signature should match the specification exactly:

agents plan correct --mode (revert|append) (--guidance|-g) <GUIDANCE>
                   [--dry-run] [--yes|-y] <DECISION_ID>

The --plan/-p flag should either:

  1. Be added to the specification (if it is an intentional extension), OR
  2. Be removed from the implementation once Bug #1025 (_resolve_active_plan_id failure in isolated environments) is fixed

Acceptance Criteria

  • The agents plan correct CLI signature matches the specification exactly
  • Either the --plan/-p flag is documented in the spec, or it is removed from the implementation
  • The --mode shorthand -m is either documented in the spec or removed
  • The --format/-f flag is either documented in the spec or removed
  • BDD tests verify the CLI signature matches the spec
  • All existing tests continue to pass

Supporting Information

  • Specification reference: docs/specification.md §CLI Commands — plan
  • Implementation: src/cleveragents/cli/commands/plan.py function correct_decision (line 3461)
  • Related bug: features/tdd_plan_correct_auto_resolve.feature (@tdd_issue_1025, @tdd_issue_4285)
  • Feature file: features/plan_cli_spec_alignment.feature

Subtasks

  • Compare full plan correct CLI signature against specification
  • Determine if --plan/-p flag should be added to spec or removed from implementation
  • Determine if --mode/-m shorthand should be added to spec or removed
  • Determine if --format/-f flag should be added to spec or removed
  • Update spec or implementation to align them
  • Add/update BDD scenarios in features/plan_cli_spec_alignment.feature to verify alignment
  • Run nox -s unit_tests -- features/plan_cli_spec_alignment.feature to verify
  • Run nox (all default sessions), fix any errors
  • Verify coverage ≥97% via nox -s coverage_report

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 lines providing relevant details about the implementation.
  • 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

## Metadata - **Commit Message**: `fix(cli): align plan correct CLI signature with specification` - **Branch**: `fix/plan-correct-cli-spec-alignment` ## Background and Context The `agents plan correct` CLI command in `src/cleveragents/cli/commands/plan.py` (function `correct_decision`) exposes a `--plan/-p` flag and a `--format/-f` flag that are **not present** in the specification. The specification (`docs/specification.md`, §CLI Commands — plan) defines the command signature as: ``` agents plan correct --mode (revert|append) (--guidance|-g) <GUIDANCE> [--dry-run] [--yes|-y] <DECISION_ID> ``` The current implementation signature is: ```python def correct_decision( identifier: str, # positional: Plan ID or Decision ID mode: str, # --mode / -m (spec only shows --mode, no -m shorthand) guidance: str, # --guidance / -g ✅ dry_run: bool, # --dry-run ✅ yes: bool, # --yes / -y ✅ plan_id: str | None, # --plan / -p ← NOT IN SPEC fmt: str, # --format / -f ← NOT IN SPEC ) ``` The `--plan/-p` flag was added as a workaround for Bug #1025 (tracked as `@tdd_issue_4285` in `features/tdd_plan_correct_auto_resolve.feature`), where `_resolve_active_plan_id()` fails in isolated environments. However, this workaround introduces a CLI flag that is not part of the specification, creating a divergence between the spec and the implementation. Additionally, the `--mode` flag has a `-m` shorthand in the implementation, but the spec only shows `--mode` without a shorthand. ## Current Behavior Running `agents plan correct --help` shows: - `--plan/-p` flag (not in spec) - `--format/-f` flag (not in spec) - `--mode/-m` shorthand (spec only shows `--mode`) ## Expected Behavior The `agents plan correct` command signature should match the specification exactly: ``` agents plan correct --mode (revert|append) (--guidance|-g) <GUIDANCE> [--dry-run] [--yes|-y] <DECISION_ID> ``` The `--plan/-p` flag should either: 1. Be added to the specification (if it is an intentional extension), OR 2. Be removed from the implementation once Bug #1025 (`_resolve_active_plan_id` failure in isolated environments) is fixed ## Acceptance Criteria - [ ] The `agents plan correct` CLI signature matches the specification exactly - [ ] Either the `--plan/-p` flag is documented in the spec, or it is removed from the implementation - [ ] The `--mode` shorthand `-m` is either documented in the spec or removed - [ ] The `--format/-f` flag is either documented in the spec or removed - [ ] BDD tests verify the CLI signature matches the spec - [ ] All existing tests continue to pass ## Supporting Information - Specification reference: `docs/specification.md` §CLI Commands — plan - Implementation: `src/cleveragents/cli/commands/plan.py` function `correct_decision` (line 3461) - Related bug: `features/tdd_plan_correct_auto_resolve.feature` (`@tdd_issue_1025`, `@tdd_issue_4285`) - Feature file: `features/plan_cli_spec_alignment.feature` ## Subtasks - [ ] Compare full `plan correct` CLI signature against specification - [ ] Determine if `--plan/-p` flag should be added to spec or removed from implementation - [ ] Determine if `--mode/-m` shorthand should be added to spec or removed - [ ] Determine if `--format/-f` flag should be added to spec or removed - [ ] Update spec or implementation to align them - [ ] Add/update BDD scenarios in `features/plan_cli_spec_alignment.feature` to verify alignment - [ ] Run `nox -s unit_tests -- features/plan_cli_spec_alignment.feature` to verify - [ ] Run `nox` (all default sessions), fix any errors - [ ] Verify coverage ≥97% via `nox -s coverage_report` ## 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 lines providing relevant details about the implementation. - 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
HAL9000 added this to the v3.3.0 milestone 2026-04-14 13:58:52 +00:00
Author
Owner

Triage: Verified [AUTO-OWNR-1]

Valid spec alignment bug: agents plan correct exposes --plan/-p and --format/-f flags that are not in the specification, and --mode/-m shorthand that is not in the spec. The --plan/-p flag was added as a workaround for Bug #1025 but creates a CLI/spec divergence.

The issue correctly identifies that the resolution requires either updating the spec to include these flags (if they are intentional extensions) or removing them from the implementation once the underlying bug is fixed.

Assigning to v3.3.0 (Corrections + Subplans + Checkpoints) as plan correct is a core M4 command. Priority Medium — spec alignment issue, the command still functions.

MoSCoW: Should Have — CLI/spec alignment is important for documentation accuracy and user trust, but the command remains functional.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Triage: Verified** [AUTO-OWNR-1] Valid spec alignment bug: `agents plan correct` exposes `--plan/-p` and `--format/-f` flags that are not in the specification, and `--mode/-m` shorthand that is not in the spec. The `--plan/-p` flag was added as a workaround for Bug #1025 but creates a CLI/spec divergence. The issue correctly identifies that the resolution requires either updating the spec to include these flags (if they are intentional extensions) or removing them from the implementation once the underlying bug is fixed. Assigning to **v3.3.0** (Corrections + Subplans + Checkpoints) as `plan correct` is a core M4 command. Priority **Medium** — spec alignment issue, the command still functions. MoSCoW: **Should Have** — CLI/spec alignment is important for documentation accuracy and user trust, but the command remains functional. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
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#9279
No description provided.