Skip to content

feat(clinical): add evidence recency labels - #3171

Open
maziyarpanahi wants to merge 1 commit into
masterfrom
dev/v3-issue-2744
Open

maziyarpanahi wants to merge 1 commit into
masterfrom
dev/v3-issue-2744

Conversation

@maziyarpanahi

Copy link
Copy Markdown
Owner

Pull Request

Description

Adds deterministic, local-only recency labels for evidence supporting guarded
clinical claims. Explicit evidence and reference timestamps are classified as
current, stale, future-dated, or unknown using configurable thresholds.
Missing or malformed timestamps fail closed to an explicit unknown label.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to work differently)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition/improvement

Changes Made

  • Added EvidenceRecencyPolicy, controlled labels, and deterministic single-item assessments.
  • Added value-free reports with label counts, review flags, stable JSON/Markdown rendering, and no retained timestamps, claim text, identifiers, or arbitrary metadata.
  • Added synthetic coverage for all labels, configurable boundaries, timezone normalization, unknown handling, deterministic serialization, and privacy-safe errors/reports.
  • Added the clinical guide, MkDocs navigation, and publication manifest entry.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this change with different models/inputs

Exact local validation:

.venv/bin/python -m pytest tests/unit/clinical/test_evidence_recency.py -q — 10 passed
.venv/bin/python -m pytest tests/unit/test_docs_publication.py::test_publication_classifies_every_default_markdown_page_exactly_once -q — 1 passed
make format — passed; 2036 files unchanged
make lint — passed
make format-check — passed; 2036 files already formatted
make type-check — passed; no issues in 4 configured source files
.venv/bin/mypy --python-version 3.10 openmed/clinical/evidence_recency.py — passed
make docs-build — passed; strict MkDocs and Pages publication validation completed
git diff --cached --check — passed before commit

Checks intentionally not run or awaited:

  • The full repository pytest suite (.venv/bin/python -m pytest tests/ -q), per the issue-run validation policy.
  • GitHub CI checks; this PR is submitted without waiting for remote checks.
  • Swift/OpenMedKit checks; no Swift files changed.
  • Model benchmarks and external/network-backed integrations; this feature is standard-library-only and offline.

The docs build emitted existing repository/plugin warnings; it completed
successfully and did not report a documentation error.

Documentation

  • I have updated the documentation accordingly
  • I have added docstrings to new functions/classes
  • I have updated the CHANGELOG.md (not applicable to this issue-scoped v3 feature; no release metadata changed)

Code Quality

  • I ran make format, make lint, and make format-check
  • For Swift/OpenMedKit changes, I ran make format-swift and make lint-swift
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings (the docs build retains existing repository/plugin warnings)

Dependencies

  • I have not added any new dependencies
  • OR I have added new dependencies and they are justified because: ____

Checklist

Related Issues

Closes #2744

Screenshots/Examples

Not applicable. The documentation includes synthetic Python examples for
single-label classification and value-free reports.

@maziyarpanahi maziyarpanahi added feature New capability P0 Critical roadmap-v3 OpenMed V3 roadmap backlog labels Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New capability P0 Critical roadmap-v3 OpenMed V3 roadmap backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add evidence recency labels for guarded clinical claims

1 participant