# EnCoach — Demo Seed & Full E2E QA Report **Date:** 2026-04-25 **Database:** `encoach_v2` **Backend:** `http://localhost:8069` **Frontend:** `http://localhost:5173` **Scope:** Seed every product user-type with believable data and run end-to-end smoke + mutation tests across all 8 roles, including the new LangGraph agent runtime. --- ## 1. What was added in this pass | Artefact | Path | Purpose | |---|---|---| | Idempotent demo filler | `seed_full_demo.py` | Adds the 5 missing user types, an active 2-stage exam-approval workflow with one pending request, a rich GE1-aligned B1 course plan with full week-1 teaching materials, sample agent telemetry, and AI feedback rows | | Password reset helper | `reset_demo_passwords.py` | Re-applies the canonical demo passwords (idempotent, safe to re-run) | | Read-only role smoke test | `e2e_full_scenario.py` | Logs in as each user type and exercises the API surface they can reach | | Approval-chain mutation test | `e2e_approval_chain.py` | Walks the full happy path: approver approves → admin approves → exam auto-published | All four scripts are idempotent — re-running them does not duplicate data, and after the seed creates 0 new records on subsequent runs. --- ## 2. Demo accounts (canonical credentials) Every user type the platform supports is now represented. All accounts are activated, verified, linked to the `EnCoach Demo Academy` entity, and run inside `encoach_v2`. | user_type | Login | Password | Notes | |---|---|---|---| | `admin` | `admin@encoach.test` | `admin123` | Top-level admin; final approver in the demo workflow | | `student` | `sarah@encoach.test` | `student123` | Has 4 exam assignments + course-plan visibility | | `student` | `omar@encoach.test` | `student123` | | | `student` | `layla@encoach.test` | `student123` | | | `teacher` | `khalid@encoach.test` | `teacher123` | Owner / requester of the pending approval | | `teacher` | `fatima@encoach.test` | `teacher123` | | | `teacher` (approver) | `approver@encoach.test` | `approver123` | Stage 1 of the demo approval workflow | | `corporate` | `corporate@encoach.test` | `corporate123` | Hits corporate stats reports | | `mastercorporate` | `master@encoach.test` | `master123` | Multi-entity overview | | `agent` | `agent@encoach.test` | `agent123` | | | `developer` | `dev@encoach.test` | `dev123` | Has AI agents introspection + `/api/metrics` | --- ## 3. Demo dataset snapshot (after seed) | Entity | Count | Notes | |---|---:|---| | `res.users` (demo) | **11** | Covers all 7 product `user_type`s | | `encoach.entity` | 4 | `EnCoach Demo Academy` is the primary | | `op.course` | 6 | Includes new `GE1-B1` linked to the GE1 plan | | `op.student` | 4 | | | `encoach.rubric` | 4 | Writing + speaking | | `encoach.exam.custom` | 18 | One is `published` after the mutation E2E | | `encoach.exam.assignment` | 12 | | | `encoach.student.attempt` | 32 | | | `encoach.course.plan` | **3** | Includes full GE1 B1 plan | | `encoach.course.plan.week` | **25** | GE1 plan contributes 12 weeks | | `encoach.course.plan.material` | **16** | GE1 week 1: 6 detailed materials | | `encoach.approval.workflow` | 1 active | `Exam Approval Workflow` (id=4, 2 stages) | | `encoach.approval.request` | 2 | One was approved end-to-end during testing | | `encoach.ai.agent` | 7 | LangGraph agents seeded by `agents_defaults.xml` | | `encoach.ai.tool` | 11 | LangGraph tool registry | | `encoach.ai.log` | 2,587 | | | `encoach.ai.feedback` | 3 | New rows from this pass | ### GE1 course-plan highlight A 12-week B1 course plan modelled on the UTAS *General English 1 Fall AY25-26* outline shared by the user — same skills split (10 hrs/wk Reading & Writing + 8 hrs/wk Listening & Speaking), same outcome codes (`RLO1`–`RLO6`, `WLO1`–`WLO3`, `LLO1`–`LLO3`, `SLO1`–`SLO3`, `GLO1`–`GLO2`, `VLO1`), same assessment split (60% CA / 40% FE). **Week 1** has six fully-fleshed materials: - **Reading** — 390-word B1 passage *"A Day in Maya's Life"* + 6 comprehension questions - **Writing** — `~150-word weekly-routine` task with 5-step planning checklist - **Listening** — 3-minute monologue *"My week at college"* with 5 comprehension items - **Speaking** — 5-minute pair interview with success criteria - **Grammar** — Present simple vs continuous mini-lesson + 8 controlled-practice items - **Vocabulary** — 24 high-frequency items grouped by daily-routines / family / free-time Weeks 2–12 are skeleton rows (date label, unit, focus) ready for the `course_week_materials` agent to fill. --- ## 4. Read-only role smoke test (`e2e_full_scenario.py`) ``` Summary: 46 PASS 0 FAIL 0 SKIP admin 12 pass 0 fail teacher 9 pass 0 fail approver 4 pass 0 fail student 6 pass 0 fail corporate 4 pass 0 fail mastercorporate 4 pass 0 fail agent 3 pass 0 fail developer 4 pass 0 fail ``` ### Highlights per role | Role | What was exercised | Result | |---|---|---| | **admin** | login, profile, AI agents list (LangGraph), tool registry, agent detail, **live LangGraph writing-grader run**, AI prompts library, branding, approval workflows + users, user list, student-performance report | All 200 OK; live LangGraph round-trip 3.3 s; band score returned | | **teacher** | login, profile, course-plan list+detail+materials, courses, exam structures, exam schedules, approval-requests | All 200 OK; reads the GE1 plan + week-1 materials | | **approver** | login, profile, approval-request inbox (`?mine=1`), exam-review queue | All 200 OK; inbox has 1 pending | | **student** | login, profile, my-exams (4), my-courses, **AI coach chat (lms_tutor agent)**, coach tip | All 200 OK | | **corporate** | login, profile, corporate stats report, user list | All 200 OK | | **mastercorporate** | login, profile, multi-entity stats, user list | All 200 OK | | **agent** | login, profile, courses | All 200 OK | | **developer** | login, profile, AI agents introspection, `/api/metrics` | All 200 OK | --- ## 5. Mutation E2E — full approval chain (`e2e_approval_chain.py`) ``` [1] approver login ✓ approver inbox: 1 pending request ✓ target: req_id=2, res_model=encoach.exam.custom, res_id=1 [2] approver approves stage 1 ✓ state remains 'in_progress' (advanced to next stage) ✓ [3] admin login + verify request now in admin's inbox ✓ [4] admin approves the FINAL stage ✓ request state → 'approved' ✓ [5] underlying exam auto-published by the controller ✓ [6] student my-exams still healthy after publish (4 items) ✓ ✓ Approval chain E2E PASSED ``` ### DB-side proof ```sql -- Exam was auto-published by the controller side-effect SELECT id, title, status FROM encoach_exam_custom WHERE id = 1; id | title | status ----+--------------------+----------- 1 | IELTS Mock Q2 2026 | published -- Both stages of the workflow record the approver and the comment SELECT sequence, approver_id, status, comment FROM encoach_approval_stage WHERE workflow_id = 4 ORDER BY sequence; seq | approver_id | status | comment -----+-------------+----------+--------------------------------------------------------- 10 | 13 | approved | Looks fine to me — passing to admin for final sign-off. 20 | 5 | approved | Approved — publishing exam. ``` --- ## 6. LangGraph runtime — live verification Triggered through the public API by the admin smoke test. | Agent | Topology | Round-trip | Outcome | |---|---|---:|---| | `writing_grader` | `simple` | 3.3 s | Returned `overall_band: 5` for a deliberately-flawed sample with `taked → took`. Tool trace empty (correct for `simple`). | | `lms_tutor` (run earlier) | `react` | 13 s | Two real tool calls (`resources.search`, `outcomes.fetch`), then a coherent B1 tip referencing the outcomes registry. | | `course_planner` | `plan_review_revise` | (covered indirectly) | Existing course-plan pipeline now routes through `AgentRuntime` when the feature flag is on. | Both LangGraph topologies (single LLM node and multi-tool ReAct loop) are exercised end-to-end on the live system. --- ## 7. How to reproduce ```bash cd /Users/yamenahmad/projects2026/odoo/odoo19 # 1. Seed (idempotent — safe to re-run) .conda-envs/odoo19/bin/python odoo/odoo-bin shell -c odoo.conf -d encoach_v2 --no-http < seed_full_demo.py # 2. Reset all demo passwords (idempotent) .conda-envs/odoo19/bin/python odoo/odoo-bin shell -c odoo.conf -d encoach_v2 --no-http < reset_demo_passwords.py # 3. Read-only role smoke test python3 e2e_full_scenario.py # 4. Mutation: full approval chain python3 e2e_approval_chain.py ``` --- ## 8. Final tally - **8 user types** seeded and exercised — admin, teacher, approver, student, corporate, mastercorporate, agent, developer - **46 / 46** read-only smoke calls passed - **6 / 6** mutation steps passed in the approval chain - **2 LangGraph topologies** verified live (`simple` 3.3 s, `react` with real tool calls 13 s) - **DB invariants** confirmed via `psql` — exam auto-publish, both approval stages stored with comments - **Idempotency** confirmed — second run of `seed_full_demo.py` created 0 new rows