pediatric-ai-scribe-v3/src/routes
Daniel b23cb3300e Collation-drift guard + lookup-miss visibility
Root cause of recent "invalid credentials on correct password" was
a silent btree index corruption: pgvector/pgvector:pg16 was pulled
with a different ICU library than the one used to build existing
indexes. Queries returned 0 rows even though matching heap rows
existed. Postgres logged nothing (corrupt index → empty result set
is a "successful" query) and the login path never logged unknown-
user attempts (enumeration protection).

Three defenses:

  1. Pin postgres image by digest in docker-compose.yml so a
     silent pull can't change ICU under our feet.
  2. Startup collation-drift check in src/db/database.js:
     compares pg_database.datcollversion to the library's actual
     version and, on mismatch, runs REINDEX DATABASE + ALTER
     DATABASE REFRESH COLLATION VERSION. Logs "Collation versions:
     aligned" on clean boot.
  3. Server-side console.warn on login lookup-miss (no email, no
     audit row — preserves enumeration protection but gives
     Grafana/Loki a signal for unusual miss rates).
2026-04-14 03:52:29 +02:00
..
admin.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
adminConfig.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
adminMilestones.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
audioBackups.js Security hardening: PHI encryption, argon2, DOMPurify, SRI 2026-04-14 02:49:38 +02:00
auth.js Collation-drift guard + lookup-miss visibility 2026-04-14 03:52:29 +02:00
billing.js Security hardening: low-risk easy wins 2026-04-14 02:42:32 +02:00
chartReview.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
documents.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
encounters.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
hospitalCourse.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
hpi.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
learningAdmin.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
learningAI.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
learningHub.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
logs.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
memories.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
milestones.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
nextcloud.js Security hardening: PHI encryption, argon2, DOMPurify, SRI 2026-04-14 02:49:38 +02:00
oidc.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
refine.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
sessions.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
sickVisit.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
soap.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
transcribe.js v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00
tts.js v6.2: Session management, password change, audit logging, refine context, UI fixes 2026-04-08 20:27:45 +02:00
userPreferences.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00
wellVisit.js Stop leaking e.message to clients across all routes 2026-04-14 03:04:24 +02:00