| 525 | } |
| 526 | |
| 527 | fn transition_from_active_recorded(event: Event) -> TransitionResult { |
| 528 | match event { |
| 529 | // Turn start while active+recorded → Ctrl-C recovery |
| 530 | // Same as Active + TurnStart: previous turn was interrupted after |
| 531 | // a mid-turn record. Transition back to Active for the new turn. |
| 532 | Event::TurnStart => { |
| 533 | TransitionResult::with_actions(Phase::Active, vec![Action::UpdateInteraction]) |
| 534 | } |
| 535 | |
| 536 | // Turn ended after mid-turn record → record the turn |
| 537 | Event::TurnEnd => TransitionResult::with_actions( |
| 538 | Phase::Idle, |
| 539 | vec![Action::RecordTurn, Action::UpdateInteraction], |
| 540 | ), |
| 541 | |
| 542 | // Another record while already in active+recorded → stay, update |
| 543 | Event::Recorded => { |
| 544 | TransitionResult::with_actions(Phase::ActiveRecorded, vec![Action::UpdateInteraction]) |
| 545 | } |
| 546 | |
| 547 | // Another session started → warn |
| 548 | Event::SessionStart => { |
| 549 | TransitionResult::with_actions(Phase::ActiveRecorded, vec![Action::WarnStaleSession]) |
| 550 | } |
| 551 | |
| 552 | // Session stopped → end |
| 553 | Event::SessionStop => { |
| 554 | TransitionResult::with_actions(Phase::Ended, vec![Action::UpdateInteraction]) |
| 555 | } |
| 556 | } |
| 557 | } |
| 558 | |
| 559 | fn transition_from_ended(event: Event, ctx: TransitionContext) -> TransitionResult { |
| 560 | match event { |