LiveForever Care Brief:把长期健康记录变成可溯源的就诊草稿
bakulbadwal/liveforever-care-brief
LiveForever 的 Care Brief 将可穿戴信号、习惯日志、化验趋势与基因组背景整理成一份带来源链接的就诊草稿,供用户在就诊前自行审阅。演示基于虚构人物 Maya Chen,分析 73 个配对夜晚后给出停用咖啡因与次日恢复的关联结果:HRV 差异 +3.94 ms,95% 区间 +1.13 至 +6.42,并明确标注仅为关联。
Personal evidence, ready for review.
Pending Break the Barrier 2026 entry · A local evidence workflow that turns longitudinal health records into a source-linked draft for clinician review.
Illustrative product scene. The interface and all health records shown in this project use one fictional, fully synthetic persona.
Try the Care Brief · Product case study · Technical method · Extension provenance
Bakul Badwal · UVA Darden MBA '27
| Product | Implementation |
|---|---|
| User: A serious self-tracker preparing for a clinical conversation | Evidence engine: Deterministic Python |
| Barrier: Years of personal health context rarely fit into a short visit | AI boundary: Explain fixed evidence; never change calculations, diagnose, or prescribe |
| Output: A concise, source-linked draft the user reviews before sharing | Public demo: Static GitHub Pages site; no login, API key, backend, or PHI |
| Stage: Working prototype; pending hackathon entry | Quality: 51 Python tests (including the AI-draft verifier), optional browser-code checks, and desktop/mobile UI verification |
LiveForever combines longitudinal wearable signals, habit logs, laboratory trends, and cautious genomic context to answer one practical question at a time, then prepares the result for a more useful clinical conversation:
What appears to affect my recovery, how uncertain is that signal, and how can I test it more carefully?
The hosted demo needs no login, API key, external health service, or live model call. Every visible record belongs to Maya Chen, a fictional persona generated for this demonstration. No personal health information appears in this repository.
Try It In 30 Seconds
- Start in Care brief to inspect evidence readiness, per-source coverage, quality warnings, uncertainty, and clinician questions.
- Switch on Trace values in the top bar. Under every locked number, the brief reveals the contract path it came from (for example
→ evidence_summary.primary_effect). The reveal is CSS-only, off by default, and hidden in print. - Scroll to the Bounded AI layer band for the contract ledger (AI may / AI may not / Locked by code) and the cached AI draft beneath it; every number the draft cites is marked green when it exists in the locked contract.
- Open Snapshot to compare the primary result, supporting metrics, and nightly recovery timeline.
- Toggle the chart between HRV and Sleep, then hover or tab through individual observations.
- Open Experiment for the balanced 14-day schedule, then use Data & methods to inspect context and calculation provenance.
- Choose Download Markdown, Download JSON, or Print brief. Both downloads keep the complete evidence contract, source links, warnings, and plan boundaries; nothing is uploaded.
The demo examines whether stopping caffeine by 2 PM is associated with better next-day recovery across 73 paired nights. It reports a +3.94 ms HRV difference with a 95% interval of +1.13 to +6.42 and keeps the result explicitly labeled as an association only.
What Makes It Different
- One question, not a correlation fishing expedition: each analysis defines an exposure, outcome, lag, and minimum sample before interpreting results.
- Calculations outside the model: Python owns effect sizes, intervals, lags, sample counts, missingness, correlations, PhenoAge, quality grades, and the initial experiment schedule.
- A model inside a contract: the included Codex Skill (written for GPT-5.6) frames questions, reviews sources, explains fixed results, identifies blind spots, and adapts a plan without altering calculated values. The demo's cached draft was produced by Claude under the same prompt and verifier; see The AI layer in the demo.
- Uncertainty stays visible: minimum-sample warnings, missingness, group balance, confidence intervals, and known confounders remain part of the product experience.
- Genetics is context, not a verdict: a synthetic CYP1A2 marker can prioritize a question but never determines a recommendation.
- Local-first privacy: raw health and genomic records remain local and outside model output, commits, screenshots, and the public demo.
- A reviewable handoff, not an AI diagnosis: the Care Brief carries sources, uncertainty, missing evidence, and clinician questions into a concise user-controlled document.
The AI Layer In The Demo
The hosted demo makes no live model calls. The Bounded AI layer band on the Care brief shows the full contract ledger (AI may / AI may not / Locked by code) and, beneath it, a cached AI draft: demo/ai_draft.json, generated once at build time from the locked care_brief contract under the repository Skill's prompt. src/liveforever_lab/ai_draft.py builds that prompt and the JSON schema the model's answer must match.
A deterministic verifier in the same module checks the draft before it can ship:
- Every number the model cites must already exist in the contract, at the contract's own rounding.
- Affirmative diagnostic, prescriptive, causal, proof, or treatment language is flagged; negated uses such as "does not establish causation" are allowed.
- The draft carries the SHA-256 of the contract it was written from, so a regenerated contract fails a stale draft.
ingestrefuses to write a draft that fails verification, andtests/test_ai_draft.pyre-runs the check on every test run.
Result for the shipped draft: 17 numbers cited, 0 outside the contract, 0 forbidden claims. On the page, every number in the draft is wrapped and shown green when it exists in the locked contract and red when it does not, with a running count ("26 / 26 numbers cited match the locked contract"; 26 on the page because the same numbers appear in several sentences) beside the build-time verifier result. Switch on Trace values in the top bar to see, under each locked number, the contract path it comes from; the reveal is CSS-only, off by default, and hidden in print.
Provenance recorded in the file: model claude-fable-5-1 (Anthropic), runner "Claude Code, using the prompt and schema from liveforever_lab.ai_draft", generated 2026-10-10. The Skill targets GPT-5.6 through Codex; the shipped demo draft was produced by Claude under the same prompt and rules. The contract and the verifier are model-agnostic, which is the point.
Regenerate the draft with any model:
PYTHONPATH=src python3.11 -m liveforever_lab.ai_draft prompt --out /tmp/prompt.md PYTHONPATH=src python3.11 -m liveforever_lab.ai_draft schema --out /tmp/schema.json # run any model with that prompt and schema, for example: codex exec --output-schema /tmp/schema.json -o /tmp/draft.json "$(cat /tmp/prompt.md)" PYTHONPATH=src python3.11 -m liveforever_lab.ai_draft ingest --result /tmp/draft.json --model <id> --runner <tool> PYTHONPATH=src python3.11 -m liveforever_lab.ai_draft verify
Break The Barrier Extension
The original Build Week release proved a privacy-safe personal evidence workflow. This independently published Break the Barrier project addresses the next failure point: useful patient-generated data rarely arrives at a clinical visit in a concise, traceable form.
The extension adds:
- A deterministic
care_briefcontract built from the existing analysis and experiment plan. - A source ledger for wearables, habit logs, laboratory context, and genomic hypothesis context.
- Explicit uncertainty and missing-evidence sections that travel with the result.
- Questions that help a clinician review relevance, alternative explanations, and next measurements.
- A model contract that locks calculations and forbids diagnosis, prescribing, invented evidence, or causal upgrades.
- A responsive Care Brief view with local Markdown/JSON export, printing, source links, and visible quality warnings; the demo transmits no health record and contains no PHI.
- Evidence readiness derived from sample sufficiency, available intervals, source links, and the existing quality grade. This is a workflow check, not a validated clinical score.
- Explicit unavailable, early, inconclusive, higher, and lower comparison states. Missing context stays missing; unknown provenance never becomes a claim that data is synthetic or free of PHI.
- A cached AI draft, generated once at build time and verified against the locked contract before it ships, shown beside the full contract ledger; and a Trace values switch that reveals the contract path behind every locked number.
- A focused 51-test Python suite (including the AI-draft verifier) plus optional dependency-free JavaScript checks for exports, display boundaries, and the draft's number marks. Invalid dates, duplicate days, ambiguous CSV headers, and non-finite values are rejected before calculation.
This is a workflow prototype, not an EHR integration or clinical device. The intended value is better visit preparation and more efficient review, while preserving professional judgment and the user's control over sharing.
The September 5 iteration strengthens this pending entry after the original Build Week submission. It does not change the historical judged artifact or the demo's three effect estimates. See the dated engineering changelog for exact behavior changes, validation, and limitations.
The October 10 iteration moves the interface to a quick-reference-handbook design (paper and ink rules, a dark spine with numbered tabs, Barlow Condensed and Barlow type, dotted-leader rows, and the boxed "Values locked by code" item; recorded in DESIGN.md), adds the Trace values switch, and ships the cached, verified AI draft. It does not change the three effect estimates either.
Impact Hypothesis
- For patients and self-trackers: less time reconstructing history, clearer uncertainty, and better questions before a visit.
- For clinicians: a concise, source-linked starting point instead of screenshots or an unstructured data dump.
- For care delivery: a safer bridge from patient-generated data to professional review without granting a model numerical or medical authority.
The next validation step is not clinical efficacy. It is a workflow study measuring preparation time, clinician review time, source traceability, question quality, and how often users or clinicians correct or reject the draft.
Built With Codex And GPT-5.6
Starting point
Before Build Week, a private LiveForever prototype already handled personal data ingestion, longitudinal health tracking, PhenoAge, genomics, trend reports, and a private dashboard. That work was built with Claude Code and is not presented as Codex work. The private repository and all personal records remain separate.
New during Build Week
Codex and GPT-5.6 were used to create this standalone public extension:
- Deterministic lagged N-of-1 comparisons and reproducible moving-block bootstrap intervals.
- Pearson correlation intervals, sample sufficiency checks, missingness checks, condition balance, and confounding warnings.
- A transparent evidence-quality score with explicit association-versus-causation boundaries.
- A fully synthetic wearable, habit, laboratory, and genomic dataset.
- A balanced 14-day replication planner with controls, stop conditions, and a predefined decision rule.
- A Codex Agent Skill defining GPT-5.6's source-review, explanation, safety, and experiment-adaptation responsibilities.
- A responsive interactive evidence dashboard, submission package, and 11 automated tests.
How we collaborated
Codex inspected the private baseline without modifying it, verified its existing tests, reviewed the hackathon requirements, helped choose a focused extension, designed the model-versus-code responsibility boundary, implemented and tested the new engine, generated fictional fixtures, built and visually verified the interface, reviewed scientific sources, validated the Skill, and prepared the public submission.
The key human product decisions were to preserve the stronger longevity direction, submit only one project, make uncertainty and experiment design the differentiator, keep every personal record private, and use genetics only to prioritize questions rather than prescribe behavior.
The hosted website intentionally avoids a browser-side API key or backend model dependency. GPT-5.6 operates through the included Skill; the static demo remains fast, free to test, and reproducible. Full before-and-after documentation is in BUILD_WEEK_PROVENANCE.md.
Post-submission portfolio iteration
After the deadline, the submitted commit was frozen and a separate branch was created for presentation improvements. That iteration replaced scroll-only navigation with real client-side views, shortened repetitive interface copy, added keyboard-accessible chart details, moved genomic context into Data & methods, and added creator attribution. This separate repository adds the Care Brief workflow while preserving the submitted Build Week artifact and its results in the original repository.
The original OpenAI Build Week project is preserved at bakulbadwal/liveforever-buildweek, with the judged artifact frozen at commit 6978bcd. See Break the Barrier provenance for the exact extension boundary.
How It Works
flowchart LR
A["Local wearables, habits, labs, and genomic context"] --> B["Deterministic Python evidence engine"]
B --> C["Immutable analysis.json contract"]
C --> D["Bounded AI through the Agent Skill"]
D --> E["Explanation, missing context, and clinician questions"]
E --> H["Cached draft, verified against the contract before it ships"]
C --> F["Interactive evidence dashboard"]
C --> G["Source-linked Care Brief"]
Loading
| Layer | Responsibility |
|---|---|
| Deterministic Python | Effects, intervals, lags, quality checks, PhenoAge, schedule, and provenance |
analysis.json |
Immutable interface between calculation and interpretation |
| Agent Skill | Question framing, source review, explanation, alternative hypotheses, and bounded care-brief preparation |
ai_draft.py |
Build-time prompt and JSON schema, the deterministic verifier, and the cached draft the demo shows |
| Web demo | Inspectable visualization and user-controlled clinical handoff for the fictional evidence record |
Demonstration Record
The synthetic record spans 84 calendar days with 80 recorded days and reports:
+3.94 msnext-day HRV, 95% interval+1.13 to +6.42+0.30 hsleep duration, 95% interval+0.05 to +0.56-1.38 bpmresting heart rate, 95% interval-2.26 to -0.4573paired nights with balanced conditions95%calendar coverage and aBevidence-quality grade- A deterministic, balanced 14-day replication schedule
These are deliberately generated signals in synthetic data, not findings about a real person. One coherent persona keeps the end-to-end story inspectable; automated tests cover small samples, missing genomic markers, missing laboratory inputs, lag correctness, and other failure cases.
Run It
Requires Python 3.11 or newer and has no runtime dependencies.
PYTHONPATH=src python3.11 -m liveforever_lab.cli python3.11 -m http.server 8765 --directory demo
Open http://localhost:8765/#care, or use the hosted demo.
The CLI regenerates only the fictional fixtures and demo/analysis.json. If the care-brief contract changes, the cached draft's recorded hash no longer matches and verify fails until the draft is regenerated (see The AI layer in the demo). Markdown export is prepared by Python in that payload; the browser saves it as .md or serializes the same Care Brief contract as .json. Markdown includes a readable summary and a complete JSON appendix so secondary outcomes, sample counts, plan stop conditions, and AI boundaries survive the handoff.
Run the tests:
PYTHONPATH=src python3.11 -m unittest discover -s tests -v
Optional browser-code regression checks use an already-installed Node runtime and no packages:
node tests/test_demo_ui.cjs
Re-check the cached AI draft against the current contract (the test suite does this too):
PYTHONPATH=src python3.11 -m liveforever_lab.ai_draft verify
To inspect failure cases without replacing the main demonstration:
PYTHONPATH=src python3.11 tests/preview_scenarios.py --port 8772
Open http://127.0.0.1:8772/empty/#care, /negative/#care, /small/#care, or /missing-condition/#care. All scenarios are generated in memory from synthetic records. Their source links point to the exact local scenario CSV.
To test the agent workflow, install this repository as a Codex Skill and invoke:
$liveforever-evidence-lab Investigate whether my caffeine timing is associated with next-day recovery.
Project Map
src/liveforever_lab/· Deterministic analysis, care-brief contract, genomics, PhenoAge, synthetic data, planning, and the AI-draft prompt and verifier.SKILL.md· Bounded AI workflow, responsibilities, forbidden behavior, and care-brief format.DESIGN.md· The handbook design system: paper and ink rules, the numbered spine, type, color as state, and the Trace values reveal.demo/· Static interactive application, generated analysis contract, cached AI draft (ai_draft.json), and preserved Build Week interface.tests/· Analysis, context, care-brief/export regressions, AI-draft verification, and a local synthetic UI scenario preview.docs/· Technical method, provenance, submission copy, demo script, and checklist.docs/README.md· Documentation index for judges and future work.
Privacy And Safety
- Real databases, profiles, exports, lab PDFs, genomic files, credentials, and intervention histories are excluded by design.
- The checked-in genome and laboratory fixtures are visibly marked synthetic.
- LiveForever supports wellness experiment planning, not diagnosis or treatment.
- Medication and supplement changes are outside the generated plan.
- Severe or concerning symptoms are a stop condition and require appropriate professional care.
Scientific Context
- PhenoAge combines chronological age with nine routine clinical biomarkers. The implementation follows the published coefficients and remains an educational summary, not a clinical age or mortality prediction: Levine et al. method discussed in PMC.
- CYP1A2
rs762551has been studied in caffeine metabolism, but reported effects vary by context and population. LiveForever uses it only to generate a hypothesis worth testing: systematic review and population-dependence meta-analysis.
License
MIT
来源:GitHub · github.com


