# DEB-370: Training Lifecycle

> **Jira:** [DEB-370](https://divami.atlassian.net/browse/DEB-370)  
> **Source Report:** [20260315.md](../../reports/jira/20260315.md)

- **Status:** Start
- **Assignee:** Rajashekar Gummadidala
- **Priority:** Medium
- **Created:** 2026-03-13T16:05:10.289+0530
- **Updated:** 2026-03-13T16:21:08.624+0530

**Description:**

When trainer updates a runbook, it should maintain versions instead of updating the exisiting runbook and the system should abide to the latest runbook.

- Create required tables to store the runbooks
- Defining the Mock data of runbooks and test them
- Version management (Whenever trainer updates the Runbook, a new version of the runbook will be created along with the new instructions, without disturbing the current version and that will be used further, prev version will be inactive)
- If the runbook updation is related to data snapshot that should be implemented from the next refresh accordingly. If the runbook updation is related to responding behavior towards the user while chating that also need to be considered and acted accordingly further .

**Architecture Diagram:**

```mermaid
flowchart TD
    A[Trainer submits Runbook Update] --> B{Validate Trainer RBAC}
    B -->|Unauthorized| Z[Reject]
    B -->|Authorized| C[Create New Runbook Version<br/>mark prev as Inactive]
    C --> D{Update Type?}
    D -->|Data Snapshot behavior| E[Apply from next Refresh cycle]
    D -->|Chat response behavior| F[Apply immediately to agent prompts]
    E --> G[Store versioned Runbook in DB]
    F --> G
    G --> H[Agent reads latest Active version]
    H --> I[Agent behaves per updated Runbook]
```
