@tdd_issue @tdd_issue_969
Feature: TDD Issue #969 — plan correct should accept plan_id as first positional argument
  As a developer
  I want plan correct to accept a plan_id as its first positional argument
  So that the natural CLI usage pattern works correctly

  This test was written to capture bug #969. The plan correct CLI command
  declares its first positional argument as decision_id. When the M3
  acceptance test passes a plan_id, the plan_id is used as
  target_decision_id, which fails because the plan ID is not a valid
  decision ID. The correction service raises an error because the
  targeted decision cannot be found in the plan's decision tree.

  The expected behavior is that when a plan_id is passed as the first
  positional argument, the command should recognize it as a plan_id,
  auto-select the root decision for that plan as the correction target,
  and complete the correction successfully.

  This test uses the @tag until the fix in #969 is
  merged. Once fixed, the tag will be removed and the test will run
  normally as a regression guard.

  Scenario: plan correct resolves root decision when given a plan_id as positional (revert mode)
    Given tpcpid a plan with a known plan_id and a root decision
    And tpcpid a CorrectionService that succeeds when targeting the root decision
    When tpcpid I invoke plan correct with the plan_id as the positional argument
    Then tpcpid the command should exit successfully
    And tpcpid request_correction should have targeted the root decision not the plan_id

  Scenario: plan correct resolves root decision when given a plan_id as positional (append mode)
    Given tpcpid a plan with a known plan_id and a root decision
    And tpcpid a CorrectionService for append mode that succeeds when targeting the root decision
    When tpcpid I invoke plan correct with the plan_id as the positional argument in append mode
    Then tpcpid the command should exit successfully
    And tpcpid request_correction should have targeted the root decision not the plan_id
