# HealthTrack v2 candidate ## Approved web-focused2.1.0 extension — Nov2,2026 The current candidate combines [web clinical/scan completion](WEB-COMPLETION.md) with the earlier fidelity and everyday-workflow improvements. The corrected application code retains its full local test-suite proof. The separate pinned migration build rule has focused byte/CLI/synthetic-ledger checks; retained workflow evidence keeps its original scope. See the [release notes](RELEASE-NOTES-2.1.md) and [candidate checklist](RELEASE-CHECKLIST.md) for current verification and limits. Oura, corrected final images/architecture/recovery and publication remain pending. Physical Android acceptance is deferred and unverified outside this web release; no public APK is included. Dated records below are historical evidence, not a live service status feed or acceptance of a different binary. This describes the v2 working tree and operator checks before release. Deployment entries record the observed instance revision at the stated time; they are not a live status feed. Publication, image promotion and live upgrades remain separate actions. ## Everyday use and data trust ### Approved release closure extension — 2026-10-29 The maintainer approved release-closure proposal 2: finish this candidate's install, profile, import/correction, data/access and release gates, preserving dated accepted slices. Reconcile GitHub #1/#2/#6/#15 and compare PR #8/#13/#14 against the candidate before selecting changes (#14 is stacked on #13). Translation #5, advanced causal analytics, exact tape sessions and exercise-history merging remain excluded. AC-01..08 and AC-AI identifiers trace these approved outcomes; this document remains product scope/evidence authority. **AC-AI / AC-AI-SEC:** each account chooses direct Anthropic, OpenAI or Gemini, submits its own API key to the authenticated server, discovers/refreshes compatible models, selects a primary and optional extraction model, explicitly tests and saves. Use existing server-controlled encryption; keys are write-only after submission, absent from logs, browser storage, ordinary exports and errors, and inaccessible to other users/delegates. Fixed official endpoints only; no custom URLs, local/enterprise variants or subscription sign-in. Saved app settings take effect on subsequent requests without restart and survive container recreation with the data volume. Key replacement/removal and stale in-flight configuration/results must be guarded. No silent provider, model or legacy-key fallback. Legacy environment migration is explicit and admin-only. All summaries, queries, interactions and lab/vaccine/history extraction must resolve the actor's configuration, retain patient authorization, validation, review-before-write and provider/model/configuration provenance. Old cached answers must be distinguishable and never automatically reused under a different configuration. Saving alone sends no clinical data. Explain provider data transfer and possible test charges; sanitize auth, model, quota, network and malformed-output errors. Local mocked/disposable proof cannot establish real-provider accuracy or physical-phone acceptance. Synthetic text and supported document calls for each provider require separate authorization. All seven existing Android acceptance groups, owner Oura consent, final exact-source/image tests and upgrade/compatible-restore evidence, advertised architecture execution and public-candidate privacy review remain release gates. Prepare consistent CHANGELOG/README/upgrade/release-draft notes. No paid calls, phone control, production writes, live maintenance, deployment, push/merge/tag/release or registry effects are authorized by this extension alone. One read-only final exact-candidate reviewer is authorized; no additional agents/chats/lanes. Initial implementation checkpoint: existing single-provider environment-key paths and silent model fallback have been located; AC-AI remains unfinished. ### Account AI and release-closure candidate (2.0.0-rc.6) The local candidate adds [account AI setup](AI.md), fixed direct-provider adapters, encrypted write-only credentials, explicit model discovery/testing and configuration-bound query/summary/interaction/document results. Saving settings makes no provider request. This has not been deployed or published. Standalone vaccine extraction now uses saved reconciliation; unknown dates remain in review. Model output cannot silently become an interaction all-clear. PR #13/#14's applicable trust/scoping protections are selected and renumbered into additive migration `0016`, retaining v2's authorized dependent queries. Legacy pooled output is retained but withheld from current results. Better Auth is locally patched from 1.6.23 to 1.7.7. Focused authentication, idle-policy, encrypted-settings and request-boundary fixtures pass; actual provider accuracy, full phone acceptance and public release remain pending. The dependency audit reports no high/critical findings after this patch; four moderate Drizzle tooling findings remain. Exact final workflow/image evidence and issue/PR dispositions belong in the release checkpoint before approval. ### Website-first Android update (2.0.0-rc.5 / APK 0.1.1) The Android app now launches the website directly, using its existing mobile navigation and online controls. Native screens are limited to phone setup/sync and saved offline summaries, with validated return navigation and app-icon shortcuts. The duplicate native Home/tab bar and Android-only browser-handoff interstitials are removed. Browser sign-in does not require phone enrollment. The signed APK is installed on the spare Android 14 phone. Full repository tests, production build, Android tests/build/signature checks, synthetic mobile browser flows and 12 physical-phone navigation checks passed. The separately authorized private Unraid rollout completed on 2026-10-26 at 17:38 UTC, source `48f99c8e32fbece39e6533ee4e079fdeb72cf165`. Exact Linux-image smoke tests, fresh stopped backup, isolated candidate restart and matching rc.4 restore passed with all 55 tables and existing native state preserved. Both bridges resumed unchanged; the independent live audit passed 39/39 checks. This is not a registry or GitHub publication. See [current Android acceptance](ANDROID-ACCEPTANCE.md#website-first-update--2026-10-26) for scope, artifact identity and remaining enrollment/offline acceptance gates. The subsequent live-phone Doctor round trip passed, but reopening exposed a pre-existing per-document idle timer that could sign out an active session from an older background TWA. Corrective source `9290c6b1c2b358e69c417a181c8af719bbeab9b6` deployed on 2026-10-26 at 18:50 UTC. It coordinates activity across pages for the same login while retaining the 15-minute inactivity rule. Full tests, production build, a two-page browser regression, fresh snapshot/restore rehearsals and the 39-check live audit passed. See [post-deployment findings](ANDROID-ACCEPTANCE.md#post-deployment-phone-check-and-inactivity-correction). The corrective phone retest passed 13 checks, including visible Settings and Doctor navigation and signed-in warm reopening; the spare remained unpaired. ### Private Android companion server (2.0.0-rc.4) The separately authorized Unraid rollout completed on 2026-10-25 at 18:59 UTC, running source `e2551523bac67ec4397c0c21b73435d587d1d0ab`. The server supports owner-approved phone pairing, native Health Connect delivery and selected offline Doctor Essentials. The signed APK is a separate private artifact; physical-phone acceptance remains outstanding. Existing online clinical editing and bulk administration remain in the browser. The fresh stopped backup, isolated upgrade/restart, exact old-image restore and 33-check independent final audit passed. Existing records, keys, original files, provider credentials and both running bridges were preserved. See [Android deployment and acceptance](ANDROID-ACCEPTANCE.md#authorized-unraid-deployment--2026-10-25) and the [rc.4 recovery point](UPGRADING.md#rc4-android-compatibility-and-recovery-point). This was private image promotion; GitHub and registry publication remain separate. ### Comparisons and Oura permission review (2.0.0-rc.3) Source revision `dd22414` adds Vitals → Compare, also linkable at `/vitals?view=compare`. Choose two metrics over an independent 30- or 90-day window. Available presets pair AHI with sleep score, calorie intake with weight, or logged training duration with readiness. Presets appear only when both metrics have recorded data in that window. The chart aligns calendar dates in the configured instance timezone and labels its left and right axes separately with each metric's units. Every day is represented: missing observations remain gaps and a reported zero stays zero. Nothing is carried forward or filled between days. Recorded-day coverage, source labels and an expandable daily-value table remain available alongside the chart. Similar patterns do not establish a cause; no causal conclusion or correlation statistic is calculated. Saved vital source preferences remain authoritative, including when their selected source has no readings. Health Connect remains the default for overlapping activity totals. Other ambiguous sources require a visible choice; competing device and nutrition totals are never added together. Source changes inside Compare apply only to that comparison, without changing global preferences. Switching people immediately clears the previous person's data and local choices. Failed manual saves retain their draft; successful saves refresh the comparison without losing its selections. The read-only, session-authenticated `/api/metric-comparison?days=30|90` provides aligned series and coverage. A personal access token alone does not authorize this route; existing v1 contracts and token scopes are unchanged. Dependent comparisons include only that dependent's vitals. Delegate comparisons include only the selected owner's own vitals. Both report nutrition and fitness unavailable rather than borrowing another person's data. See the [comparison contract](API.md#session-only-metric-comparison) for scoping, aggregation and bounded-history warnings. New Oura authorization requests include the `stress` permission needed for Resilience. Settings → Integrations → Oura offers **Review Oura permissions** when the existing grant lacks it. An upgrade or token refresh cannot grant new permissions: the owner must review Oura's consent screen and choose what to allow. Existing usable feeds remain active with partial coverage while the missing permission is unresolved; a collection-level permission denial does not imply the whole connection expired. The candidate passed 1,603 tests, repository lint with zero errors and 20 existing warnings, the production Linux/amd64 container build, and actual HTTP browser checks at 375px, 390px and 1280px widths. These are disposable-instance checks, separate from provider consent and production user acceptance. No database migration is added. The separately authorized Unraid promotion was observed healthy at 2026-10-25 05:23 UTC (2026-10-24 22:23 America/Phoenix), running **2.0.0-rc.3**, source `dd2241488908fe9c23316e8463b41e0c25fc7249`. A fresh full stopped snapshot, offline exact-old-image restore and candidate preservation checks passed for all 46 tables, 474 columns, the unchanged 13-migration ledger, keys and original files. Effective environment, host configuration and mounts were preserved apart from the intended revision/image identity changes. Public login rendered without page errors, and anonymous clinical, build, context and comparison requests returned 401. These production probes did not operate the owner's authenticated Compare screen or approve Oura consent. Both existing bridges initially resumed with their previous images and configuration. Their subsequent repairs and acceptance results are recorded below. Oura's additional permission still requires the owner's consent, and Health Connect delivery requires action in the companion phone app. No GitHub or registry publication occurred. See the [rc.3 recovery point](UPGRADING.md#rc3-compatibility-and-recovery-point) for the matching rollback pair. Sanitized deployment evidence is retained outside Git under `tmpdata/comparisons-and-integrations/final-audit.json` and `deploy-browser-results.json`. ### Bridge repairs verified (2026-10-25) The bridge rollout's final read-back passed at 05:40 UTC, with the rc.3 application unchanged and healthy. Renpho's SDK now sends its existing app version and platform headers before authentication, while retaining the token and user-ID authentication guard. Real provider login, history fetch and tape poll completed without errors inside the unchanged ten-day self-heal window. No recent records were eligible, so the accepted outcome is `success_no_recent_data`: an upstream poll was verified, but no new HealthTrack delivery or fresh receipt is claimed. The myAir patch distinguishes unknown usage from a reported zero. Missing, invalid, nonfinite or negative usage remains unknown; zero usage sends only the usage observation. Positive usage retains actual recorded zero AHI and other finite efficacy values. Live acceptance verified a received zero-use observation for its provider date, with no newly posted AHI, leak or score. Previous records remain intact; these rules govern subsequent deliveries. Both repaired containers preserved their runtime credentials, configuration, host options and network aliases. Compose now pins each verified patched image and omits its original `build: .` line. Existing source files remain on the host; a future source rebuild must apply these patches before replacing the fixed images. Exact old images/configuration were archived privately, and the old containers remain stopped for scoped recovery. No clinical database rollback was performed. The patch suite passed 34 tests; the independently reviewed rollout and delivery gates passed 64 synthetic tests. These checks distinguish successful polling from actual delivery and retain the stricter recorded-zero acceptance for myAir. Sanitized operational evidence, exact private recovery paths and any recovery/retry details remain outside Git under `tmpdata/comparisons-and-integrations/`, including `post-bridge-audit.json`. No GitHub or registry publication occurred. Oura permission consent and phone-side Health Connect delivery remain user actions. ### Integrations polish (2.0.0-rc.2) Each integration now has one card for status, connection actions and management. Oura warnings link directly to its Reconnect action. Authorization and sync outcomes are independent; returning from Oura reports the completed initial sync outcome, including empty, partial and failed fetches. Initial import still waits for the existing 30-day backfill. No background job queue is added. Health Connect setup creates a narrowly scoped delivery token only on an explicit action, retains exact package approvals, and keeps existing active connections unchanged. Its timestamps distinguish phone contact (including a test ping), a recorded nonempty import, processing, activity dates and nutrition days. Recorded import time is the first stored receipt of that import, not the latest byte-identical retry. Bridge cards keep upstream health unknown. The session-authenticated integration-status response keeps its existing array and fields, adding optional `connectionStatus`, `lastRecordedImportAt`, `latestNutritionDate` and `timeZone`. Existing external v1 ingestion contracts and API scopes are unchanged. This release adds no database migration. Oura authorization started before an upgrade may need to be restarted because state is now bound to the initiating account. ### Existing v2 workflows The integrations polish candidate was verified locally on 2026-10-24 at source revision `5faff897901facff2f6fcb6fa3cfc6eb4a787b6b`. The full suite passed 1,539 tests in 154 files; the final heading-only adjustment passed its 14 focused tests. Repository lint passed with 20 existing warnings. Production builds and the Linux/amd64 container passed, including first-user bootstrap, closed second signup, HTTP session cookies, medication date persistence, AI-unconfigured responses and anonymous endpoint denial. The disposable browser exercised signed Health Connect pings and real record delivery, exact source approval and normalization, duplicate retries, retained drafts/one-time reveals across Settings groups, clearing reveals after leaving, legacy links, Back/Forward, and 375px/390px/1280px layouts. Mocked Oura status covered callback notices, reconnection, unavailable-status recovery and backoff. No uncaught page errors occurred. Real Oura consent/provider delivery and authenticated production workflows were not exercised. The authorized Unraid deployment below records the subsequent live promotion and its limits. The prepared rollout/rollback script passed independent review, 41 mocked recovery cases and 37 synthetic preservation/preflight checks. The retained rc.1 image archive and all 13 layers were verified read-only on Unraid. The authorized rollout then completed the fresh stopped-volume backup and isolated restore gates. Detailed local evidence is ignored under `tmpdata/integrations-release/`. - Settings groups related tasks under Profile, Integrations, People & sharing, Data & reports, and Advanced & about. Direct links select the right group and open the requested section, including older dependent and integration links. Within a Settings visit, switching groups retains unfinished forms; leaving Settings clears that temporary state. API access and build identity live under Advanced & about. - Medication history supports start/end-date corrections and date-only presentation. Saved lab visits support collection-date, result, unit and reference-range corrections with stable IDs, retained source files and a before/after correction audit. - Settings → Integrations distinguishes native Oura attempts, full successes, reconnect requirements and rate-limit backoff from received deliveries. Push bridges report receipt and observation dates; receipt does not verify upstream login, scheduling or the device connection. Only a source the server can actually pull offers Sync Now. - Vitals distinguishes missing observations from measured zeroes. Source preferences prevent competing wearable/bridge feeds from silently counting the same metric twice. Unresolved source conflicts remain visible. - Vitals → Measurements has independent left/right series, Core/Arms/Legs presets, dated latest/previous changes, sparse trends and a deterministic range report. See [body measurements](body-measurements.md). Its latest-known snapshot may contain values from different dates; it is not proof of one tape session. Same-metric/day/source circumferences still share the existing canonical upsert key. - Fitness → Weekly has a guided mobile check-in with body context and imported nutrition coverage. Imported nutrition stays separate from manual weekly fields; competing food sources are not added together. Historical tape placeholders are not automatically recorded again as today's measurements. - Fitness → Goals & catalog searches confirmed and unreviewed exercises and edits existing names/aliases. Existing per-exercise estimated 1RM, PRs and weekly tonnage remain available. Duplicate-history merging and muscle-group analytics are outside this candidate. - Doctor summary provides a patient-scoped PDF with medication history, collection-dated latest labs, selected vitals and optional clinical sections. Download it before an appointment and open the actual PDF to verify it. - In-app AI queries and `GET /api/v1/context?days=30|90|365` share dated facts, patient identity, coverage, source warnings, evidence links and a fingerprint. The PAT endpoint requires `read:all` and reads the token owner's own profile. Dependent nutrition, fitness and integration domains are reported unavailable rather than borrowed from the owner. The context endpoint needs no AI call; optional AI answers still need configuration and human review. - Settings → Advanced & about and authenticated `GET /api/build` expose version, build revision and configured timezone. A `development` revision is not an immutable release identity. Two-metric comparisons are included in rc.3 as described above. Automated causal/outlier claims remain outside this candidate. ## Safe document imports Lab PDFs and complete medical histories use one durable review ledger. Extraction stages claims separately from accepted clinical records. Check the patient and original document before applying decisions. Complete-history originals remain owner-only even when extracted labs are shared. Ordinary lab files retain their existing exact patient/section sharing checks. The SHA-256 file hash is scoped to account, selected patient and importer kind. Uploading the same bytes through the same importer resumes its saved batch; it does not replay completed decisions. Settings → Data & reports → Import Medical History lists saved document reviews, including lab reviews. Another patient has a separate batch. | Classification | Meaning | | ------------------ | --------------------------------------------------------------------------- | | New entry | No candidate with that name was found. | | Possible match | Similar record or ambiguous event identity; review is required. | | Conflicting values | A dated candidate has incompatible known values. | | Exact match | Complete compared content and sufficient identity agree with one candidate. | A name match does not prove duplication. The same lab name, date and value can represent multiple draws. Exact lab matching requires positive specimen/accession/collection-time evidence without contradictory known identity fields; units remain case-sensitive. Cross-page extraction retains different or richer claims instead of silently choosing one. Printed LOINC codes are preserved through extraction, review, saving and corrections. Matching nonempty codes can identify candidates with different printed names; conflicting codes prevent an exact match. A shared code alone still does not prove the same draw. Without a name/code candidate, an exact date/value/unit match with compatible specimen evidence can surface a possible alternative for human review. It never confirms a duplicate across different names without the same printed code. No code is inferred from a name, and no terminology lookup or guessed synonym is used. | Decision | Effect | | -------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | Keep in review | Leave the item pending. | | Skip | Record the decision without changing clinical data. | | Add separately | Create a distinct record; if the server proves an exact duplicate during commit, associate the source with that existing record. | | Link | Associate the source claim with the selected record without changing clinical values. | | Correct | Update reviewed fields while retaining previous values and the reason. A stale review cannot overwrite a subsequently changed record. | Commit uses a SQLite immediate transaction and a savepoint per item. A failed item rolls back its own clinical writes and remains retryable; successful items stay durable. Counts distinguish `applied`, `linked`, `corrected`, `skipped`, `pending` and `error`. Retries do not create another record for a previously applied item. The ledger retains extracted and accepted payloads, plus source/page evidence when available. Saved lab editing uses stable result IDs and cannot replace the original file or delete sibling tests. | Method | Session-authenticated route | Purpose | | ---------- | -------------------------------------- | ----------------------------------------------------------------- | | POST | `/api/parse-lab-pdf` | Validate bytes, extract and stage a lab batch. | | POST | `/api/parse-medical-history` | Extract and stage supported clinical domains. | | GET | `/api/import-batches?dependent_id=...` | List the owner's reviews for exactly one patient. | | GET / POST | `/api/import-batches/{id}` | Read review state / apply explicit decisions. | | POST | `/api/import-medical-history` | Compatibility entry point through the same ledger/commit service. | | PATCH | `/api/labs/{id}` | Correct a visit and supplied stable-ID results with an audit. | Import mutations are owner-only, including the owner's dependents; they do not grant delegate/PAT write access. The old standalone lab-save route returns `409 review_required` for a staged source so it cannot bypass the review. ### Limits, uncertainty and retries - Standalone labs: 10 MB. Complete histories: PDF up to 50 MB and 200 pages; images up to 10 MB. History PDFs over 30 pages use sequential 25-page chunks. A document is limited to 2,000 staged claims. - PDF, PNG and JPEG are detected from signatures. Empty/wrong browser MIME does not turn an image into a PDF. Recognizable file contents are required. Provider limits and proxy timeouts can still reject a request. - Partial dates remain `YYYY` or `YYYY-MM`; unknown dates remain unknown. Required clinical dates need an exact reviewed date. Nothing defaults an absent collection date to today or invents January 1. - Multi-draw lab reports retain per-result collection dates and specimen context. Ambiguous dates stay staged. Check historical comparison columns against the original; AI extraction is not verification. - Qualitative-only results such as “Negative” or “Reactive” are not represented by the numeric lab schema and are currently skipped during extraction. Preserve the original and use a clinical note where appropriate. Numeric thresholds such as `<5` retain printed text in staging and cannot be saved as an exact number; keep them in review or skip them. - Failed history chunks produce page-range warnings. Even when all extracted items are resolved, failed sections keep a batch `incomplete`. Reupload the same file for the same patient with **Retry an incomplete extraction** selected. This uses AI again and may process the whole document. Recovered or changed claims are appended to the existing ledger; applied records are not replayed. New matches still require review. If every chunk fails, no successful extraction is reported. - `complete` means staged supported claims were resolved without an outstanding extraction failure. It does not prove that every printed source row was represented or that the clinical content is correct. ## Operator upgrade and restore Follow [release verification](RELEASE.md). Preserve effective operator values; do not replace an applied Unraid template with repository defaults or put credentials in commands, logs, examples or release evidence. 1. Record the current immutable image identity, intended access URL, data mount and configuration. Keep the current install working while checking the candidate in isolation. 2. **Confirm the calendar timezone before ingestion or nutrition reprocessing.** Older Health Connect normalization used `America/Phoenix`; this candidate uses configured `TZ`, falling back to `Etc/UTC`. Verify the intended timezone against historical day assignments, including readings near midnight. An existing Phoenix-based installation should explicitly retain `America/Phoenix` unless a separate date-conversion plan is approved. There is no automatic stored-date migration. A timezone change followed by reprocessing can assign different canonical days. The live Unraid timezone has not been verified by these local changes. 3. Before an authorized upgrade, stop writes and consistently back up the whole `/data` tree: database, uploads and generated keys. Preserve externally supplied secrets in protected configuration backups. Retain the prior immutable image and its configuration with the snapshot. 4. Test migrations and restore in isolation. Routine regressions use synthetic records. An operator-authorized drill with an actual backup must remain private and isolated. Disable native scheduling in the test copy (`OURA_SYNC_ENABLED=false`), avoid real provider calls and do not direct bridges at it. Do not reprocess production data as a test. 5. Startup applies migrations automatically. This candidate adds import/audit, integration freshness and context-evidence storage. Verify sign-in, exact patient isolation, medication dates, import/resume/correction, original-file access, source selection and the downloaded PDF. Health alone proves none of these workflows. 6. Use the intended `APP_URL`. LAN HTTP uses an exact `http://host:port` origin and functional non-Secure session cookies. HTTPS origins need Secure cookies even behind a proxy forwarding HTTP internally. See [cookie verification](RELEASE.md#release-evidence-requirements). 7. For an authorized rollback, stop the candidate, retain its data separately, and restore the complete pre-upgrade snapshot with its compatible prior image/configuration. An image rollback alone does not undo migrations. Verify sign-in, records, originals and integration state before resuming writes or ingestion. Having a backup is not a successful restore drill. ## Candidate validation Validated locally on 2026-10-23, based on GitHub `main` at `db80b11bc034537b84abababf4c9967bf81a6b3d`, on branch `codex/healthtrack-v2`, version `2.0.0-rc.1`. Measurements was selectively integrated from `00bb030`; the original branch remains intact. The candidate commit is recorded in Git history; the image/source manifest below identifies the exact application content used for container verification. | Check | Result | | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `npm test -- --maxWorkers=4` | 148 files, **1,444 tests passed**. Includes import concurrency/retries/conflicts, medication dates/identifiers, patient isolation, cookie schemes, source calculations, sync outcomes and context compatibility. | | `npm run lint` | Exit 0, no errors; 20 existing warnings (compiler limitations, navigation, ARIA and unused declarations). | | `npm run build` | Next.js 16.4.3 production build and TypeScript passed. Postbuild excludes copied local runtime state from standalone output. | | Browser against production standalone | Eight workflow groups passed using a disposable database and headless Chrome. No uncaught browser errors. No operator data or provider credentials. | | Mobile | 375px and 390px: medication editing, reload and failed-save draft retention; measurements and weekly review fit without document overflow. Continue performs no write; explicit Save performs exactly one, with durable confirmation. | | Calendar | Tokyo browser against Phoenix instance: calendar-date medication round-trip and an intraday observation at Phoenix 11:30 PM remain on the correct date. Unit tests also cover UTC and DST transitions. | | Saved import review | Accessible without configured AI; valid item creates a record, uncertain date remains staged, and retry returns the same record ID. | | Doctor summary | Owner/dependent JSON stays isolated; late-imported historical results do not replace newer draws. Actual downloaded two-page PDF rendered and visually inspected: long names, medication dates, unknown ranges/flags, instance-clock observations and intact section headings. Extracted-text checks passed. | | Independent review | Patient scoping, reconciliation, ingestion/source calculations and authentication reviewed independently. Findings fixed and regression-tested, including conflicting specimens bridged by an unknown specimen. | Local sanitized evidence is retained in ignored `tmpdata/v2-validation/`: `tests-final.log`, `lint-final.log`, `build-final.log`, `browser-results.json`, phone screenshots, `doctor-summary.pdf`, rendered pages and `pdf-results.json`. These are local run artifacts, not additional source-controlled health data. Task-owned local servers and headless browsers were stopped after verification. The PDF renderer needs its bundled WebAssembly layout engine. CSP permits `wasm-unsafe-eval`; JavaScript `unsafe-eval` remains absent. See the [browser policy documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/script-src#unsafe_webassembly_execution). The actual browser download was checked with the production policy in force. Dependency maintenance removed high/critical findings in the Windows audit; four moderate findings remain in the Drizzle development-tool loader chain (also pulled as an optional peer). No forced breaking downgrade was applied. Real-provider extraction accuracy and OAuth/device delivery UAT remain unverified: parser/sync tests use synthetic inputs and mocked providers. The read-only Unraid inspection and exact old-image rehearsal below now verify the running identity, configuration agreement, Phoenix timezone, volume ownership, migration/schema compatibility and public TLS. The subsequently authorized real-volume snapshot/restore also passed as described below. Provider UAT, ARM64 and post-deployment checks remain outstanding; take a fresh snapshot at cutover because production writes have resumed. Publication and live deployment require separate authorization. ### Isolated Docker upgrade and restore drill The Linux/amd64 Docker Desktop lifecycle drill passed on 2026-10-23 using only synthetic records, disposable data directories and loopback ports 3211/3212. The image was built locally as `healthtrack:v2-local` with `BUILD_REVISION=db80b11-workingtree-v2-rc1`, based on `db80b11` plus the uncommitted candidate. Full-lifecycle image ID: `sha256:b6c40b20feb290d9a37a2f912ae0e6e38f2530e2ae173e49b39c84f1564c0542`. SHA-256 manifests of 622 public source/configuration files matched before the build, after the build and after the lifecycle drill: `b3f89c3f09a07424b128ce99aa8a7ac9866a251a2633d7e607bb0626014a204d`. The accepted final local image, rebuilt after the final UI/calendar/import fixes, is `sha256:6d20c15e35c993d781b3a8daa18eb6918b547cc9437b9ea8805eb28c879f89b0` (Linux/amd64, 93,328,565 bytes). Its 624-file source/configuration manifest matched before the build, after the build and after the final smoke: `8729586fed9d7a78c1919df0b9ebe5d1714b36209efb6b268f673dd09625f257`. This records the tested working tree; it is not an immutable Git release SHA. Changes to this document are outside this source manifest and Docker build context. Commands and detailed sanitized evidence are retained under the ignored `tmpdata/v2-validation/docker/` directory. The build command was `docker build --progress=plain --build-arg VCS_REF=db80b11-workingtree-v2-rc1 -t healthtrack:v2-local .`; `node tmpdata/v2-validation/docker/final-run/validate.cjs` reran all lifecycle checks against this image using new empty fixture directories. After the final rebuild, `node tmpdata/v2-validation/docker/quick-final.cjs` passed health, denied unauthenticated clinical access, functional HTTP sign-in, persisted medication-date correction, PAT context v2 and token revocation. An actual HTTP import saved all three synthetic A/unknown/B results across two visits, preserving their printed LOINC codes; a subsequent unrelated saved lab correction retained the code. The final smoke container was removed, ports 3211/3212 were closed and build processes had exited. The full backup/restore/upgrade drill was not repeated after those final bounded display/import fixes; the migration set and backup mechanism were unchanged. The build context excluded `.env*`, runtime data, uploads, local caches and validation fixtures. No operator credentials or provider calls were used. | Check | Observed result | | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Fresh install | Health, first-user admin, closed subsequent signup, denied unauthenticated clinical access and runtime UID 99 passed. | | Representative writes | Medication start-date correction persisted; lab date/value correction retained result IDs and the original document; PAT context reads and revocation passed. Unconfigured AI returned 501. | | LAN HTTP | An HTTP `APP_URL` issued a functional session without `Secure`; an authenticated reload passed. | | HTTPS configuration | An HTTPS `APP_URL` issued a `Secure` session cookie through local HTTP transport emulating a TLS-terminating proxy. No TLS handshake or certificate was tested. | | Full data restore | The stopped `/data` tree was copied to a backup and an empty restore directory. All six files matched byte-for-byte, including the database, generated authentication/encryption keys and original upload. The restored session, corrected medication/lab data and original download passed. | | Baseline upgrade | The exact baseline migrations 0000–0009 created the synthetic old schema. Candidate startup applied all 13 migrations; the known medication date survived, legacy `last_received_at` stayed NULL, old summary cache was invalidated, keys/uploads were unchanged and SQLite integrity was `ok`. | | Pre-upgrade snapshot | A separate restored baseline snapshot retained its 10 migrations, known medication date and SQLite integrity. The prior application image was not run. | | Cleanup | All four task-named containers were removed; ports 3211/3212 were closed and no task build processes remained. The drill only removed exact task names after checking their ownership label; it issued no unrelated stop/remove operations. | Both tested images' `/app` metadata contained no `.env*`, runtime data, validation fixtures, `.git` or `.claude` directory, and the inspected provider credentials were unconfigured. Container runtime used UID 99 from `/app`. Host process counts changed from 587 before the drill to 620 after; total working set changed from 36.25 GB to 34.48 GB while separate browser/build work continued. Those shared-host differences are not attributed to this drill. The fresh authentication key was generated by application startup. The encryption key in the synthetic fixture was generated for the backup drill; this does not verify a provider-encryption workflow. The baseline drill tests migration compatibility against the old schema, not an upgrade from a running old application binary. Docker Desktop bind mounts do not establish Unraid filesystem/permission behavior, ARM64 compatibility, real-provider operation, public TLS or live-data upgrade readiness. The later preflight below closes some of those gaps without changing the live instance. ### Exact running-image preflight (2026-10-23) Read-only Unraid inspection identified v0.8.1, revision `ed0d1f2edf5993637ee3abda10be66287536fbee`. Its immutable digest is recorded in [UPGRADING.md](UPGRADING.md#v081-to-v2-compatibility-evidence). Live SQLite integrity returned `ok`; all ten migration files, hashes and timestamps match the old image. The 104-object schema fingerprint exactly matches a fresh database from that image. Safe effective configuration and secret equality matched the applied template; values of secrets were not logged. The server uses UID 99/GID 100, with mode-0600 generated key files. Browser-facing TLS validated, health returned 200, and both medication APIs denied anonymous access with 401. Incoming Renpho/myAir bridges and scheduled Oura sync were identified for the future write pause. Existing July backup files have no verified current full-volume/key/upload coverage. A second Linux/amd64 drill used the **exact running old image**, followed by the accepted final candidate image `sha256:6d20c15e35c993d781b3a8daa18eb6918b547cc9437b9ea8805eb28c879f89b0`, then the old image against a restored untouched snapshot. All containers used `--network none`, published no ports and contained only synthetic records. The old application created the account and records through its APIs. | Check | Result | | --- | --- | | Upgrade and restart | All 13 migrations applied, the original ten ledger entries retained, both legacy receipt fields stayed NULL, and the old summary cache cleared. Restart was idempotent. | | Authentication and isolation | The old password and session worked through upgrade, restart and rollback; HTTPS cookies were Secure, patient scoping and anonymous denial passed. | | Records and files | Owner/dependent medication, lab and vital IDs, dates and values persisted. Original downloads and both generated keys matched. All six stopped-volume files copied byte-for-byte. | | Encryption | An offline synthetic Health Connect HMAC sentinel exercised application decryption in old/candidate/restored-old binaries. Valid signatures on intentionally malformed JSON reached validation (400); bad signatures were rejected (403). No delivery or provider call occurred. | | Exact-binary rollback | The original immutable image booted the untouched restored old snapshot. It never opened migrated data. Login, session, records, files, keys and historical schema/ledger passed. | | Cleanup | All three disposable containers removed; no task containers or runner processes remained. No host ports were published. | Sanitized local evidence is retained in ignored `tmpdata/v2-preflight/exact-image-drill/summary.json` and `evidence.json`, with the read-only live inventory alongside them. No live data was copied and no production container, configuration or key was changed during that rehearsal. The following approved maintenance window completed the real snapshot gate. ### Approved real-volume restore rehearsal (2026-10-23) The operator authorized pausing only the application and Renpho/myAir bridges, creating a protected full-volume/configuration backup, resuming unchanged v0.8.1 and testing its restored copy offline. That run passed on Unraid. - All 27 files (116,111,191 bytes), including both generated keys and 15 original PDFs, matched byte hashes, UID/GID, modes and timestamps before startup. The old image was archived; its configuration and 13 layer hashes verified. - The restored exact old binary ran as 99:100 with no network or published ports, no provider environment credentials and Oura scheduling disabled. SQLite integrity, ten migrations, the 104-object schema and aggregate record counts matched before/after startup. All three saved encrypted integration values authenticated with the restored key; no plaintext was logged. - Master snapshot and restored keys/original files stayed unchanged. Real account sign-in was not attempted without an existing password/session; synthetic login/session coverage above still applies. No OAuth/provider call. - Production resumed unchanged v0.8.1 and both bridges after the stopped copy was verified, before offline testing. Stop/copy/resume took 97 seconds, including bridge shutdown. Images, full configurations, mounts and policies matched their originals; public health200, medication APIs401 and TLS passed. - Disposable container removed and runner exited. Protected backup and restore files remain on the host; no live health data or configuration was downloaded into this repository. Sanitized metadata only is retained locally. See [UPGRADING.md](UPGRADING.md#approved-real-volume-snapshot-and-restore) and ignored `tmpdata/v2-preflight/real-result.json`, `real-final-audit.json`, `image-archive-verification.json` and `public-probes-after-pause.json`. The snapshot/restore rehearsal is complete. Production writes have resumed; take another stopped snapshot immediately before an approved deployment. Same-host backup does not establish off-host recovery, and provider UAT/ARM64 remain unverified. Nothing was published or deployed. ### Authorized Unraid deployment (2026-10-23) The operator subsequently authorized live deployment. v2.0.0-rc.1, source revision `ef5745ab9c65e561e00c4334eb92a1958208ec70`, went live on Linux/amd64 after another complete stopped-volume snapshot and offline migration validation. The tested Docker Desktop descriptor `6d20c15e…` maps to the imported image configuration `7a8baf875797fafe9b427a1c100c57653d868dc1296db38d9b716fe80dedbc2b`; archive, configuration and all 13 layer hashes were verified during transfer. Runtime `BUILD_REVISION` identifies the exact tested source commit without changing the image's application content. Version remains **2.0.0-rc.1**. Migration integrity, all 13 ledger entries and the 112-object schema passed. Old-column bidirectional comparisons across 25 tables preserved clinical data, profiles, sessions, accounts, API keys and saved integration values. Existing table counts stayed unchanged except the generated summary cache; unknown historical receipt/outcome timestamps stayed NULL. Keys, originals and the master snapshot matched, and three saved encrypted values authenticated offline. The candidate initially ran with no network/ports and sync disabled. After that gate, production started with the existing ports, data mount, timezone, signup policy, provider credentials and Oura scheduling. Both bridges resumed. Docker health, public HTTPS/health, anonymous API denial, actual public login rendering at 375px/1280px and zero uncaught browser errors passed. Real sign-in and provider delivery were not exercised as verification actions. The applied template now uses the pinned locally loaded image plus the intended revision field; all other template bytes and effective settings were preserved. The stopped old container was removed without deleting volumes; its matched image/config/data backup is retained. No temporary container or runner remains. The launch used a local image transfer, **not a GitHub or registry publication**. Sanitized evidence is in ignored `tmpdata/v2-preflight/deploy-result.json`, `deploy-final-audit.json`, `deploy-browser-results.json` and `DEPLOYMENT.md`. The deployment script passed independent review and 41 mocked recovery checks. A conservative configuration mismatch caused an earlier real pre-release rollback, which restored the whole snapshot before the old image started. No new production writes were discarded. Docker's internal image filesystem has little free space; data-volume capacity is separate. The launch reused the already verified old-image archive when export scratch was insufficient and did not prune unrelated resources. Capacity maintenance remains an operator follow-up. The production snapshot is a recovery point; preserve newer writes before any later rollback. Off-host recovery and ARM64 remain unverified. ### Integrations release on Unraid (2026-10-24) The separately authorized rollout promoted **2.0.0-rc.2**, source revision `5faff897901facff2f6fcb6fa3cfc6eb4a787b6b`, at 18:46 America/Phoenix (2026-10-25 01:46 UTC). The running Linux/amd64 image configuration is `sha256:1e742651b9ee57660f54abb5faabc375a44a3d55efd2c77b8f3d7960476e19a6`, loaded locally under `healthtrack:v2.0.0-rc.2-5faff89`. The archive, configuration and all 13 layer hashes verified before load. No GitHub or registry publication occurred. The stopped full-volume snapshot contains 27 files (116,320,087 bytes). Byte hashes, ownership, modes and timestamps matched before either image opened the data. The exact rc.1 binary booted a separate restored copy with no network, published ports or provider environment credentials. Both that restore and the offline rc.2 stage passed SQLite integrity, the unchanged 13-migration ledger and 112-object schema, and bidirectional comparisons of all 46 tables and 474 columns, including row multiplicities, import ledgers, receipts, outcomes and caches. Keys, originals and the master snapshot stayed unchanged. All three saved encrypted values authenticated offline; this does not prove token validity. After release, Docker health was healthy with zero restarts; the application ran as UID 99/GID 100. Existing environment values were preserved except the intended build revision. Ports, mounts, timezone, signup policy and provider configuration matched the previous container. The applied Unraid XML changed only the image tag and build revision. Both bridges resumed with their original IDs, images and complete configurations. No helper container or task runner remained. Docker-root free space was 2,637,160,448 bytes at final audit, above the required 2 GiB after image load and before reopening access. Only the separately approved unused image/cache entries were removed for capacity. Public HTTPS login and health passed. Login rendered at 375px, 390px and 1280px without overflow or uncaught browser errors; the configured Google option remained visible. Anonymous build, doctor-summary, context, medication and integration-status APIs returned 401. Real account sign-in, authenticated production Settings and provider consent/delivery were not exercised as release tests. Existing expired Oura authorization still requires the owner's Reconnect action; deployment does not renew a provider grant. The protected same-host rc.1 image/configuration/data pair is retained; see [the rc.2 recovery point](UPGRADING.md#rc2-deployment-recovery-point). Preserve subsequent production writes before considering rollback. Off-host recovery and ARM64 remain unverified. Sanitized evidence is retained in ignored `tmpdata/integrations-release/deploy-result.json`, `deploy-final-audit.json`, `deploy-browser-results.json` and `DEPLOYMENT.md`. The rollout and final evidence received independent review. ### Oura permission correction (2026-10-24) After successful authorization, the initial sync could immediately mark the connection expired again. Live read-only checks showed that the saved token worked for seven available endpoints, while Resilience returned a 401 with an explicit scope-permission error. The client treated every 401 as token expiry; one denied collection therefore disabled the otherwise usable connection. [Oura documents missing scopes separately from invalid or expired tokens](https://cloud.ouraring.com/docs/error-handling). Revision `abd78eaa5ecef462ecb02e9c5fa3f9d8592f1084` classifies explicit 401/403 scope errors before refreshing tokens. It retains active authorization and reports partial coverage. Unknown 401s still refresh once, and genuine terminal authentication failures still require reconnection. Provider response bodies and arbitrary scope text are never persisted or echoed in errors. Requested OAuth scopes and database migrations did not change. All 1,557 tests in 154 files passed with two workers. One unrelated context test timed out in the initial unrestricted run; its isolated retry and the full lower-concurrency run passed. Lint had zero errors and 20 existing warnings. The production Linux/amd64 build and isolated authenticated container smoke passed. A synthetic real-client → sync → SQLite → status test proved that available readings persist while the scope denial leaves authorization active. The compiled client also recognized the actual live permission response without refreshing and still read sleep successfully. The separately authorized corrective rollout completed at 21:33 America/Phoenix (2026-10-25 04:33 UTC), retaining version **2.0.0-rc.2** with the new revision. The image configuration is `sha256:452d5e9a00f0eb9085650256898aa0f7e4a9c6a6d4d2037ed525f576c4161aa8`. A fresh full stopped snapshot, exact prior-image offline restore and offline candidate preservation checks passed: all 46 tables, 474 columns, 13 unchanged migrations, keys, originals and three encrypted values. Final Docker health, configuration preservation, bridge resumption, public login/anonymous denial and phone/desktop rendering passed; no helpers remained. Only the applied image tag and revision changed. The deployment and repair received independent review. After the new image was healthy, a separately guarded operational correction rechecked the stored token against seven available endpoints and the explicit Resilience scope denial, without refreshing it. An atomic update changed only the falsely expired connection status and error classification, conditional on the owner, token pair, expiry, attempt and prior state still matching. Tokens, timestamps, other metadata and clinical records were untouched. The connection was verified active with partial coverage. Resilience remains unavailable until the provider grants access; no new scope or consent was assumed. The owner's authenticated Settings screen was not operated; refresh it to read the current status. No GitHub/registry publication occurred. Recovery details are in [the corrective recovery point](UPGRADING.md#oura-corrective-deployment-recovery-point), and sanitized evidence is ignored under `tmpdata/oura-permission-fix/`.