# 1. AI Tutor Configuration — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: ai_tutor_configuration.md — every feature, sub-feature, and rule covered

## Test Execution Policy

- Zero tolerance: any deviation from the documented behavior is a defect.
- Every failed test is logged with a Bug ID, the feature, the sub-feature, the expected vs actual result, and the severity; 100% of bugs are fixed before the group passes.
- 100% pass rate is required for the group to be marked complete.

## Coverage Matrix

| Feature | Sub-feature / Rule | Test IDs |
|---------|--------------------|----------|
| 1.1 Question Limits per Plan | Question caps per plan (daily, weekly, monthly) | TC-SA-AI-1-001 |
| 1.1 Question Limits per Plan | Cap enforcement behavior (hard stop, soft warning) | TC-SA-AI-1-002 |
| 1.1 Question Limits per Plan | Overage handling (block, prompt upgrade, grace) | TC-SA-AI-1-003 |
| 1.1 Question Limits per Plan | Per-plan cap overrides (promotional, trial) | TC-SA-AI-1-004 |
| 1.1 Question Limits per Plan | Rule: no silent overage | TC-SA-AI-1-005 |
| 1.1 Question Limits per Plan | Rule: plan change applies new caps from change point | TC-SA-AI-1-006 |
| 1.1 Question Limits per Plan | Audit logging of AI tutor question limits | TC-SA-AI-1-007 |
| 1.2 Subject-Specific AI Behavior | Teaching approach per subject | TC-SA-AI-2-001 |
| 1.2 Subject-Specific AI Behavior | Difficulty calibration per subject and grade band | TC-SA-AI-2-002 |
| 1.2 Subject-Specific AI Behavior | Response style and knowledge scope | TC-SA-AI-2-003 |
| 1.2 Subject-Specific AI Behavior | Subject enable/disable | TC-SA-AI-2-004 |
| 1.2 Subject-Specific AI Behavior | Rule: out-of-scope question answered with scope notice | TC-SA-AI-2-005 |
| 1.2 Subject-Specific AI Behavior | Rule: unconfigured subject falls back to global default | TC-SA-AI-2-006 |
| 1.2 Subject-Specific AI Behavior | Audit logging of subject-specific AI behavior | TC-SA-AI-2-007 |
| 1.3 Multi-Language Response Settings | Supported language list and default language | TC-SA-AI-3-001 |
| 1.3 Multi-Language Response Settings | Language detection (auto-detect from input) | TC-SA-AI-3-002 |
| 1.3 Multi-Language Response Settings | Mixed-language handling (dominant language) | TC-SA-AI-3-003 |
| 1.3 Multi-Language Response Settings | Per-language quality thresholds | TC-SA-AI-3-004 |
| 1.3 Multi-Language Response Settings | Rule: unsupported language falls back to default with notice | TC-SA-AI-3-005 |
| 1.3 Multi-Language Response Settings | Rule: default language resolution order (locale → plan → global) | TC-SA-AI-3-006 |
| 1.3 Multi-Language Response Settings | Audit logging of multi-language settings | TC-SA-AI-3-007 |
| 1.4 Response Quality Parameters | Accuracy target | TC-SA-AI-4-001 |
| 1.4 Response Quality Parameters | Response length bounds and step-showing requirement | TC-SA-AI-4-002 |
| 1.4 Response Quality Parameters | Citation requirement | TC-SA-AI-4-003 |
| 1.4 Response Quality Parameters | Quality monitoring (sampled responses) | TC-SA-AI-4-004 |
| 1.4 Response Quality Parameters | Rule: failed accuracy target flagged, corrected, incident logged | TC-SA-AI-4-005 |
| 1.4 Response Quality Parameters | Rule: step-showing applies to problem-solving only | TC-SA-AI-4-006 |
| 1.4 Response Quality Parameters | Audit logging of response quality parameters | TC-SA-AI-4-007 |
| 1.5 Escalation to Human Tutor Rules | Escalation triggers (repeated failure, request, low confidence) | TC-SA-AI-5-001 |
| 1.5 Escalation to Human Tutor Rules | Escalation routing (subject-matched tutor, queue) | TC-SA-AI-5-002 |
| 1.5 Escalation to Human Tutor Rules | Handoff context (summary, level, unresolved question) | TC-SA-AI-5-003 |
| 1.5 Escalation to Human Tutor Rules | Availability window and async fallback | TC-SA-AI-5-004 |
| 1.5 Escalation to Human Tutor Rules | Rule: student-requested escalation always succeeds | TC-SA-AI-5-005 |
| 1.5 Escalation to Human Tutor Rules | Rule: low-confidence trigger only below threshold | TC-SA-AI-5-006 |
| 1.5 Escalation to Human Tutor Rules | Audit logging of escalation rules | TC-SA-AI-5-007 |

