# Week 04 — batchlens first release

[**Full learning notebook: explanations, step-by-step challenges, stashes and evidence**](./learning-notebook.md) · [NotebookLM export](./notebooklm.txt)

Status: NOT_STARTED. Calendar dates: not assigned. Owner: Peter Ciancaglini. Planning authority: v5 Part 6 with retained v4 details. Deeper walkthrough: [v6 · Week 4 · L1: public and reproducible](../../../LABLOOP-Master-Plan-v6.md#week-4--l1-public-and-reproducible). Active project/repository: batchlens.

[Programme](../../README.md) · [Model instructions](../../specs.md) · [Decisions](../../DECISIONS.md) · [Resources](../../SOURCES.md) · [**v6 walkthrough**](../../../LABLOOP-Master-Plan-v6.md#week-4--l1-public-and-reproducible) · [**Materials: read & watch**](./materials.md) · [Previous week review](../week-03-statistical-batch-monitoring/review.md) · [Next week](../week-05-fermlit-corpus-and-schema/specs.md)

## Outcome and relevance

This week delivers the three concrete artifacts below and the supporting learning/branding/opportunity pack. The scientific or commercial outcome follows the preserved source brief, while the acceptance checks make its evidence testable. The career objective is to turn this work into something a scientist, hiring manager or buyer can inspect.

- Scientific/build priority: Compute detection delay from fault onset, lead time before harvest, false-alarm rate and undetected fraction on held-out batches.
- Public/profile priority: Prepare release post with measured lead time, false alarms, simulation caveat and reproducibility link.
- Career/relationship/commercial priority: Prepare one code-review request and a small founder feedback ask; log sent and answered separately.

## Deeper walkthrough (v6)

Read [v6 · Week 4 · L1: public and reproducible](../../../LABLOOP-Master-Plan-v6.md#week-4--l1-public-and-reproducible) before Monday. It carries this week's v5 brief unchanged and adds the **Welcome** analogy, **Learn it** (▶ core and ＋ deeper sources), **Run it** (repos with a 20-40 minute exercise), the **NotebookLM kit** and the mentor check below. Standing v6 rules: [resource rules](../../../LABLOOP-Master-Plan-v6.md#prologue-3--the-resource-rules-so-you-never-waste-an-evening-on-a-bad-source), [NotebookLM protocol](../../../LABLOOP-Master-Plan-v6.md#prologue-4--the-notebooklm-protocol-one-notebook-per-week-zero-decisions), [chapter anatomy](../../../LABLOOP-Master-Plan-v6.md#prologue-5--how-to-read-a-chapter-the-anatomy-identical-for-all-41). v6 adds depth only; it does not change a goal, gate, output or the 600-minute cap, so this specification still governs execution.

Verified links, exact scopes and durations for this week's reading and watching: [materials.md](./materials.md).

**Act I (finale) · Threads: B, M, BL, R · GATE 4**

**Where this week sits.**
- ← **From:** weeks 1-3 (simulator, tidy data, alarms).
- → **Feeds:** week 8 (technical report cites v0.1), week 12 and 17 (batch-wise CV is the backbone of the learning curves), week 36 (JOSS needs a clean release history).
- ⟳ **Returns in:** every release: v0.2 (wk 8), v0.3 (wk 17).

**Goals.**
- 🎯 **This week:** `batchlens v0.1` released with a DOI, headline number in README, `make report` reproduces it, batch-wise CV implemented.
- 🏁 **This gate (4):** L1 public and reproducible + L2 citable (DOI).
- 🌟 **Final:** the release history JOSS reviewers will read in week 36.

**Mentor check.** *"A stranger can clone batchlens, run one command, and get my number. I can explain why batch-wise CV is not optional."*

## Required inputs and dependency check

- [Week 03](../week-03-statistical-batch-monitoring/specs.md): inspect its actual evidence and review; source/code artifacts must exist before the dependent task begins.
- Read [commitment](./commitment.md), [evidence](./evidence.md), [review](./review.md) and the current root TODAY/PROGRESS/QUESTIONS files.
- Read this week's chapter, [v6 · Week 4 · L1: public and reproducible](../../../LABLOOP-Master-Plan-v6.md#week-4--l1-public-and-reproducible), then the standing sections: [Part 0 · how to use the document](../../../LABLOOP-Master-Plan-v6.md#part-0--how-to-use-this-document-read-this-every-monday-for-the-first-month), [Part 3 · the scientific thesis](../../../LABLOOP-Master-Plan-v6.md#part-3--the-scientific-thesis-explained-twice-like-a-kid-then-like-a-reviewer), [Part 4 · curriculum](../../../LABLOOP-Master-Plan-v6.md#part-4--curriculum-from-zero-four-tracks-all-free-exact-units), [Part 8 · the prompt pack](../../../LABLOOP-Master-Plan-v6.md#part-8--the-prompt-pack-copy-paste-fill-the-brackets) and [Part 9 · branding and endorsement](../../../LABLOOP-Master-Plan-v6.md#part-9--branding-connection-ladder-endorsement). The same sections exist in the [v5 master](../../../LABLOOP-Master-Plan-v5.md), which remains the governing sequence; v6 reproduces them and adds depth. Retained commercial/instrument details come from [v4](../../../AI-Upskilling-Plan-Biotech-v4.md).
- Inspect the actual canonical repository state, available data, existing figures and required human/external inputs. Never assume a previous week succeeded from its folder name.
- Verify current resource links, versions, dataset rights and any live company/venue information before relying on them. Use [source catalog](../../SOURCES.md); explicitly record inaccessible resources.

## Seven-day plan: 600 minutes maximum

The model must turn these into exact physical actions using the observed files and available inputs. Each 90-minute block includes start/stop rituals. All calls, posts, debugging, reading and exercises consume this same capacity.

| Day | Budget | Work and stopping condition |
|---|---:|---|
| Monday | 90 min | 💰 Put money numbers on the alarm. Hook: how many hours earlier would a plant know? Do: compute detection delay, lead time before harvest, false-alarm rate and missed faults on held-out batches, each with its N. Done when: every metric has a definition and a denominator. This is batchlens's money metric. |
| Tuesday | 90 min | 🍺 Fermentation vs respiration. Hook: why are some tanks aerated and others not? Learn (20 min): Khan Academy 'Fermentation and anaerobic respiration', then one paragraph in notes/bio/B4.md: what is a fermentation, really. Done when: you can explain aerobic vs anaerobic to a friend. Then stop studying and start the README. |
| Wednesday | 90 min | 📘 Make it installable. Hook: could a stranger run it in five minutes? Do: README, install steps, CITATION.cff (following the GitHub citation docs) and licence, then reproduce in a clean environment (let AI draft the README, you check every claim). Done when: the headline numbers come out of one command on a fresh install. |
| Thursday | 90 min | 🧪 Don't fool yourself. Hook: StatQuest Cross Validation (6 min). Learn: Kapoor & Narayanan's leakage taxonomy only (20 min), then implement batch-wise CV with a test that fails if one batch lands in two folds. Done when: you can explain leakage across batches. ISLP ch. 5 is parked. Last 30 min: founder paper. |
| Friday | 90 min | 🚀 Ship it. Hook: the DOI badge on your own repo. Do: tag batchlens v0.1, connect Zenodo, get the DOI, and prepare one small review request. Done when: the public URL and the DOI actually exist. |
| Saturday | 90 min | Catch up, then reward. First: finish the earliest unfinished mission (only its Done when). Then the rabbit-hole slot: anything from PARKING or the Deeper list, guilt-free. Done when: no mission from this week is half-open, or it is logged as moved. |
| Sunday | 60 min | Show it. 20 min: post the release with its DOI and money metric with three lines (what, how, one honest limitation). 5 min: tick evidence. 20 min: write what was hard and why. 15 min: write next Monday's first action, startable in 2 minutes. Done when: the post is drafted and Monday's action is written. |

Each day is one mission: the **Hook** gets you in, **Done when** tells you to stop. Study stops at the understanding check. If a piece feels pointless, ask whether Done when needs it: no → skip and log; yes → let AI do the boring part and review it; still stuck → smallest version in 25 minutes.

## Learning specification

### Biology/domain unit

Source unit: B4 · Microbial metabolism and fermentation

Material: Khan Academy "Fermentation and anaerobic respiration" (trimmed 2026-09-29; Microbiology ch. 8 is Deeper)

Produce: one paragraph "what is a fermentation, really"

Understanding check: You can explain aerobic vs anaerobic to a friend

During preparation, write one worked example connected to the week's actual task, one exercise with a separate answer key and five questions. Peter supplies answers; score explanation quality and flag misconceptions in QUESTIONS. Numeric/scientific conclusions require actual data or explicitly synthetic teaching values.

### AI/scientific-method unit

Source unit: M4 · Validation done right

Material: StatQuest Cross Validation + Kapoor & Narayanan leakage taxonomy (trimmed 2026-09-29; ISLP ch. 5 is Deeper)

Produce: Batch-wise CV implemented in batchlens

Understanding check: You can explain leakage across batches

Use the [prompt pack](../../../LABLOOP-Master-Plan-v6.md#part-8--the-prompt-pack-copy-paste-fill-the-brackets): P1 explanation ladder, P2 concept-to-project bridge and P3 quiz. Coding practice belongs within the allocated study/build block. Where the source asks for a favorable scientific result, substitute an honest measured comparison as explained below.

### Founder/scientist paper

Select one verified founder/scientific-lead paper relevant to this week's domain. Use [P11](../../../LABLOOP-Master-Plan-v6.md#part-8--the-prompt-pack-copy-paste-fill-the-brackets); save the question, method, numerical result with context, data workflow, three author questions and one connection sentence in founder-paper.md. Keep abstract-only access limitations explicit. On source weeks with no study, prioritize the commercial/submission task and log any skipped digest.

## Artifact contracts

These filenames are outputs to prepare during this week's execution; this scaffold does not claim they already exist. Drafts and measured results have different states. Technical code/data stay in the canonical project repository and are referenced from these coordinating files.

| Artifact | Required content / acceptance | Primary responsibility |
|---|---|---|
| `release-metrics.csv` | Compute detection delay from fault onset, lead time before harvest, false-alarm rate and undetected fraction on held-out batches. Acceptance: Definitions, numerator/denominator, N and interval method accompany each metric. | Model assists; Peter checks and owns the outcome |
| `release-checklist.md` | Prepare README, install instructions, CITATION.cff, license and release metadata with a clean-environment reproduction check. Acceptance: Headline results trace to commands and input checksums. | Model assists; Peter checks and owns the outcome |
| `review-request.md` | Package batchlens v0.1 and DOI deposit materials; prepare a bounded review request for the Sumble contact. Acceptance: Release is ready; public URL and DOI count only when actually issued. | Model assists; Peter checks and owns the outcome |
| `study-notes.md` | Selected exact free resources; bounded lesson/exercise; separate solution; quiz and grading rubric; Peter's answers and gaps when executed | Model prepares; Peter learns |
| `founder-paper.md` | Verified source and P11 digest; authentic question and connection sentence; access limitations | Model assists; Peter checks |
| `branding-pack.md` | Wednesday note, Sunday build log, X adaptation, figure/caption/alt text and the week's special asset; each claim linked to real proof | Model drafts; Peter owns voice/public claims |
| `opportunity-actions.md` | Qualified target/role, source/date, ladder stage, next action, message/interview/proposal draft and actual status | Model prepares; Peter owns external relationships |
| `evidence.md` | Actual paths/URLs, versions, checks/metrics, preparation versus execution state and external receipts when applicable | Updated after each deliverable |
| `review.md` | Checklist, learning assessment, gate status, shortfalls, next actions and carryover | Peter and reviewing model |

During preparation, future measured tables get column definitions, input requirements and run instructions with PENDING status. During execution, replace pending values only with measured outputs. Do not create realistic-looking fake evidence.

## Branding and opportunity execution brief

Branding: Prepare release post with measured lead time, false alarms, simulation caveat and reproducibility link.

Opportunity action: Prepare one code-review request and a small founder feedback ask; log sent and answered separately.

Use [career asset contracts](../../CAREER-ASSETS.md). Publish at most the agreed cadence; one figure and one supported number or admitted failure can support multiple drafts. In long-form weeks, prepare a 1,500–2,500-word article from existing evidence within the build/buffer allocation. In release/demo weeks, prepare a 60-second script: problem, input, command/action, result, limitation and proof link.

Verify individuals, jobs and affiliations at execution time. The [GridX list](../../../GridX%20Startups.csv) and v4 company map are research seeds, not current facts. Do not reveal named company weaknesses or employer/client confidential information. Keep drafted/sent/replied/booked/held statuses separate. The planning request alone does not authorize external messages or publication; honor explicit authorization in the execution session.

## Quality risks and week-specific constraints

A DOI establishes citability, not peer review. Maintain public development from this release for the later JOSS target.

Apply the root scientific evidence contract: provenance; meaningful independent splits; no future-data leakage; baseline comparison; actual denominators/uncertainty; failed cases; human review where required. State whether data are simulated, public experimental, synthetic or partner-provided.

Keep source gates intact, and log scope/time conflicts in review. Missing people, money, access or results must not be replaced with invented evidence. Reduce optional polish first. A specific essential external dependency stays pending while independent preparation continues.

## Completion and gate review

This is Gate 04: **Public and reproducible**.

Required proof: batchlens v0.1 public, measured headline, reproducible report, actual DOI.

Reputation interpretation: L1; L2 when citable. Record target, forecast, actual date and evidence link. The original gate stays incomplete until the required external proof exists.

- [ ] Monday artifact satisfies: Definitions, numerator/denominator, N and interval method accompany each metric.
- [ ] Wednesday artifact satisfies: Headline results trace to commands and input checksums.
- [ ] Friday artifact satisfies: Release is ready; public URL and DOI count only when actually issued.
- [ ] Study pack is prepared; Peter's actual learning/quiz result is recorded separately.
- [ ] Branding and opportunity drafts use supported claims and the correct external-action state.
- [ ] Reproduction or document checks are recorded with file/version references.
- [ ] This week's special gate, if any, has real evidence or remains explicitly pending.
- [ ] Review, root progress/log and the next physical action are updated.

## Minimum viable week and recovery

Source-preserving minimum: the release with the DOI.

Operational first step if stalled: open `release-metrics.csv`, write the required inputs and produce the smallest checkable example in ten minutes. If a more urgent missing gate dependency controls the week, use the source minimum above.

If the full week does not fit, use [P14](../../../LABLOOP-Master-Plan-v6.md#part-8--the-prompt-pack-copy-paste-fill-the-brackets): retain one gate-critical deliverable and one directly supporting study exercise; record what is skipped versus moved. Do not mark the original full gate passed merely because the minimum was completed. After a missed week, reforecast from actual evidence and avoid a second unexamined lost week.

## Handoff to the next model

In review, state exactly what exists, what was verified, what Peter can now explain, which external events remain pending, where the canonical code/data live, and the next file/function or draft paragraph to touch. Link each fact to evidence. Carry scientific assumptions, split definitions and rights constraints forward explicitly.

## Ready-to-copy model prompt

```text
Prepare Week 04 of this LABLOOP execution plan.
Read execution-plan/specs.md, execution-plan/DECISIONS.md,
execution-plan/GATES.md and
execution-plan/weeks/week-04-batchlens-first-release/specs.md, commitment.md, evidence.md and review.md.
Read prior prerequisite reviews and inspect actual repository/data state.
Use v5 as the governing sequence, the v6 Week 04 chapter
(LABLOOP-Master-Plan-v6.md) as the deeper walkthrough, and v4 only for
retained details.
Produce the full local preparation pack and the exact week-specific files named
in the artifact table. Give me a bounded lesson with exercises/answer key,
daily physical actions, technical runbook or draft, branding drafts and
career/commercial actions. Keep the total to 600 minutes.
Separate prepared artifacts from measured results and my learning completion.
Verify sources and do not invent metrics, citations, papers, people or outcomes.
Do not execute external communications, publication or spending unless the
current session already authorizes the specific action.
Finish by updating evidence/review and TODAY with the next physical action.
```

## Preserved original v5 weekly brief

v6 reproduces this brief unchanged inside [v6 · Week 4 · L1: public and reproducible](../../../LABLOOP-Master-Plan-v6.md#week-4--l1-public-and-reproducible).
The following is source planning text, not a claim of completion. Apply the explicit evidence corrections in this specification and DECISIONS.md.

### Week 4 · L1: public and reproducible
- **Goal:** first public number and first DOI.
- **Tue (B4):** Microbiology ch. 8.1-8.4.
- **Thu (M4):** ISLP ch. 5. Implement batch-wise CV.
- **Build:** [ ] Mon: hours-to-detection on every faulty batch; false-alarm rate on normal batches; one table. Done when the table regenerates with `make report`. [ ] Wed: README with the headline number, `CITATION.cff`, Zenodo integration. Done when the DOI badge renders. [ ] Fri: release `batchlens v0.1`. Send the repo to your Sumble friend for a 30-minute code review.
- **Sun:** L-Sun: "Deviation detected X hours before harvest on N faulty batches, Y% false alarms". **Z1**. Gauge: **L1**, and L2 for the DOI.
- **Only one thing:** the release with the DOI.
