Conversation
Three readers streamed one patient through the model with their own copy of the same PackedLaneSampler loop. It now lives once in odyssey/inference/patient_stream.py (stream_patient, risk_within), and case_study and counterfactual use it. Behaviour is unchanged: the existing case-study and counterfactual tests pass unmodified. Also added, each with tests: - extract_patient_case reports risk at 8/24/72 h (event_risk_by_horizon); event_risk_24h is kept for the report that reads it. - ordered_sequence_rows: the exact row order build_patient_sequence tokenizes, so a position maps back to its raw row. - load_meds_subject: one subject from one shard, filter pushed into the scan. - code_metadata.load_code_descriptions, split out of steering so readers can name codes without importing steering. - occlude_codes: target-agnostic occlusion with a progress callback; occlusion_attribution is now a thin wrapper, plus event_occlusion_attribution for an event's risk. - concept_display_name moves from make_readout_table into concepts. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zuuVqnBfTsozfaj5F4y3r
A web app that replays one admission and shows, moment by moment, the model's risk of ICU admission, vasopressors, AKI, Sepsis-3 and death against an alert line, what it thinks is going on, what it expects next, what-if value edits, occlusion evidence, and a scorecard against the tuned GBM. Runbook: docs/clinician_demo.md. - Standard library HTTP only (the GPU host's environment is pinned); loopback bind, Host allowlist, custom API header, no CORS, no-store, same-origin CSP, static path containment. - Two data modes: credentialed (held-out MIMIC-IV) and open (MIMIC-IV Clinical Database Demo). Every chart says whether the model trained on that patient. - Honest by construction: the gallery shows misses and false alarms with their rates; lead time counts from the alert episode still on at the event; risk is hidden after onset; readmission, steering, label overrides and rollouts are never shown (a test enforces the imports). - Vanilla ES modules, no build step, no third-party JS. - 200+ CPU tests on synthetic data: every module, server security over a real socket, and spies proving the run's chunk_size reaches every model call. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zuuVqnBfTsozfaj5F4y3r
for more information, see https://pre-commit.ci
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #250 +/- ##
==========================================
+ Coverage 89.98% 90.08% +0.10%
==========================================
Files 69 71 +2
Lines 10771 10835 +64
==========================================
+ Hits 9692 9761 +69
+ Misses 1079 1074 -5
🚀 New features to boost your workflow:
|
- server: static files are served from a map built once at startup (static_files); a request is a dictionary lookup, so no filesystem path is ever built from request data. Clears the three CodeQL "uncontrolled data used in path expression" alerts. Symlinks out of the root and non-allowlisted extensions are still excluded, now at map-build time; tests cover both. - showcase: rename the `_thr` column and `thr` test argument, which the typos hook reads as "the". - pre-commit: no hook rewrites scripts/gemini/out/ (pre-commit.ci's end-of-file fixer had edited 12 verbatim GEMINI exports on this PR), and mypy/typos skip the two cohort producers committed verbatim as they ran. pyproject's mypy exclude never applied to them because pre-commit passes files by name; this is why main's code check has failed since 0de877f. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zuuVqnBfTsozfaj5F4y3r
This reverts commit 8348226, which added a trailing newline to 12 files under scripts/gemini/out/evals/. Those files are GEMINI's exported reports, kept byte-for-byte; the previous commit stops the hooks from touching them again. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zuuVqnBfTsozfaj5F4y3r
Front end only; the API and Python are unchanged.
- Light theme by default, dark via a footer toggle. One accent colour;
event colours only on lines and dots.
- Replay: patient one-liner, sticky "now" bar (play, scrub, clock time),
five risk tiles with a status word (Low / Watch / Alert on / Happened)
and "n× the average patient", then the chart, what happened in the
stay, what the model believes now, and the what-if / evidence tools.
- The chart fades everything after "now".
- Alert stories are composed client-side in clock time ("Began Day 1,
22:53. The alert had been on since Day 1, 01:16: 22 h of warning").
- The 29-row concept strip, alert-line statistics and next-token list
sit behind disclosures; model name and checkpoint move to the footer.
- Gallery cards carry one key line; the full admission list is a
collapsed per-patient list with a note on how many were in training.
- Scorecard cells show one number per model, intervals on hover.
- Fix: class display rules overrode the browser's [hidden] rule, so the
search box showed in open mode and "Alert on now" showed on every row.
- Runbook: static files can be copied over a running deployment.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QebToqtFMVakRkx3PhF3ZX
amrit110
added a commit
that referenced
this pull request
Sep 14, 2026
- check-docstring-first read the module-level attribute docstrings in the new target module and probe script as second module docstrings; they are comments now. - pre-commit.ci's autofix had rewritten 12 scripts/gemini/out/ JSONs (trailing newlines) on this branch, the same way it did on PR #250. This carries PR #250's hook config over: scripts/gemini/out/ is excluded from every hook, and mypy/typos skip the two cohort producers committed verbatim, which is also what has been failing main's code check. The 12 exports are byte-identical to main again. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01StsjDmueuDqVNNuVoCEF1P
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A clinician-facing web app for the MIMIC-IV flagship model (
full_run_v10). It replays one admission and shows, moment by moment:Runbook:
docs/clinician_demo.md.Commits
odyssey/). The loop copied incase_studyandcounterfactualnow lives once inodyssey/inference/patient_stream.py. Also addsordered_sequence_rows,load_meds_subject,code_metadata.load_code_descriptions, a target-agnosticocclude_codes, and movesconcept_display_nameintoconcepts. Behaviour is unchanged: the existing tests pass unmodified.apps/clinician_demo/), with its tests (tests/apps/) and the runbook.pyproject.tomlonly addsappsto coverage.Design notes
Hostallowlist, a requiredX-Odyssey-Demoheader, no CORS,Cache-Control: no-store, same-origin CSP, static files from an allowlisted directory with path containment.credentialedserves held-out MIMIC-IV and is for PhysioNet-credentialed viewers only.openserves the MIMIC-IV Clinical Database Demo. 90 of those 100 patients were in the model's training split, and every chart says so.Test plan
odyssey scripts apps.chunk_sizereaches every model call. The trace equalsscore_record_atat every bundle end.CI fixes (commits 3 and 4)
ab3368b):thris renamed tothreshold, since the typos hook read it as "the".scripts/gemini/out/.pyproject.tomlexcludes them from mypy, but pre-commit passes files by name, which bypasses that exclude. This is also whymain's code check has failed since0de877f. Merging this fixesmaintoo.35b5e9a). The bot added a trailing newline to 12 verbatim GEMINI exports on this branch. They are byte-identical tomainagain.Caveats
~/odyssey_demo, not frommain. After merge it can move to the normalgit resetpath.🤖 Generated with Claude Code
https://claude.ai/code/session_012zuuVqnBfTsozfaj5F4y3r