Skip to main content

trace-agent — clinical data traceability checker

MIT License Python 3.9+ PyPI

Free, open-source tool that finds traceability gaps in CDISC submissions before the FDA does.

Given a study's CDISC define.xml (2.0/2.1) and its SAS transport (XPT) datasets, trace-agent builds a variable-level lineage graph (ADaM ← SDTM ← aCRF/protocol) and flags traceability gaps — the #1 source of findings in regulatory review.

🚀 Try the live demo in your browser — no install needed.

Install

pip install cdisc-trace-agent

Or from source:

git clone https://github.com/girishkankipati2-pixel/trace-agent.git
cd trace-agent
pip install -e .

Run

trace-agent --study <study-folder> --out report.html

The study folder must contain define.xml at its root and *.xpt files at the root or in an xpt/ subdirectory. A text summary is printed and a self-contained HTML report (inline SVG + JS, no external dependencies) is written to --out. The report has summary counts, a gap table, and a clickable lineage graph (click a node to highlight its lineage).

Demo

python make_demo.py                                  # builds demo_study/
python trace_agent.py --study demo_study --out demo_report.html

demo_study/ is a tiny synthetic study (SDTM DM + AE, ADaM ADSL) with five deliberately planted gaps — see demo_study/planted_gaps.txt. The demo run should report all of them.

Gaps detected

Code Meaning
XPT_ONLY Variable present in XPT but missing from define.xml
DEFINE_ONLY Variable defined in define.xml but missing from XPT
DERIVED_NO_METHOD ADaM variable with Origin=Derived but no MethodDef/description
DANGLING_REF Derivation references a variable defined nowhere
NO_SDTM_PATH ADaM variable with no predecessor chain reaching SDTM

How lineage is resolved

For each variable, predecessors are resolved from, in order:

  1. The linked def:MethodDef (via ItemRef/@MethodOID, per the Define-XML 2.0 spec) — description and formal-expression text are scanned for DOMAIN.VAR references.
  2. Inline def:Origin description text (same reference scanning).
  3. def:Origin Type="Predecessor" — links to the same-named variable in SDTM datasets.

Explicit dotted references (DM.AGE) are authoritative; bare tokens only count when they uniquely match one known variable name.

Limitations (v1)

  • Annotated CRF / protocol documents are not parsed; CRF origins are recorded but not linked to pages.
  • def:DocumentRef, value-level metadata (ValueListDef), and ARM (arm:AnalysisResult) are not yet followed.
  • Dataset role (SDTM vs ADaM) uses def:Class, falling back to an AD* name heuristic.
  • Reference extraction from derivation prose is heuristic text matching, not SAS parsing.

Metadata

Release files for cdisc-trace-agent 1.0.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 cdisc-trace-agent 1.0.0
File Size Uploaded Provenance Actions
cdisc_trace_agent-1.0.0.tar.gz 12.8 kB Without provenance Details for cdisc_trace_agent-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cdisc-trace-agent 1.0.0
File Interpreter ABI Platform Actions
cdisc_trace_agent-1.0.0-py3-none-any.whl Python 3 none any Details for cdisc_trace_agent-1.0.0-py3-none-any.whl

Total release size: 26.3 kB

Release files / cdisc_trace_agent-1.0.0.tar.gz

Download URL cdisc_trace_agent-1.0.0.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4239b849e89f42a74b3d59bb529df9142a2bae6eb9a1ab2b9972f4e19b47ba98
BLAKE2b-256 checksum
How to use checksums
7adf7ef7d154e0affbbfcf9b5afe11885834f33b2fcb86820941d3b13076329a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / cdisc_trace_agent-1.0.0-py3-none-any.whl

Download URL cdisc_trace_agent-1.0.0-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44db6dbd7aae87ef2fa16e1b88bc674dc384eeac26a46b1eea9084f6aac477b5
BLAKE2b-256 checksum
How to use checksums
24eabe19958124a03ec15b51fd67e3dbf334daceb60999f9a42f7332151f5811
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for cdisc-trace-agent 1.0.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

1.0.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