test: add TDD bug-capture test for #969 — plan correct plan_id handling #1051

Merged
hurui200320 merged 1 commits from tdd/m3-plan-correct-plan-id into master 2026-03-19 07:31:13 +00:00

1 Commits

Author SHA1 Message Date
hurui200320 7b8b15f75c test: add TDD bug-capture test for #969 — plan correct plan_id handling
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 18s
CI / quality (pull_request) Successful in 34s
CI / typecheck (pull_request) Successful in 51s
CI / security (pull_request) Successful in 53s
CI / unit_tests (pull_request) Successful in 3m25s
CI / docker (pull_request) Successful in 9s
CI / integration_tests (pull_request) Successful in 3m37s
CI / e2e_tests (pull_request) Successful in 5m10s
CI / coverage (pull_request) Successful in 6m57s
CI / benchmark-regression (pull_request) Successful in 38m14s
Add Behave and Robot Framework tests capturing bug #969: the plan correct
CLI command treats its first positional argument strictly as a decision_id,
but the M3 acceptance test passes a plan_id. When a plan_id is given as the
first positional argument, the command should auto-resolve to the root
decision of that plan. Currently it uses the plan_id as target_decision_id,
which fails because the plan ID is not a valid decision ID.

The test asserts that request_correction is called with the root decision ID
as target_decision_id (not the plan_id). This assertion currently fails,
confirming the bug exists. The @tdd_expected_fail tag inverts the failure so
CI passes while the bug is unfixed.

Both revert and append correction modes are tested, since the bug affects
target_decision_id resolution before the mode-specific branching.

Shared mock fixtures (constants, mock builders, CLI args helper) are
centralised in features/mocks/tdd_plan_correct_plan_id_fixtures.py to
eliminate duplication between the Behave steps and Robot helper.

Files added:
- features/tdd_plan_correct_plan_id.feature (Behave scenarios: revert + append)
- features/steps/tdd_plan_correct_plan_id_steps.py (step definitions)
- features/mocks/tdd_plan_correct_plan_id_fixtures.py (shared fixtures)
- robot/tdd_plan_correct_plan_id.robot (Robot integration tests: revert + append)
- robot/helper_tdd_plan_correct_plan_id.py (Robot test helper)

Files modified:
- CHANGELOG.md (added entry for #979)

ISSUES CLOSED: #979
2026-03-19 15:23:04 +08:00