Skip to main content

CARE-TRACE

Audit a literature-grounded covariate decision before anyone treats the include list as an adjustment set.

Python License: MIT

CARE-TRACE retrieves passages, applies the study's include / exclude / unresolved rule, and scores a decision on synthetic data where the effect is known. A completed include can be the wrong include. The package does not certify a causal adjustment, and it does not recommend a treatment.

CARE-TRACE workflow

pip install -e .
caretrace demo

caretrace demo builds two synthetic passages, labels one cited record and one citation that was not shown, and fits a cross-validated augmented inverse-probability estimate on a synthetic draw. Nothing in that command reads a patient file or calls an external model.

What the package does

Piece Where
BM25, top 3, identifier bonus off care_trace.audit.bm25_hits
Embedding scores as a dot product of L2-normalized vectors care_trace.audit.embedding_hits
Include, exclude, or unresolved care_trace.audit.label_decision
Baseline report, with non-baseline covariates removed care_trace.audit.covariate_report
Synthetic effect and cross-fit AIPW care_trace.designs, care_trace.aipw
Worked example examples/synthetic_audit.py
from care_trace.audit import label_decision

label_decision(
    {
        "truncated": False,
        "json_valid": True,
        "generated_role": "confounder",
        "final_adjustment": "adjust",
        "generated_citations": ["age:relevant"],
        "known_timing": "baseline",
    },
    shown_ids={"age:relevant"},
    arm="bm25",
)

That call returns "include". The same record with a citation that was not shown returns "unresolved". covariate_report always sets validated_causal_estimate to false.

Local embedding models and FAISS are optional:

pip install -e ".[local]"

The base install uses the hashing embedder in the demo. That embedder is a deterministic stand-in. The study embedding was Qwen/Qwen3-Embedding-0.6B.

What stays out of this install

The All of Us reproduction is the cohort notebook and the job scripts in scripts/. Those scripts are not installed by pip. Do not put participant-level rows, clinical JSON from the workbench, or an API key in this repository. Do not send participant text to an external model API.

requirements.txt is the pinned research environment, including torch. The installable package does not require torch.

Tests

pip install -e ".[dev]"
python -m pytest tests/test_audit.py

Citation

The journal record and its DOI will be added when the tagged release is archived. Until then, cite the software repository:

https://github.com/Elyasirankhah/CARE_TRACE

Metadata

Release files for caretrace 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for caretrace 0.1.0
File Size Uploaded Provenance Actions
caretrace-0.1.0.tar.gz 113.8 kB Without provenance Details for caretrace-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for caretrace 0.1.0
File Interpreter ABI Platform Actions
caretrace-0.1.0-py3-none-any.whl Python 3 none any Details for caretrace-0.1.0-py3-none-any.whl

Total release size: 237.3 kB

Release files / caretrace-0.1.0.tar.gz

Download URL caretrace-0.1.0.tar.gz
Size 113.8 kB
Tags Source
SHA-256 checksum
How to use checksums
57ffe30b58dab85d00dc93b4d43a562a000b269777f1aa17e2f4409ad1e4fc85
BLAKE2b-256 checksum
How to use checksums
4177325e1526801eb9fbef2d4854ffd57ab2ea53b4143e80ed0e9ee1ed7df105
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / caretrace-0.1.0-py3-none-any.whl

Download URL caretrace-0.1.0-py3-none-any.whl
Size 123.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ee5e3aff37ab84a2c20de7e0b62a1fa0df5b5b80f7198c1c5adaac81a121a87
BLAKE2b-256 checksum
How to use checksums
0e6bd1650fbf0e8944b3910ddef9737d570c3f26682843c8a061e0db88fa0a9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Security for caretrace 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page