| 1 | @long-running |
| 2 | # [LONG RUNNING] Opt-in acceptance workflows. Run with: |
| 3 | # cargo test -p codewhale-tui --bin codewhale-tui --features long-running-tests commands::groups::session::acceptance -- --test-threads=1 |
| 4 | Feature: Session command workflows |
| 5 | |
| 6 | Scenario: Save and export preserve data while load defers restoration |
| 7 | Given a CodeWhale session workspace with one user message |
| 8 | When the user saves the active session |
| 9 | And the user exports the active transcript |
| 10 | And the user clears the active conversation |
| 11 | And the user loads the saved session |
| 12 | Then the saved session file should contain the saved message |
| 13 | And the load action should target the saved session file |
| 14 | And the exported markdown should contain the active transcript |
| 15 | And the active session should be cleared without an active session id |
| 16 | And CodeWhale should defer the session-loaded receipt to the event loop |
| 17 | |
| 18 | Scenario: Fork keeps the original session resumable |
| 19 | Given a CodeWhale persisted session workspace with one user message |
| 20 | When the user forks the active session |
| 21 | Then the forked session should reference the original session |
| 22 | And the original session should still be loadable |
| 23 | And the active session should be the forked session |
| 24 | |
| 25 | Scenario: New session cannot be forked before messages exist |
| 26 | Given a CodeWhale session workspace with one user message |
| 27 | When the user starts a new session |
| 28 | And the user tries to fork the active session |
| 29 | Then CodeWhale should reject the fork because there are no messages |
| 30 | And the active session should be empty |
| 31 | |
| 32 | Scenario: Cleared session cannot be forked before messages exist |
| 33 | Given a CodeWhale session workspace with one user message |
| 34 | When the user clears the active conversation |
| 35 | And the user tries to fork the active session |
| 36 | Then CodeWhale should reject the fork because there are no messages |
| 37 | And the active session should be empty |
| 38 | |
| 39 | Scenario: Fork followed by new keeps both saved sessions |
| 40 | Given a CodeWhale persisted session workspace with one user message |
| 41 | When the user forks the active session |
| 42 | And the user starts a new session |
| 43 | Then the original and forked sessions should remain loadable |
| 44 | And the active session should be a new empty session |
| 45 | |
| 46 | Scenario: Fork followed by clear keeps both saved sessions |
| 47 | Given a CodeWhale persisted session workspace with one user message |
| 48 | When the user forks the active session |
| 49 | And the user clears the active conversation |
| 50 | Then the original and forked sessions should remain loadable |
| 51 | And the active session should be cleared without an active session id |
| 52 | |
| 53 | Scenario: Rename updates the active saved session title |
| 54 | Given a CodeWhale persisted session workspace with one user message |
| 55 | When the user renames the active session to "Renamed whale path" |
| 56 | Then the active saved session title should be "Renamed whale path" |
| 57 | And the active session should be the original session |
| 58 | |
| 59 | Scenario: Sessions list opens the saved session picker |
| 60 | Given a CodeWhale persisted session workspace with one user message |
| 61 | When the user lists saved sessions |
| 62 | Then the session picker should be open |
| 63 | And the original session should still be loadable |
| 64 | |
| 65 | Scenario: Sessions prune removes only stale sessions |
| 66 | Given a CodeWhale session workspace with stale and fresh saved sessions |
| 67 | When the user prunes sessions older than 7 days |
| 68 | Then CodeWhale should report that one session was pruned |
| 69 | And the fresh session should still be loadable |
| 70 | And the stale session should no longer be loadable |
| 71 | |
| 72 | Scenario: Context management commands emit actions without clearing the active session |
| 73 | Given a CodeWhale session workspace with one user message |
| 74 | When the user compacts context |
| 75 | Then CodeWhale should trigger context compaction |
| 76 | And the active session should contain the saved message |
| 77 | When the user purges context |
| 78 | Then CodeWhale should trigger context purge |
| 79 | And the active session should contain the saved message |
| 80 | When the user prepares a session relay focused on "handoff details" |
| 81 | Then CodeWhale should send a session relay instruction focused on "handoff details" |
| 82 | And the active session should contain the saved message |
| 83 | |
| 84 | Scenario: Singular session command is not registered |
| 85 | Given a CodeWhale session workspace with one user message |
| 86 | When the user runs the singular session command |
| 87 | Then CodeWhale should reject the unknown session command |
| 88 | And the active session should contain the saved message |
| 89 |