## 1.1 Question Limits per Subscription Plan

### TC-SA-AI-1-001 — Question caps per plan (daily, weekly, monthly)
**Type:** Positive
**Covers:** 1.1 → Question caps per plan
**Preconditions:** A Super Admin account is active; subscription plans exist.
**Steps:**
1. As a Super Admin, open AI Feature Configuration → AI Tutor → Question Limits and set the question caps per subscription plan (daily, weekly, monthly).
2. Verify the caps are saved and applied to AI tutor sessions for each plan.
**Expected Result:** Question caps per plan — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-1-002 — Cap enforcement behavior (hard stop, soft warning)
**Type:** Positive
**Covers:** 1.1 → Cap enforcement behavior
**Preconditions:** Question caps are set per plan.
**Steps:**
1. Set the enforcement behavior to hard stop and verify questions are blocked at the cap.
2. Set it to soft warning and verify a warning is shown at the cap.
**Expected Result:** Cap enforcement behavior — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-1-003 — Overage handling (block, prompt upgrade, grace)
**Type:** Positive
**Covers:** 1.1 → Overage handling
**Preconditions:** A student is at the question cap.
**Steps:**
1. Set the overage handling to block, prompt upgrade, and grace allowance (separately).
2. Verify each overage handling behaves as configured when the cap is reached.
**Expected Result:** Overage handling — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-1-004 — Per-plan cap overrides (promotional, trial)
**Type:** Positive
**Covers:** 1.1 → Per-plan overrides
**Preconditions:** Base question caps are set.
**Steps:**
1. Define a per-plan override for a promotional or trial plan.
2. Verify the override applies to students on that plan and the base cap applies to others.
**Expected Result:** Per-plan cap overrides — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-1-005 — Rule: no silent overage
**Type:** Negative
**Covers:** 1.1 → Rule: no silent overage
**Preconditions:** A student reaches the question cap.
**Steps:**
1. Reach the cap and attempt further questions.
2. Verify the overage is handled per the rule (block, prompt, or grace) and never silently allowed.
**Expected Result:** A student at the cap is handled per the overage rule; there is no silent overage — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-1-006 — Rule: plan change applies new caps from change point
**Type:** Negative
**Covers:** 1.1 → Rule: plan change scope
**Preconditions:** A student on Plan A changes to Plan B mid-period.
**Steps:**
1. Change the student's plan.
2. Verify the new plan's caps apply from the change point and usage is not retroactively recalculated.
**Expected Result:** A plan change applies the new plan's caps from the change point; usage is not retroactively recalculated — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-1-007 — Audit logging of AI tutor question limits
**Type:** Positive
**Covers:** 1.1 → Audit logging
**Preconditions:** Question limit changes have been made.
**Steps:**
1. Open the audit trail and filter by AI tutor question limits.
2. Verify entries show the plan, the change, and the timestamp.
**Expected Result:** Audit logging of AI tutor question limits — delivered exactly as documented.
**Priority:** Critical

## 1.2 Subject-Specific AI Behavior

### TC-SA-AI-2-001 — Teaching approach per subject
**Type:** Positive
**Covers:** 1.2 → Teaching approach
**Preconditions:** A Super Admin is configuring subject behavior.
**Steps:**
1. Set the teaching approach per subject (step-by-step, Socratic, direct answer).
2. Ask the same question in two subjects and verify each uses its configured approach.
**Expected Result:** Teaching approach per subject — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-2-002 — Difficulty calibration per subject and grade band
**Type:** Positive
**Covers:** 1.2 → Difficulty calibration
**Preconditions:** Subject behavior is configured.
**Steps:**
1. Calibrate the difficulty per subject and grade band.
2. Verify the AI tutor's response difficulty matches the calibration for a student in the band.
**Expected Result:** Difficulty calibration per subject and grade band — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-2-003 — Response style and knowledge scope
**Type:** Positive
**Covers:** 1.2 → Response style and scope
**Preconditions:** Subject behavior is configured.
**Steps:**
1. Set the subject-specific response style (formal, conversational) and verify it is used.
2. Set the knowledge scope (curriculum boundaries) and verify answers stay within scope.
**Expected Result:** Response style and knowledge scope — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-2-004 — Subject enable/disable
**Type:** Positive
**Covers:** 1.2 → Subject enable/disable
**Preconditions:** The AI tutor is enabled in some subjects.
**Steps:**
1. Disable the AI tutor for a subject.
2. Verify no AI tutor access is shown for that subject.
**Expected Result:** Subject enable/disable — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-2-005 — Rule: out-of-scope question answered with scope notice
**Type:** Negative
**Covers:** 1.2 → Rule: scope boundary
**Preconditions:** A subject has a configured knowledge scope.
**Steps:**
1. Ask a question outside the curriculum scope.
2. Verify the answer includes a scope notice (not a full out-of-scope answer).
**Expected Result:** Out-of-scope questions are answered with a scope notice — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-2-006 — Rule: unconfigured subject falls back to global default
**Type:** Edge
**Covers:** 1.2 → Rule: fallback behavior
**Preconditions:** A subject has no configured behavior.
**Steps:**
1. Use the AI tutor in the unconfigured subject.
2. Verify it falls back to the global default behavior.
**Expected Result:** A subject with no configured behavior falls back to the global default behavior — delivered exactly as documented.
**Priority:** Medium

