TDD: Re-creating an action after archiving fails with "already exists" error #1255

Open
opened 2026-04-02 01:17:30 +00:00 by brent.edwards · 0 comments
Member

Metadata

  • Commit Message: test(action): add TDD capture test for archive-then-recreate bug #1254
  • Branch: tdd/m1-action-archive-recreate

Background

This is the TDD issue-capture companion to bug #1254. Per the Bug Fix Workflow in CONTRIBUTING.md, every Type/Bug issue requires a corresponding Type/Testing issue whose sole deliverable is a test that proves the bug exists before any fix is attempted.

Bug #1254 reports that after archiving an action with cleveragents action archive, attempting to create a new action with the same name fails with Action with name '...' already exists. The action name uniqueness check does not exclude archived actions.

Expected Behavior

A Behave scenario tagged with @tdd_issue, @tdd_issue_1254, and @tdd_expected_fail that:

  1. Creates an action with a given name.
  2. Archives that action.
  3. Attempts to create a new action with the same name.
  4. Asserts the second creation succeeds.

Because @tdd_expected_fail is present, the test framework will invert the result — the scenario will pass CI even though the assertion fails (proving the bug exists). When the bug fix is implemented in the bugfix/m1-action-archive-recreate branch, the fix developer will remove the @tdd_expected_fail tag so the test runs normally and must pass.

Acceptance Criteria

  • A Behave scenario exists that captures the archive-then-recreate failure described in #1254
  • The scenario is tagged with @tdd_issue, @tdd_issue_1254, and @tdd_expected_fail
  • The scenario passes CI with @tdd_expected_fail present (inverted result proves the bug)
  • The scenario is placed in an appropriate feature file under features/

Subtasks

  • Write the Behave scenario with the three required TDD tags (@tdd_issue, @tdd_issue_1254, @tdd_expected_fail)
  • Implement any necessary step definitions for creating, archiving, and re-creating an action
  • Verify the scenario fails at the assertion level (proving the bug exists) but passes CI due to @tdd_expected_fail
  • Verify coverage >=97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

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.
## Metadata - **Commit Message**: `test(action): add TDD capture test for archive-then-recreate bug #1254` - **Branch**: `tdd/m1-action-archive-recreate` ## Background This is the TDD issue-capture companion to bug #1254. Per the Bug Fix Workflow in CONTRIBUTING.md, every `Type/Bug` issue requires a corresponding `Type/Testing` issue whose sole deliverable is a test that proves the bug exists before any fix is attempted. Bug #1254 reports that after archiving an action with `cleveragents action archive`, attempting to create a new action with the same name fails with `Action with name '...' already exists`. The action name uniqueness check does not exclude archived actions. ## Expected Behavior A Behave scenario tagged with `@tdd_issue`, `@tdd_issue_1254`, and `@tdd_expected_fail` that: 1. Creates an action with a given name. 2. Archives that action. 3. Attempts to create a new action with the same name. 4. Asserts the second creation succeeds. Because `@tdd_expected_fail` is present, the test framework will invert the result — the scenario will pass CI even though the assertion fails (proving the bug exists). When the bug fix is implemented in the `bugfix/m1-action-archive-recreate` branch, the fix developer will remove the `@tdd_expected_fail` tag so the test runs normally and must pass. ## Acceptance Criteria - [ ] A Behave scenario exists that captures the archive-then-recreate failure described in #1254 - [ ] The scenario is tagged with `@tdd_issue`, `@tdd_issue_1254`, and `@tdd_expected_fail` - [ ] The scenario passes CI with `@tdd_expected_fail` present (inverted result proves the bug) - [ ] The scenario is placed in an appropriate feature file under `features/` ## Subtasks - [ ] Write the Behave scenario with the three required TDD tags (`@tdd_issue`, `@tdd_issue_1254`, `@tdd_expected_fail`) - [ ] Implement any necessary step definitions for creating, archiving, and re-creating an action - [ ] Verify the scenario fails at the assertion level (proving the bug exists) but passes CI due to `@tdd_expected_fail` - [ ] Verify coverage >=97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## 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.
brent.edwards added this to the v3.0.0 milestone 2026-04-02 01:17:36 +00:00
freemo modified the milestone from v3.0.0 to v3.2.0 2026-04-02 08:10:52 +00:00
freemo self-assigned this 2026-04-02 18:45:27 +00:00
freemo removed this from the v3.2.0 milestone 2026-04-07 02:32:34 +00:00
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.

Reference
cleveragents/cleveragents-core#1255
No description provided.