diff --git a/README.md b/README.md index 517603d..20ced8c 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ [![Data: openFDA, cached](https://img.shields.io/badge/data-openFDA_·_cached_offline-e7a948?style=flat-square&labelColor=0b1322)](data/PROVENANCE.md) [![License: MIT](https://img.shields.io/badge/license-MIT-f1ebdd?style=flat-square&labelColor=0b1322)](LICENSE) -**[The discovery](#the-discovery)** · **[Two hops deep](#two-hops-deep)** · **[Judge walkthrough](#judge-walkthrough)** · **[Why Relate](#why-relate)** · **[Architecture](#architecture)** · **[Results](#results-honestly)** · **[Docs](#go-deeper)** +**[The discovery](#the-discovery)** · **[One hop](#one-hop-breathepal)** · **[Judge walkthrough](#judge-walkthrough)** · **[Why Relate](#why-relate)** · **[Architecture](#architecture)** · **[Results](#results-honestly)** · **[Docs](#go-deeper)** · **[Licensing](#data-licensing-and-attribution)** @@ -27,29 +27,15 @@ A new medical device reaches the US market through a 510(k) by claiming it is "s ## The discovery -BreathePal Bilevel was cleared in March 2026. Its FDA summary names one predicate, the Philips Respironics BiPAP A30. FDA had already attributed a **Class I** recall with root cause **Device Design** (the PE-PUR foam recall) to that predicate's clearance, **4 years 9 months earlier**. Nothing on BreathePal's own FDA record says so. The graph does: - -| | Evidence | Source | -| --- | --- | --- | -| **Candidate** | K252078 · BreathePal Bilevel · Compal Electronics · cleared 2026-03-17 | [FDA summary PDF](https://www.accessdata.fda.gov/cdrh_docs/pdf25/K252078.pdf#page=6) | -| **Citation** | p. 6: *"substantially equivalent to the legally marketed predicate device, BiPAP A30 Ventilatory support system (K113053)."* | same PDF, page 6 | -| **Predicate** | K113053 · BiPAP A30 · Respironics · cleared 2012-02-01 | [FDA 510(k) record](https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfpmn/pmn.cfm?ID=K113053) | -| **Recall** | Z-1957-2021 and Z-1958-2021 · event 88071 · Class I · Device Design · initiated 2021-06-14 | FDA recall [Z-1957-2021](https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfRES/res.cfm?id=187817), [Z-1958-2021](https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfRES/res.cfm?id=187818) | -| **Verdict** | `REVIEW_LINEAGE`: a direct predicate with a Class I design recall on file | deterministic rules in [`forebear/lineage.py`](forebear/lineage.py) | - -Every value in this table is asserted against the shipped store by [`tests/test_story_facts.py`](tests/test_story_facts.py) and [`tests/test_shipped_evidence.py`](tests/test_shipped_evidence.py). FDA attributes these recalls to product *families* that list K113053, so the signal is "FDA links a Class I design recall to the predicate's clearance", not "this exact model was recalled". - -**Why it matters.** FDA's September 2023 draft guidance on [selecting a predicate device](https://www.fda.gov/regulatory-information/search-fda-guidance-documents/best-practices-selecting-predicate-device-support-premarket-notification-510k-submission) recommends predicates without design-related recalls. [Kadakia et al. (JAMA 2023)](https://pubmed.ncbi.nlm.nih.gov/36625810/) found that devices cleared using predicates with Class I recalls had a 6.4× higher risk (RR 6.40, 95% CI 3.59–11.40) of a Class I recall of their own. Forebear is for the regulatory or quality engineer who has to check that before citing a predicate. - -## Two hops deep - -BreathePal's predicate carries the recall itself, so a one-hop lookup already finds it. **SleepRes PAP System (K251770) is the case where only the graph does.** Its own predicate, the DreamStation 2, has no recall in the shipped FDA records. That predicate's predicates do: two REMstar clearances that FDA lists on Class I design recall **Z-1974-2021**. +**One more generation changes the verdict.** SleepRes PAP System (K251770) was cleared in December 2025. Its FDA summary names one predicate, the Philips DreamStation 2 (K200480), and no recall in the shipped FDA records lists the DreamStation 2. A check that stops at the named predicate comes back clean. One generation further, the DreamStation 2's own summary names two REMstar clearances, and FDA lists both on **Class I** recall **Z-1974-2021**, root cause **Device Design** (the PE-PUR foam recall), initiated **4 years 6 months** before SleepRes was cleared. | Query depth | What it walks | Verdict for K251770 | | --- | --- | --- | | **1 generation** | K251770 → K200480 (no recall on file) | `NO_DESIGN_RECALL_SIGNAL`, marked **provisional** because grand-predicates were not traversed | | **2 generations** | K251770 → K200480 → K130077 and K131982, both on Z-1974-2021 | `REVIEW_LINEAGE`, evidence complete | +**The decision it changes.** At depth 1 the result is a provisional "no design-recall signal": an engineer who took it at face value would cite the DreamStation 2 with nothing to explain. At depth 2 the verdict is **Review lineage** with complete evidence: the predicate rationale now has to account for a Class I design recall two generations up, for example by saying whether the recalled design element is carried forward, or by choosing another predicate. Forebear does not answer that question; it makes sure it gets asked, with the evidence attached. + | | Evidence | Source | | --- | --- | --- | | **Candidate** | K251770 · SleepRes PAP System · Sleepres, Inc. · cleared 2025-12-15 | [FDA summary PDF](https://www.accessdata.fda.gov/cdrh_docs/pdf25/K251770.pdf#page=5) | @@ -57,8 +43,18 @@ BreathePal's predicate carries the recall itself, so a one-hop lookup already fi | **Predicate** | K200480 · DreamStation 2 System · Respironics · cleared 2020-07-10 | [FDA summary PDF](https://www.accessdata.fda.gov/cdrh_docs/pdf20/K200480.pdf#page=4) | | **Hop 2** | p. 4: *"Primary Predicate Device: REMSTAR AUTO A-FLEX HT (K131982)"*, *"Secondary Predicate Device: REMSTAR SE (K130077)"* | K200480 PDF, page 4 | | **Recall** | Z-1974-2021 · event 88058 · Class I · Device Design · initiated 2021-06-14 (PE-PUR foam). FDA's record lists K130077 and K131982, not K200480 | [FDA recall Z-1974-2021](https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfRES/res.cfm?id=187815) | +| **Verdict** | `REVIEW_LINEAGE` at depth 2, provisional `NO_DESIGN_RECALL_SIGNAL` at depth 1 | deterministic rules in [`forebear/lineage.py`](forebear/lineage.py) | -The recall began after the DreamStation 2 was cleared and 4 years 6 months before SleepRes was. The investigation page shows both depths side by side (*Why the graph matters*), with each hop's quote, a link to the FDA PDF at the cited page, and the recall record. The same simplified query as [below](#why-relate), with `*1..1` and then `*1..2`: +The recall began after the DreamStation 2 was cleared. The investigation page shows both depths side by side (*Why the graph matters*), with each hop's quote, a link to the FDA PDF at the cited page, and the recall record. In Relate the difference between the two answers is one number in the pattern, `*1..1` versus `*1..2`: + +```cypher +MATCH path = (d:Device {k: 'K251770'})-[:CITES*1..2]->(a:Device) +WHERE all(c IN relationships(path) WHERE c.kind = 'predicate') +MATCH (a)-[:SUBJECT_OF]->(r:Recall) +WHERE r.classification = 'Class I' AND r.root_cause = 'Device Design' + AND r.initiated < d.decision_date +RETURN [n IN nodes(path) | n.k] AS chain, r.id AS recall, r.initiated AS initiated +``` ```text *1..1 (no rows) @@ -66,13 +62,37 @@ The recall began after the DreamStation 2 was cleared and 4 years 6 months befor ['K251770', 'K200480', 'K130077'] Z-1974-2021 2021-06-14 ``` -Every value here, including both verdicts and both query results, is asserted against the shipped store and the cached FDA page text by [`tests/test_two_hop_story.py`](tests/test_two_hop_story.py). As with BreathePal, FDA attributes the recall to product families that list these clearances; it is a question for the predicate rationale, not a finding that SleepRes is unsafe. +Every value here, including both verdicts and both query results, is asserted against the shipped store and the cached FDA page text by [`tests/test_two_hop_story.py`](tests/test_two_hop_story.py). The query is simplified: the app's version also applies human-review and audit rules to every edge (`LINEAGE_EDGE` in [`forebear/graph.py`](forebear/graph.py)). FDA attributes the recall to product families that list these clearances; it is a question for the predicate rationale, not a finding that SleepRes is unsafe. + +**Why it matters.** FDA's September 2023 draft guidance on [selecting a predicate device](https://www.fda.gov/regulatory-information/search-fda-guidance-documents/best-practices-selecting-predicate-device-support-premarket-notification-510k-submission) recommends predicates without design-related recalls. That recommendation is about the predicate itself; a recall two generations up is not a guidance violation, but it is the kind of history a reviewer may ask about. [Kadakia et al. (JAMA 2023)](https://pubmed.ncbi.nlm.nih.gov/36625810/) found that devices cleared using predicates with Class I recalls had a 6.4× higher risk (RR 6.40, 95% CI 3.59–11.40) of a Class I recall of their own. Forebear is for the regulatory or quality engineer who has to check that before citing a predicate. + +## One hop: BreathePal + +BreathePal Bilevel (K252078, the case in the banner above) is the simpler version: the recall sits on the named predicate itself, so a one-hop lookup already finds it. It was cleared in March 2026, and its FDA summary names one predicate, the Philips Respironics BiPAP A30. FDA had already attributed a **Class I** recall with root cause **Device Design** (the same PE-PUR foam recall) to that predicate's clearance, **4 years 9 months earlier**. BreathePal's own 510(k) record does not mention it; connecting the two takes the citation on page 6 of its summary and FDA's recall records: + +| | Evidence | Source | +| --- | --- | --- | +| **Candidate** | K252078 · BreathePal Bilevel · Compal Electronics · cleared 2026-03-17 | [FDA summary PDF](https://www.accessdata.fda.gov/cdrh_docs/pdf25/K252078.pdf#page=6) | +| **Citation** | p. 6: *"substantially equivalent to the legally marketed predicate device, BiPAP A30 Ventilatory support system (K113053)."* | same PDF, page 6 | +| **Predicate** | K113053 · BiPAP A30 · Respironics · cleared 2012-02-01 | [FDA 510(k) record](https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfpmn/pmn.cfm?ID=K113053) | +| **Recall** | Z-1957-2021 and Z-1958-2021 · event 88071 · Class I · Device Design · initiated 2021-06-14 | FDA recall [Z-1957-2021](https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfRES/res.cfm?id=187817), [Z-1958-2021](https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfRES/res.cfm?id=187818) | +| **Verdict** | `REVIEW_LINEAGE`: a direct predicate with a Class I design recall on file | deterministic rules in [`forebear/lineage.py`](forebear/lineage.py) | + +Every value in this table is asserted against the shipped store by [`tests/test_story_facts.py`](tests/test_story_facts.py) and [`tests/test_shipped_evidence.py`](tests/test_shipped_evidence.py). FDA attributes these recalls to product *families* that list K113053, so the signal is "FDA links a Class I design recall to the predicate's clearance", not "this exact model was recalled". ## Judge walkthrough -No API key, external database or other service is needed: the graph and the web build are committed. Pick one way to run it. +No API key, external database or other service is needed: the graph (`data/forebear.rl`) and the web build (`web/dist`) are committed, so nothing is fetched from FDA at run time. Pick one way to run it. + +| Path | You need | Tested on | +| --- | --- | --- | +| Docker (recommended on macOS and Linux) | Docker Engine with Compose v2, e.g. Docker Desktop | Linux container | +| Native Windows | PowerShell 5.1+, Python 3.12, internet for the one-time `pip install` | Windows 10, Python 3.12.0 | +| Native Linux | Python 3.12 with `venv` | CI runs the test suite on Ubuntu; the app itself is demoed on Windows and in Docker | + +Node is not needed unless you change the UI. -**With Docker (any OS).** Needs Docker Engine with Compose v2, for example Docker Desktop. +**With Docker (any OS).** ```sh git clone https://github.com/Asembris/Forebear.git @@ -90,11 +110,32 @@ cd Forebear powershell -ExecutionPolicy Bypass -File .\run.ps1 ``` -`run.ps1` creates `.venv`, installs the pinned [`requirements.txt`](requirements.txt), rebuilds `data\forebear.rl` offline only if it is missing, and opens . Then, with either setup, in about three minutes: +`run.ps1` creates `.venv`, installs the pinned [`requirements.txt`](requirements.txt), rebuilds `data\forebear.rl` offline only if it is missing, and opens . + +**Natively on Linux.** The same steps by hand: + +```sh +git clone https://github.com/Asembris/Forebear.git +cd Forebear +python3.12 -m venv .venv +.venv/bin/python -m pip install -r requirements.txt +.venv/bin/python -m uvicorn forebear.api:app --host 127.0.0.1 --port 8765 +``` + +**Check it is up.** returns `{"ok": true, ...}` with the store's node and relationship counts. If it does not: + +| Symptom | Fix | +| --- | --- | +| Port 8765 already in use | Native: pass another `--port`. Docker: change the left side of `127.0.0.1:8765:8765` in [`compose.yaml`](compose.yaml) | +| `Python 3.12 was not found` | Install 3.12 from [python.org](https://www.python.org/downloads/); `relate-db` 1.0.2 is pinned and tested on 3.12 | +| `run.ps1 cannot be loaded` | Use the exact command above; `-ExecutionPolicy Bypass` applies to that one process only | +| Docker shows old data after a pull | `docker compose down -v`, then `docker compose up --build` (this deletes your local reviews and saved assessments) | -1. **Watch the thread.** A short opening film follows K252078 → K113053 → the 2021 Class I recall (Skip or Esc ends it). Deep link: [`#/check/K252078`](http://127.0.0.1:8765/#/check/K252078). -2. **Investigate K252078.** The verdict is **Review lineage**. Open the evidence graph or its *Timeline* mode: the recall diamonds sit *before* BreathePal's clearance. -3. **See what one more hop finds.** On the landing page, click **Two hops deep** under the hero (or open [`#/check/K251770`](http://127.0.0.1:8765/#/check/K251770)). *Why the graph matters* puts depth 1 (**No design-recall signal · provisional**) next to depth 2 (**Review lineage**, Class I design recall Z-1974-2021), with a PDF link at the cited page for each hop. +Then, with any setup, in about three minutes: + +1. **See what one more hop finds.** Open [`#/check/K251770`](http://127.0.0.1:8765/#/check/K251770), or click **Two hops deep** under the landing-page hero. *Why the graph matters* puts depth 1 (**No design-recall signal · provisional**) next to depth 2 (**Review lineage**, Class I design recall Z-1974-2021), with a PDF link at the cited page for each hop. +2. **Watch the thread.** The landing page opens with a short film that follows the one-hop case, K252078 → K113053 → the 2021 Class I recall (Skip or Esc ends it). Deep link: [`#/check/K252078`](http://127.0.0.1:8765/#/check/K252078). +3. **Investigate K252078.** The verdict is **Review lineage**. Open the evidence graph or its *Timeline* mode: the recall diamonds sit *before* BreathePal's clearance. 4. **Open the evidence.** Select any thread for its verbatim quote, a link to the FDA PDF at the cited page, and the PDF's SHA-256. *What needs human review* lists every uncertainty. 5. **Write to the graph.** Click **Save assessment to graph**. Under *What K252078 cites*, reject the edge: the lineage and verdict change at once and the saved assessment is marked **stale**. Restore it. 6. **Trace recall reach.** Open **Recall reach** for [`88058,88071`](http://127.0.0.1:8765/#/reach/88058,88071), the Philips recall filed as two openFDA events: 14 recalled clearances, 26 later devices descend from them, 8 of those were cleared after the recall on their own lineage began. @@ -123,7 +164,11 @@ The rebuild reproduces the same graph and counts, but the `.rl` bytes and the ti ## Why Relate -Predicate ancestry is a graph problem: a variable-depth walk over citations, a join to recalls at every hop, and a date comparison along the path. In tables that is a recursive query per device. In Relate it is one Cypher pattern, run in-process against a single file. +Predicate ancestry is a graph problem: a variable-depth walk over citations, a join to recalls at every hop, and a date comparison along the path. None of it strictly needs a graph database. A person can find Z-1974-2021 by reading two PDFs and searching FDA's recall database for each K-number, and SQL can express the walk as a recursive CTE. What Relate changes is the cost of asking: + +- **Depth is a parameter, not a rewrite.** The K251770 result above flips between `*1..1` and `*1..2` in the same pattern. The path comes back as a value, so the app shows each hop's page, quote, PDF hash and review state next to the answer. +- **Evidence and decisions live on the same edges.** Human reviews, audit decisions and saved assessments are written to the graph the queries walk, so rejecting a citation changes the lineage at once, and a saved assessment whose ancestry later changed is found by a query. +- **It runs everywhere the repo does.** One committed file opened in-process, with no server, so every one of the 1,040 in-family devices gets the same check in the build instead of a manual lookup per candidate. **Single-file mode.** The whole graph lives in [`data/forebear.rl`](data/forebear.rl), about 6.5 MB, committed to the repo. It persists every write the app makes (human reviews, saved assessments, live ingests, agent runs) and is opened in-process through `relate-db` 1.0.2. There is no database server to run. The FastAPI app is the only writer, pinned to one thread. @@ -148,7 +193,7 @@ graph LR | `Recall` nodes / `SUBJECT_OF` relationships | 563 / 762 | | `Company` / `ProductCode` nodes | 301 / 76 | -The discovery as one query (simplified: the app's version also applies human-review and audit rules to every edge, see `LINEAGE_EDGE` in [`forebear/graph.py`](forebear/graph.py)): +The same query for the one-hop BreathePal case (simplified: the app's version also applies human-review and audit rules to every edge, see `LINEAGE_EDGE` in [`forebear/graph.py`](forebear/graph.py)). Depth 2 also surfaces recalls on BreathePal's grand-predicates: ```cypher MATCH path = (d:Device {k: 'K252078'})-[:CITES*1..2]->(a:Device) @@ -213,16 +258,31 @@ Continuous integration runs ruff and `pytest` (Ubuntu and Windows), a stale-`web | [Investigation agent](docs/INVESTIGATION_AGENT.md) | Tools, loop, safety boundaries, CLI and HTTP API, persisted runs in Relate | | [Agent evaluation](docs/AGENT_EVALUATION.md) | Frozen 24-case protocol, deterministic vs live results, failure analysis | | [UX: "The Invisible Thread"](docs/UX_EXPERIENCE.md) | The opening film, the workspace and the design system | -| [Example investigations](docs/investigations/) | Four committed reports with tool traces, including [K252078](docs/investigations/K252078_I-ce598786bd48.md) | +| [Example investigations](docs/investigations/) | Four committed reports with tool traces, including [K251770](docs/investigations/K251770_I-8203364b195e.md) and [K252078](docs/investigations/K252078_I-ce598786bd48.md) | +| [Third-party notices](THIRD_PARTY_NOTICES.md) | Data rights, manufacturer-authored text, trademarks, bundled fonts and libraries | +| [Submission checklist](docs/SUBMISSION_CHECKLIST.md) | What to confirm before the Devpost entry goes in | + +## Data, licensing and attribution + +- **Code and docs** written for Forebear are under the [MIT License](LICENSE). +- **openFDA records** (510(k), recall, enforcement, classification) are public domain under openFDA's [CC0 1.0 dedication](https://open.fda.gov/license/). Data provided by the U.S. Food and Drug Administration (). FDA has not reviewed or endorsed this project. +- **510(k) summary text** is written by the submitting companies, not by FDA, so it is **not** claimed as public domain and is not covered by the MIT License. The repository keeps its extracted page text (not the PDFs) so that every citation can be checked and the graph rebuilt offline; each quote links to FDA's copy. Details and a removal route: [third-party notices](THIRD_PARTY_NOTICES.md). +- **Names** of devices and companies are used only as identifiers from FDA records and belong to their owners. The bundled Inter and Newsreader fonts are under the SIL Open Font License 1.1. + +## AI assistance (disclosure) + +- **Building the project.** Claude Code, an AI coding assistant, wrote most of the code, tests and documentation, including this README, under the author's direction. +- **Evidence labels.** The extraction-audit decisions in [`data/audit/link_decisions.json`](data/audit/link_decisions.json), the extraction-evaluation labels in [`eval/`](eval/) and the 2026-11-20 source-correction checks in [data provenance](data/PROVENANCE.md) were made by Claude Code agents, not people. Each is labelled that way in the data and kept out of the human-review fields. No human review has been recorded yet. +- **At run time,** no language model produces a verdict, a count or an audit decision. The two optional features below are the only model calls, and both are off unless an NVIDIA API key is configured. +- **Example reports.** The four reports in [`docs/investigations/`](docs/investigations/) were written by the optional investigation agent and say so in each file.
-AI and third-party tools (disclosure) +Optional model features and libraries - **Optional LLM triage.** NVIDIA-hosted `nvidia/nemotron-3.5-lightning-30b-a3b` (fallback `mistralai/mistral-large-4-1t-a52b`) labels *ambiguous* citation mentions on request. Its output must quote the snippet verbatim or it is discarded. An LLM label is advisory: it is shown with its provenance but never changes the lineage or a verdict until a person confirms the citation. - **Optional investigation agent.** NVIDIA-hosted `nvidia/nemotron-3-ultra-550b-a55b` (same fallback). It chooses tool calls and writes findings, but produces no verdicts or counts and cannot change lineage. - Both need `NVIDIA_API_KEY` and `NVIDIA_BASE_URL` in `.env` (see [`.env.example`](.env.example)). Everything else works without them. -- **Libraries.** Relate (`relate-db`), FastAPI, Uvicorn, pypdf, httpx, React 18, Vite. Optional OCR refresh: RapidOCR and pypdfium2 ([`requirements-ocr.txt`](requirements-ocr.txt)). -- **Built with** Claude Code, an AI coding assistant, which wrote most of the code and docs under the author's direction. +- **Libraries.** Relate (`relate-db`), FastAPI, Uvicorn, pypdf, httpx, React 18, Vite. Optional OCR refresh: RapidOCR and pypdfium2 ([`requirements-ocr.txt`](requirements-ocr.txt)). Licenses: [third-party notices](THIRD_PARTY_NOTICES.md).
@@ -231,5 +291,5 @@ Continuous integration runs ruff and `pytest` (Ubuntu and Windows), a stale-`web
Forebear mark
-FDA data is US federal government work in the public domain. Code under the MIT License. +Code under the MIT License. openFDA data under CC0; manufacturer-authored summary text keeps its authors' rights. See third-party notices.
diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md new file mode 100644 index 0000000..78b5a12 --- /dev/null +++ b/THIRD_PARTY_NOTICES.md @@ -0,0 +1,40 @@ +# Third-party data, content and software + +The [MIT License](LICENSE) covers the code and documentation written for Forebear. It does not cover the FDA material, manufacturer-authored text or third-party software described here, which keep their own terms. This file states what the repository contains and the terms its sources publish. It is not legal advice. + +## FDA data + +| What | Where in the repo | Published terms | +| --- | --- | --- | +| openFDA records: 510(k), device recall, enforcement and classification endpoints | `data/raw/openfda/`, and derived values in `data/forebear.rl` | openFDA dedicates its content and data to the public domain under [CC0 1.0](https://open.fda.gov/license/), with no warranty. Its [terms](https://open.fda.gov/terms/) ask for credit (not required) and the license asks users not to imply endorsement. | +| FDA-authored pages, such as 510(k) clearance letters and recall records on accessdata.fda.gov | Page text in `data/raw/summaries/`; links throughout the docs | FDA states that fda.gov content is not copyrighted and is in the public domain, "unless otherwise noted" ([website policies](https://www.fda.gov/about-fda/about-website/website-policies)). | + +Data provided by the U.S. Food and Drug Administration (). FDA has not reviewed or endorsed Forebear, and its warranties disclaimer applies to everything derived from these sources. + +## 510(k) summary text written by manufacturers + +A 510(k) summary is written by the company that submitted the device (21 CFR 807.92) and published by FDA. openFDA's terms note that some FDA-published data "may not be public domain", including copyrightable works that private entities gave to FDA. Forebear therefore **does not claim** that summary text is public domain. + +- **What is included.** `data/raw/summaries/{K}.json` and `data/raw/ocr/{K}.json` hold the extracted text of each cached FDA PDF, page by page, with its URL and SHA-256. The PDFs themselves are not included. The Relate store, the example reports in `docs/investigations/` and the UI show short quoted excerpts with page numbers. +- **Why.** The text is there so that every predicate citation can be checked against its source and the graph can be rebuilt offline (`tests/test_reproducibility.py`). Each excerpt links back to FDA's copy of the PDF. +- **Rights.** Any rights in this text stay with its authors, and the MIT License does not apply to it. Rights holders who want their text removed from the cache can ask the maintainer through the repository. `scripts/fetch_data.py` regenerates the cache from FDA when a redistributable copy is not wanted. + +## Names and trademarks + +Device, company and product names (for example Philips Respironics, DreamStation, BiPAP, REMstar, SleepRes and BreathePal) appear only as identifiers taken from FDA records. They belong to their owners. Forebear is not affiliated with, or endorsed by, FDA or any company it names. + +## Research cited + +The README cites FDA's 2023 draft guidance on predicate selection and Kadakia et al., *JAMA* 2023 (PubMed 36625810). Only their findings are summarized; no text is reproduced. + +## Software shipped in the repository + +| Component | Where | License | +| --- | --- | --- | +| Inter variable font (via `@fontsource-variable/inter` 5.3.0) | `web/dist/assets/inter-*.woff2` | SIL Open Font License 1.1, [full text](docs/licenses/Inter-OFL-1.1.txt) | +| Newsreader variable font (via `@fontsource-variable/newsreader` 5.3.0) | `web/dist/assets/newsreader-*.woff2` | SIL Open Font License 1.1, [full text](docs/licenses/Newsreader-OFL-1.1.txt) | +| React and React DOM 18.3.1 | bundled into `web/dist/assets/index-*.js`; their license headers are kept in the bundle | MIT | + +## Software installed, not redistributed + +Python dependencies are installed from PyPI by `pip install -r requirements.txt` (or in the Docker build) and are not committed. They include `relate-db` 1.0.2 (Apache-2.0), FastAPI, Starlette, Uvicorn, Pydantic, httpx, pypdf, truststore, python-dotenv and the `openai` client, each under its own license. The optional OCR packages are listed in `requirements-ocr.txt`. The Relate CLI is not bundled: the README explains how to download it and check it against [`docs/relate-v1.0.2-SHA256SUMS.txt`](docs/relate-v1.0.2-SHA256SUMS.txt). diff --git a/data/PROVENANCE.md b/data/PROVENANCE.md index 3b87df7..1dd972c 100644 --- a/data/PROVENANCE.md +++ b/data/PROVENANCE.md @@ -1,6 +1,6 @@ # Data provenance -All data is US federal government work, which is public domain in the US. It was fetched on 2026-11-16 with no API key. +All data was fetched from FDA on 2026-11-16 with no API key. openFDA records are dedicated to the public domain under [CC0 1.0](https://open.fda.gov/license/), and FDA-authored pages are in the public domain. The 510(k) summary text in `data/raw/summaries/` and `data/raw/ocr/` is different: summaries are written by the submitting companies, so Forebear makes no public-domain claim for that text. See [third-party notices](../THIRD_PARTY_NOTICES.md). | Source | Endpoint / URL pattern | What we keep | Where | |---|---|---|---| diff --git a/docs/SUBMISSION_CHECKLIST.md b/docs/SUBMISSION_CHECKLIST.md new file mode 100644 index 0000000..e6b613b --- /dev/null +++ b/docs/SUBMISSION_CHECKLIST.md @@ -0,0 +1,43 @@ +# Devpost submission checklist + +For the maintainer, before the entry goes in. Check each item against the hackathon's own rules page: its deadline (with time zone), eligibility, video length, required technologies and judging criteria take precedence over this list. + +## Repository + +- [ ] **Judges can open the repo.** It is currently private (CodeQL and dependency review are skipped for that reason). Make it public, or grant access the way the rules require. +- [ ] **If it goes public**, re-run the Security workflow and check that CodeQL and dependency review pass. The README must not call a skipped run a pass. +- [ ] **`main` is green.** Backend, Frontend, Security and Hygiene badges at the top of the README. +- [ ] **Fresh-clone run.** Follow the [README walkthrough](../README.md#judge-walkthrough) on a clean machine or folder, by Docker and natively. returns `"ok": true` and [`#/check/K251770`](http://127.0.0.1:8765/#/check/K251770) shows depth 1 and depth 2 side by side. +- [ ] **No secrets.** `.env` is gitignored and gitleaks runs in CI. Keep `.env`, API keys and terminal history out of the video and screenshots. +- [ ] **Tag the submitted commit** so judges see exactly what was entered. + +## Devpost fields + +- [ ] **Story.** Lead with K251770: provisional "no design-recall signal" at one generation, **Review lineage** at two, because FDA lists the grand-predicates (not the DreamStation 2) on Class I recall Z-1974-2021. Then BreathePal (K252078) as the one-hop case. +- [ ] **Claims match the README.** Use the "Why Relate" wording. Do not say the recall can *only* be found with a graph: a person can find it by reading two PDFs and searching FDA's recall database. Relate makes it one parameterized query, with the evidence on every edge, run for every device. +- [ ] **Numbers come from the README's "Results, honestly" table**, including the no-go result for the investigation agent and "no human review yet". +- [ ] **Built with:** Relate (`relate-db` 1.0.2), Python 3.12, FastAPI, React, Vite, openFDA, plus the optional NVIDIA-hosted models (named in the README) and Claude Code. +- [ ] **Links:** repository, video, and the FDA PDF and recall links from the README tables. +- [ ] **Images.** Devpost galleries take raster images, so export `docs/assets/forebear-hero.svg` or use app screenshots. + +## Video + +- [ ] Opens on K251770 depth 1 vs depth 2 and the decision it changes; shows a quote opening the FDA PDF at its cited page. +- [ ] Shows or says the disclaimer: documented lineage and recall history, not regulatory advice or a safety finding. +- [ ] Within the rules' length limit; music and footage are yours or licensed for this use. + +## Disclosures + +- [ ] **AI assistance:** copy the README's [AI assistance](../README.md#ai-assistance-disclosure) section into the Devpost description, or link it, if the rules ask for disclosure. +- [ ] **Data and licensing:** link [third-party notices](../THIRD_PARTY_NOTICES.md). openFDA data is CC0; 510(k) summary text is written by manufacturers and is not claimed as public domain; FDA has not endorsed the project. +- [ ] **Pre-existing work:** if the rules restrict code written before the hackathon window, check the commit history against the window and say what came before. + +## Facts and the tests that guard them + +| Claim | Test | +| --- | --- | +| K251770 depth 1 and depth 2 verdicts, hops, quotes, Z-1974-2021 holders and the README query results | [`tests/test_two_hop_story.py`](../tests/test_two_hop_story.py) | +| K252078 → K113053 → Z-1957-2021 / Z-1958-2021 and the BreathePal evidence table | [`tests/test_story_facts.py`](../tests/test_story_facts.py), [`tests/test_shipped_evidence.py`](../tests/test_shipped_evidence.py) | +| Offline rebuild matches the shipped store | [`tests/test_reproducibility.py`](../tests/test_reproducibility.py) | + +Run `.venv\Scripts\python.exe -m pytest` after any change to `data/` or the README's evidence tables. diff --git a/docs/licenses/Inter-OFL-1.1.txt b/docs/licenses/Inter-OFL-1.1.txt new file mode 100644 index 0000000..40589da --- /dev/null +++ b/docs/licenses/Inter-OFL-1.1.txt @@ -0,0 +1,93 @@ +Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) Inter-Italic[opsz,wght].ttf: Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/licenses/Newsreader-OFL-1.1.txt b/docs/licenses/Newsreader-OFL-1.1.txt new file mode 100644 index 0000000..03ad13c --- /dev/null +++ b/docs/licenses/Newsreader-OFL-1.1.txt @@ -0,0 +1,93 @@ +Copyright 2020 The Newsreader Project Authors (http://github.com/productiontype/Newsreader) Newsreader-Italic[opsz,wght].ttf: Copyright 2020 The Newsreader Project Authors (http://github.com/productiontype/Newsreader) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE.