TDD: TUI uses ctrl+t to cycle presets instead of spec-required ctrl+tab #10315

Open
opened 2026-04-18 08:39:23 +00:00 by HAL9000 · 0 comments
Owner

Metadata

  • Commit message: test(tui): add failing Behave scenario for ctrl+tab preset cycling (tdd_issue_10314)
  • Branch name: bugfix/m8-cycle-preset-wrong-keybinding

Background and Context

This is the TDD counterpart to bug issue #10314 (UAT: TUI uses ctrl+t to cycle presets instead of spec-required ctrl+tab).

The TUI specification (ADR-045, Persona System) requires ctrl+tab to cycle presets. The current implementation binds ctrl+t instead. This issue tracks a failing Behave scenario that proves the bug exists — the scenario is expected to fail until the fix in #10314 is implemented.

Expected Behavior

A Behave scenario tagged @tdd_issue, @tdd_issue_10314, and @tdd_expected_fail should:

  1. Inspect _TextualCleverAgentsTuiApp.BINDINGS
  2. Assert that ctrl+tab is bound to cycle_preset
  3. Fail (expected) because the current binding is ctrl+t, not ctrl+tab

Acceptance Criteria

  • A Behave scenario tagged @tdd_issue @tdd_issue_10314 @tdd_expected_fail exists in the TUI feature files
  • The scenario asserts ctrl+tab is bound to cycle_preset in _TextualCleverAgentsTuiApp.BINDINGS
  • The scenario fails on the current codebase (proving the bug)
  • The scenario passes after the fix in #10314 is applied
  • Coverage >= 97%

Subtasks

  • Create or update a Behave feature file (e.g., features/tui/tui_keybindings.feature) with the failing scenario
  • Tag the scenario with @tdd_issue, @tdd_issue_10314, and @tdd_expected_fail
  • Implement step definitions if not already present
  • Confirm the scenario fails on the current codebase (nox -s bdd_tests -- --tags=tdd_issue_10314)
  • Verify coverage >= 97% via nox -s coverage_report

Failing Behave Scenario

@tdd_issue @tdd_issue_10314 @tdd_expected_fail
Scenario: TUI BINDINGS uses ctrl+tab (not ctrl+t) to cycle presets
  Given the TUI application class is available
  When I inspect the BINDINGS class variable of _TextualCleverAgentsTuiApp
  Then the binding for action "cycle_preset" should use key "ctrl+tab"
  And the binding for action "cycle_preset" should NOT use key "ctrl+t"

Why This Fails (Current State)

# Current BINDINGS in src/cleveragents/tui/app.py:
BINDINGS: ClassVar[list[tuple[str, str, str]]] = [
    ("ctrl+q", "quit", "Quit"),
    ("f1", "help", "Help"),
    ("ctrl+t", "cycle_preset", "Cycle Preset"),  # BUG: should be ctrl+tab
]
# The step "the binding for action 'cycle_preset' should use key 'ctrl+tab'"
# will FAIL because the actual key is "ctrl+t"

Why This Passes After Fix

After the fix in #10314 changes "ctrl+t" to "ctrl+tab", the scenario will pass:

("ctrl+tab", "cycle_preset", "Cycle Preset"),  # FIXED

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • The failing scenario exists and is confirmed to fail on the pre-fix codebase.
  • After the fix in #10314 is merged, this scenario passes.
  • 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.

Automated by CleverAgents Bot
Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor

## Metadata - **Commit message:** `test(tui): add failing Behave scenario for ctrl+tab preset cycling (tdd_issue_10314)` - **Branch name:** `bugfix/m8-cycle-preset-wrong-keybinding` ## Background and Context This is the TDD counterpart to bug issue **#10314** (`UAT: TUI uses ctrl+t to cycle presets instead of spec-required ctrl+tab`). The TUI specification (ADR-045, Persona System) requires `ctrl+tab` to cycle presets. The current implementation binds `ctrl+t` instead. This issue tracks a **failing** Behave scenario that proves the bug exists — the scenario is expected to fail until the fix in #10314 is implemented. ## Expected Behavior A Behave scenario tagged `@tdd_issue`, `@tdd_issue_10314`, and `@tdd_expected_fail` should: 1. Inspect `_TextualCleverAgentsTuiApp.BINDINGS` 2. Assert that `ctrl+tab` is bound to `cycle_preset` 3. **Fail** (expected) because the current binding is `ctrl+t`, not `ctrl+tab` ## Acceptance Criteria - [ ] A Behave scenario tagged `@tdd_issue @tdd_issue_10314 @tdd_expected_fail` exists in the TUI feature files - [ ] The scenario asserts `ctrl+tab` is bound to `cycle_preset` in `_TextualCleverAgentsTuiApp.BINDINGS` - [ ] The scenario **fails** on the current codebase (proving the bug) - [ ] The scenario **passes** after the fix in #10314 is applied - [ ] Coverage >= 97% ## Subtasks - [ ] Create or update a Behave feature file (e.g., `features/tui/tui_keybindings.feature`) with the failing scenario - [ ] Tag the scenario with `@tdd_issue`, `@tdd_issue_10314`, and `@tdd_expected_fail` - [ ] Implement step definitions if not already present - [ ] Confirm the scenario fails on the current codebase (`nox -s bdd_tests -- --tags=tdd_issue_10314`) - [ ] Verify coverage >= 97% via `nox -s coverage_report` ## Failing Behave Scenario ```gherkin @tdd_issue @tdd_issue_10314 @tdd_expected_fail Scenario: TUI BINDINGS uses ctrl+tab (not ctrl+t) to cycle presets Given the TUI application class is available When I inspect the BINDINGS class variable of _TextualCleverAgentsTuiApp Then the binding for action "cycle_preset" should use key "ctrl+tab" And the binding for action "cycle_preset" should NOT use key "ctrl+t" ``` ### Why This Fails (Current State) ```python # Current BINDINGS in src/cleveragents/tui/app.py: BINDINGS: ClassVar[list[tuple[str, str, str]]] = [ ("ctrl+q", "quit", "Quit"), ("f1", "help", "Help"), ("ctrl+t", "cycle_preset", "Cycle Preset"), # BUG: should be ctrl+tab ] # The step "the binding for action 'cycle_preset' should use key 'ctrl+tab'" # will FAIL because the actual key is "ctrl+t" ``` ### Why This Passes After Fix After the fix in #10314 changes `"ctrl+t"` to `"ctrl+tab"`, the scenario will pass: ```python ("ctrl+tab", "cycle_preset", "Cycle Preset"), # FIXED ``` ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - The failing scenario exists and is confirmed to fail on the pre-fix codebase. - After the fix in #10314 is merged, this scenario passes. - 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. --- **Automated by CleverAgents Bot** Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor
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.

Dependencies

No dependencies set.

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