### TC-SA-AI-2-007 — Audit logging of subject-specific AI behavior
**Type:** Positive
**Covers:** 1.2 → Audit logging
**Preconditions:** Subject behavior changes have been made.
**Steps:**
1. Open the audit trail and filter by subject-specific AI behavior.
2. Verify entries show the subject, the change, and the timestamp.
**Expected Result:** Audit logging of subject-specific AI behavior — delivered exactly as documented.
**Priority:** Critical

## 1.3 Multi-Language Response Settings

### TC-SA-AI-3-001 — Supported language list and default language
**Type:** Positive
**Covers:** 1.3 → Language list and default
**Preconditions:** A Super Admin is configuring languages.
**Steps:**
1. Set the supported language list and the default response language.
2. Verify responses are delivered in the default language by default.
**Expected Result:** Supported language list and default language — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-3-002 — Language detection (auto-detect from input)
**Type:** Positive
**Covers:** 1.3 → Language detection
**Preconditions:** Language detection is enabled.
**Steps:**
1. Submit a question in a supported non-default language.
2. Verify the response is in the detected language.
**Expected Result:** Language detection — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-3-003 — Mixed-language handling (dominant language)
**Type:** Positive
**Covers:** 1.3 → Mixed-language handling
**Preconditions:** Mixed-language handling is configured.
**Steps:**
1. Submit a question mixing two supported languages.
2. Verify the response is in the dominant language.
**Expected Result:** Mixed-language handling — delivered exactly as documented.
**Priority:** Medium

### TC-SA-AI-3-004 — Per-language quality thresholds
**Type:** Positive
**Covers:** 1.3 → Per-language quality thresholds
**Preconditions:** Per-language quality thresholds are set.
**Steps:**
1. Set a quality threshold for a language.
2. Verify a language below its threshold is disabled for new responses.
**Expected Result:** Per-language quality thresholds — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-3-005 — Rule: unsupported language falls back to default with notice
**Type:** Negative
**Covers:** 1.3 → Rule: unsupported fallback
**Preconditions:** A student submits input in an unsupported language.
**Steps:**
1. Submit a question in an unsupported language.
2. Verify the response falls back to the default language with a notice.
**Expected Result:** An unsupported language triggers a fallback to the default language with a notice — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-3-006 — Rule: default language resolution order
**Type:** Edge
**Covers:** 1.3 → Rule: resolution order
**Preconditions:** A student has a locale, a plan default, and a global default.
**Steps:**
1. Verify the default language resolves per student locale first.
2. Remove the locale and verify it resolves per plan, then the global default.
**Expected Result:** The default language is resolved per student locale, then per plan, then the global default — delivered exactly as documented.
**Priority:** Medium

### TC-SA-AI-3-007 — Audit logging of multi-language settings
**Type:** Positive
**Covers:** 1.3 → Audit logging
**Preconditions:** Multi-language setting changes have been made.
**Steps:**
1. Open the audit trail and filter by multi-language settings.
2. Verify entries show the setting, the change, and the timestamp.
**Expected Result:** Audit logging of multi-language settings — delivered exactly as documented.
**Priority:** Critical

## 1.4 Response Quality Parameters

### TC-SA-AI-4-001 — Accuracy target
**Type:** Positive
**Covers:** 1.4 → Accuracy target
**Preconditions:** A Super Admin is configuring response quality.
**Steps:**
1. Set the accuracy target (minimum correctness threshold).
2. Verify responses are evaluated against the accuracy target.
**Expected Result:** Accuracy target — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-4-002 — Response length bounds and step-showing requirement
**Type:** Positive
**Covers:** 1.4 → Length bounds and step-showing
**Preconditions:** Response quality is configured.
**Steps:**
1. Set the response length bounds (min/max per response type) and verify responses respect them.
2. Enable the step-showing requirement and verify problem-solving responses show working.
**Expected Result:** Response length bounds and step-showing requirement — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-4-003 — Citation requirement
**Type:** Positive
**Covers:** 1.4 → Citation requirement
**Preconditions:** The citation requirement is enabled.
**Steps:**
1. Ask a question where curriculum sources apply.
2. Verify the response references the curriculum sources.
**Expected Result:** Citation requirement — delivered exactly as documented.
**Priority:** Medium

