Repository navigation
Retry reports after privacy-review outages and retire stale model output - #1700
Merged
elkimek merged 4 commits intoNov 2, 2026
Merged
Conversation
A report whose privacy review could not run, or was cancelled after the local privacy model failed (or while a configured model is unreachable), was recorded as an explicit skip, so the auto-import source never offered it again. Report it as failed instead so it is retried on a later check. Other review callers are unchanged: the new result is opt-in.
Contributor
[Medium impact] The PR appears safe to merge; no new actionable issues remain. SummaryKeeps auto-imported reports eligible for retry when privacy review is unavailable.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Batch privacy review] --> B{Review outcome}
B -->|Unavailable| C[Report failed]
C --> D[Offer report on a later feed check]
B -->|Deliberate cancel| E[Report skipped]
E --> F[Mark report handled]
B -->|Approved text| G[Analyze and preview report]
Reviews (4) · Last reviewed commit: "Merge main and harden privacy-outage ret..." · Reviewed by Greptile |
A stream aborted for the regex fallback could reject later with a plain Error (the reachability probe rewraps the abort), which marked the local model as failed again and turned an explicit cancel into a retry. Ignore results from a stream that was aborted or replaced. Add tests through the real handleBatchPDFs path: an unavailable review and a cancel while the configured local model is unreachable report 'failed'; ordinary cancels report 'skipped'.
Contributor
Author
Owner
|
Hey, thanks, will look into this later but I don't have the issue at least with my Czech lab reports so it might be language problem. |
Owner
|
Thanks for the contribution! |
elkimek
added a commit
that referenced
this pull request
Nov 3, 2026
#1711) * Keep every dated medication course visible in supplement AI context The supplements section of the AI context capped compact mode at 12 products (24 in detail), ranked active records first, and summarised the rest as an unnamed '+N more therapy records' line: the 'Other stored therapy records' list was diffed against the pre-cap set, so it was empty whenever the inventory itself was the input. A medication stopped before the latest blood draw lost to any current supplement, and the model received neither its name nor its dates. Users who log each dose change as a separate record (common for titrated medications) lose exactly the course that explains their lab history, and the model then fills the gap with invented dates. - Fill the character budget instead of a fixed product cap (cap kept as a safety net: 40 compact / 60 detail). - Rank records named in the question first, then medications before supplements; within each, current before lab-range overlapping before unrelated. - List every record without full detail by name, type, status and date ranges. - Match named records case/diacritic-insensitively with a leading-word stem, including genericName and brand, so inflected mentions open detail mode; add folded Slovak/Czech therapy vocabulary. - Add a completeness rule: never fill a therapy timeline gap by assumption. - Report 'N of M records detailed' in the chat context receipt. Fixes #1710 * Keep report privacy replacements consistent and synchronize review panes (#1699) * Make privacy redaction consistent and sync the review panes Regex redaction before the analysis model now uses keyed, deterministic replacements (HMAC-SHA256 with a random per-profile key), so a value maps to the same replacement on every page and in every report of a profile: - Patient names are removed ([PATIENT]) in every written form ("Last, First", "First M Last", upper case), detected from labels, header layouts before DOB, and the profile name when it is a full name. - Dates of birth keep the real year; only month/day are replaced, the same way everywhere (including the profile DOB in any format). Age is left unchanged so age-based analysis stays correct. - IDs are format-preserving; physicians, addresses, cities/ZIPs, phones and emails get neutral keyed placeholders instead of random Czech data. - Labeled values stop at the next column/label, so labels such as "Patient Report" or "Specimen Details" are never treated as values and neighbouring fields on the same line survive. - The local-model path pre-redacts deterministically first, so repeated identifiers stay consistent there too. The Review & Edit panes now scroll together (vertical and horizontal), following the textarea, diff preview, or pane itself, with echo suppression to avoid feedback loops. * Skip profile labels as patient names and create the pseudonym key lazily * Expect the regex fallback to redact the patient name instead of faking one * Close redaction gaps from review and keep pre-pass replacements stable - Accept English name labels without a colon (full names only, at line or column start) and lowercase full names behind explicit labels - Replace uppercase month DOBs and keep their case - Replace letters-only and dotted labeled IDs; route labeled birth numbers through the birth-number replacement - Keep labeled phone matches within one field and stop treating pH as a phone label - Keep the deterministic pre-pass replacements in the final pass and send the finalized text from streaming review * Keep the obfuscatePDFText return shape compatible for review callers * Keep empty ID labels from consuming the next line * Redact titled physician names after a label without a colon * fix: redact odd DOB formats and spaced Czech addresses; keep result flags and compact collection dates * fix: keep DOB labels on one line, narrow result-flag and compact-date exceptions * fix: keep result-flag surnames only after a measured value, compact dates only beside their label - A surname like Low is kept only when it trails a number on a result line with a unit, never right after a label (Surname: Low Age: 27). - An 8-digit date is kept only when it sits directly beside a collection or report label, so a later Order: number on the same line is still redacted. - Regression tests use the exact review examples. * fix: keep every given name after the comma in Last, First Middle names Patient and physician names written as "Smith, Jane Anne Marie" kept only the first middle name, so "Marie" survived. All given names after the comma are now kept, and each middle name or its initial can appear in any written form of the name. * Add Slovak privacy aliases and recognize Slovak report fields * Fix privacy alias collisions and preserve labeled birth-date copies --------- Co-authored-by: bhargavmehta01 <bhargavmehta01@users.noreply.github.com> Co-authored-by: bhargavmehta01 <16927944+bhargavmehta01@users.noreply.github.com> Co-authored-by: Elkim <36666630+elkimek@users.noreply.github.com> * Retry reports after privacy-review outages and retire stale model output (#1700) * Retry auto-imported reports when the local privacy model is unavailable A report whose privacy review could not run, or was cancelled after the local privacy model failed (or while a configured model is unreachable), was recorded as an explicit skip, so the auto-import source never offered it again. Report it as failed instead so it is retried on a later check. Other review callers are unchanged: the new result is opt-in. * Ignore stale privacy streams and cover batch retry outcomes A stream aborted for the regex fallback could reject later with a plain Error (the reachability probe rewraps the abort), which marked the local model as failed again and turned an explicit cancel into a retry. Ignore results from a stream that was aborted or replaced. Add tests through the real handleBatchPDFs path: an unavailable review and a cancel while the configured local model is unreachable report 'failed'; ordinary cancels report 'skipped'. --------- Co-authored-by: bhargavmehta01 <bhargavmehta01@users.noreply.github.com> Co-authored-by: bhargavmehta01 <16927944+bhargavmehta01@users.noreply.github.com> Co-authored-by: Elkim <36666630+elkimek@users.noreply.github.com> * Add medication-aware demos and proportionate chat safety * Bound therapy context by actual coverage and align browser fixtures * Select demo refresh behavior tests in affected CI plans * Preserve specimen duration and volume during privacy redaction * Cache demo treatment data and refresh affected test fixtures * Stabilize owned chat fixtures and retain wellness prompt contracts * Cancel dashboard auto-open before discussion fixture setup * Enable paused AI before asserting the shipping chat composer * Wait for the delayed profile write before replacing its view * Persist native conversation fixtures before testing chat controls --------- Co-authored-by: Bhargav Mehta <bhargav.mehta01@gmail.com> Co-authored-by: bhargavmehta01 <bhargavmehta01@users.noreply.github.com> Co-authored-by: bhargavmehta01 <16927944+bhargavmehta01@users.noreply.github.com> Co-authored-by: Elkim <36666630+elkimek@users.noreply.github.com>
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.
A report cancelled after an unavailable privacy review must remain eligible for a later auto-import feed check. Previously, the batch outcome was
skipped, so the feed permanently remembered the report as handled.Batch review now opts into a distinct unavailable result for review-loading failure or cancellation after an unrecovered local-model failure. Cancellation while a configured local privacy model is unreachable also reports failure. Ordinary cancellation still skips deliberately; a successful stream retry or an explicit Regex replacement clears the failed-stream state. Other review callers keep their existing cancellation contract.
The review controller also retires every callback from replaced, stopped, completed, or closed attempts, including queued animation frames, text, thinking, completion, and error callbacks. A delayed model response can no longer overwrite a selected Regex result or a newer retry. Integration with current main preserves report-local aliases, clinical text, scroll synchronization, and the finalized privacy payload used by Send.
Validation on Node 24 / TypeScript 7:
The fixtures are synthetic and deterministic. They verify application lifecycle and bookkeeping rather than a particular local model's extraction accuracy. Exhaustive browser and combined-coverage matrices remain owned by GitHub Actions; no assertions, safety settings, or budgets were relaxed.
Contracts and the generated module map are updated. Public documentation companion: elkimek/getbased-docs#27 (draft until this application change is merged).
Fresh CI on
894a618f: Tests workflow passed, including 3,322 affected unit tests in 139 suites, selected legacy checks, 110 shipping Chromium tests across four shards, and the finaltestgate. CodeQL and sync scope checks passed. Greptile reviewed this exact commit with 5/5 confidence and no actionable findings; all review threads are resolved.CI used the repository's affected-test policy. The optional full-regression, real-model, combined-coverage, and separate performance lanes were not requested; the shipping resource-budget checks did run and pass.