SciTeX Clew (scitex-clew)
Trace every manuscript claim back to the code and data that produced it.
Full Documentation · uv pip install "scitex-clew[all]"
Problem and Solution
| # | Problem | Solution |
|---|---|---|
| 1 | Unverified claims — reviewers cannot tell which code and data produced a number in a manuscript. | Claim back-trace — each registered claim resolves to the runs and files behind it in a hash-linked DAG. |
| 2 | Silent drift — outputs change after the code or inputs move on, and nobody notices. | Hash verification — clew verify re-hashes recorded files and names the first broken link. |
| 3 | Logging is extra work — provenance tools need calls researchers forget to make. | Unconscious capture — @stx.session and stx.io record inputs, scripts and outputs as a side effect. |
Why claim binding matters. In a seizure-forecasting analysis (2026-06-30) two same-named scripts produced "Table 03". One fabricated timestamps and showed near-chance numbers; the other used the real time column. Both looked like the source until each claim had to resolve to one registered session. That incident made clew registration mandatory for every manuscript value (ADR-0021).
Clew establishes provenance (this result came from this code and data, unchanged), not correctness. The name is the thread Ariadne gave Theseus to find his way back through the labyrinth.
Quick Start
import scitex_clew as clew
clew.status() # git-status-like overview
clew.run("session_20250301_143022") # verify one run (hash check)
clew.chain("output/figure.png") # trace a file's provenance chain
clew.dag(["output/figure.png"]) # verify the DAG behind a target
clew.rerun("session_20250301_143022") # re-execute in a sandbox and compare
Figure 1. DAG verification. Green nodes are sessions whose recorded hashes still match disk; red nodes flag a drift.
Demo
Figure 2. Clew — a thread of evidence (concept clip, narrated).
Installation
uv pip install "scitex-clew[all]"
Requires Python >= 3.10. Records go to PostgreSQL through
scitex_dev.store.host_store(): SCITEX_STORE_DSN when set, otherwise a
per-user local store under ~/.scitex/store/local, created on first use. The
local store needs the PostgreSQL server binaries (initdb, pg_ctl) from
your OS, conda, or pip install 'scitex-dev[local-store]' (Python <= 3.12).
Architecture
graph LR
S[Source<br/>01_download.py] --> I[Input<br/>raw_data.csv]
I --> P[Processing<br/>03_analyze.py]
P --> O[Output<br/>figure1.png]
O --> C[Claim<br/>'Fig 1: p<0.05']
Figure 3. The five node classes. Verification walks backward from a claim to its sources, checking every hash on the way.
| Mode | API | Answers |
|---|---|---|
| Project | clew.dag() |
Is the whole project intact? |
| Files | clew.dag(["output.csv"]) |
Can I trust this specific file? |
| Claims | clew.verify_claim("Fig 1") |
Is this figure or statistic still backed by the data? |
Table 1. Three verification modes. Each supports cache verification (hash comparison) and re-run verification (sandbox re-execution).
What clew guarantees, each with its full statement in a skill page:
- Verification covers only what a claim rests on.
clew.prune(target)(CLIclew prune) keeps the runs and files on a path to the target; claim verification uses this pruned graph. The pre-0.40slicenames remain as deprecated aliases until 1.0.0. Pruned graph - Caches never hide a change. Every cache key is a SHA-256 of live file bytes; no mtime logic. Python API
- Capture is automatic inside the project root. Files read from outside it are recorded as external inputs with their hash. Unconscious capture
- Killed runs keep their record. A per-session journal is replayed on the next start. Killed runs
- Recording can be turned off.
SCITEX_CLEW_CAPTURE=0disables all automatic recording. Environment variables - Large pipelines stay readable. Groupers collapse per-subject files into one node with a Merkle root. Grouping
Four Interfaces
🐍 Python API ⭐⭐⭐ — import scitex_clew as clew
clew.add_claim("Fig 1 shows p<0.05", source_files=["fig1.png"])
clew.verify_claim("Fig 1")
clew.mermaid(claims=True) # Mermaid DAG diagram
clew list-python-apis -v prints the full API.
Full API reference
💻 CLI ⭐⭐⭐ — clew
clew status # overview
clew verify # verify every registered claim
clew dag --strict --json # strict DAG check with failure attribution
clew export-evidence --out report.json
clew --help-recursive # every command
🔧 MCP Server ⭐⭐ — clew mcp start
Agents verify runs, trace provenance and manage claims with the same
operations as the Python API. clew mcp list-tools -vv lists every tool with
its arguments.
📖 Skills ⭐⭐ — clew docs list
Workflow pages for agents: claims, evidence bundles, the evidence provider, capture boundaries and common workflows.
clew docs list
scitex-dev skills export --package scitex-clew # install for Claude Code
SciTeX Ecosystem
flowchart LR
session["scitex-session"] -->|run hooks| clew["<b>scitex-clew</b>"]
io["scitex-io"] -->|load/save hooks| clew
scholar["scitex-scholar"] -->|resolved citations| clew
clew -->|evidence-report 1.3.0<br/>entry point, no import| lp["scitex-live-paper"]
lp -->|PDF viewer| rp["scitex-rich-pdf"]
Figure 4. scitex-clew and the packages it is most often used with.
- scitex-session and scitex-io own running scripts and file I/O; clew subscribes to their hooks and records what they open and write.
- scitex-scholar resolves
\citekeys; clew keeps the citation ledger and checks manuscript citations against it. - scitex-live-paper renders the paper and per-claim state. It never imports clew: clew owns the evidence-provider adapter and reports through the
scitex-live-paper.evidence-report1.3.0 contract, found by thescitex.livepaper.renderersentry point. Evidence provider - scitex-rich-pdf is the PDF viewer live-paper uses; clew does not touch it.
With the umbrella, one decorator records a whole run:
import scitex as stx
@stx.session
def main(CONFIG=stx.INJECTED):
data = stx.io.load("input.csv") # recorded as input
stx.io.save(process(data), "output.csv") # recorded as output
return 0
Part of SciTeX
scitex-clew is part of SciTeX.
The SciTeX system follows the Four Freedoms for Research below, inspired by the Free Software Definition:
Four Freedoms for Research
- The freedom to run your research anywhere — your machine, your terms.
- The freedom to study how every step works — from raw data to final manuscript.
- The freedom to redistribute your workflows, not just your papers.
- The freedom to modify any module and share improvements with the community.
AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.
Metadata
Release files for scitex-clew 0.42.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scitex_clew-0.42.2.tar.gz | 7.6 MB | Without provenance | Details for scitex_clew-0.42.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scitex_clew-0.42.2-py3-none-any.whl | Python 3 | none | any | Details for scitex_clew-0.42.2-py3-none-any.whl |
Total release size: 14.2 MB
Release files / scitex_clew-0.42.2.tar.gz
| Download URL | scitex_clew-0.42.2.tar.gz |
|---|---|
| Size | 7.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c552083fe3357cc5fe2347965389af0259ca47af84ea1c8fb1f574c6e77edb6
|
|
BLAKE2b-256 checksum How to use checksums |
433ccf4a6f7a755897e616605342bf567f7cd18374d2bf3a22ced1ee4df2a82c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / scitex_clew-0.42.2-py3-none-any.whl
| Download URL | scitex_clew-0.42.2-py3-none-any.whl |
|---|---|
| Size | 6.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
18773302fbc82c2864e0d1330e5505b27c35f16fce13d2391a46bde8b0d157bc
|
|
BLAKE2b-256 checksum How to use checksums |
5c9c513381e396ee6587b8c099fde7d76651f759eb70ec8adb3d067e32972186
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Security for scitex-clew 0.42.2
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.