test: add TDD bug-capture test for #969 — plan correct plan_id handling #1051
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
#979 TDD: Write failing test for #969 — plan correct expects decision_id but test passes plan_id
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core!1051
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "tdd/m3-plan-correct-plan-id"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add TDD bug-capture tests for bug #969 (
plan correctexpectsdecision_idbut M3 acceptance test passesplan_id). These tests prove the bug exists and will serve as regression guards once the fix in #969 is merged.Changes
Behave test (
features/tdd_plan_correct_plan_id.feature): Two scenarios tagged@tdd_expected_fail @tdd_bug @tdd_bug_969— one for--mode revertand one for--mode append— that invokeplan correct <plan_id>(without--planflag) and assert the command resolves the plan_id to its root decision astarget_decision_id. Both modes are tested because the bug affectstarget_decision_idresolution before mode-specific branching.Step definitions (
features/steps/tdd_plan_correct_plan_id_steps.py): Mock setup for DI container (DecisionService), CorrectionService, and_resolve_active_plan_id. Usestpcpidstep prefix per project conventions.Shared fixtures (
features/mocks/tdd_plan_correct_plan_id_fixtures.py): Centralised constants, patch targets, mock builders (make_decision_ns,make_mock_container,make_correction_svc,make_default_decisions,make_default_container), andbuild_cli_argshelper. Both the Behave steps and Robot helper import from this shared module, eliminating code duplication and drift risk.Robot test (
robot/tdd_plan_correct_plan_id.robot): Two integration-level tests (revert + append) withtdd_expected_fail tdd_bug tdd_bug_969tags, exercising the same code paths via the helper script.Robot helper (
robot/helper_tdd_plan_correct_plan_id.py): Standalone helper that exits 0 with sentinel when the bug is fixed, exits 1 when the bug is present. Imports shared fixtures fromfeatures/mocks/.Changelog (
CHANGELOG.md): Added entry under Unreleased for #979.Bug Description
The
correct_decisionfunction incleveragents.cli.commands.plandeclaresdecision_idas its first positional argument. When the M3 acceptance test callsplan correct <plan_id> --mode revert --guidance "...", the plan_id is captured asdecision_idand used directly astarget_decision_idinsvc.request_correction(). Since the plan_id is not a valid decision_id, the correction service cannot find the targeted decision. The same bug path is exercised by--mode append.How TDD Expected-Fail Works
@tdd_expected_failtag causes the test framework to invert the result: the test passes CI when the underlying assertion fails (proving the bug exists) and fails CI if the assertion passes (bug was fixed without removing the tag).@tdd_expected_failtag, and the test runs normally as a regression guard.Quality Gates
All nox sessions pass:
nox -s lint✅nox -s typecheck✅ (0 errors)nox -s unit_tests✅ (387 features, 11121 scenarios, 0 failures)nox -s integration_tests✅ (1561 tests, 0 failures)nox -s e2e_tests✅ (16 tests, 0 failures)nox -s coverage_report✅ (≥97%)Closes #979
5a08e12ebd433aa7db21Code Review — PR #1051
test: TDD bug-capture test for #969 — plan correct plan_id handlingClean TDD test with correct tag triplet (
@tdd_expected_fail @tdd_bug @tdd_bug_969). Excellent use of shared fixtures infeatures/mocks/tdd_plan_correct_plan_id_fixtures.py— this eliminates duplication between Behave steps and Robot helper and should be the standard pattern for future TDD PRs. Two scenarios (revert + append modes) thoroughly test the root bug.Approved. No issues found.
433aa7db217b8b15f75cNew commits pushed, approval review dismissed automatically according to repository settings