Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Lesson 4 of 5 · Lab · 25 min · revision 2

Lab: Reproducibility Dry Run from a Clean Checkout

Build a tiny RAG repository with pinned dependencies, a checksummed document snapshot, one config file, a versioned question set and one command that rebuilds the index and the report; prove it reproduces from a fresh clone, find the gap the clone exposes, then make one decision from the report and record it with a reproducibility checklist.

Contentsand lesson path

What you will learn

  • Explain what makes an integrated RAG application reproducible by someone else.

Prerequisites: AI Evaluation, AI Security, App Deployment, Observability

01. Goal and setup

In this lab you build the reference repository from lesson 2, prove that it reproduces from a clean checkout, and then use its report to make and record one real decision. The dry run is the heart of it: a fresh git clone into a new folder, a new virtual environment, exactly the commands in the README, and a byte-for-byte comparison of the regenerated report with the committed one. Your own working copy can never do this check, because everything you forgot to commit is still sitting in it.

One of the files you write in step 1 contains a realistic mistake of exactly that kind. Do not hunt for it; let the dry run find it.

You need: Python 3.12 itself, not a later version, because the lab pins the interpreter in .python-version and reproduce.py checks it; Git 2.28 or later (for git init -b) and about 50 MB of disk. The only package is NumPy, pinned to 2.5.4. There is no API key, GPU or model download: a hashed bag of words stands in for the embedding model, as lesson 2 explained. Commands are for macOS and Linux; on Windows, activate environments with .venv\Scripts\activate and create small files in an editor.

