一键导入
reproduce-study
Run a reproducibility audit on a vitrine study — re-executes scripts, checks determinism, and verifies claims against outputs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run a reproducibility audit on a vitrine study — re-executes scripts, checks determinism, and verifies claims against outputs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Draft a research paper skeleton from a vitrine study's provenance trail — decisions, annotations, scripts, tables, and plots become an IMRAD manuscript with auto-generated Methods and supplementary appendices.
Compile a structured research report from a vitrine study — gathers cards, decisions, annotations, and scripts into an organized REPORT.md.
The agent's research journal and live display. Documents decisions, findings, and rationale as persistent cards; collects structured researcher input; creates an exportable provenance trail across research studies.
| name | reproduce-study |
| description | Run a reproducibility audit on a vitrine study — re-executes scripts, checks determinism, and verifies claims against outputs. |
| tier | community |
| category | system |
Re-execute every script in a vitrine study, check determinism, and verify that card claims match script outputs. Produces a REPRODUCIBILITY.md report and a live summary card.
from vitrine import study_context, register_output_dir, show
import pandas as pd
from pathlib import Path
STUDY = "<study-label>" # provided as context when dispatched
output_dir = register_output_dir(study=STUDY)
Call study_context(STUDY) and read the result. Note:
card_count — total cards in the studycards — list of card dicts, each with card_id, title, type, previewdecisions_made — decisions and their outcomesRead PROTOCOL.md and RESULTS.md from output_dir if they exist — these contain claims to verify.
List all .py files in output_dir / "scripts/". Sort by filename (they should be numbered: 01_cohort_definition.py, 02_baseline.py, etc.).
If there are no scripts, post a single card explaining that the study has no scripts to audit and stop.
Post an initial progress card and capture the card ID for progressive updates:
progress = "| Script | Status | Deterministic | Output Matches |\n"
progress += "|--------|--------|---------------|----------------|\n"
for script in scripts:
progress += f"| `{script.name}` | pending | -- | -- |\n"
card_id = show(progress, title="Reproducibility Audit", study=STUDY)
For each script in order:
Run 1 — Execute the script via the Bash tool: python scripts/NN_name.py from the output directory. Capture stdout/stderr and exit code. Record output files produced in data/ and plots/ (snapshot filenames and file hashes).
Run 2 — Execute the same script a second time. Capture the same information.
Check determinism — Compare output file hashes between Run 1 and Run 2. If all hashes match, the script is deterministic. If any differ, flag it.
Check claims — Look through the study's cards for any card whose title or content references this script's outputs (e.g., a card titled "Cohort" that shows a DataFrame likely came from 01_cohort_definition.py). Compare:
Update progress card — After each script completes, update the card in-place:
# Build updated table with results so far
progress = "| Script | Status | Deterministic | Output Matches |\n"
progress += "|--------|--------|---------------|----------------|\n"
for entry in results:
progress += f"| `{entry['script']}` | {entry['status']} | {entry['deterministic']} | {entry['matches']} |\n"
# Remaining scripts still pending
for script in remaining:
progress += f"| `{script.name}` | pending | -- | -- |\n"
show(progress, title="Reproducibility Audit", replace=card_id, study=STUDY)
Save a full report to output_dir / "REPRODUCIBILITY.md" with:
# Reproducibility Report
**Study:** <study-label>
**Date:** <ISO date>
**Scripts audited:** N
## Summary
| Script | Status | Deterministic | Output Matches |
|--------|--------|---------------|----------------|
| `01_cohort_definition.py` | pass | yes | yes |
| `02_baseline.py` | pass | yes | unverifiable |
| ... | ... | ... | ... |
## Verdict
X/Y scripts pass, Z/Y deterministic, W/Y claims verified, V unverifiable.
## Details
### 01_cohort_definition.py
- **Status:** pass
- **Deterministic:** yes — output hashes identical across runs
- **Output matches:** yes — cohort.parquet has 4238 rows, card "Cohort" shows 4238 rows
- **Outputs:** data/cohort.parquet (sha256: abc123...)
### 02_baseline.py
...
## Non-Deterministic Scripts
[List any scripts that produced different outputs across runs, with details on what differed.]
## Unverifiable Claims
[List any cards whose claims could not be traced back to a script output.]
## Failures
[List any scripts that failed to execute, with error messages.]
Update the progress card one last time with the verdict line appended:
verdict = f"\n**Verdict:** {pass_count}/{total} scripts pass, {det_count}/{total} deterministic, {match_count}/{total} claims verified, {unverifiable_count} unverifiable."
show(progress + verdict, title="Reproducibility Audit", replace=card_id, study=STUDY)
Always run from the output directory. Scripts use Path(__file__).resolve().parent.parent to find data/ and plots/, so the working directory must be output_dir.
Hash comparison for determinism. Use SHA-256 hashes of output files, not content comparison. For parquet files, hash the file bytes. Some non-determinism is acceptable in floating-point edge cases — note it but don't fail the script.
Claim matching is best-effort. Not every card will map cleanly to a script. Use title keywords, output filenames, and row counts as heuristics. Mark anything ambiguous as "unverifiable" rather than guessing.
Do not modify scripts. This is an audit — run scripts as-is. If a script fails, record the failure and move on. (You are working in a sandbox copy; the original study files are safe.)
Use study=STUDY on every show() call. This keeps audit cards grouped with the study being audited.
Progressive updates use replace=card_id. The first show() returns a DisplayHandle (string-like card ID). Pass it as replace= to update the same card.