Appearance
SDD-007 — Global Learner Orchestration & Model Growth Control
Nguyên tắc: Store everything, model only what matters, load only what is relevant, optimize globally.
text
Infinite History → Compact Current Model → Small Relevant Context → Globally Optimized DecisionInvariants: Raw History ≠ Learner Model · Learner Model ≠ Runtime Context · School Recommendation ≠ Final Recommendation · School Workload ≠ Learner Capacity · Canonical Skill ≠ School-specific duplicate.
2. High-Level
Schools (Turtle…Ray) → Evidence Layer → {Evidence Store, Event Store} → Learner Engine → Canonical Learner Model → {Context, Goals, Workload Engines} → Global Learner Orchestrator → school Assessment/Learning/Recommendation Engines (chỉ tạo candidates) → Final Action Plan.
3–4. Data Separation & Model Growth (REQ-INT-10)
- Evidence Store: immutable observations
{evidence_id, learner_id, skill_id, source, value, reliability, school_id, occurred_at}. - Event Store: những gì đã xảy ra (audit, analytics, rebuild state) — không dùng trực tiếp làm AI context.
- Learner Model: chỉ computed state (
skill_states, capability_states, stable_preferences, learning_patterns, active_goals_summary, model_metadata); 20.000 câu trả lời → Evidence Store; model chỉ giữLinear Equations: mastery 0.78, confidence 0.91. - Hard constraints: no raw events, no full conversation history, no complete assessment history, no duplicated school skill state, no expired context. Historical → summaries có provenance ("responds well to worked examples; difficulty with multi-step algebra") truy ngược được evidence gốc.
5. Shared Canonical Skill Graph (REQ-SCH-02)
Skill canonical (vd ALG.LINEAR_EQUATION.SOLVE) — một mastery state duy nhất; school thêm context: Turtle expected difficulty 2, Shark 5, SAT exam_application. Cấm turtle_linear_equation / shark_linear_equation / sat_linear_equation (fix fragmentation RISK-003, RISK-019).
6–7. Context Projection & Context Builder (REQ-INT-07)
Context tạo theo task: Goal + Relevant Skills + Recent Evidence + Workload + Constraints + Relevant History. Mỗi Engine khai báo Context Contract (max_skills, recent_evidence_days, include_active_goal, include_parent_model…). Context Builder Service là gateway bắt buộc trước khi AI chạm learner data: Retrieve → Filter → Rank relevance → Summarize → Enforce token budget → Return. Cấm LLM query learner DB tùy ý (QG-010).
8. Global Workload Model (REQ-INT-08)
{available_time, committed_time, deadlines, active_programs, cognitive_load, recent_load, fatigue, capacity} — dùng chung mọi school. Mỗi recommendation khai estimated_minutes, cognitive_load, deadline, frequency, priority. Demand 17h/capacity 10h → phải resolve, không đưa cả ba.
9. Global Learner Orchestrator (REQ-INT-09, REQ-LRN-06)
School engines sinh CandidateRecommendation[];
text
GlobalPriority = GoalValue × Urgency × ExpectedImpact × DependencyImportance × Confidence
÷ (TimeCost × CognitiveCost)
constraint: TotalAllocatedTime ≤ LearnerCapacity
→ GlobalLearningPlan (vd: Fix Fractions 3h · SAT Mock 2h · IELTS Reading 3h · Shark Geometry defer)10. Conflict Resolution
Conflict Detector: Time (quá capacity) · Goal (tranh thời gian) · Pedagogical (A bảo tiến, B bảo còn prerequisite gap) · Duplicate work (merge activity) · Deadline (SAT 7 ngày > goal 6 tháng).
12. Recency & Decay (REQ-INT-12)
effective_confidence = stored_confidence × recency_factor; context TTL: tired_today ~ hours, exam_next_week ~ days, active_course ~ months. "Struggled with fractions Grade 6" không được chi phối Grade 10 khi evidence mới đã supersede.
13. Incremental Recalculation
Evidence mới → chỉ recompute skill đó + dependent nodes + aggregates + affected recommendations (dependency graph). Heavy recompute qua Queue/Workflow.
14–15. Storage & Caching
D1: learner_skill_state, learner_goals, enrollments, workload_commitments, model_versions, context_metadata, recommendations. R2: snapshots, archived reports, bulky AI outputs. Queues: EvidenceRecorded, ModelUpdateRequested, RecommendationInvalidated, WorkloadChanged. Workflows: full recalculation, semester transition, goal replanning, cross-school schedule. Cache (KV): CurrentLearnerSummary/Plan/Workload/ActiveGoals — invalidate bằng domain events; cache không phải source of truth.
16. Versioning
Model: {model_version, algorithm_version, generated_at, evidence_cutoff}; recommendation lưu {learner_model_version, context_version, algorithm_version} → giải thích được "vì sao ngày 12/08 khuyên vậy".
17. Failure Isolation
Orchestrator lỗi → learner tiếp tục activity, portal sống, model không mất, recommendation trì hoãn. Một school lỗi → school khác không block. Context generation lỗi → fallback deterministic compact context. Orchestrator không là hard dependency của page load.
Trace
REQ-INT-07 → §6-7 · REQ-INT-08 → §8 · REQ-INT-09 → §9-10 · REQ-INT-10 → §3-4, §13 · REQ-INT-12 → §12 · REQ-SCH-02 → §5 · REQ-LRN-06 → §5, §9.