Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt

Use this file to discover all available pages before exploring further.

Last Updated: 2026-02-24
Purpose: Track missing RLS, unit, integration, and E2E tests for the Clinical (CL) core. Use to prioritize Phase B–D work and manual review (Phase E).
See also: SPEC_TEST_COVERAGE.md (spec–test matrix), TESTING_SETUP_AND_RUN.md, .cursor/rules/testing-completion.mdc.

Summary

CategoryStatusNotes
RLSPartial6 CL tables missing RLS tests (see below). Run npm run check-rls-coverage -- --missing-only to refresh.
UnitPartialSeveral CL specs have unit tests; not all hooks/utils covered.
IntegrationPartialCL-01, CL-02, CL-03, CL-17, CL-21 have workflow tests; others may need coverage.
E2EGapNo dedicated tests/e2e/cl/ Playwright suite; critical flows (consent, progress notes, risk screening) should be added.

Quick Reference

I need to…PatternLocation
Run RLS checknpm run check-rls-coverage -- --missing-onlyRLS: Tables Missing Tests
Run unit auditnpm run test:audit:completenessRefreshing This Document
Add E2E specsCreate tests/e2e/cl/*.spec.tsE2E: Gaps

RLS: Tables Missing Tests

As of the last check-rls-coverage --missing-only run (with cl_ in CORE_PREFIXES):
TableSpec(s)Action
cl_group_attendanceCL-14 (Group Therapy)Add tests/rls/cl/cl-14-group-attendance.rls.test.ts (or cover in existing group-session test)
cl_group_sessionsCL-14Add or extend RLS test for group sessions
cl_outcome_measuresCL-10 (Outcomes Tracking)Add RLS test when implementing
cl_pharmaciesCL-06 (E-Prescribing)Add RLS test
cl_prescriptionsCL-06Add RLS test
cl_program_outcomesCL-10Add RLS test when implementing
CL tables that already have RLS test coverage (via existing tests/rls/cl/*.rls.test.ts or .from() usage):
cl_patient_charts (cl-01), cl_assessments / sections / instruments (cl-02), cl_treatment_plans / goals / interventions / signatures (cl-03), cl_risk_screenings, cl_safety_plans (cl-07), cl_cds_rules / cl_cds_alerts (cl-08), cl_care_teams / cl_transitions (cl-12), cl_pdmp_* (cl-17), cl_moud_* (cl-21), and others covered by the same test files.

Unit: Gaps

  • Covered: CL-01–CL-03 (chart, assessment, treatment plan utils), CL-07 (risk screening), CL-08 (CDS evaluate), CL-09 (lab orders, result parsing, CDS lab monitoring), CL-11 (consent), CL-12 (care coordination), CL-17/CL-21 (via integration), vitals trend, progress note content, export audit, break-glass authorization.
  • Gaps: Other CL specs’ hooks and services (e.g. CL-04 progress notes, CL-05/06 meds/e-prescribing, CL-10 outcomes, CL-11 disclosure log, CL-13 crisis, CL-15 reporting, CL-16 FHIR, CL-18/19 SDOH/peer, CL-20 export, CL-22 vitals) — add unit tests as those areas are implemented or touched.

Integration: Gaps

  • Covered: CL-01 (chart workflow), CL-02 (assessment workflow), CL-03 (treatment plan workflow), CL-17 (PDMP workflow), CL-21 (MOUD workflow).
  • Gaps: CL-04 (progress notes), CL-05/06 (medication/e-prescribing), CL-10–11 (outcomes, consent flows), CL-14 (group therapy), CL-18/19 (SDOH, peer), CL-20 (export), etc. Add integration tests for workflows that cross modules or use Supabase.

E2E: Gaps

  • Current: No tests/e2e/cl/ directory; no Playwright specs tagged for CL-only runs.
  • Recommended: Add E2E for critical CL flows per plan Phase D: consent capture (CL-11), progress note creation (CL-04), risk screening (CL-07), and key dashboards/reporting (CL-15). Create tests/e2e/cl/ and add specs (e.g. consent-capture.spec.ts, progress-note-flow.spec.ts, risk-screening.spec.ts).

Manual Review (Phase E)

After automated tests are in place, a human should:
  1. Confirm test assertions match spec acceptance criteria (no tautological or placeholder assertions).
  2. Spot-check 2–3 CL specs (e.g. CL-11, CL-15, CL-22) against implemented code and tests.
  3. Verify REGULATORY_COMPLIANCE_TRACKER.md (or CL-specific compliance notes) for tests that assert compliance-related behavior (e.g. Part 2, PDMP, incident deadlines).

Refreshing This Document

  1. Run npm run test:audit:completeness and inspect reports for CL.
  2. Run npx tsx scripts/check-rls-coverage.ts --missing-only and update the “RLS: Tables Missing Tests” table.
  3. Update SPEC_TEST_COVERAGE.md CL Core section when adding or changing tests.