Skip to content

Formative review

app/observers.py produces the end-of-encounter review from events and evidence records. It replaces the earlier keyword feedback.

Nine anchor domains

History, problem representation, differential and revision, examination planning, investigations, management, communication, documentation and closure. Each carries a draft faculty anchor (pending review) and one of these states:

State Meaning
evidenced Countable behaviour meets the anchor (for example a differential revised after new information)
partially_evidenced Some behaviour, or behaviour whose quality needs semantic or faculty review
not_yet_evidenced Nothing in the delivered record
suspended Communication and closure when 30% or more of voice turns had unconfirmed audio or unreliable transcripts
safety_concern Management, when an authored unsafe action was recorded

Every non-empty claim cites event sequences. No scalar, overall or numeric score is produced.

Teaching mode and assistance

The learner chooses the mode before starting (practice_start / demo_start take mode: assessment | teaching; assessment is the default) and it cannot change mid-encounter.

  • Teaching: the Ask for a hint control, or a spoken/typed hint request, climbs one rung of the ladder per request: a broad prompt (authored teaching hint), a specific hint (the kernel's follow-up) and a worked example (clue → follow-up → what it unlocks). The last rung repeats.
  • Assessment: hints are refused and nothing steers the learner.
  • Every hint is a hint event with assistance: {level}. The review reports assistance and attempt_type: supported | independent; supported attempts are never counted as independent practice (#16).

Variants, next exercise and attempt accounting

app/encounter/variants.py:

  • Variants (practice_start with variant_seed) change surface features only: age (within adult or child range), locality, and the patient's Sarvam and Gemini voices (same gender, still distinct from any attendant). Truth, facts, kernel, exams, orders and rules are identical, so the hash changes but the clinical case does not. The opening wording is not yet varied.
  • Next exercise after every encounter: a hint-free variant in assessment mode when the attempt was supported, a critical step was missed or the kernel was not used; otherwise a new case from the same cohort.
  • Attempt types: supported (teaching mode or any hint), repeated (same case and variant already attempted independently), independent. Progress shows independent cases, supported attempts and repeats separately; repeating a case never adds an independent case.

Spaced retrieval

app/retrieval.py builds question/answer cards from authored case content (the diagnostic kernel and critical-action rules) once a learner has finished that case, so cards never spoil an unattempted case. Scheduling is a deterministic Leitner ladder (1, 3, 7, 16, 35 days): recalled climbs a box, forgot returns to the first. Cards are private retrieval_card objects with their own history; they never count as encounters or attempts. The Spaced review section in practice history shows due cards (retrieval_due, retrieval_answer). Recalling a fact is not evidence of eliciting it in a consultation.

Critical-action rules

Delhi cases carry critical_rules derived from their authored actions and unsafe lists (draft, pending faculty review): required (met / not met at the end / pending) and unsafe (triggered / not triggered). Matching is deterministic: delivered facts, released exam or order items, and keywords in prescriptions or plans; unless_facts exempts an action once a prerequisite is known (primaquine after G6PD status).

Semantic observer

/api/session_feedback asks Gemini for claims tagged with a domain. Claims without reliable evidence citations, or with an unknown domain, are rejected. Accepted claims are attached to their domain as semantic_claims with review_required; they never change a deterministic state and are dropped for suspended domains. If the model fails, the deterministic review is returned unchanged and the event stream is untouched.