Skip to content

Testing

python3 -m unittest discover -s app/tests -v

Unit tests never call paid providers; model calls are replaced with deterministic fakes.

File Covers
test_core.py Source review, releases, revocation, roles, audit chain, encounter epochs and idempotency.
test_case_compiler.py Case hashing, prerequisite validation, pinned-version gate, assessor fields never reaching realizers.
test_gemini_speech.py Pause tags never before negations or numbers, PCM wrapped as WAV, provider selection, Gemini realizer/STT/TTS requests, Sarvam fallback and its off switch, reservations.
test_gating.py Clef request and response shape, adapters need configuration, lexicon-first blocking, model catches, shadow vs enforce, fail-closed and circuit breaker, negatives never generated, routing, verbatim TTS, evaluation set.
test_improviser.py Reported fever phrasings, attribute answers, validator rejections, model fallback, hidden fields never sent, pinning, Sarvam and Gemini Live checks, no evidence credit, review queue.
test_interpreter.py Closed action set, catalogue-bounded facts, injection, client actions discarded, replay, fallback, separate budget.
test_disclosure_policy.py One level per delivery on text, Sarvam and native paths; native depth waits for completed playback.
test_paraphrase_eval.py The 85-question battery targets real facts, counts add up, wrong facts are listed, an interpreter outage counts as an error.
test_consistency.py The suite passes on bundled cases and detects sabotaged disclosure, contradictions, unsupported findings and live number/negation changes; blocked versions are refused.
test_authoring.py Explicit persona dimensions, immutable versions, approval confirmations and record, reviewer-only, approved cases under the enforced gate, bundled files untouched.
test_agreement.py ICC vs Shrout & Fleiss, weighted kappa vs scikit-learn, confusion and sensitivity, cluster bootstrap, blind view, blinding loss, label validation, two-rater report.
test_progress.py Practice score weights, suspension and safety cap, attempt kinds and re-test gap, specialty on every case, tracks and filters, rolling mean without hinted attempts, own-data access, weekly map, cohort specialty filter, debrief bands and citations.
test_dashboards.py Matrix cells are counts with n and sparsity, safety concerns counted, trajectories keep attempt types, drill-down to evidence, reviewer-only.
test_records.py Formative records never exported, retention redaction keeps evidence and is audited, appeal lifecycle and permissions.
test_retrieval.py Deterministic Leitner scheduling, cards unlock only after finishing a case, rescheduling, privacy, separation from attempts.
test_variants.py Variants keep clinical content identical, valid for every case, attempt types, repeats never counted as independent cases, next exercise, end-to-end flow.
test_teaching.py Mode fixed and validated, ladder progression, spoken hint requests, assessment refusal, supported attempts.
test_observers.py Critical rules (pending/met/not met/triggered/exempt), nine cited domains, degraded-audio suspension, no scalar score, semantic claims validated and never upgrading, observer failure.
test_evidence.py Opportunity fields, response windows, clarification, unplayed audio never available, kernel chain with deterministic and uncertain use.
test_lexicon.py Lexicon entries and cues, the paper's example, clarification links, conservative speech-doubt checks on each path.
test_reasoning.py Explicit reasoning controls, differential revision history, past medication never a prescription, review ordering.
test_services.py English/Hindi exam synonyms, granularity rules, unavailable vs ambiguous, compound-order confirmation, examiner channel on every path.
test_attendant.py Attendant compile rules, once-only interjections, interrupt/after/turn modes, direct answers, attribution, attendant voice, native playback deferral.
test_languages.py Every dropdown language has a profile, provider codes, per-language prompts on both paths, wrong-script flags, cached opening.
test_speech_plan.py Plan distribution targets, latency classes, neutral condition, guard rejects each violation and accepts faithful disfluency, segmented speech with real silences, Live delivery, session statistics.
test_prosody.py Reversible pauses never touching negations or numbers, per-turn variation within range, voice validation, emotion on both speech paths.
test_conditions.py Condition assignment, neutral audio strips only expression, text has no audio, latency marks and per-stage report, baselines on identical probes.
test_workflows.py Stage gating (absent patient), required reasoning before advancing, separate per-stage reviews, palliative closure without agreement.
test_personas.py Paper persona profiles, suggested language, caregiver interruption with a different concern, protected dialect negation, Bengali on both speech paths.
test_patient_voice.py Colloquial patient speech, review flags, faculty review gate.
test_voice.py Sarvam path budgets, ownership, fact gating, stale turns.
test_native.py Gemini Live prompt, fact gate, played-audio disclosure, connection caps.
test_docs_site.py Docs phrase sessions, cookie flow, path traversal, docs token rejected by the API.
test_history.py, test_access.py, test_budget.py, test_evaluation.py Review history, access codes, INR budgets, reporting.

CI (.github/workflows/tests.yml) runs the unit tests and the deterministic consistency suite on every push and pull request.

Live smoke scripts (*_smoke.py) call real providers and need keys; run them manually.

Docs

python3 -m pip install -r docs/requirements.txt
mkdocs serve            # http://127.0.0.1:8000
mkdocs build --strict   # what CI runs