### TC-SA-AI-4-004 — Quality monitoring (sampled responses)
**Type:** Positive
**Covers:** 1.4 → Quality monitoring
**Preconditions:** Quality monitoring is enabled with a sampling rate.
**Steps:**
1. Enable quality monitoring (sampled responses reviewed for quality).
2. Verify responses are sampled per the rate and available for review.
**Expected Result:** Quality monitoring — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-4-005 — Rule: failed accuracy target flagged, corrected, incident logged
**Type:** Negative
**Covers:** 1.4 → Rule: accuracy failure handling
**Preconditions:** A response fails the accuracy target.
**Steps:**
1. Flag the response for review and confirm it is incorrect.
2. Verify it is corrected and the incident is logged.
**Expected Result:** A response failing the accuracy target is flagged, corrected, and the incident logged — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-4-006 — Rule: step-showing applies to problem-solving only
**Type:** Edge
**Covers:** 1.4 → Rule: step-showing scope
**Preconditions:** The step-showing requirement is enabled.
**Steps:**
1. Ask a factual question and verify no step-showing is required.
2. Ask a problem-solving question and verify the working is shown.
**Expected Result:** The step-showing requirement applies to problem-solving responses; factual responses are exempt — delivered exactly as documented.
**Priority:** Medium

### TC-SA-AI-4-007 — Audit logging of response quality parameters
**Type:** Positive
**Covers:** 1.4 → Audit logging
**Preconditions:** Response quality parameter changes have been made.
**Steps:**
1. Open the audit trail and filter by response quality parameters.
2. Verify entries show the parameter, the change, and the timestamp.
**Expected Result:** Audit logging of response quality parameters — delivered exactly as documented.
**Priority:** Critical

## 1.5 Escalation to Human Tutor Rules

### TC-SA-AI-5-001 — Escalation triggers (repeated failure, request, low confidence)
**Type:** Positive
**Covers:** 1.5 → Escalation triggers
**Preconditions:** A Super Admin is configuring escalation.
**Steps:**
1. Set the escalation triggers (repeated failure, student request, low-confidence answer).
2. Trigger each condition and verify an escalation is initiated.
**Expected Result:** Escalation triggers — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-5-002 — Escalation routing (subject-matched tutor, queue)
**Type:** Positive
**Covers:** 1.5 → Escalation routing
**Preconditions:** Escalation triggers are configured; human tutors exist.
**Steps:**
1. Configure the escalation routing (subject-matched human tutor, queue).
2. Trigger an escalation and verify it is routed to the subject-matched tutor or queue.
**Expected Result:** Escalation routing — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-5-003 — Handoff context (summary, level, unresolved question)
**Type:** Positive
**Covers:** 1.5 → Handoff context
**Preconditions:** An escalation occurs.
**Steps:**
1. Trigger an escalation.
2. Verify the handoff context (session summary, student level, unresolved question) is generated and visible to the human tutor.
**Expected Result:** Handoff context — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-5-004 — Availability window and async fallback
**Type:** Positive
**Covers:** 1.5 → Availability and fallback
**Preconditions:** The availability window is configured.
**Steps:**
1. Set the availability window (human tutor hours).
2. Trigger an escalation outside the window and verify the async ticket fallback.
**Expected Result:** Availability window and async fallback — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-5-005 — Rule: student-requested escalation always succeeds
**Type:** Negative
**Covers:** 1.5 → Rule: request always succeeds
**Preconditions:** A student requests escalation outside the availability window.
**Steps:**
1. Request escalation as a student.
2. Verify the escalation succeeds (routed or ticketed) and is never silently dropped.
**Expected Result:** A student-requested escalation always succeeds (routed or ticketed) — delivered exactly as documented.
**Priority:** Critical

### TC-SA-AI-5-006 — Rule: low-confidence trigger only below threshold
**Type:** Negative
**Covers:** 1.5 → Rule: confidence threshold
**Preconditions:** The low-confidence threshold is set; an answer has confidence above the threshold.
**Steps:**
1. Deliver a low-confidence answer above the threshold.
2. Verify no escalation is triggered.
**Expected Result:** A low-confidence answer triggers escalation only when below the configured threshold — delivered exactly as documented.
**Priority:** High

### TC-SA-AI-5-007 — Audit logging of escalation rules
**Type:** Positive
**Covers:** 1.5 → Audit logging
**Preconditions:** Escalation rule changes have been made.
**Steps:**
1. Open the audit trail and filter by escalation rules.
2. Verify entries show the rule, the change, and the timestamp.
**Expected Result:** Audit logging of escalation rules — delivered exactly as documented.
**Priority:** Critical
