Files
temp/features/tdd_plan_apply_yes_flag.feature
freemo 48cff5cfe0 refactor(cli): rename plan lifecycle-list and lifecycle-apply to match specification
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>
2026-04-02 19:09:04 +00:00

51 lines
2.3 KiB
Gherkin

@tdd_issue @tdd_issue_932
Feature: TDD Issue #932 — plan apply missing --yes flag
As a developer
I want to verify that `agents plan apply` accepts the --yes
flag required by the specification
So that the bug is captured and will be caught by a regression test
These scenarios verify that `apply` correctly handles
`--yes`/`-y` flags as a regression guard. Other destructive CLI
commands (`session delete`, `project delete`, `plan correct`,
`plan rollback`) correctly implement the `--yes`/`-y` pattern to skip
confirmation prompts.
Scenario: apply recognises the --yes long flag
Given a plan CLI runner for the yes-flag test
When I invoke apply with --yes flag and a mocked service
Then the apply --yes invocation should not report an unknown option
And the apply --yes output should not contain the confirmation prompt
And the apply exit code should be 0
And the apply should have called apply
Scenario: apply recognises the -y short flag
Given a plan CLI runner for the yes-flag test
When I invoke apply with -y flag and a mocked service
Then the apply -y invocation should not report an unknown option
And the apply -y output should not contain the confirmation prompt
And the apply exit code should be 0
And the apply should have called apply
Scenario: apply without --yes prompts for confirmation and user declines
Given a plan CLI runner for the yes-flag test
When I invoke apply without --yes and decline
Then the apply output should contain "Apply cancelled."
And the apply exit code should be 0
And the apply should not have called apply
Scenario: apply without --yes prompts for confirmation and user accepts
Given a plan CLI runner for the yes-flag test
When I invoke apply without --yes and accept
Then the apply output should not contain "Apply cancelled."
And the apply output should contain the confirmation prompt
And the apply exit code should be 0
And the apply should have called apply
Scenario: apply catches unexpected exceptions cleanly
Given a plan CLI runner for the yes-flag test
When I invoke apply --yes with a service that raises an unexpected error
Then the apply output should contain "Unexpected error"
And the apply output should not contain "Traceback"
And the apply exit code should be non-zero