Why this workflow worked
This was not just “make me a plot.” The prompt asked for a reproducible environment, local version control, test-driven development, physics properties, and visible artifacts. Those constraints made the agent leave a trail that can be audited.
Prompt choices that improved the result
- “Use UV.” This forced an explicit, recreatable Python environment rather than a mystery global install.
- “Use git, do not push.” This created an audit trail without publishing unfinished work.
- “Use TDD and commit after every cycle.” This made failures visible and prevented a giant unreviewable rewrite.
- “Use property-based tests.” For scientific code, exact answers are often unavailable. Physical monotonicity and limiting cases are excellent oracles.
- “Extract and digitize the figure.” This moved the comparison from subjective visual similarity to data-backed regression checks.
Key moments in the session
1. Equations became executable tests
The paper’s κ-Köhler expression was translated into a public API. Tests checked the Kelvin coefficient, the κ=0 limiting case, and the large-droplet approximation for critical supersaturation.
S(D) = [(D³ - Dd³) / (D³ - Dd³(1 - κ))] exp(A/D) A = 4 σ M_w / (R T ρ_w) sc = max_D S(D) - 1
2. TDD exposed missing interfaces early
The first tests failed because the module did not exist yet. That is a feature, not a bug: the failing test defined the intended public interface before the implementation was written.
ImportError: cannot import name 'kohler' from 'kappa_kohler_figure'
3. Property tests found a subtle numerical edge case
Hypothesis generated a tiny positive value of κ. Mathematically it behaves like κ=0, but the numerical solver tried to bracket an interior maximum and failed. The fix was to define a tolerance for the Kelvin branch.
Falsifying example: dry_diameter=4.904843734817048e-07 kappa=4.417464254787923e-65 ValueError: f(a) and f(b) must have different signs Fix: if kappa <= 1e-12, use the Kelvin limit.
4. The plot was digitized, not just eyeballed
The PDF page was rendered at 300 dpi. A crop of Figure 1 was calibrated using log-axis tick marks. Thresholding found dark curve crossings; the axis transform converted pixels into dry diameter values.
pdftoppm -f 3 -l 3 -png -r 300 acp-7-1961-2007.pdf extracted/page3 threshold: grayscale < 80 x calibration: 0.01, 0.10, 1.00 μm ticks y calibration: 1.0%, 0.1% ticks
5. Visual agreement became a regression test
The digitized points were saved as CSV and loaded by a test. The test is intentionally tolerant because the points are image-derived, but it still protects against gross physical or plotting regressions.
Data and logs for deeper inspection
The digitized Figure 1 test points are available as a linked CSV artifact rather than embedded in the page. The full exported HTML session log is also linked for anyone who wants to inspect the raw interaction in more detail.
Download the digitized test points CSV · Open the full session log HTML
Conversation summary
The user-facing exchange is summarized below. Tool calls and long pytest output are linked as artifacts so the main narrative stays readable.
Turn 1: initial research-code request
acp-7-1961-2007.pdf using TDD and git commits. Validation: uv run pytest → 8 passed. Working tree clean. Commits made after each completed TDD cycle.Turn 2: extract and digitize
uv run pytest → 10 passed.Turn 3: overlay
outputs/figure1_with_digitized_points.png. The digitized paper points are shown as red open-circle markers over the recreated κ-Köhler curves. Validation: uv run pytest → 11 passed.Turn 4: polish the plot
Turn 5: make this lesson
Open the redacted exported Pi session log (tool calls/results included; hidden reasoning and image payloads omitted) · Open the full HTML session log.