Layout at the end of the lab
capstone-lab/
├── make_data.py           step 1: writes the documents (not part of the project)
├── larkspur-assistant/    the project: a Git repository
│   ├── .gitignore  .gitattributes  .python-version  requirements.txt  README.md
│   ├── config/rag.toml    every setting that can change a result
│   ├── data/              raw/*.md, SOURCES.md, checksums.sha256
│   ├── eval/              queries-v1.csv, report.md (generated and committed)
│   ├── rag.py             step 2: chunk, embed, search
│   ├── reproduce.py       step 3: the one command
│   └── docs/              step 6: REPRODUCIBILITY.md, decisions/0001-...md
└── dry-run/               step 4: a fresh clone, deleted and remade each time

Create the project, its environment and the two files that pin the environment. Freezing an environment that contains only what the project needs gives a complete and exact list; freezing your everyday environment would pin dozens of unrelated packages.

Terminal
mkdir -p capstone-lab/larkspur-assistant && cd capstone-lab/larkspur-assistant
git init -b main
python3.12 -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate
python -m pip install numpy==2.5.4
python -m pip freeze > requirements.txt
echo 3.12 > .python-version
cat requirements.txt
Expected output (last command)
numpy==2.5.4

02. Step 1: Write the documents, the settings and the questions

In a real project you copy licensed documents into data/raw and record where they came from. Here a script outside the project does it: save it as capstone-lab/make_data.py, one folder above the repository, and run it from inside larkspur-assistant. It writes five short pages, a SOURCES.md with origin and licence, and a checksum file in the format sha256sum uses.

Python · capstone-lab/make_data.py
"""Write the five-page Larkspur docs snapshot, its sources and its checksums."""
import hashlib
from pathlib import Path

PAGES = {
    "install.md": """# Installing Larkspur

Larkspur is a job scheduler for small teams. It runs as one process and keeps
its state in a SQLite file.

## Requirements

Larkspur needs Python 3.11 or later and about 50 MB of disk space. It runs on
Linux and macOS; Windows is supported through WSL 2 only.

## Upgrading to version 3

Version 3 changed the state format. Stop the scheduler and run larkspur migrate
once before you start the new version, or jobs stay stuck in the queued state.
""",
    "configuration.md": """# Configuration

Larkspur reads larkspur.toml from the working directory. Environment variables
override settings in the file.

## Workers

The workers setting controls how many jobs run at the same time. The default is
4. Each worker is a separate process, so memory use grows with this number.

## Time zones

Schedules use UTC unless you set timezone. Daylight-saving changes can skip or
repeat a run between 01:00 and 03:00 local time.
""",
    "retries.md": """# Retries and failures

A failed job is retried 3 times, waiting 10, 20 and then 40 seconds.

## Dead-letter queue

After the last retry, the job moves to the dead-letter queue. It stays there
for 14 days and is then deleted. Run larkspur dlq replay with the job ID to run
it again, or larkspur dlq list to see what is waiting.
""",
    "schedules.md": """# Schedules

A schedule is a cron expression or an interval such as every = "15m".

## Missed runs

If the scheduler is stopped when a run is due, that run is skipped. Set
catch_up = true to run each missed schedule once when the scheduler starts.
""",
    "api.md": """# HTTP API

The API listens on port 8650. Send the token from LARKSPUR_TOKEN in an
Authorization header as a bearer token.

## Endpoints

POST /jobs adds a job to the queue. GET /jobs/{id} returns its status. Each
token may send 60 requests per minute; more return status 429.
""",
}

raw = Path("data/raw")
raw.mkdir(parents=True, exist_ok=True)
lines = []
for name, text in sorted(PAGES.items()):
    path = raw / name
    path.write_text(text, encoding="utf-8", newline="\n")
    digest = hashlib.sha256(path.read_bytes()).hexdigest()
    lines.append(f"{digest}  {path.as_posix()}")
checksums = "\n".join(lines) + "\n"
Path("data/checksums.sha256").write_text(checksums, encoding="utf-8", newline="\n")
sources = (
    "# Sources\n\n"
    "All five pages in data/raw were written for this sample and are released\n"
    "under CC0 1.0. Snapshot taken 2026-10-19; checksums in data/checksums.sha256.\n"
)
Path("data/SOURCES.md").write_text(sources, encoding="utf-8", newline="\n")
print(f"wrote {len(PAGES)} pages, data/SOURCES.md and data/checksums.sha256")
Terminal (in larkspur-assistant)
python ../make_data.py
Expected output
wrote 5 pages, data/SOURCES.md and data/checksums.sha256

Next, two Git files. .gitignore keeps derived and local files out of the repository; .gitattributes makes Git check text files out with LF line endings on every platform, so the checksums hold on Windows too.

Text · .gitignore
.venv/
__pycache__/
build/
# keep source documents out of Git
data/raw/
Text · .gitattributes
* text=auto eol=lf

Every setting that can change a result goes into one file. The threshold min_score = 0.25 is a first guess; step 5 replaces it with a decision.

TOML · config/rag.toml
# Every setting that can change a result lives here, and nowhere else.
[chunking]
size = 300       # characters per chunk
overlap = 60     # characters shared by neighbouring chunks

[embedding]
model = "hashing-bow"   # stand-in; a real project names its model here
revision = "v1"         # bump when the embedder changes
dims = 256

[retrieval]
k = 3
min_score = 0.25        # abstain when the best chunk scores lower

The evaluation set is version 1, and its split was fixed before any result existed: seven development questions and five held-out ones. An empty expected_sources marks an out-of-scope question, whose right answer is an abstention. If you ever change a row, save the result as queries-v2.csv instead of editing this file.

CSV · eval/queries-v1.csv
id,split,question,expected_sources
q01,dev,Which Python version does Larkspur need?,install.md
q02,dev,How many jobs run at the same time by default?,configuration.md
q03,dev,What happens to a job after its last retry?,retries.md
q04,dev,How do I run a job from the dead-letter queue again?,retries.md
q05,dev,Are runs missed during downtime made up later?,schedules.md
q06,dev,Which port does the HTTP API listen on?,api.md
q07,dev,How much does an enterprise licence cost?,
q08,held_out,What must I run before starting version 3?,install.md
q09,held_out,Why did my nightly job skip a run in March?,configuration.md
q10,held_out,How do I authenticate requests to the API?,api.md
q11,held_out,How long are failed jobs kept?,retries.md
q12,held_out,Can it post alerts to Slack?,

03. Step 2: Write the pipeline module

rag.py holds everything that turns inputs into rankings. Each function reads its settings from the parsed config, and nothing reads an environment variable, the clock or a random number. Three details come from lesson 2: verify_data compares every file with the checksum file in both directions, embed uses hashlib rather than the salted built-in hash(), and search rounds scores and breaks ties by chunk ID so the order is the same on every machine.

Python · rag.py
"""Larkspur assistant: chunk, embed and search, exactly as config/rag.toml says."""
import hashlib
import json
import re
import tomllib
from pathlib import Path

import numpy as np

STOP = set("a an and are as at be by can do does for from how i in is it my of on "
           "or the this to what when which why with you".split())


def load_config(path: str = "config/rag.toml") -> dict:
    with open(path, "rb") as f:
        return tomllib.load(f)


def fingerprint(settings: dict) -> str:
    """Short hash of the parsed settings: comments and key order do not change it."""
    text = json.dumps(settings, sort_keys=True)
    return hashlib.sha256(text.encode("utf-8")).hexdigest()[:12]


def verify_data(checksums: str = "data/checksums.sha256") -> list[Path]:
    """The files in data/raw must be exactly the ones recorded in the checksum file."""
    expected = {}
    for line in Path(checksums).read_text(encoding="utf-8").splitlines():
        digest, name = line.split(maxsplit=1)
        expected[name] = digest
    files = sorted(Path("data/raw").glob("*.md"))
    actual = {p.as_posix(): hashlib.sha256(p.read_bytes()).hexdigest() for p in files}
    problems = []
    for name in sorted(actual.keys() | expected.keys()):
        if name not in actual:
            problems.append(f"  missing: {name}")
        elif name not in expected:
            problems.append(f"  not in the checksum file: {name}")
        elif actual[name] != expected[name]:
            problems.append(f"  changed: {name}")
    if problems:
        detail = "\n".join(problems)
        raise SystemExit(f"data/raw does not match {checksums}:\n{detail}")
    return files


def chunk(text: str, size: int, overlap: int) -> list[str]:
    step = size - overlap
    return [text[i:i + size] for i in range(0, max(len(text) - overlap, 1), step)]


def embed(texts: list[str], dims: int) -> np.ndarray:
    """Stand-in embedder: a hashed bag of words, normalised to unit length."""
    vectors = np.zeros((len(texts), dims))
    for row, text in enumerate(texts):
        for word in re.findall(r"[a-z0-9]+", text.lower()):
            if word not in STOP:
                digest = hashlib.blake2b(word.encode("utf-8"), digest_size=4).digest()
                vectors[row, int.from_bytes(digest, "big") % dims] += 1.0
    norms = np.linalg.norm(vectors, axis=1, keepdims=True)
    return vectors / np.where(norms == 0, 1.0, norms)


def build_index(cfg: dict, files: list[Path]) -> tuple[list[dict], np.ndarray]:
    size, overlap = cfg["chunking"]["size"], cfg["chunking"]["overlap"]
    chunks = []
    for path in files:
        pieces = chunk(path.read_text(encoding="utf-8"), size, overlap)
        for i, piece in enumerate(pieces):
            chunks.append({"id": f"{path.name}#{i}", "doc": path.name, "text": piece})
    return chunks, embed([c["text"] for c in chunks], cfg["embedding"]["dims"])


def search(question: str, chunks: list[dict], vectors: np.ndarray, cfg: dict):
    """Top-k unique documents and the best score. Rounding plus a tie-break on the
    chunk ID give the same order on every machine."""
    query = embed([question], cfg["embedding"]["dims"])[0]
    scores = np.round(vectors @ query, 6)
    order = sorted(range(len(chunks)), key=lambda i: (-scores[i], chunks[i]["id"]))
    docs: list[str] = []
    for i in order:
        if chunks[i]["doc"] not in docs:
            docs.append(chunks[i]["doc"])
    return docs[: cfg["retrieval"]["k"]], float(scores[order[0]])

Check three pieces before wiring them together: the config fingerprint, the data check and the chunker.

Terminal
python -c "import rag; cfg = rag.load_config(); print(rag.fingerprint(cfg))"
python -c "import rag; print([p.name for p in rag.verify_data()])"
python -c "import rag; print(rag.chunk('abcdefghij', size=4, overlap=1))"
Expected output
abb82aaff2ae
['api.md', 'configuration.md', 'install.md', 'retries.md', 'schedules.md']
['abcd', 'defg', 'ghij']

The fingerprint is a hash of the parsed settings, so yours matches as long as your rag.toml has the same values, whatever its comments say. The chunker repeats one character between neighbouring chunks, as the overlap of 1 asks.

04. Step 3: One command, then commit

reproduce.py is the one command. It checks that every input exists and that the Python version matches .python-version, verifies the data, rebuilds the index into the ignored build/ folder, evaluates every question and writes eval/report.md with the inputs at the top. It writes no timestamps or timings, so two runs on the same inputs produce identical files.

Python · reproduce.py
"""One command: check the inputs, rebuild the index, regenerate eval/report.md."""
import csv
import hashlib
import json
import sys
from pathlib import Path

import numpy as np

import rag

EVAL_SET = "eval/queries-v1.csv"
INPUTS = [".python-version", "config/rag.toml", "data/checksums.sha256", EVAL_SET]


def short_sha(path: str) -> str:
    return hashlib.sha256(Path(path).read_bytes()).hexdigest()[:12]


def check_inputs() -> None:
    missing = [p for p in INPUTS if not Path(p).exists()]
    if missing:
        raise SystemExit(f"missing input: {missing} (committed? git check-ignore -v)")
    wanted = Path(".python-version").read_text(encoding="utf-8").strip()
    running = f"{sys.version_info.major}.{sys.version_info.minor}"
    if running != wanted:
        raise SystemExit(f"Python {wanted} required (.python-version), got {running}")


def evaluate(cfg: dict, chunks: list[dict], vectors: np.ndarray):
    """Recall@k per split, abstentions on out-of-scope rows, one line per question."""
    totals: dict[str, dict] = {}
    lines = []
    with open(EVAL_SET, encoding="utf-8", newline="") as f:
        for q in csv.DictReader(f):
            docs, top = rag.search(q["question"], chunks, vectors, cfg)
            abstained = top < cfg["retrieval"]["min_score"]
            t = totals.setdefault(q["split"], dict(n=0, recall=0.0, oos=0, ok=0))
            expected = [s for s in q["expected_sources"].split(";") if s]
            if not expected:  # out of scope: abstaining is the right answer
                t["oos"] += 1
                t["ok"] += abstained
                verdict = "abstained, correct" if abstained else f"answered ({docs[0]})"
            else:
                found = [] if abstained else [d for d in expected if d in docs]
                t["n"] += 1
                t["recall"] += len(found) / len(expected)
                if found:
                    verdict = f"found at rank {docs.index(found[0]) + 1}"
                else:
                    verdict = "abstained, wrong" if abstained else f"missed ({docs[0]})"
            lines.append(f"- {q['id']} {q['split']}: {verdict}, top score {top:.3f}")
    k = cfg["retrieval"]["k"]
    results = [
        f"- {split}: recall@{k} {t['recall'] / t['n']:.2f} on {t['n']} answerable, "
        f"out of scope abstained {t['ok']}/{t['oos']}"
        for split, t in totals.items()
    ]
    return results, lines


def main() -> None:
    check_inputs()
    cfg = rag.load_config()
    files = rag.verify_data()
    chunks, vectors = rag.build_index(cfg, files)
    out = Path("build/index")  # derived: ignored by Git, rebuilt on every run
    out.mkdir(parents=True, exist_ok=True)
    np.save(out / "vectors.npy", vectors)
    index_json = json.dumps({"config": cfg, "chunks": chunks}, indent=1)
    (out / "chunks.json").write_text(index_json, encoding="utf-8")
    results, lines = evaluate(cfg, chunks, vectors)

    emb = cfg["embedding"]
    report = [
        "# Evaluation report", "",
        "Generated by `python reproduce.py`. Do not edit by hand.", "",
        "## Inputs", "",
        f"- eval set: {EVAL_SET}, sha256 {short_sha(EVAL_SET)}",
        f"- data: {len(files)} files, checksums sha256 "
        f"{short_sha('data/checksums.sha256')}",
        f"- config: fingerprint {rag.fingerprint(cfg)}",
        f"- embedder: {emb['model']} {emb['revision']}, {emb['dims']} dims, "
        f"{len(chunks)} chunks",
        f"- runtime: Python {sys.version_info.major}.{sys.version_info.minor}, "
        f"numpy {np.__version__}", "",
        "## Results", "", *results, "",
        "## Per question", "", *lines,
    ]
    text = "\n".join(report) + "\n"
    Path("eval/report.md").write_text(text, encoding="utf-8", newline="\n")
    print(f"data ok: {len(files)} files match data/checksums.sha256")
    print(f"index: {len(chunks)} chunks in {out} (config {rag.fingerprint(cfg)})")
    print(*results, sep="\n")
    print("wrote eval/report.md")


if __name__ == "__main__":
    main()

Add the README from lesson 2, which promises a second person exactly what the dry run will test:

Markdown · README.md
# Larkspur assistant

Finds the Larkspur documentation page that answers a question, or says it
cannot, and reports how well that works on a versioned question set.

## Reproduce the evaluation report

You need Python 3.12 and Git. No API key, no GPU, no model download.

    git clone <repository-url> larkspur-assistant
    cd larkspur-assistant
    python3.12 -m venv .venv
    source .venv/bin/activate            # Windows: .venv\Scripts\activate
    python -m pip install -r requirements.txt
    python reproduce.py
    git diff --exit-code eval/report.md

`reproduce.py` checks every input, rebuilds `build/index` from `data/raw` and
rewrites `eval/report.md`. If the last command prints nothing and exits with
status 0, you got the same results as the committed report.

## What decides the results

- `data/raw/`: the document snapshot. Origin and licence in `data/SOURCES.md`,
  checksums in `data/checksums.sha256`.
- `config/rag.toml`: every setting (chunking, embedder, k, abstain threshold).
- `eval/queries-v1.csv`: the questions; a changed set gets a new file name.
- `requirements.txt` and `.python-version`: the environment.

## Known limitations

- The stand-in embedder matches words, not meanings: "jobs" does not match "job".
- 12 questions: one held-out question moves recall@3 by 0.25.
Terminal
python reproduce.py
git add .
git commit -q -m "Larkspur assistant with eval set v1 and one-command report"
git status --short
Expected output (git status prints nothing)
data ok: 5 files match data/checksums.sha256
index: 8 chunks in build/index (config abb82aaff2ae)
- dev: recall@3 1.00 on 6 answerable, out of scope abstained 1/1
- held_out: recall@3 0.50 on 4 answerable, out of scope abstained 1/1
wrote eval/report.md

Everything works, the report is committed and Git reports a clean working tree. By the standards of most projects this is done. The next step shows why it is not.

05. Step 4: Dry run from a clean checkout

Pretend to be the second person. Leave the project environment, clone the repository into a sibling folder, create a new environment there and follow the README:

Terminal
deactivate
cd ..
git clone larkspur-assistant dry-run
cd dry-run
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
python reproduce.py
Expected output (last command)
data/raw does not match data/checksums.sha256:
  missing: data/raw/api.md
  missing: data/raw/configuration.md
  missing: data/raw/install.md
  missing: data/raw/retries.md
  missing: data/raw/schedules.md

The project that worked a minute ago fails in its own clone, and the data check says precisely how: the checksum file arrived, the documents did not. Ask Git why, from the original repository:

Terminal
cd ../larkspur-assistant
git check-ignore -v data/raw/api.md
Expected output
.gitignore:5:data/raw/	data/raw/api.md

Line 5 of .gitignore ignores the whole snapshot. Somebody meant well, since large raw data often does not belong in Git. But this snapshot is five small pages under CC0, and the report depends on every byte of it, so it has to travel with the code. For a corpus that is large, or whose licence does not allow redistribution, commit a fetch script that downloads the files and verifies the checksums instead, and say so in the README.

Delete the last two lines of .gitignore (the comment and data/raw/), then commit the snapshot:

Terminal
cat .gitignore
git add .gitignore data/raw
git commit -q -m "Commit the CC0 document snapshot the report depends on"
git ls-files data
Expected output
.venv/
__pycache__/
build/
data/SOURCES.md
data/checksums.sha256
data/raw/api.md
data/raw/configuration.md
data/raw/install.md
data/raw/retries.md
data/raw/schedules.md

Now repeat the dry run from scratch. The git diff at the end is the actual test:

Terminal
deactivate
cd .. && rm -rf dry-run
git clone larkspur-assistant dry-run && cd dry-run
python3.12 -m venv .venv && source .venv/bin/activate
python -m pip install -r requirements.txt
python reproduce.py
git diff --exit-code eval/report.md && echo "report reproduced"
Expected output (last two commands)
data ok: 5 files match data/checksums.sha256
index: 8 chunks in build/index (config abb82aaff2ae)
- dev: recall@3 1.00 on 6 answerable, out of scope abstained 1/1
- held_out: recall@3 0.50 on 4 answerable, out of scope abstained 1/1
wrote eval/report.md
report reproduced

This time the clone has everything. The report it regenerated is byte-for-byte identical to the committed one, so git diff --exit-code prints nothing and exits with 0, and the echo runs. That is what reproduced means in this skill: same inputs, same command, identical claim.

06. Step 5: Make one decision from the report

Go back to the project and its own environment. The abstain threshold min_score = 0.25 was a guess; decide it the way lesson 3 describes, by looking at the development questions first, and only at those:

Terminal
deactivate
cd ../larkspur-assistant && source .venv/bin/activate
grep "dev:" eval/report.md
Expected output (last command)
- dev: recall@3 1.00 on 6 answerable, out of scope abstained 1/1
- q01 dev: found at rank 1, top score 0.298
- q02 dev: found at rank 1, top score 0.464
- q03 dev: found at rank 1, top score 0.363
- q04 dev: found at rank 1, top score 0.707
- q05 dev: found at rank 2, top score 0.276
- q06 dev: found at rank 1, top score 0.250
- q07 dev: abstained, correct, top score 0.146

The weakest answerable question, q06, scores 0.250: it clears the threshold by nothing at all, so the smallest change to the embedder or the chunking would turn it into a wrong abstention. The only out-of-scope dev question, q07, scores 0.146. A threshold in the middle of that gap, 0.20, leaves about 0.05 of margin on both sides. That is the decision, made on dev alone.

Edit config/rag.toml so that the line reads min_score = 0.20, then regenerate the report and let Git show what changed:

Terminal
python reproduce.py
git diff --stat
git diff -U0 eval/report.md
Expected output
data ok: 5 files match data/checksums.sha256
index: 8 chunks in build/index (config de5fe0c9e1e9)
- dev: recall@3 1.00 on 6 answerable, out of scope abstained 1/1
- held_out: recall@3 0.75 on 4 answerable, out of scope abstained 1/1
wrote eval/report.md
 config/rag.toml | 2 +-
 eval/report.md  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/eval/report.md b/eval/report.md
index f279d0c..cce1764 100644
--- a/eval/report.md
+++ b/eval/report.md
@@ -9 +9 @@ Generated by `python reproduce.py`. Do not edit by hand.
-- config: fingerprint abb82aaff2ae
+- config: fingerprint de5fe0c9e1e9
@@ -16 +16 @@ Generated by `python reproduce.py`. Do not edit by hand.
-- held_out: recall@3 0.50 on 4 answerable, out of scope abstained 1/1
+- held_out: recall@3 0.75 on 4 answerable, out of scope abstained 1/1
@@ -29 +29 @@ Generated by `python reproduce.py`. Do not edit by hand.
-- q10 held_out: abstained, wrong, top score 0.217
+- q10 held_out: found at rank 1, top score 0.217

Read the diff as evidence. The config fingerprint changed, as it must when a setting changes. The dev results did not change at all: every dev question is answered or refused as before, now with margin. Now, and only now, read the held-out lines: recall@3 rose from 0.50 to 0.75 because q10, an answerable question scoring 0.217, is no longer refused, and the out-of-scope q12 is still refused. The held-out split confirmed the direction; it did not choose the value. With four answerable held-out questions, one question is worth 0.25 of recall, so this is a direction rather than a measurement, and the record has to say so.

07. Step 6: Record the decision and the checklist

Write the decision record with the template from lesson 3 and the real numbers from steps 3 and 5:

Markdown · docs/decisions/0001-abstain-threshold.md
# 1. Abstain when the best chunk scores below 0.20

Status: accepted, 2026-10-19
Setting: retrieval.min_score in config/rag.toml (config fingerprint de5fe0c9e1e9)

## Context
The assistant abstains when its best chunk scores below min_score. The first
value, 0.25, was a guess. In eval/report.md the weakest answerable dev question
(q06) scored 0.250, exactly on the line, and the out-of-scope dev question (q07)
scored 0.146.

## Options
- 0.25: keep the guess.
- 0.20: the middle of the dev gap between 0.146 and 0.250.
- 0.15: answer more borderline questions; q07 would abstain by only 0.004.

## Evidence (eval set v1; chunk size 300, k 3, hashing-bow v1)
- Dev, used to choose: all three keep recall@3 at 1.00 and abstain on q07. Only
  the margins differ: 0.20 leaves about 0.05 on both sides, 0.25 leaves none.
- Held-out, read once after choosing: recall@3 0.50 -> 0.75 (q10 now found),
  q12 still abstains. One question moves held-out recall by 0.25, so this is a
  direction, not a measurement.

## Decision
Use 0.20.

## Consequences
- More borderline questions get an answer, so an out-of-scope question near
  0.2 may now get one too.
- The threshold belongs to this embedder and chunk size; scores shift if either
  changes.
- q11 still abstains ("jobs" does not match "job"): an embedder problem, not a
  threshold problem.

## Revisit when
Eval set v2 has at least 10 out-of-scope questions, or the embedder or chunk
size changes.

Then turn the inventory from lesson 1 into a checklist in which every line names the file or command that proves it. Tick a line only when that proof exists; the last line stays open until you do stretch task 3.

Markdown · docs/REPRODUCIBILITY.md
# Reproducibility checklist

Tick a line only when the named file or command proves it.

## Environment
- [x] Python version pinned: `.python-version`, checked by reproduce.py
- [x] Every dependency pinned to an exact version: `requirements.txt`
- [x] No API key, GPU or model download needed to reproduce the report

## Data
- [x] Every document committed, or fetched by a committed script
- [x] Origin and licence of every file: `data/SOURCES.md`
- [x] Checksums verified on every run: `data/checksums.sha256`

## Configuration and evaluation
- [x] Every setting in one file: `config/rag.toml`, fingerprint in the report
- [x] Evaluation set versioned by file name: `eval/queries-v1.csv`
- [x] Nothing random, or every seed recorded in the config
- [x] No timestamps, timings or absolute paths in the compared report

## Rebuild
- [x] One command rebuilds the index and the report: `python reproduce.py`
- [x] Derived files are ignored, never committed: `build/`
- [x] Fresh clone + one command gives an identical report (dry run 2026-10-19)
- [ ] CI repeats the dry run on every push
Terminal
git add config/rag.toml eval/report.md docs
git commit -q -m "Abstain below 0.20; add decision record and checklist"
git log --format=%s
Expected output
Abstain below 0.20; add decision record and checklist
Commit the CC0 document snapshot the report depends on
Larkspur assistant with eval set v1 and one-command report

Finally, repeat the dry run from step 4 once more, unchanged. It must still end with report reproduced, now with the new threshold: the decision, its evidence and the claim travel together in the repository.

08. Check your understanding

Practice check · 3 questions

What the dry run showed

Answer from what you saw in this lab. Each question has one best answer.

Q1. In step 3, python reproduce.py succeeded in your working copy, yet the first dry run failed. Why could the working copy not reveal the problem?
Q2. In step 5, before you read any held-out line, every dev question is already handled correctly at `min_score = 0.25`: q06, the weakest answerable one, scores 0.250 and the out-of-scope q07 scores 0.146. Why change the threshold to 0.20?
Q3. Why does the dry run create a new virtual environment instead of activating the one in larkspur-assistant/.venv?
Practice only: not graded, not saved, not evidence.

09. Apply it: stretch tasks

  1. Dry-run your own project. Clone your Build a Grounded RAG Assistant repository into a new folder, follow its README literally in a fresh environment, and log every place where you had to improvise. Each one is a missing README line or a missing file. Fix them until the clone reproduces your M4 retrieval numbers exactly, and your generated-answer numbers within the band your report states.
  2. Write your checklist and one real decision record. Copy docs/REPRODUCIBILITY.md into your project, add lines for the embedding model revision, the prompt version, the generation model ID and the recorded outputs, and tick only what you can prove. Then write docs/decisions/0001-...md for one decision backed by your M4 evidence.
  3. Add CI. Commit the workflow from lesson 2 and push to GitHub. Then break it on purpose, by editing a page in data/raw without updating the checksums, and watch both runners fail before you revert.
  4. Lock with hashes. Put numpy==2.5.4 in requirements.in and run uv pip compile requirements.in --universal --generate-hashes -o requirements.txt (or use pip-compile --generate-hashes from pip-tools), then repeat the dry run. pip now refuses any package file whose hash is not listed.
  5. The real test. Ask another person to reproduce your project from the README alone while you watch without helping. That is the practice task of this skill and the first criterion of the M6 rubric.

10. Review prompt

Without looking back, answer in your own words:

  1. Why can a dry run find problems that running the one command in your working copy cannot?
  2. What did the first dry run report, and which Git command showed the cause?
  3. When should raw documents be committed, and what do you commit instead when they cannot be?
  4. How did you choose the new threshold, and what did the held-out split add to that choice?
  5. Which lines of the checklist can you tick for your own project today, and what proves each one?

References

Your progress

Reading state

Sign in to save that you finished reading this lesson.

Sign in to mark reading complete

Prove this skill

4 questions · about 5 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.
Take the skill check