Custody Lens
Live prototype · Narrated demonstration · One-page project brief · Source and tests
Inspiration and intended users
Laboratory operations teams need to inspect unusual handling records without hiding the evidence or uncertainty behind a single authoritative-looking score. Custody Lens explores that problem using transit time, queue time and missing custody scans. It is an operations research prototype for review workflows, not a diagnostic tool or a system for approving or rejecting specimens.
What it does
Users import a JSON dataset containing reference journeys and candidate records. A local, route-specific three-nearest-neighbor model fits the reference, scores candidates, and exposes the nearest examples behind each score. A reviewer can inspect a record, add a note, and export the reference data, model results and notes as a portable research packet.
The example has twenty synthetic reference records and four candidates. Two show unusual patterns, one is within the fitted range, and one stays unscored because its route lacks enough reference examples. These are demonstrations of software behavior, not clinical accuracy measurements.
AI/ML implementation
The model uses three numeric features, robust median-absolute-deviation scaling with an explicit floor, and a per-route leave-one-out 95th-percentile reference-distance threshold. Candidate scores average the distances to the three nearest reference examples. Each route requires at least eight reference records. Unknown routes do not borrow a different route's baseline. Constant data is handled without division by zero.
This is unsupervised distance-based anomaly detection. There is no hosted inference requirement for this new interface: the model and data processing run in browser JavaScript. Reference selection, sample size and distribution shifts can materially change its results.
Privacy and human review
Only the record identifier, route and three numeric features are retained from imports. Other fields are dropped. This is not complete de-identification: identifiers, routes and reviewer notes can still contain sensitive information, so users must not import identifiable patient data. Files are processed locally and notes stay in the current browser tab until export. The prototype is not an authenticated, tamper-evident audit system. No clinical action is triggered.
What is new for UnivaBio
This adapts my existing MED-BLACKBOX project, whose original source includes a Splunk-native workflow and a hosted-model agent. That prior work is preserved and disclosed; its integrations are not presented as newly built or as running in this browser demo.
New work completed September 11, 2026 for UnivaBio includes the local kNN model, separate route references, strict JSON validation, candidate evidence inspector, annotated review-packet export, responsive interface, tests, PDF brief and demo. The new implementation lives in custody-lens/; the original history and MIT attribution remain intact.
Challenges and checks
The main design challenge was keeping an unusual-distance result separate from a clinical conclusion. Unsupported routes stay unscored, nearest examples are inspectable, and the UI repeatedly states the limits. Four model tests pass, covering unusual examples, route isolation, constant reference data, invalid numeric values, duplicate IDs and unknown-field removal. Browser checks verify selection, malformed imports, JSON export and mobile layout. The one-page PDF and recorded demo are available above.
AI assistance and next steps
OpenAI Codex assisted with implementation, tests and documentation. Google Cloud Chirp 3 HD generated narration over an actual screen recording. Next steps are qualified laboratory-operations review, consented and governed evaluation data, and prospective measurement of false positives and missed patterns. No hospital deployment, patient benefit, clinical validation or guaranteed specimen quality is claimed.
Built With
- css
- google-cloud-text-to-speech
- html
- javascript
- k-nearest-neighbors
- node.js
- openai-codex
- playwright

Log in or sign up for Devpost to join the conversation.