Studio 11 — Reproduce and package
Studio 11
Prove that someone who is not you can obtain your result from your materials.
Studio 11
This studio closes with Milestone 11: Your reproducible package, a short chapter of its own after the lessons. What it asks you to produce. An independent cold-run record and a reusable research package. Working alone, the record is a clean-environment rerun labeled “solo proxy; external cold run pending” — the label, and the honesty it enforces, are part of the artifact.
Studio 11 · Road map
Lesson 1 of this studio · Chapter 36
whether a result regenerates from the files alone, and which of its weaknesses most endangers the claim
Chapter 36
Handed nothing but the files a study shipped, yours or someone else’s, you decide whether the reported number actually comes back out. Then you rank the weaknesses you found by how much each one threatens the headline claim, not by how easy each one is to fix.
Chapter 36 · Key terms
Reproduction
getting the same number from the same data and code a study shipped (National Academies of Sciences, Engineering, and Medicine 2019).
Replication
getting a similar result from a new study or new data.
Chapter 36 · Why this decision matters
I do not care that your figure is pretty or that the code ran on your laptop. Hand me your files and let me get the same number back out. If I cannot, you do not have a result yet. You have a story. — a principal investigator reading a first-year researcher’s lab report
Chapter 36 · Why this decision matters
Chapter 36 · The concept
Chapter 36 · The concept
Reproducibility package
the full bundle a study ships so someone else can rebuild its numbers: the data, the code, the run order, any random seed, and the write-up
Headline number
the one figure the main claim rests on
Restart-and-run-all
clearing the notebook’s memory and running every cell from the top with no manual fixes
Chapter 36 · The concept
Claims-vs-computation agreement
checks that every sentence the write-up asserts is backed by a number the code actually prints
Alternative specification
a different but equally defensible way to compute the same headline, to see whether the answer depends on an undisclosed choice
Hidden assumption
a claim the analysis quietly relies on and never states, which the result would collapse without
Pseudoreplication
treating repeated measurements from the same animal, plate, or tank as independent data points when the real experimental unit is the animal, plate, or tank
Chapter 36 · A worked example
Chapter 36 · A worked example
Chapter 36 · A worked example
Chapter 36 · A worked example
Chapter 36 · A worked example
Chapter 36 · A worked example
Chapter 36 · A worked example
Chapter 36 · A worked example
import numpy as np, pandas as pd
SEED = 464
rng = np.random.default_rng(SEED)
tanks = pd.DataFrame({"tank": range(6), "probiotic": [True]*3 + [False]*3})
rows = []
for _, t in tanks.iterrows():
n = 40
tank_effect = rng.normal(0, 0.25) # tanks differ, larvae cluster
length = (4.60 + 0.25 * t.probiotic + tank_effect
+ rng.normal(0, 0.35, size=n))
# death is a POST-TREATMENT event, and the probiotic changes who dies
died = rng.random(n) < np.where(t.probiotic, 0.06, 0.18) * (length < 4.6)
rows.append(pd.DataFrame({"tank": t.tank, "probiotic": t.probiotic,
"length": length, "died": died}))
larvae = pd.concat(rows, ignore_index=True)
alive = larvae[~larvae.died]
gap_survivors = (alive[alive.probiotic].length.mean()
- alive[~alive.probiotic].length.mean())
gap_all = (larvae[larvae.probiotic].length.mean()
- larvae[~larvae.probiotic].length.mean())
by_tank = alive.groupby(["probiotic", "tank"]).length.mean()
gap_tank = (by_tank[True].mean() - by_tank[False].mean())
print(f"the write-up claims : 0.50 mm")
print(f"survivors, larva by larva : {gap_survivors:.2f} mm")
print(f"everyone, including the dead : {gap_all:.2f} mm")
print(f"tank means (n = 3 vs 3) : {gap_tank:.2f} mm")
print(f"\ndeaths: {larvae[larvae.probiotic].died.sum()} treated vs "
f"{larvae[~larvae.probiotic].died.sum()} control")
print("three defensible numbers, none of them 0.50, and the unit of")
print("randomization was the TANK, not the larva")Chapter 36
Where the tool failed
You paste the whole package into a general AI tool and ask, “Does this study reproduce, and are its limitations complete?” It answers with total confidence: yes, the code runs, and the limitations paragraph looks thorough, covering sample size, measurement noise, and a call for future work. Every sentence is fluent. The tool never once flags that 240 larvae came from only six tanks. It has quietly mistaken a long list for a complete one.
Chapter 36 · An AI failure case
Chapter 36
This stays yours
An AI tool connected to an execution environment can run the code, and asking it to is reasonable. What it cannot do is stand behind the result. So demand the evidence of the run rather than the summary of it: the commands, the environment and package versions, the exact version of the code and data it ran (a commit hash, if the package has one), whether each command exited cleanly or errored, the raw output, and which files it actually touched. A confident “it reproduces” with no execution record tells you nothing about whether the released package ran, a modified copy ran, or nothing ran at all. Then reproduce the headline yourself from a clean start, because the verdict carries your name. You also keep three judgments: which weakness most threatens the claim, how you rank the recommendations, and the final verdict on what the package can and cannot support. A tool proposes suspects. You decide which ones the evidence convicts.
Chapter 36 · Your move
Work it in the companion notebook with Chapter 36 open beside it. Log every delegation in your AI Research Ledger.
Lesson 2 of this studio · Chapter 37
what goes inside the capsule that ships with your work, and whether the sentence “this reproduces” is honest when you write it
Chapter 37
Decide what goes into the reproducibility capsule that ships with your research note, and defend the claim that a stranger can rerun your work and get your numbers. You own what the package includes and whether “it reproduces” is honest, and you never let a clean run stand in for a correct one.
Chapter 37 · Why this decision matters
I don’t want to hear that it runs on your laptop. Hand me the folder, let me clear everything, and let me press run. If your headline number does not come back on my machine, you do not have a result yet. You have a memory of one.
Chapter 37 · Why this decision matters
Chapter 37 · The concept
Reproducibility capsule
everything a stranger needs to rebuild your numbers and nothing they would have to guess (Wilson et al. 2017)
Restart-and-run-all
you clear the kernel and run every cell top to bottom with no memory of earlier clicks
Chapter 37 · The concept
Chapter 37 · The concept
Chapter 37 · The concept
The scan gets you to the starting line. A person who reruns you cold is the race.
Chapter 37 · A worked example
Chapter 37 · A worked example
turnout_clean.csv from your own Desktop, a file only your laptop has.Chapter 37 · A worked example
SEED = 464 before the bootstrap.Chapter 37 · A worked example
Chapter 37 · A worked example
import numpy as np, pandas as pd
SEED = 464 # sin four, fixed: the seed is pinned
rng = np.random.default_rng(SEED)
# Twelve counties of precinct turnout, with the two data problems the sinful
# capsule handled silently: a duplicated precinct name and missing registrations.
precincts = pd.DataFrame({
"county": np.repeat([f"county {i:02d}" for i in range(1, 13)], 25),
"precinct": [f"P{i:04d}" for i in range(300)],
"turnout": np.clip(rng.normal(0.44, 0.09, size=300), 0.05, 0.95),
})
precincts.loc[17, "precinct"] = precincts.loc[16, "precinct"] # the duplicate
precincts.loc[rng.choice(300, 14, replace=False), "turnout"] = np.nan
deduped = precincts.drop_duplicates("precinct")
missing = deduped.turnout.isna().sum()
below = (deduped.turnout < 0.40).sum() / deduped.turnout.notna().sum()
boot = [(rng.choice(deduped.turnout.dropna(), deduped.turnout.notna().sum())
< 0.40).mean() for _ in range(2000)]
lo, hi = np.percentile(boot, [2.5, 97.5])
print(f"precincts loaded : {len(precincts)}")
print(f"duplicate names removed : {len(precincts) - len(deduped)}")
print(f"registrations missing : {missing} (reported, not silently dropped)")
print(f"share below 40% turnout : {below*100:.1f}% [{lo*100:.1f}%, {hi*100:.1f}%]")
print("\nrerun this cell: the interval does not move, because the seed is")
print("pinned and every repair above happens in code a clean run repeats")Chapter 37
Where the tool failed
You paste your notebook into your AI and ask, “will this run cold and produce my low-turnout share?” It walks through every cell and answers, with total confidence, “Yes, this runs top to bottom cleanly and returns your headline number.” It sounds like a green check. It is not. The AI never executed anything. It read the code and narrated it. Cell 3 loads ~/Desktop/turnout_clean.csv, a path only your laptop has, and the fluent walkthrough described reading that file as if it were sitting there.
Chapter 37 · An AI failure case
FileNotFoundError appears on cell 3 in seconds.Chapter 37
This stays yours
You decide what goes in the capsule and whether the sentence “this reproduces” is honest. The tool can list gaps and pin versions, but it cannot record your true data provenance, judge whether an exclusion’s logged reason is a good reason, or certify that your analysis is correct rather than merely runnable. The name on the folder, and the claim that a stranger can trust it, are yours.
Chapter 37 · Your move
Work it in the companion notebook with Chapter 37 open beside it. Log every delegation in your AI Research Ledger.
Studio 11 closes here
What the lessons handed you becomes one artifact you can defend.
Milestone 11
The artifact
What this milestone produces. An independent cold-run record and a reusable research package. Working alone, the record is a clean-environment rerun labeled “solo proxy; external cold run pending” — the label, and the honesty it enforces, are part of the artifact.
Milestone 11 · Check before you start
Milestone 11 · In the studio
Milestone 11 · Every studio, these four
Ethics, permissions, and data exposure
What can be shared is set by your permissions, and the package says so explicitly.
Evidence, provenance, and reproducibility
Reproduction is the evidence rail’s final test.
AI activity, verification, and human decisions
An assistant can generate documentation; only a cold human run can validate it.
Uncertainty, claim boundary, and revision history
Reproduce the uncertainty statement, not only the point estimate.
Milestone 11
How the record works
Your milestone artifact is a dated, numbered version with the reason for the version attached. When later evidence changes it, you write the next version rather than editing the last one, because the sequence of changes is itself part of your research record.
AI is your arm and your research assistant, not your brain.
AI can review AI, and a second model is a real auditor of the first. The last decision is always human.

EDR|AI · Studio 11 — Reproduce and package